Moving code to template

1.10.x
Julio Montoya 9 years ago
parent aa6364a738
commit 24b5bafc9d
  1. 15
      main/inc/lib/userportal.lib.php
  2. 12
      main/template/default/layout/login_form.tpl

@ -34,9 +34,6 @@ class IndexManager
function set_login_form($setLoginForm = true)
{
global $loginFailed;
$login_form = '';
if (!($this->user_id) || api_is_anonymous($this->user_id)) {
// Only display if the user isn't logged in.
@ -47,18 +44,6 @@ class IndexManager
if ($loginFailed) {
$this->tpl->assign('login_failed', self::handle_login_failed());
}
if (api_get_setting('allow_lostpassword') == 'true' || api_get_setting('allow_registration') == 'true') {
$login_form .= '<ul class="nav nav-pills nav-stacked">';
if (api_get_setting('allow_registration') != 'false') {
$login_form .= '<li><a href="main/auth/inscription.php">'.get_lang('SignUp').'</a></li>';
}
if (api_get_setting('allow_lostpassword') == 'true') {
$login_form .= '<li><a href="main/auth/lostPassword.php">'.get_lang('LostPassword').'</a></li>';
}
$login_form .= '</ul>';
}
$this->tpl->assign('login_options', $login_form);
}
}
}

@ -13,7 +13,17 @@
{{ login_form }}
{{ login_options }}
{% if "allow_lostpassword" | get_setting == 'true' and "allow_registration" | get_setting == 'true' %}
<ul class="nav nav-pills nav-stacked">
{% if "allow_registration" | get_setting != 'false' %}
<li><a href="main/auth/inscription.php"> {{ 'SignUp' | get_lang }} </a></li>
{% endif %}
{% if "allow_lostpassword" | get_setting == 'true' %}
<li><a href="main/auth/lostPassword.php"> {{ 'LostPassword' | get_lang }} </a></li>
{% endif %}
</ul>
{% endif %}
{% if plugin_login_bottom is not null %}
<div id="plugin_login_bottom">

Loading…
Cancel
Save