mirror of
https://github.com/Karaka-Management/oms-Navigation.git
synced 2026-01-11 16:18:42 +00:00
Continue with getter/setter cleanup
This commit is contained in:
parent
ce94bea9e1
commit
5ee6c67f15
|
|
@ -15,10 +15,10 @@ declare(strict_types=1);
|
|||
/**
|
||||
* @var \phpOMS\Views\View $this
|
||||
*/
|
||||
$navs = $this->getData('navs') ?? [];
|
||||
$apps = $this->getData('apps') ?? [];
|
||||
$navs = $this->data['navs'] ?? [];
|
||||
$apps = $this->data['apps'] ?? [];
|
||||
|
||||
echo $this->getData('nav')->render();
|
||||
echo $this->data['nav']->render();
|
||||
?>
|
||||
|
||||
<div class="row">
|
||||
|
|
|
|||
|
|
@ -15,12 +15,12 @@ declare(strict_types=1);
|
|||
use phpOMS\Uri\UriFactory;
|
||||
|
||||
$nav = $this->getData('nav-element');
|
||||
$routes = $this->getData('routes') ?? [];
|
||||
$routes = $this->data['routes'] ?? [];
|
||||
|
||||
/**
|
||||
* @var \phpOMS\Views\View $this
|
||||
*/
|
||||
echo $this->getData('nav')->render(); ?>
|
||||
echo $this->data['nav']->render(); ?>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
|
|
|
|||
|
|
@ -18,12 +18,12 @@ use phpOMS\Uri\UriFactory;
|
|||
* @var \phpOMS\Views\View $this
|
||||
* @var \Modules\Navigation\Models\NavElement[] $navs
|
||||
*/
|
||||
$navs = $this->getData('navigation') ?? [];
|
||||
$navs = $this->data['navigation'] ?? [];
|
||||
|
||||
$previous = empty($navs) ? 'admin/nav/list' : '{/base}/admin/nav/list?{?}&id=' . \reset($navs)->id . '&ptype=p';
|
||||
$next = empty($navs) ? 'admin/nav/list' : '{/base}/admin/nav/list?{?}&id=' . \end($navs)->id . '&ptype=n';
|
||||
|
||||
echo $this->getData('nav')->render(); ?>
|
||||
echo $this->data['nav']->render(); ?>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
|
|
|
|||
|
|
@ -175,17 +175,17 @@ final class BackendController extends Controller
|
|||
public function viewModuleSettings(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : RenderableInterface
|
||||
{
|
||||
$view = new View($this->app->l11nManager, $request, $response);
|
||||
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1000105001, $request, $response));
|
||||
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1000105001, $request, $response);
|
||||
|
||||
$id = $request->getDataString('id') ?? '';
|
||||
|
||||
$settings = SettingMapper::getAll()->where('module', $id)->execute();
|
||||
if ($settings->id > 0) {
|
||||
$view->setData('settings', !\is_array($settings) ? [$settings] : $settings);
|
||||
$view->data['settings'] = !\is_array($settings) ? [$settings] : $settings;
|
||||
}
|
||||
|
||||
$navigation = NavElementMapper::getAll()->execute();
|
||||
$view->setData('navigation', $navigation);
|
||||
$view->data['navigation'] = $navigation;
|
||||
|
||||
$view->setTemplate('/Modules/' . static::NAME . '/Admin/Settings/Theme/Backend/settings');
|
||||
|
||||
|
|
@ -207,9 +207,9 @@ final class BackendController extends Controller
|
|||
{
|
||||
$view = new View($this->app->l11nManager, $request, $response);
|
||||
$view->setTemplate('/Modules/' . static::NAME . '/Admin/Settings/Theme/Backend/settings-nav');
|
||||
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1000105001, $request, $response));
|
||||
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1000105001, $request, $response);
|
||||
|
||||
$view->addData('nav-element', NavElementMapper::get()->where('id', (int) $request->getData('nav'))->execute());
|
||||
$view->data['nav-element'] = NavElementMapper::get()->where('id', (int) $request->getData('nav'))->execute();
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
|
@ -229,10 +229,10 @@ final class BackendController extends Controller
|
|||
{
|
||||
$view = new View($this->app->l11nManager, $request, $response);
|
||||
$view->setTemplate('/Modules/Navigation/Admin/Settings/Theme/Backend/modules-nav-list');
|
||||
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1000105001, $request, $response));
|
||||
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1000105001, $request, $response);
|
||||
|
||||
$module = $request->getDataString('id') ?? '';
|
||||
$view->setData('module', $module);
|
||||
$view->data['module'] = $module;
|
||||
|
||||
$query = NavElementMapper::getAll()
|
||||
->where('from', $module);
|
||||
|
|
@ -242,10 +242,10 @@ final class BackendController extends Controller
|
|||
}
|
||||
|
||||
$activeNavElements = $query->execute();
|
||||
$view->setData('navs', $activeNavElements);
|
||||
$view->data['navs'] = $activeNavElements;
|
||||
|
||||
$apps = AppMapper::getAll()->execute();
|
||||
$view->setData('apps', $apps);
|
||||
$view->data['apps'] = $apps;
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ use Modules\Navigation\Models\NavigationType;
|
|||
*/
|
||||
if (isset($this->nav[NavigationType::TOP])) : ?>
|
||||
<ul id="t-nav" role="navigation">
|
||||
<?php $unread = $this->getData('unread');
|
||||
<?php $unread = $this->data['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'] . '\'' : ''; ?>>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user