Skip to content

Commit

Permalink
com_users view review
Browse files Browse the repository at this point in the history
  • Loading branch information
zero-24 committed Jul 24, 2017
1 parent 5b0eaaa commit acbd82c
Show file tree
Hide file tree
Showing 13 changed files with 258 additions and 251 deletions.
65 changes: 29 additions & 36 deletions components/com_users/views/login/tmpl/default_login.php
Expand Up @@ -12,33 +12,28 @@
JHtml::_('behavior.keepalive');
JHtml::_('behavior.formvalidator');
?>

<div class="login<?php echo $this->pageclass_sfx; ?>">
<?php if ($this->params->get('show_page_heading')) : ?>
<div class="page-header">
<h1>
<?php echo $this->escape($this->params->get('page_heading')); ?>
</h1>
</div>
<div class="page-header">
<h1>
<?php echo $this->escape($this->params->get('page_heading')); ?>
</h1>
</div>
<?php endif; ?>

<?php if (($this->params->get('logindescription_show') == 1 && str_replace(' ', '', $this->params->get('login_description')) != '') || $this->params->get('login_image') != '') : ?>
<div class="login-description">
<div class="login-description">
<?php endif; ?>
<?php if ($this->params->get('logindescription_show') == 1) : ?>
<?php echo $this->params->get('login_description'); ?>
<?php endif; ?>
<?php if ($this->params->get('login_image') != '') : ?>
<img src="<?php echo $this->escape($this->params->get('login_image')); ?>" class="login-image" alt="<?php echo JText::_('COM_USERS_LOGIN_IMAGE_ALT'); ?>"/>
<?php endif; ?>

<?php if ($this->params->get('logindescription_show') == 1) : ?>
<?php echo $this->params->get('login_description'); ?>
<?php endif; ?>

<?php if ($this->params->get('login_image') != '') : ?>
<img src="<?php echo $this->escape($this->params->get('login_image')); ?>" class="login-image" alt="<?php echo JText::_('COM_USERS_LOGIN_IMAGE_ALT'); ?>"/>
<?php endif; ?>

<?php if (($this->params->get('logindescription_show') == 1 && str_replace(' ', '', $this->params->get('login_description')) != '') || $this->params->get('login_image') != '') : ?>
</div>
</div>
<?php endif; ?>

<form action="<?php echo JRoute::_('index.php?option=com_users&task=user.login'); ?>" method="post" class="form-validate form-horizontal well">

<fieldset>
<?php foreach ($this->form->getFieldset('credentials') as $field) : ?>
<?php if (!$field->hidden) : ?>
Expand All @@ -52,7 +47,6 @@
</div>
<?php endif; ?>
<?php endforeach; ?>

<?php if ($this->tfa) : ?>
<div class="control-group">
<div class="control-label">
Expand All @@ -63,22 +57,19 @@
</div>
</div>
<?php endif; ?>

<?php if (JPluginHelper::isEnabled('system', 'remember')) : ?>
<div class="control-group">
<div class="control-label"><label><?php echo JText::_('COM_USERS_LOGIN_REMEMBER_ME') ?></label></div>
<div class="controls"><input id="remember" type="checkbox" name="remember" class="inputbox" value="yes"/></div>
</div>
<div class="control-group">
<div class="control-label"><label><?php echo JText::_('COM_USERS_LOGIN_REMEMBER_ME') ?></label></div>
<div class="controls"><input id="remember" type="checkbox" name="remember" class="inputbox" value="yes"/></div>
</div>
<?php endif; ?>

<div class="control-group">
<div class="controls">
<button type="submit" class="btn btn-primary">
<?php echo JText::_('JLOGIN'); ?>
</button>
</div>
</div>

<?php $return = $this->form->getValue('return', '', $this->params->get('login_redirect_url', $this->params->get('login_redirect_menuitem'))); ?>
<input type="hidden" name="return" value="<?php echo base64_encode($return); ?>" />
<?php echo JHtml::_('form.token'); ?>
Expand All @@ -89,19 +80,21 @@
<ul class="nav nav-tabs nav-stacked">
<li>
<a href="<?php echo JRoute::_('index.php?option=com_users&view=reset'); ?>">
<?php echo JText::_('COM_USERS_LOGIN_RESET'); ?></a>
<?php echo JText::_('COM_USERS_LOGIN_RESET'); ?>
</a>
</li>
<li>
<a href="<?php echo JRoute::_('index.php?option=com_users&view=remind'); ?>">
<?php echo JText::_('COM_USERS_LOGIN_REMIND'); ?></a>
</li>
<?php
$usersConfig = JComponentHelper::getParams('com_users');
if ($usersConfig->get('allowUserRegistration')) : ?>
<li>
<a href="<?php echo JRoute::_('index.php?option=com_users&view=registration'); ?>">
<?php echo JText::_('COM_USERS_LOGIN_REGISTER'); ?></a>
<?php echo JText::_('COM_USERS_LOGIN_REMIND'); ?>
</a>
</li>
<?php $usersConfig = JComponentHelper::getParams('com_users'); ?>
<?php if ($usersConfig->get('allowUserRegistration')) : ?>
<li>
<a href="<?php echo JRoute::_('index.php?option=com_users&view=registration'); ?>">
<?php echo JText::_('COM_USERS_LOGIN_REGISTER'); ?>
</a>
</li>
<?php endif; ?>
</ul>
</div>
37 changes: 18 additions & 19 deletions components/com_users/views/login/tmpl/default_logout.php
Expand Up @@ -9,35 +9,34 @@

