Skip to content

Instantly share code, notes, and snippets.

@iamrobert
Last active March 12, 2018 13:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iamrobert/5a1d206279d1faad245dc7c1f1502772 to your computer and use it in GitHub Desktop.
Save iamrobert/5a1d206279d1faad245dc7c1f1502772 to your computer and use it in GitHub Desktop.
Overwrite Joomla Login for Foundation 5 - templats/your_template/html/mod_login/default.php
<?php
/**
* @package Joomla.Site
* @subpackage mod_login
*
* @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
require_once JPATH_SITE . '/components/com_users/helpers/route.php';
JHtml::_('behavior.keepalive');
JHtml::_('bootstrap.tooltip');
?>
<form action="<?php echo JRoute::_(htmlspecialchars(JUri::getInstance()->toString()), true, $params->get('usesecure')); ?>" method="post" id="login-form" data-abide>
<?php if ($params->get('pretext')) : ?>
<div class="pretext">
<p><?php echo $params->get('pretext'); ?></p>
</div>
<?php endif; ?>
<div class="userdata">
<div id="form-login-username" class="row">
<?php if (!$params->get('usetext')) : ?>
<div class="small-3 columns">
<label for="modlgn-username" class="element-invisible"><?php echo JText::_('MOD_LOGIN_VALUE_USERNAME'); ?></label>
<span data-tooltip aria-haspopup="true" class="tok-user has-tip right inline mt-10" title="<?php echo JText::_('MOD_LOGIN_VALUE_USERNAME') ?>"></span>
</div>
<div class="small-9 columns">
<input id="modlgn-username" type="text" name="username" class="input-small" tabindex="0" size="18" placeholder="<?php echo JText::_('MOD_LOGIN_VALUE_USERNAME') ?>" /></div>
<?php else: ?>
<div class="small-3 columns">
<label for="modlgn-username" class="right inline"><?php echo JText::_('MOD_LOGIN_VALUE_USERNAME') ?></label>
</div>
<div class="small-9 columns">
<input id="modlgn-username" type="text" name="username" class="input-small" tabindex="0" size="18" placeholder="<?php echo JText::_('MOD_LOGIN_VALUE_USERNAME') ?>" />
</div>
<?php endif; ?>
</div>
<div id="form-login-password" class="row">
<?php if (!$params->get('usetext')) : ?>
<div class="small-3 columns">
<label for="modlgn-passwd" class="element-invisible"><?php echo JText::_('JGLOBAL_PASSWORD'); ?></label>
<span data-tooltip aria-haspopup="true" class="tok-login has-tip right inline mt-10" title="<?php echo JText::_('JGLOBAL_PASSWORD'); ?>"></span>
</div>
<div class="small-9 columns">
<input id="modlgn-passwd" type="password" name="password" class="input-small" tabindex="0" size="18" placeholder="<?php echo JText::_('JGLOBAL_PASSWORD') ?>" />
</div>
<?php else: ?>
<label for="modlgn-passwd" class="right inline"><?php echo JText::_('JGLOBAL_PASSWORD') ?></label>
<input id="modlgn-passwd" type="password" name="password" class="input-small" tabindex="0" size="18" placeholder="<?php echo JText::_('JGLOBAL_PASSWORD') ?>" />
<?php endif; ?>
</div>
<?php if (count($twofactormethods) > 1): ?>
<div id="form-login-secretkey" class="row">
<?php if (!$params->get('usetext')) : ?>
<div class="small-3 columns">
<label for="modlgn-secretkey" class="element-invisible"><?php echo JText::_('JGLOBAL_SECRETKEY'); ?></label>
<span data-tooltip aria-haspopup="true" class="tok-login has-tip right inline mt-10" title="<?php echo JText::_('JGLOBAL_SECRETKEY'); ?>"></span>
</div>
<div class="small-9 columns">
<input id="modlgn-secretkey" autocomplete="off" type="text" name="secretkey" class="input-small" tabindex="0" size="18" placeholder="<?php echo JText::_('JGLOBAL_SECRETKEY') ?>" />
<span class="btn width-auto hasTooltip" title="<?php echo JText::_('JGLOBAL_SECRETKEY_HELP'); ?>">
<span class="icon-help"></span>
</span>
</div>
<?php else: ?>
<div class="small-3 columns"><label for="modlgn-secretkey" class="right inline"><?php echo JText::_('JGLOBAL_SECRETKEY') ?></label></div>
<div class="small-9 columns"><input id="modlgn-secretkey" autocomplete="off" type="text" name="secretkey" class="input-small" tabindex="0" size="18" placeholder="<?php echo JText::_('JGLOBAL_SECRETKEY') ?>" />
<span class="btn width-auto hasTooltip" title="<?php echo JText::_('JGLOBAL_SECRETKEY_HELP'); ?>">
<span class="icon-help"></span>
</span></div>
<?php endif; ?>
</div>
</div>
<?php endif; ?>
<div class="row">
<?php if (JPluginHelper::isEnabled('system', 'remember')) : ?>
<div class="small-9 small-offset-3 medium-5 medium-offset-3 columns" id="form-login-remember">
<input id="modlgn-remember" type="checkbox" name="remember" value="yes" class="inline"/> <label for="modlgn-remember" class="inline"><?php echo JText::_('MOD_LOGIN_REMEMBER_ME') ?></label>
</div>
<?php endif; ?>
<div class="medium-4 columns text-right" id="form-login-submit">
<button type="submit" tabindex="0" name="Submit" class="button"><?php echo JText::_('JLOGIN') ?></button>
</div>
</div>
<?php
$usersConfig = JComponentHelper::getParams('com_users'); ?>
<div class="row">
<div class="small-9 small-offset-3 columns">
<ul class="unstyled">
<?php if ($usersConfig->get('allowUserRegistration')) : ?>
<li>
<a href="<?php echo JRoute::_('index.php?option=com_users&view=registration&Itemid=' . UsersHelperRoute::getRegistrationRoute()); ?>">
<?php echo JText::_('MOD_LOGIN_REGISTER'); ?> <span class="icon-arrow-right"></span></a>
</li>
<?php endif; ?>
<li>
<a href="<?php echo JRoute::_('index.php?option=com_users&view=remind&Itemid=' . UsersHelperRoute::getRemindRoute()); ?>">
<?php echo JText::_('MOD_LOGIN_FORGOT_YOUR_USERNAME'); ?></a>
</li>
<li>
<a href="<?php echo JRoute::_('index.php?option=com_users&view=reset&Itemid=' . UsersHelperRoute::getResetRoute()); ?>">
<?php echo JText::_('MOD_LOGIN_FORGOT_YOUR_PASSWORD'); ?></a>
</li>
</ul>
</div>
</div>
<input type="hidden" name="option" value="com_users" />
<input type="hidden" name="task" value="user.login" />
<input type="hidden" name="return" value="<?php echo $return; ?>" />
<?php echo JHtml::_('form.token'); ?>
</div>
<?php if ($params->get('posttext')) : ?>
<div class="posttext">
<p><?php echo $params->get('posttext'); ?></p>
</div>
<?php endif; ?>
</form>
<?php /** * @package Joomla.Site * @subpackage mod_login * * @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; JHtml::_('behavior.keepalive'); ?> <form action="<?php echo JRoute::_('index.php', true, $params->get('usesecure')); ?>" method="post" id="login-form" class="form-vertical"> <?php if ($params->get('greeting')) : ?> <div class="login-greeting"> <?php if ($params->get('name') == 0) : { echo JText::sprintf('MOD_LOGIN_HINAME', htmlspecialchars($user->get('name'))); } else : { echo JText::sprintf('MOD_LOGIN_HINAME', htmlspecialchars($user->get('username'))); } endif; ?> </div> <?php endif; ?> <div class="logout-button"> <input type="submit" name="Submit" class="button" value="<?php echo JText::_('JLOGOUT'); ?>" /> <input type="hidden" name="option" value="com_users" /> <input type="hidden" name="task" value="user.logout" /> <input type="hidden" name="return" value="<?php echo $return; ?>" /> <?php echo JHtml::_('form.token'); ?> </div> </form>
<?php if ($this->countModules( 'modal' )) : ?>
<div id="loginModal" class="reveal-modal full" data-reveal aria-labelledby="loginModal" aria-hidden="true" role="dialog">
<jdoc:include type="modules" name="modal" style="iamrobert" />
<a class="close-reveal-modal" aria-label="Close">&#215;</a>
</div>
<?php endif; ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment