Skip to content

Commit

Permalink
Add custom field rendering to core template overrides
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicholas K. Dionysopoulos committed Aug 20, 2016
1 parent afcb7da commit 72317e1
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 0 deletions.
32 changes: 32 additions & 0 deletions administrator/templates/hathor/html/mod_login/default.php
Expand Up @@ -29,6 +29,20 @@
</div>
</div>
<?php endif; ?>
<?php if (count($extraFields)):
$extraFieldCounter = 0;
/** @var JAuthenticationFieldInterface $extraField */
foreach ($extraFields as $extraField):
if ($extraField->getType() != 'field') continue;
?>
<div id="form-login-extrafield-<?php echo ++$extraFieldCounter ?>" class="control-group">
<div class="controls">
<label><?php echo $extraField->getLabel(); ?></label>
<?php echo $extraField->getInput(); ?>
</div>
</div>
<?php endforeach; ?>
<?php endif; ?>
<?php if (!empty ($langs)) : ?>
<label id="mod-login-language-lbl" for="lang"><?php echo JText::_('MOD_LOGIN_LANGUAGE'); ?></label>
<?php echo $langs; ?>
Expand All @@ -43,6 +57,24 @@
<?php echo JText::_('MOD_LOGIN_LOGIN'); ?></a>
</div>
</div>
<?php if (count($extraFields)):
$extraFieldCounter = 0;
/** @var JAuthenticationFieldInterface $extraField */
foreach ($extraFields as $extraField):
if ($extraField->getType() != 'button') continue;
?>
<div class="button1">
<div class="next">
<a id="form-login-button-<?php echo ++$extraFieldCounter ?>" href="<?php echo $extraField->getInput() ?>">
<?php if ($extraField->getIcon()): ?>
<span class="<?php echo $extraField->getIcon() ?>"></span>
<?php endif; ?>
<?php echo $extraField->getLabel(); ?>
</a>
</div>
</div>
<?php endforeach; ?>
<?php endif; ?>
</div>

<div class="clr"></div>
Expand Down
48 changes: 48 additions & 0 deletions templates/beez3/html/mod_login/default.php
Expand Up @@ -42,13 +42,48 @@
</div>
</div>
<?php endif; ?>
<?php if (count($extraFields)):
$extraFieldCounter = 0;
/** @var JAuthenticationFieldInterface $extraField */
foreach ($extraFields as $extraField):
if ($extraField->getType() != 'field') continue;
?>
<div id="form-login-extrafield-<?php echo ++$extraFieldCounter ?>" class="control-group">
<div class="controls">
<?php if (!$params->get('usetext')) : ?>
<div class="input-prepend input-append">
<label><?php echo $extraField->getLabel(); ?></label>
<?php echo $extraField->getInput(); ?>
</div>
<?php else: ?>
<label><?php echo $extraField->getLabel(); ?></label>
<?php echo $extraField->getInput(); ?>
<?php endif; ?>
</div>
</div>
<?php endforeach; ?>
<?php endif; ?>
<?php if (JPluginHelper::isEnabled('system', 'remember')) : ?>
<p id="form-login-remember">
<label for="modlgn-remember"><?php echo JText::_('MOD_LOGIN_REMEMBER_ME') ?></label>
<input id="modlgn-remember" type="checkbox" name="remember" class="inputbox" value="yes"/>
</p>
<?php endif; ?>
<input type="submit" name="Submit" class="button" value="<?php echo JText::_('JLOGIN') ?>" />
<?php if (count($extraFields)):
$extraFieldCounter = 0;
/** @var JAuthenticationFieldInterface $extraField */
foreach ($extraFields as $extraField):
if ($extraField->getType() != 'button') continue;
?>
<button type="button" id="form-login-button-<?php echo ++$extraFieldCounter ?>" href="<?php echo $extraField->getInput() ?>">
<?php if ($extraField->getIcon()): ?>
<span class="<?php echo $extraField->getIcon() ?>"></span>
<?php endif; ?>
<?php echo $extraField->getLabel(); ?>
</button>
<?php endforeach; ?>
<?php endif; ?>
<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; ?>" />
Expand All @@ -68,6 +103,19 @@
<?php echo JText::_('MOD_LOGIN_REGISTER'); ?></a>
</li>
<?php endif; ?>
<?php if (count($extraFields)):
$extraFieldCounter = 0;
/** @var JAuthenticationFieldInterface $extraField */
foreach ($extraFields as $extraField):
if ($extraField->getType() != 'link') continue;
?>
<li>
<a id="form-login-link-<?php echo ++$extraFieldCounter ?>" href="<?php echo $extraField->getInput() ?>">
<?php echo $extraField->getLabel(); ?>
</a>
</li>
<?php endforeach; ?>
<?php endif; ?>
</ul>
<?php if ($params->get('posttext')) : ?>
<div class="posttext">
Expand Down

0 comments on commit 72317e1

Please sign in to comment.