mirror of
https://github.com/Karaka-Management/oms-News.git
synced 2026-02-03 10:48:40 +00:00
fix/impl edit button
This commit is contained in:
parent
54950a0a4b
commit
f30ea8f781
|
|
@ -121,6 +121,12 @@ final class BackendController extends Controller implements DashboardElementInte
|
|||
$view->setTemplate('/Modules/News/Theme/Backend/news-single');
|
||||
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1000701001, $request, $response));
|
||||
$view->addData('news', $article);
|
||||
$view->addData('editable', $this->app->accountManager->get($accountId)->hasPermission(
|
||||
PermissionType::MODIFY, $this->app->orgId, $this->app->appName, self::MODULE_NAME, PermissionState::NEWS, $article->getId())
|
||||
);
|
||||
|
||||
$t = $this->app->accountManager->get($accountId)->hasPermission(
|
||||
PermissionType::MODIFY, $this->app->orgId, $this->app->appName, self::MODULE_NAME, PermissionState::NEWS, $article->getId());
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,12 +12,21 @@
|
|||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
use phpOMS\Account\PermissionType;
|
||||
|
||||
/**
|
||||
* @var \Modules\News\Models\NewsArticle $news
|
||||
*/
|
||||
$news = $this->getData('news');
|
||||
|
||||
/**
|
||||
* @var bool $editable
|
||||
*/
|
||||
$editable = $this->getData('editable');
|
||||
|
||||
/**
|
||||
* @var \phpOMS\Views\View $this
|
||||
*/
|
||||
|
||||
$news = $this->getData('news');
|
||||
|
||||
echo $this->getData('nav')->render(); ?>
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
|
|
@ -28,4 +37,12 @@ echo $this->getData('nav')->render(); ?>
|
|||
</article>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if ($editable) : ?>
|
||||
<div class="row">
|
||||
<div class="box">
|
||||
<a tabindex="0" class="button" href="<?= \phpOMS\Uri\UriFactory::build('{/prefix}news/edit?id=' . $news->getId()); ?>">Edit</a>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user