Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions administrator/templates/atum/html/layouts/chromes/well.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
// Permission checks
$user = Factory::getUser();
$canEdit = $user->authorise('core.edit', 'com_modules.module.' . $id) && $user->authorise('core.manage', 'com_modules');
$canChange = $user->authorise('core.edit.state', 'com_modules.module.' . $id) && $user->authorise('core.manage', 'com_modules');

$moduleTag = $params->get('module_tag', 'div');
$bootstrapSize = (int) $params->get('bootstrap_size', 6);
Expand All @@ -37,21 +38,23 @@
?>
<div class="<?php echo $moduleClass; ?> module-wrapper">
<<?php echo $moduleTag; ?> class="card mb-3<?php echo $moduleClassSfx; ?>">
<?php if ($canEdit) : ?>
<?php $uri = Uri::getInstance(); ?>
<?php $url = Route::_('index.php?option=com_modules&task=module.edit&id=' . $id . '&return=' . base64_encode($uri)); ?>

<?php if ($canEdit || $canChange) : ?>
<?php $dropdownPosition = Factory::getLanguage()->isRTL() ? 'left' : 'right'; ?>

<div class="module-actions dropdown">
<a data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" id="dropdownMenuButton-<?php echo $id; ?>">
<span class="fa fa-cog"><span class="sr-only">
<?php echo Text::_('JACTION_EDIT') . ' ' . $module->title; ?>
</span></span>
</a>
<div class="dropdown-menu dropdown-menu-' . $dropdownPosition . '" aria-labelledby="dropdownMenuButton-<?php echo $id; ?>">
<a class="dropdown-item" href="<?php echo $url; ?>"><?php echo Text::_('JACTION_EDIT'); ?></a>
<a class="dropdown-item unpublish-module" data-module-id="<?php echo $id; ?>"><?php echo Text::_('JACTION_UNPUBLISH'); ?></a>
<?php if ($canEdit) : ?>
<?php $uri = Uri::getInstance(); ?>
<?php $url = Route::_('index.php?option=com_modules&task=module.edit&id=' . $id . '&return=' . base64_encode($uri)); ?>
<a class="dropdown-item" href="<?php echo $url; ?>"><?php echo Text::_('JACTION_EDIT'); ?></a>
<?php endif; ?>
<?php if ($canChange) : ?>
<a class="dropdown-item unpublish-module" data-module-id="<?php echo $id; ?>"><?php echo Text::_('JACTION_UNPUBLISH'); ?></a>
<?php endif; ?>
</div>
</div>
<?php endif; ?>
Expand Down