[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/modules/mod_login/tmpl/ -> default.php (source)

   1  <?php
   2  
   3  /**
   4   * @package     Joomla.Site
   5   * @subpackage  mod_login
   6   *
   7   * @copyright   (C) 2006 Open Source Matters, Inc. <https://www.joomla.org>
   8   * @license     GNU General Public License version 2 or later; see LICENSE.txt
   9   */
  10  
  11  defined('_JEXEC') or die;
  12  
  13  use Joomla\CMS\Component\ComponentHelper;
  14  use Joomla\CMS\HTML\HTMLHelper;
  15  use Joomla\CMS\Language\Text;
  16  use Joomla\CMS\Plugin\PluginHelper;
  17  use Joomla\CMS\Router\Route;
  18  
  19  $app->getDocument()->getWebAssetManager()
  20      ->useScript('core')
  21      ->useScript('keepalive')
  22      ->useScript('field.passwordview');
  23  
  24  Text::script('JSHOWPASSWORD');
  25  Text::script('JHIDEPASSWORD');
  26  ?>
  27  <form id="login-form-<?php echo $module->id; ?>" class="mod-login" action="<?php echo Route::_('index.php', true); ?>" method="post">
  28  
  29      <?php if ($params->get('pretext')) : ?>
  30          <div class="mod-login__pretext pretext">
  31              <p><?php echo $params->get('pretext'); ?></p>
  32          </div>
  33      <?php endif; ?>
  34  
  35      <div class="mod-login__userdata userdata">
  36          <div class="mod-login__username form-group">
  37              <?php if (!$params->get('usetext', 0)) : ?>
  38                  <div class="input-group">
  39                      <input id="modlgn-username-<?php echo $module->id; ?>" type="text" name="username" class="form-control" autocomplete="username" placeholder="<?php echo Text::_('MOD_LOGIN_VALUE_USERNAME'); ?>">
  40                      <label for="modlgn-username-<?php echo $module->id; ?>" class="visually-hidden"><?php echo Text::_('MOD_LOGIN_VALUE_USERNAME'); ?></label>
  41                      <span class="input-group-text" title="<?php echo Text::_('MOD_LOGIN_VALUE_USERNAME'); ?>">
  42                          <span class="icon-user icon-fw" aria-hidden="true"></span>
  43                      </span>
  44                  </div>
  45              <?php else : ?>
  46                  <label for="modlgn-username-<?php echo $module->id; ?>"><?php echo Text::_('MOD_LOGIN_VALUE_USERNAME'); ?></label>
  47                  <input id="modlgn-username-<?php echo $module->id; ?>" type="text" name="username" class="form-control" autocomplete="username" placeholder="<?php echo Text::_('MOD_LOGIN_VALUE_USERNAME'); ?>">
  48              <?php endif; ?>
  49          </div>
  50  
  51          <div class="mod-login__password form-group">
  52              <?php if (!$params->get('usetext', 0)) : ?>
  53                  <div class="input-group">
  54                      <input id="modlgn-passwd-<?php echo $module->id; ?>" type="password" name="password" autocomplete="current-password" class="form-control" placeholder="<?php echo Text::_('JGLOBAL_PASSWORD'); ?>">
  55                      <label for="modlgn-passwd-<?php echo $module->id; ?>" class="visually-hidden"><?php echo Text::_('JGLOBAL_PASSWORD'); ?></label>
  56                      <button type="button" class="btn btn-secondary input-password-toggle">
  57                          <span class="icon-eye icon-fw" aria-hidden="true"></span>
  58                          <span class="visually-hidden"><?php echo Text::_('JSHOWPASSWORD'); ?></span>
  59                      </button>
  60                  </div>
  61              <?php else : ?>
  62                  <label for="modlgn-passwd-<?php echo $module->id; ?>"><?php echo Text::_('JGLOBAL_PASSWORD'); ?></label>
  63                  <input id="modlgn-passwd-<?php echo $module->id; ?>" type="password" name="password" autocomplete="current-password" class="form-control" placeholder="<?php echo Text::_('JGLOBAL_PASSWORD'); ?>">
  64              <?php endif; ?>
  65          </div>
  66  
  67          <?php if (PluginHelper::isEnabled('system', 'remember')) : ?>
  68              <div class="mod-login__remember form-group">
  69                  <div id="form-login-remember-<?php echo $module->id; ?>" class="form-check">
  70                      <label class="form-check-label">
  71                          <input type="checkbox" name="remember" class="form-check-input" value="yes">
  72                          <?php echo Text::_('MOD_LOGIN_REMEMBER_ME'); ?>
  73                      </label>
  74                  </div>
  75              </div>
  76          <?php endif; ?>
  77  
  78          <?php foreach ($extraButtons as $button) :
  79              $dataAttributeKeys = array_filter(array_keys($button), function ($key) {
  80                  return substr($key, 0, 5) == 'data-';
  81              });
  82              ?>
  83              <div class="mod-login__submit form-group">
  84                  <button type="button"
  85                          class="btn btn-secondary w-100 <?php echo $button['class'] ?? '' ?>"
  86                          <?php foreach ($dataAttributeKeys as $key) : ?>
  87                              <?php echo $key ?>="<?php echo $button[$key] ?>"
  88                          <?php endforeach; ?>
  89                          <?php if ($button['onclick']) : ?>
  90                          onclick="<?php echo $button['onclick'] ?>"
  91                          <?php endif; ?>
  92                          title="<?php echo Text::_($button['label']) ?>"
  93                          id="<?php echo $button['id'] ?>"
  94                          >
  95                      <?php if (!empty($button['icon'])) : ?>
  96                          <span class="<?php echo $button['icon'] ?>"></span>
  97                      <?php elseif (!empty($button['image'])) : ?>
  98                          <?php echo $button['image']; ?>
  99                      <?php elseif (!empty($button['svg'])) : ?>
 100                          <?php echo $button['svg']; ?>
 101                      <?php endif; ?>
 102                      <?php echo Text::_($button['label']) ?>
 103                  </button>
 104              </div>
 105          <?php endforeach; ?>
 106  
 107          <div class="mod-login__submit form-group">
 108              <button type="submit" name="Submit" class="btn btn-primary w-100"><?php echo Text::_('JLOGIN'); ?></button>
 109          </div>
 110  
 111          <?php
 112              $usersConfig = ComponentHelper::getParams('com_users'); ?>
 113              <ul class="mod-login__options list-unstyled">
 114                  <li>
 115                      <a href="<?php echo Route::_('index.php?option=com_users&view=reset'); ?>">
 116                      <?php echo Text::_('MOD_LOGIN_FORGOT_YOUR_PASSWORD'); ?></a>
 117                  </li>
 118                  <li>
 119                      <a href="<?php echo Route::_('index.php?option=com_users&view=remind'); ?>">
 120                      <?php echo Text::_('MOD_LOGIN_FORGOT_YOUR_USERNAME'); ?></a>
 121                  </li>
 122                  <?php if ($usersConfig->get('allowUserRegistration')) : ?>
 123                  <li>
 124                      <a href="<?php echo Route::_($registerLink); ?>">
 125                      <?php echo Text::_('MOD_LOGIN_REGISTER'); ?> <span class="icon-register" aria-hidden="true"></span></a>
 126                  </li>
 127                  <?php endif; ?>
 128              </ul>
 129          <input type="hidden" name="option" value="com_users">
 130          <input type="hidden" name="task" value="user.login">
 131          <input type="hidden" name="return" value="<?php echo $return; ?>">
 132          <?php echo HTMLHelper::_('form.token'); ?>
 133      </div>
 134      <?php if ($params->get('posttext')) : ?>
 135          <div class="mod-login__posttext posttext">
 136              <p><?php echo $params->get('posttext'); ?></p>
 137          </div>
 138      <?php endif; ?>
 139  </form>


Generated: Wed Sep 7 05:41:13 2022 Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer