diff --git a/lam/lib/modules.inc b/lam/lib/modules.inc index 4f33422f..aa28136b 100644 --- a/lam/lib/modules.inc +++ b/lam/lib/modules.inc @@ -1266,62 +1266,63 @@ class accountContainer { */ private function printPasswordPromt($errors) { $this->printPageHeader(); - // print error messages + echo "
type . "list-bright\">\n"; + $container = new htmlTable(); + // title + $container->addElement(new htmlSpacer(null, '5px'), true); + $titleContainer = new htmlTable(); + $titleContainer->colspan = 3; + $titleContainer->addElement(new htmlSpacer('5px', null)); + $titleContainer->addElement(new htmlOutputText(_("Set password"))); + $titleContainer->addElement(new htmlHelpLink('404'), true); + $container->addElement($titleContainer, true); + $container->addElement(new htmlSpacer(null, '20px'), true); + // error messages for ($i = 0; $i < sizeof($errors); $i++) { - call_user_func_array('StatusMessage', $errors[$i]); + $text = ''; + if (isset($errors[$i][2])) $text = $errors[$i][2]; + $params = array(); + if (isset($errors[$i][3])) $params = $errors[$i][3]; + $message = new htmlStatusMessage($errors[$i][0], $errors[$i][1], $text, $params); + $message->colspan = 3; + $container->addElement($message, true); } - // create module menu - echo "
type."list\" border=0 width=\"100%\" style=\"border-collapse: collapse;\">\n"; - echo "type . "list-bright\">"; - echo " \n"; - echo ""; - echo "\n"; - echo "type . "list-bright\">\n"; - echo "type . "list-bright\">\n"; - echo "
 \"key.png\" " . _("Set password") . "   \n"; - printHelpLink(getHelp(null, 404), 404); - echo " 
\n"; - echo "
\n"; - echo "
\n"; - echo "\n"; - echo "'; - echo ''; - echo ''; - echo ""; - - echo "\n"; - echo "\n"; - echo "
\n"; - echo _('Password') . ''; - - echo ' '; - echo ''; - $tabindex = 3; + // password modules + $moduleContainer = new htmlTable(); foreach ($this->module as $name => $module) { if (($module instanceof passwordService) && $module->managesPasswordAttributes()) { - echo ''; - $tabindex++; + $moduleContainer->addElement(new htmlOutputText(getModuleAlias($name, $this->type))); + $moduleContainer->addElement(new htmlSpacer('10px', null)); } } - echo '
'; + $moduleContainer->addElement(new htmlInputCheckbox('cb_' . $name, true)); $buttonImage = $module->getIcon(); if ($buttonImage != null) { - $buttonImage = '' . getModuleAlias($name, $this->type) . ''; + $moduleContainer->addElement(new htmlImage('../../graphics/' . $buttonImage, null, null, getModuleAlias($name, $this->type))); } - echo '' . $buttonImage . getModuleAlias($name, $this->type) . "
\n"; - echo '
"; - echo _('Repeat password') . ''; - echo "


"; - echo '"; - $tabindex++; - echo ' '; - echo '"; - $tabindex++; - echo '   '; - echo '"; - $tabindex++; - echo "
\n"; - echo "
\n"; + $moduleContainer->colspan = 5; + $container->addElement($moduleContainer, true); + $container->addElement(new htmlSpacer(null, '10px'), true); + // password fields + $container->addElement(new htmlOutputText(_('Password'))); + $pwdInput1 = new htmlInputField('newPassword1'); + $pwdInput1->setIsPassword(true); + $container->addElement($pwdInput1, true); + $container->addElement(new htmlOutputText(_('Repeat password'))); + $pwdInput2 = new htmlInputField('newPassword2'); + $pwdInput2->setIsPassword(true); + $container->addElement($pwdInput2, true); + $container->addElement(new htmlSpacer(null, '10px'), true); + // buttons + $buttonContainer = new htmlTable(); + $buttonContainer->colspan = 3; + $buttonContainer->addElement(new htmlButton('setNewPasswordOk', _('Ok'))); + $buttonContainer->addElement(new htmlButton('setNewPasswordCancel', _('Cancel'))); + $buttonContainer->addElement(new htmlButton('setNewPasswordRandom', _('Set random password'))); + $container->addElement($buttonContainer); + // generate HTML + $tabindex = 1; + parseHtml(null, $container, array(), false, $tabindex, $this->type); // set focus on password field echo "\n"; + echo "
\n"; $this->printPageFooter(); }