defined('_JEXEC') or die;
?>

<div class="logout<?php echo $this->pageclass_sfx; ?>">
<?php if ($this->params->get('show_page_heading')) : ?>
<div class="page-header">
<h1>
<?php echo $this->escape($this->params->get('page_heading')); ?>
</h1>
</div>
<div class="page-header">
<h1>
<?php echo $this->escape($this->params->get('page_heading')); ?>
</h1>
</div>
<?php endif; ?>

<?php if (($this->params->get('logoutdescription_show') == 1 && str_replace(' ', '', $this->params->get('logout_description')) != '')|| $this->params->get('logout_image') != '') : ?>
<div class="logout-description">
<div class="logout-description">
<?php endif; ?>
<?php if ($this->params->get('logoutdescription_show') == 1) : ?>
<?php echo $this->params->get('logout_description'); ?>
<?php endif; ?>
<?php if ($this->params->get('logout_image') != '') : ?>
<img src="<?php echo $this->escape($this->params->get('logout_image')); ?>" class="thumbnail pull-right logout-image" alt="<?php echo JText::_('COM_USER_LOGOUT_IMAGE_ALT'); ?>"/>
<?php endif; ?>

<?php if ($this->params->get('logoutdescription_show') == 1) : ?>
<?php echo $this->params->get('logout_description'); ?>
<?php endif; ?>

<?php if ($this->params->get('logout_image') != '') : ?>
<img src="<?php echo $this->escape($this->params->get('logout_image')); ?>" class="thumbnail pull-right logout-image" alt="<?php echo JText::_('COM_USER_LOGOUT_IMAGE_ALT'); ?>"/>
<?php endif; ?>

<?php if (($this->params->get('logoutdescription_show') == 1 && str_replace(' ', '', $this->params->get('logout_description')) != '')|| $this->params->get('logout_image') != '') : ?>
</div>
</div>
<?php endif; ?>

<form action="<?php echo JRoute::_('index.php?option=com_users&task=user.logout'); ?>" method="post" class="form-horizontal well">
<div class="control-group">
<div class="controls">
<button type="submit" class="btn btn-primary"><span class="icon-arrow-left icon-white"></span> <?php echo JText::_('JLOGOUT'); ?></button>
<button type="submit" class="btn btn-primary">
<span class="icon-arrow-left icon-white"></span>
<?php echo JText::_('JLOGOUT'); ?>
</button>
</div>
</div>
<?php if ($this->params->get('logout_redirect_url')) : ?>
Expand Down
42 changes: 21 additions & 21 deletions components/com_users/views/profile/tmpl/default.php
Expand Up @@ -9,26 +9,26 @@

defined('_JEXEC') or die;
?>
<div class="profile<?php echo $this->pageclass_sfx; ?>">
<?php if ($this->params->get('show_page_heading')) : ?>
<div class="page-header">
<h1>
<?php echo $this->escape($this->params->get('page_heading')); ?>
</h1>
</div>
<?php endif; ?>
<?php if (JFactory::getUser()->id == $this->data->id) : ?>
<ul class="btn-toolbar pull-right">
<li class="btn-group">
<a class="btn" href="<?php echo JRoute::_('index.php?option=com_users&task=profile.edit&user_id=' . (int) $this->data->id); ?>">
<span class="icon-user"></span> <?php echo JText::_('COM_USERS_EDIT_PROFILE'); ?></a>
</li>
</ul>
<?php endif; ?>
<?php echo $this->loadTemplate('core'); ?>

<?php echo $this->loadTemplate('params'); ?>

<?php echo $this->loadTemplate('custom'); ?>

<div class="profile<?php echo $this->pageclass_sfx; ?>">
<?php if ($this->params->get('show_page_heading')) : ?>
<div class="page-header">
<h1>
<?php echo $this->escape($this->params->get('page_heading')); ?>
</h1>
</div>
<?php endif; ?>
<?php if (JFactory::getUser()->id == $this->data->id) : ?>
<ul class="btn-toolbar pull-right">
<li class="btn-group">
<a class="btn" href="<?php echo JRoute::_('index.php?option=com_users&task=profile.edit&user_id=' . (int) $this->data->id); ?>">
<span class="icon-user"></span>
<?php echo JText::_('COM_USERS_EDIT_PROFILE'); ?>
</a>
</li>
</ul>
<?php endif; ?>
<?php echo $this->loadTemplate('core'); ?>
<?php echo $this->loadTemplate('params'); ?>
<?php echo $this->loadTemplate('custom'); ?>
</div>
2 changes: 0 additions & 2 deletions components/com_users/views/profile/tmpl/default_core.php
Expand Up @@ -37,7 +37,6 @@
<dt>
<?php echo JText::_('COM_USERS_PROFILE_LAST_VISITED_DATE_LABEL'); ?>
</dt>

<?php if ($this->data->lastvisitDate != $this->db->getNullDate()) : ?>
<dd>
<?php echo JHtml::_('date', $this->data->lastvisitDate); ?>
Expand All @@ -47,6 +46,5 @@
<?php echo JText::_('COM_USERS_PROFILE_NEVER_VISITED'); ?>
</dd>
<?php endif; ?>

</dl>
</fieldset>
5 changes: 4 additions & 1 deletion components/com_users/views/profile/tmpl/default_custom.php
Expand Up @@ -32,6 +32,7 @@
$customFields[$customField->name] = $customField;
}
?>

<?php foreach ($fieldsets as $group => $fieldset) : ?>
<?php $fields = $this->form->getFieldset($group); ?>
<?php if (count($fields)) : ?>
Expand All @@ -45,7 +46,9 @@
<dl class="dl-horizontal">
<?php foreach ($fields as $field) : ?>
<?php if (!$field->hidden && $field->type !== 'Spacer') : ?>
<dt><?php echo $field->title; ?></dt>
<dt>
<?php echo $field->title; ?>
</dt>
<dd>
<?php if (key_exists($field->fieldname, $customFields)) : ?>
<?php echo $customFields[$field->fieldname]->value ?: JText::_('COM_USERS_PROFILE_VALUE_NOT_FOUND'); ?>
Expand Down
45 changes: 24 additions & 21 deletions components/com_users/views/profile/tmpl/default_params.php
Expand Up @@ -12,27 +12,30 @@
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');

?>

<?php $fields = $this->form->getFieldset('params'); ?>
<?php if (count($fields)) : ?>
<fieldset id="users-profile-custom">
<legend><?php echo JText::_('COM_USERS_SETTINGS_FIELDSET_LABEL'); ?></legend>
<dl class="dl-horizontal">
<?php foreach ($fields as $field) :
if (!$field->hidden) : ?>
<dt><?php echo $field->title; ?></dt>
<dd>
<?php if (JHtml::isRegistered('users.' . $field->id)) : ?>
<?php echo JHtml::_('users.' . $field->id, $field->value); ?>
<?php elseif (JHtml::isRegistered('users.' . $field->fieldname)) : ?>
<?php echo JHtml::_('users.' . $field->fieldname, $field->value); ?>
<?php elseif (JHtml::isRegistered('users.' . $field->type)) : ?>
<?php echo JHtml::_('users.' . $field->type, $field->value); ?>
<?php else : ?>
<?php echo JHtml::_('users.value', $field->value); ?>
<?php endif; ?>
</dd>
<?php endif; ?>
<?php endforeach; ?>
</dl>
</fieldset>
<fieldset id="users-profile-custom">
<legend><?php echo JText::_('COM_USERS_SETTINGS_FIELDSET_LABEL'); ?></legend>
<dl class="dl-horizontal">
<?php foreach ($fields as $field) :
if (!$field->hidden) : ?>
<dt>
<?php echo $field->title; ?>
</dt>
<dd>
<?php if (JHtml::isRegistered('users.' . $field->id)) : ?>
<?php echo JHtml::_('users.' . $field->id, $field->value); ?>
<?php elseif (JHtml::isRegistered('users.' . $field->fieldname)) : ?>
<?php echo JHtml::_('users.' . $field->fieldname, $field->value); ?>
<?php elseif (JHtml::isRegistered('users.' . $field->type)) : ?>
<?php echo JHtml::_('users.' . $field->type, $field->value); ?>
<?php else : ?>
<?php echo JHtml::_('users.value', $field->value); ?>
<?php endif; ?>
</dd>
<?php endif; ?>
<?php endforeach; ?>
</dl>
</fieldset>
<?php endif; ?>

0 comments on commit acbd82c

Please sign in to comment.