Initial import of animal_management module

This commit is contained in:
Kelin Rescue Hub
2026-04-04 13:13:00 -04:00
commit 20adb1bd1e
65 changed files with 14004 additions and 0 deletions

51
components/UrlRule.php Normal file
View File

@@ -0,0 +1,51 @@
<?php
namespace humhub\modules\animal_management\components;
use humhub\components\ContentContainerUrlRuleInterface;
use humhub\modules\content\components\ContentContainerActiveRecord;
use yii\base\Component;
use yii\web\UrlManager;
use yii\web\UrlRuleInterface;
class UrlRule extends Component implements UrlRuleInterface, ContentContainerUrlRuleInterface
{
public const CONTAINER_ROUTE = 'animal_management/animals/index';
private const ROUTE_SEGMENT = 'animals';
public function parseContentContainerRequest(ContentContainerActiveRecord $container, UrlManager $manager, string $containerUrlPath, array $urlParams)
{
if ($containerUrlPath === self::ROUTE_SEGMENT) {
return [self::CONTAINER_ROUTE, $urlParams];
}
return false;
}
public function createContentContainerUrl(UrlManager $manager, string $containerUrlPath, string $route, array $params)
{
if (ltrim($route, '/') !== self::CONTAINER_ROUTE) {
return false;
}
$url = $containerUrlPath . '/' . self::ROUTE_SEGMENT;
if (!empty($params)) {
$query = http_build_query($params);
if ($query !== '') {
$url .= '?' . $query;
}
}
return $url;
}
public function createUrl($manager, $route, $params)
{
return false;
}
public function parseRequest($manager, $request)
{
return false;
}
}