mirror of
https://github.com/Karaka-Management/oms-Navigation.git
synced 2026-01-11 16:18:42 +00:00
autofixes
This commit is contained in:
parent
0b43d9b520
commit
446af118eb
|
|
@ -27,5 +27,6 @@ use phpOMS\Stdlib\Base\Enum;
|
|||
abstract class LinkType extends Enum
|
||||
{
|
||||
public const CATEGORY = 0;
|
||||
|
||||
public const LINK = 1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ if (isset($this->nav[NavigationType::SIDE])) : ?>
|
|||
<?php if (isset($parent['nav_icon'])) : ?>
|
||||
<i class="<?= $this->printHtml($parent['nav_icon']); ?>"></i>
|
||||
<?php endif; ?>
|
||||
<span><?= $this->getHtml($parent['nav_name'], 'Navigation') ?></span><i class="fa fa-chevron-right expand"></i></label>
|
||||
<span><?= $this->getHtml($parent['nav_name'], 'Navigation'); ?></span><i class="fa fa-chevron-right expand"></i></label>
|
||||
<?php if (isset($this->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
|
||||
?>
|
||||
<li<?= (\count($parentUri) > 2 && \stripos($uriPath, $miniParent) !== false) ? ' class="active"' : '' ?>>
|
||||
<a href="<?= $uri; ?>"><?= $this->getHtml($link['nav_name'], 'Navigation') ?></a>
|
||||
<li<?= (\count($parentUri) > 2 && \stripos($uriPath, $miniParent) !== false) ? ' class="active"' : ''; ?>>
|
||||
<a href="<?= $uri; ?>"><?= $this->getHtml($link['nav_name'], 'Navigation'); ?></a>
|
||||
<?php endif;
|
||||
endforeach;
|
||||
endif; ?>
|
||||
|
|
|
|||
|
|
@ -23,13 +23,13 @@ if (isset($this->nav[NavigationType::TOP])) : ?>
|
|||
<?php $unread = $this->getData('unread');
|
||||
foreach ($this->nav[NavigationType::TOP] as $key => $parent) :
|
||||
foreach ($parent as $id => $link) : ?>
|
||||
<li><a id="link-<?= $id; ?>" target="<?= $link['nav_target'] ?>" href="<?= \phpOMS\Uri\UriFactory::build($link['nav_uri']); ?>"<?= $link['nav_action'] !== null ? ' data-action=\'' . $link['nav_action'] . '\'' : ''; ?>>
|
||||
<li><a id="link-<?= $id; ?>" target="<?= $link['nav_target']; ?>" href="<?= \phpOMS\Uri\UriFactory::build($link['nav_uri']); ?>"<?= $link['nav_action'] !== null ? ' data-action=\'' . $link['nav_action'] . '\'' : ''; ?>>
|
||||
|
||||
<?php if (isset($link['nav_icon'])) : ?>
|
||||
<i class="<?= $this->printHtml($link['nav_icon']); ?> infoIcon"><?php if (isset($unread[$link['nav_from']]) && $unread[$link['nav_from']] > 0) : ?><span class="badge"><?= $this->printHtml($unread[$link['nav_from']]); ?></span><?php endif; ?></i>
|
||||
<?php endif; ?>
|
||||
|
||||
<span class="link"><?= $this->getHtml($link['nav_name'], 'Navigation') ?><span></a>
|
||||
<span class="link"><?= $this->getHtml($link['nav_name'], 'Navigation'); ?><span></a>
|
||||
<?php endforeach;
|
||||
endforeach; ?>
|
||||
</ul>
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user