new meta HTML for password dialog

This commit is contained in:
Roland Gruber 2010-10-11 16:04:17 +00:00
parent 3637f3fa7d
commit e114f67af3
1 changed files with 49 additions and 47 deletions

View File

@ -1266,62 +1266,63 @@ class accountContainer {
*/ */
private function printPasswordPromt($errors) { private function printPasswordPromt($errors) {
$this->printPageHeader(); $this->printPageHeader();
// print error messages echo "<div class=\"" . $this->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++) { 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 // password modules
echo "<br><table class=\"".$this->type."list\" border=0 width=\"100%\" style=\"border-collapse: collapse;\">\n"; $moduleContainer = new htmlTable();
echo "<tr class=\"" . $this->type . "list-bright\">";
echo "<td nowrap>&nbsp;<img alt=\"key.png\" src=\"../../graphics/key.png\">&nbsp;</td> \n";
echo "<td nowrap>" . _("Set password") . "&nbsp;&nbsp;&nbsp;</td>";
echo "<td>\n";
printHelpLink(getHelp(null, 404), 404);
echo "</td><td width=\"100%\">&nbsp;</td>\n";
echo "<tr class=\"" . $this->type . "list-bright\"><td colspan=4>\n";
echo "<hr class=\"modulePage\" noshade>\n";
echo "</td></tr>\n";
echo "<tr class=\"" . $this->type . "list-bright\"><td colspan=4>\n";
echo "<table>\n";
echo "<tr><td>\n";
echo _('Password') . '</td><td><input type="password" name="newPassword1" tabindex=1>';
echo '</td>';
echo '<td width=30 rowspan=2>&nbsp;</td>';
echo '<td rowspan=3 valign="top">';
echo '<table>';
$tabindex = 3;
foreach ($this->module as $name => $module) { foreach ($this->module as $name => $module) {
if (($module instanceof passwordService) && $module->managesPasswordAttributes()) { if (($module instanceof passwordService) && $module->managesPasswordAttributes()) {
echo '<tr><td>'; $moduleContainer->addElement(new htmlInputCheckbox('cb_' . $name, true));
$buttonImage = $module->getIcon(); $buttonImage = $module->getIcon();
if ($buttonImage != null) { if ($buttonImage != null) {
$buttonImage = '<img src="../../graphics/' . $buttonImage . '" alt="' . getModuleAlias($name, $this->type) . '"></td><td>'; $moduleContainer->addElement(new htmlImage('../../graphics/' . $buttonImage, null, null, getModuleAlias($name, $this->type)));
} }
echo '<input type="checkbox" checked name="cb_' . $name . '" tabindex=' . $tabindex . '></td><td>' . $buttonImage . getModuleAlias($name, $this->type) . "<br>\n"; $moduleContainer->addElement(new htmlOutputText(getModuleAlias($name, $this->type)));
echo '</td></tr>'; $moduleContainer->addElement(new htmlSpacer('10px', null));
$tabindex++;
} }
} }
echo '</table></td>'; $moduleContainer->colspan = 5;
echo "</tr>"; $container->addElement($moduleContainer, true);
$container->addElement(new htmlSpacer(null, '10px'), true);
echo "<tr><td>"; // password fields
echo _('Repeat password') . '</td><td><input type="password" name="newPassword2" tabindex=2>'; $container->addElement(new htmlOutputText(_('Password')));
echo "</td></tr>\n"; $pwdInput1 = new htmlInputField('newPassword1');
echo "<tr><td colspan=3 valign=\"top\"><br><br>"; $pwdInput1->setIsPassword(true);
echo '<input type="submit" name="setNewPasswordOk" value="'. _('Ok') . "\" tabindex=$tabindex>"; $container->addElement($pwdInput1, true);
$tabindex++; $container->addElement(new htmlOutputText(_('Repeat password')));
echo '&nbsp;'; $pwdInput2 = new htmlInputField('newPassword2');
echo '<input type="submit" name="setNewPasswordCancel" value="'. _('Cancel') . "\" tabindex=$tabindex>"; $pwdInput2->setIsPassword(true);
$tabindex++; $container->addElement($pwdInput2, true);
echo '&nbsp;&nbsp;&nbsp;'; $container->addElement(new htmlSpacer(null, '10px'), true);
echo '<input type="submit" name="setNewPasswordRandom" value="'. _('Set random password') . "\" tabindex=$tabindex>"; // buttons
$tabindex++; $buttonContainer = new htmlTable();
echo "</td></tr>\n"; $buttonContainer->colspan = 3;
echo "</table>\n"; $buttonContainer->addElement(new htmlButton('setNewPasswordOk', _('Ok')));
echo "</td></tr>\n"; $buttonContainer->addElement(new htmlButton('setNewPasswordCancel', _('Cancel')));
echo "</table>\n"; $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 // set focus on password field
echo "<script type=\"text/javascript\" language=\"javascript\">\n"; echo "<script type=\"text/javascript\" language=\"javascript\">\n";
echo "<!--\n"; echo "<!--\n";
@ -1329,6 +1330,7 @@ class accountContainer {
echo "myElement.focus();\n"; echo "myElement.focus();\n";
echo "//-->\n"; echo "//-->\n";
echo "</script>\n"; echo "</script>\n";
echo "</div>\n";
$this->printPageFooter(); $this->printPageFooter();
} }