Improve linking from ActiveTheme report widget with permissions (#3869)
Fixes #3855. Credit to @Eoler.
This commit is contained in:
parent
9522deff4e
commit
35cb96ef40
|
|
@ -1,6 +1,7 @@
|
|||
<?php namespace Cms\ReportWidgets;
|
||||
|
||||
use Lang;
|
||||
use BackendAuth;
|
||||
use Cms\Classes\Theme;
|
||||
use Cms\Models\MaintenanceSetting;
|
||||
use Backend\Classes\ReportWidgetBase;
|
||||
|
|
@ -64,5 +65,7 @@ class ActiveTheme extends ReportWidgetBase
|
|||
|
||||
$this->vars['theme'] = $theme;
|
||||
$this->vars['inMaintenance'] = MaintenanceSetting::get('is_enabled');
|
||||
$this->vars['canManage'] = BackendAuth::getUser()->hasAccess('cms.manage_themes');
|
||||
$this->vars['canConfig'] = BackendAuth::getUser()->hasAccess('cms.manage_theme_options');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,32 +7,38 @@
|
|||
</div>
|
||||
<ul class="list-inline">
|
||||
<li>
|
||||
<?php if ($canManage): ?>
|
||||
<a href="<?= Backend::url('system/settings/update/october/cms/maintenance_settings') ?>">
|
||||
<?php if ($inMaintenance): ?>
|
||||
<i class="icon-circle warning"></i>
|
||||
<span class="text-warning">
|
||||
<?= e(trans('cms::lang.dashboard.active_theme.maintenance')) ?>
|
||||
</span>
|
||||
<?php else: ?>
|
||||
<i class="icon-circle success"></i>
|
||||
<span class="text-success">
|
||||
<?= e(trans('cms::lang.dashboard.active_theme.online')) ?>
|
||||
</span>
|
||||
<?php endif ?>
|
||||
<?php endif ?>
|
||||
<?php if ($inMaintenance): ?>
|
||||
<i class="icon-circle warning"></i>
|
||||
<span class="text-warning">
|
||||
<?= e(trans('cms::lang.dashboard.active_theme.maintenance')) ?>
|
||||
</span>
|
||||
<?php else: ?>
|
||||
<i class="icon-circle success"></i>
|
||||
<span class="text-success">
|
||||
<?= e(trans('cms::lang.dashboard.active_theme.online')) ?>
|
||||
</span>
|
||||
<?php endif ?>
|
||||
<?php if ($canManage): ?>
|
||||
</a>
|
||||
<?php endif ?>
|
||||
</li>
|
||||
<?php if ($canManage): ?>
|
||||
<li>
|
||||
<a href="<?= Backend::url('cms/themes') ?>">
|
||||
<?= e(trans('cms::lang.dashboard.active_theme.manage_themes')) ?>
|
||||
</a>
|
||||
</li>
|
||||
<?php if ($theme->hasCustomData()): ?>
|
||||
<li>
|
||||
<a href="<?= Backend::url('cms/themeoptions/update/'.$theme->getDirName()) ?>">
|
||||
<?= e(trans('cms::lang.dashboard.active_theme.customize_theme')) ?>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif ?>
|
||||
<?php endif ?>
|
||||
<?php if ($canConfig && $theme->hasCustomData()): ?>
|
||||
<li>
|
||||
<a href="<?= Backend::url('cms/themeoptions/update/'.$theme->getDirName()) ?>">
|
||||
<?= e(trans('cms::lang.dashboard.active_theme.customize_theme')) ?>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif ?>
|
||||
</ul>
|
||||
<?php else: ?>
|
||||
<div class="callout callout-warning">
|
||||
|
|
|
|||
Loading…
Reference in New Issue