Skip to content

Commit

Permalink
Update tabs.php
Browse files Browse the repository at this point in the history
  • Loading branch information
anuragteapot committed Jan 30, 2018
1 parent 81b8658 commit 323eeed
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions layouts/joomla/form/field/rules/tabs.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ class="custom-select novalidate"
<td headers="aclactionth<?php echo $group->value; ?>">
<?php $result = array(); ?>
<?php // Get the group, group parent id, and group global config recursive calculated permission for the chosen action. ?>
<?php $inheritedGroupRule = Access::checkGroup((int) $group->value, $action->name, $assetId);
<?php $inheritedGroupRule = Access::checkGroup((int) $group->value, $action->name, $assetId);
$inheritedGroupParentAssetRule = !empty($parentAssetId) ? Access::checkGroup($group->value, $action->name, $parentAssetId) : null;
$inheritedParentGroupRule = !empty($group->parent_id) ? Access::checkGroup($group->parent_id, $action->name, $assetId) : null;

Expand All @@ -191,13 +191,13 @@ class="custom-select novalidate"
if ($inheritedGroupRule === null || $inheritedGroupRule === false)
{
$result['class'] = 'badge badge-danger';
$result['text'] = Text::_('JLIB_RULES_NOT_ALLOWED_INHERITED');
$result['text'] = Text::_('JLIB_RULES_NOT_ALLOWED_INHERITED');
}
// If recursive calculated setting is "Allowed". Calculated permission is "Allowed (Inherited)".
else
{
$result['class'] = 'badge badge-success';
$result['text'] = Text::_('JLIB_RULES_ALLOWED_INHERITED');
$result['text'] = Text::_('JLIB_RULES_ALLOWED_INHERITED');
}

// Second part: Overwrite the calculated permissions labels if there is an explicit permission in the current group.
Expand All @@ -212,13 +212,13 @@ class="custom-select novalidate"
if ($assetRule === false)
{
$result['class'] = 'badge badge-danger';
$result['text'] = Text::_('JLIB_RULES_NOT_ALLOWED');
$result['text'] = Text::_('JLIB_RULES_NOT_ALLOWED');
}
// If there is an explicit permission is "Allowed". Calculated permission is "Allowed".
else if ($assetRule === true)
{
$result['class'] = 'badge badge-success';
$result['text'] = Text::_('JLIB_RULES_ALLOWED');
$result['text'] = Text::_('JLIB_RULES_ALLOWED');
}

// Third part: Overwrite the calculated permissions labels for special cases.
Expand All @@ -227,7 +227,7 @@ class="custom-select novalidate"
if (empty($group->parent_id) && $isGlobalConfig === true && $assetRule === null)
{
$result['class'] = 'badge badge-danger';
$result['text'] = Text::_('JLIB_RULES_NOT_ALLOWED_DEFAULT');
$result['text'] = Text::_('JLIB_RULES_NOT_ALLOWED_DEFAULT');
}

/**
Expand Down

0 comments on commit 323eeed

Please sign in to comment.