mirror of
https://github.com/Karaka-Management/oms-Tag.git
synced 2026-01-28 23:08:41 +00:00
Continue with getter/setter cleanup
This commit is contained in:
parent
ee84056dd9
commit
3e56107c9b
|
|
@ -49,7 +49,7 @@ final class BackendController extends Controller
|
|||
$view = new View($this->app->l11nManager, $request, $response);
|
||||
|
||||
$view->setTemplate('/Modules/Tag/Theme/Backend/tag-create');
|
||||
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1007501001, $request, $response));
|
||||
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1007501001, $request, $response);
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
|
@ -71,35 +71,29 @@ final class BackendController extends Controller
|
|||
$view = new View($this->app->l11nManager, $request, $response);
|
||||
|
||||
$view->setTemplate('/Modules/Tag/Theme/Backend/tag-list');
|
||||
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1007501001, $request, $response));
|
||||
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1007501001, $request, $response);
|
||||
|
||||
if ($request->getData('ptype') === 'p') {
|
||||
$view->setData('tags',
|
||||
TagMapper::getAll()
|
||||
$view->data['tags'] = TagMapper::getAll()
|
||||
->with('title')
|
||||
->where('id', $request->getDataInt('id') ?? 0, '<')
|
||||
->where('title/language', $request->header->l11n->language)
|
||||
->limit(25)
|
||||
->execute()
|
||||
);
|
||||
->execute();
|
||||
} elseif ($request->getData('ptype') === 'n') {
|
||||
$view->setData('tags',
|
||||
TagMapper::getAll()
|
||||
$view->data['tags'] = TagMapper::getAll()
|
||||
->with('title')
|
||||
->where('id', $request->getDataInt('id') ?? 0, '>')
|
||||
->where('title/language', $request->header->l11n->language)
|
||||
->limit(25)
|
||||
->execute()
|
||||
);
|
||||
->execute();
|
||||
} else {
|
||||
$view->setData('tags',
|
||||
TagMapper::getAll()
|
||||
$view->data['tags'] = TagMapper::getAll()
|
||||
->with('title')
|
||||
->where('id', 0, '>')
|
||||
->where('title/language', $request->header->l11n->language)
|
||||
->limit(25)
|
||||
->execute()
|
||||
);
|
||||
->execute();
|
||||
}
|
||||
|
||||
return $view;
|
||||
|
|
@ -129,15 +123,15 @@ final class BackendController extends Controller
|
|||
->execute();
|
||||
|
||||
$view->setTemplate('/Modules/Tag/Theme/Backend/tag-single');
|
||||
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1007501001, $request, $response));
|
||||
$view->addData('tag', $tag);
|
||||
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1007501001, $request, $response);
|
||||
$view->data['tag'] = $tag;
|
||||
|
||||
/** @var \phpOMS\Localization\BaseStringL11n[] $l11n */
|
||||
$l11n = TagL11nMapper::getAll()
|
||||
->where('ref', $tag->id)
|
||||
->execute();
|
||||
|
||||
$view->addData('l11n', $l11n);
|
||||
$view->data['l11n'] = $l11n;
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ declare(strict_types=1);
|
|||
use phpOMS\Uri\UriFactory;
|
||||
|
||||
/** @var \phpOMS\Views\View $this */
|
||||
echo $this->getData('nav')->render(); ?>
|
||||
echo $this->data['nav']->render(); ?>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-md-6">
|
||||
<div class="portlet">
|
||||
|
|
|
|||
|
|
@ -18,12 +18,12 @@ use phpOMS\Uri\UriFactory;
|
|||
* @var \phpOMS\Views\View $this
|
||||
* @var \Modules\Tag\Models\Tag[] $tags
|
||||
*/
|
||||
$tags = $this->getData('tags');
|
||||
$tags = $this->data['tags'];
|
||||
|
||||
$previous = empty($tags) ? '{/base}/tag/list' : '{/base}/tag/list?{?}&id=' . \reset($tags)->id . '&ptype=p';
|
||||
$next = empty($tags) ? '{/base}/tag/list' : '{/base}/tag/list?{?}&id=' . \end($tags)->id . '&ptype=n';
|
||||
|
||||
echo $this->getData('nav')->render(); ?>
|
||||
echo $this->data['nav']->render(); ?>
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<div class="portlet">
|
||||
|
|
|
|||
|
|
@ -16,11 +16,11 @@ use phpOMS\Localization\ISO639Enum;
|
|||
use phpOMS\Uri\UriFactory;
|
||||
|
||||
/** @var \Modules\Tag\Models\Tag */
|
||||
$tag = $this->getData('tag');
|
||||
$l11n = $this->getData('l11n') ?? [];
|
||||
$tag = $this->data['tag'];
|
||||
$l11n = $this->data['l11n'] ?? [];
|
||||
|
||||
/** @var \phpOMS\Views\View $this */
|
||||
echo $this->getData('nav')->render(); ?>
|
||||
echo $this->data['nav']->render(); ?>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-md-6">
|
||||
<div class="portlet">
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user