Skip to content

Commit

Permalink
Merge pull request #1 from Bakual/patch-1
Browse files Browse the repository at this point in the history
Simplify parameter checks
  • Loading branch information
brianteeman authored Mar 6, 2017
2 parents 12951a7 + f478eca commit 65962fa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 32 deletions.
19 changes: 2 additions & 17 deletions administrator/components/com_users/views/groups/tmpl/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,7 @@
$listOrder = $this->escape($this->state->get('list.ordering'));
$listDirn = $this->escape($this->state->get('list.direction'));


// Create shortcut to parameters.
$params = $this->state->get('params');

$app = JFactory::getApplication();
$input = $app->input;

// This checks if the config options have ever been saved. If they haven't they will fall back to the original settings.
$params = json_decode($params);
$debugoptions = isset($params->debugGroups);

if (!$debugoptions)
{
$$params->debugGroups = '1';
}

$debugGroups = $this->state->get('params')->get('debugGroups', 1);

JText::script('COM_USERS_GROUPS_CONFIRM_DELETE');

Expand Down Expand Up @@ -129,7 +114,7 @@
<?php else : ?>
<?php echo $this->escape($item->title); ?>
<?php endif; ?>
<?php if ($params->debugGroups == 1) : ?>
<?php if ($debugGroups) : ?>
<div class="small"><a href="<?php echo JRoute::_('index.php?option=com_users&view=debuggroup&group_id=' . (int) $item->id); ?>">
<?php echo JText::_('COM_USERS_DEBUG_GROUP'); ?></a></div>
<?php endif; ?>
Expand Down
17 changes: 2 additions & 15 deletions administrator/components/com_users/views/users/tmpl/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,7 @@


// Create shortcut to parameters.
$params = $this->state->get('params');

$app = JFactory::getApplication();
$input = $app->input;

// This checks if the config options have ever been saved. If they haven't they will fall back to the original settings.
$params = json_decode($params);
$debugoptions = isset($params->debugUsers);

if (!$debugoptions)
{
$params->debugUsers = '1';
}

$debugUsers = $this->state->get('params')->get('debugUsers', 1);
?>
<form action="<?php echo JRoute::_('index.php?option=com_users&view=users'); ?>" method="post" name="adminForm" id="adminForm">
<?php if (!empty( $this->sidebar)) : ?>
Expand Down Expand Up @@ -130,7 +117,7 @@
<?php if ($item->requireReset == '1') : ?>
<span class="label label-warning"><?php echo JText::_('COM_USERS_PASSWORD_RESET_REQUIRED'); ?></span>
<?php endif; ?>
<?php if ($params->debugUsers == '1'): ?>
<?php if ($debugUsers) : ?>
<div class="small"><a href="<?php echo JRoute::_('index.php?option=com_users&view=debuguser&user_id=' . (int) $item->id); ?>">
<?php echo JText::_('COM_USERS_DEBUG_USER'); ?></a></div>
<?php endif; ?>
Expand Down

0 comments on commit 65962fa

Please sign in to comment.