. */ /** * Class LoginBlockModule */ class LoginBlockModule extends AbstractModule implements ModuleBlockInterface { /** {@inheritdoc} */ public function getTitle() { return /* I18N: Name of a module */ I18N::translate('Login'); } /** {@inheritdoc} */ public function getDescription() { return /* I18N: Description of the “Login” module */ I18N::translate('An alternative way to login and logout.'); } /** {@inheritdoc} */ public function getBlock($block_id, $template = true, $cfg = null) { global $controller; $id = $this->getName() . $block_id; $class = $this->getName() . '_block'; $controller->addInlineJavascript(' jQuery("#new_passwd").hide(); jQuery("#passwd_click").click(function() { jQuery("#new_passwd").slideToggle(100, function() { jQuery("#new_passwd_username").focus(); }); return false; }); '); if (Auth::check()) { $title = I18N::translate('Logout'); $content = '
'; $content .= '
' . I18N::translate('Logged in as ') . ' ' . Auth::user()->getRealNameHtml() . '

'; $content .= ''; $content .= '

'; } else { $title = I18N::translate('Login'); $content = '
'; $content .= '
'. I18N::translate('Request new password') . '
'; if (Site::getPreference('USE_REGISTRATION_MODULE')) { $content .= '
' . I18N::translate('Request new user account') . '
'; } $content .= '
'; // close "login-form" // hidden New Password block $content .= '

'. I18N::translate('Lost password request') . '

'; //"new_passwd" $content .= '
'; //"login-box" } if ($template) { return Theme::theme()->formatBlock($id, $title, $class, $content); } else { return $content; } } /** {@inheritdoc} */ public function loadAjax() { return false; } /** {@inheritdoc} */ public function isUserBlock() { return true; } /** {@inheritdoc} */ public function isGedcomBlock() { return true; } /** {@inheritdoc} */ public function configureBlock($block_id) { } }