diff --git a/Models/LinkType.php b/Models/LinkType.php index f5792a2..8d7a4b7 100755 --- a/Models/LinkType.php +++ b/Models/LinkType.php @@ -27,5 +27,6 @@ use phpOMS\Stdlib\Base\Enum; abstract class LinkType extends Enum { public const CATEGORY = 0; + public const LINK = 1; } diff --git a/Models/NavElement.php b/Models/NavElement.php index a195657..2664057 100755 --- a/Models/NavElement.php +++ b/Models/NavElement.php @@ -25,18 +25,32 @@ namespace Modules\Navigation\Models; class NavElement { public int $id = 0; + public string $pid = ''; + public string $name = ''; + public int $type = 1; + public int $subtype = 2; + public ?string $icon = null; + public ?string $uri = null; + public string $target = 'self'; + public ?string $action = null; + public string $from = '0'; + public int $order = 1; + public int $parent = 0; + public ?int $permissionPerm = null; + public ?int $permissionType = null; + public ?int $permissionElement = null; } diff --git a/Theme/Backend/side.tpl.php b/Theme/Backend/side.tpl.php index 0b549e6..cbd805b 100755 --- a/Theme/Backend/side.tpl.php +++ b/Theme/Backend/side.tpl.php @@ -29,7 +29,7 @@ if (isset($this->nav[NavigationType::SIDE])) : ?> - getHtml($parent['nav_name'], 'Navigation') ?> + getHtml($parent['nav_name'], 'Navigation'); ?> nav[NavigationType::SIDE][LinkType::LINK])) : foreach ($this->nav[NavigationType::SIDE][LinkType::LINK] as $key2 => $link) : if ($link['nav_parent'] === $key) : @@ -40,8 +40,8 @@ if (isset($this->nav[NavigationType::SIDE])) : ?> // todo: very simpleminded solution. doesn't work for root path /en/backend etc. e.g. dashboard // this also fails for urls which are not structured like a tree ?> - 2 && \stripos($uriPath, $miniParent) !== false) ? ' class="active"' : '' ?>> - getHtml($link['nav_name'], 'Navigation') ?> + 2 && \stripos($uriPath, $miniParent) !== false) ? ' class="active"' : ''; ?>> + getHtml($link['nav_name'], 'Navigation'); ?> diff --git a/Theme/Backend/top.tpl.php b/Theme/Backend/top.tpl.php index c274fcb..f752bce 100755 --- a/Theme/Backend/top.tpl.php +++ b/Theme/Backend/top.tpl.php @@ -23,13 +23,13 @@ if (isset($this->nav[NavigationType::TOP])) : ?> getData('unread'); foreach ($this->nav[NavigationType::TOP] as $key => $parent) : foreach ($parent as $id => $link) : ?> -
  • > +
  • > 0) : ?>printHtml($unread[$link['nav_from']]); ?> - getHtml($link['nav_name'], 'Navigation') ?> + getHtml($link['nav_name'], 'Navigation'); ?> diff --git a/tests/Admin/AdminTest.php b/tests/Admin/AdminTest.php index f4add91..a4f1c05 100755 --- a/tests/Admin/AdminTest.php +++ b/tests/Admin/AdminTest.php @@ -26,6 +26,7 @@ use phpOMS\Uri\HttpUri; class AdminTest extends \PHPUnit\Framework\TestCase { protected const MODULE_NAME = 'Navigation'; + protected const URI_LOAD = ''; use \Modules\tests\ModuleTestTrait;