From 38f3463ffb390d1bf58818e83e4e5837f64899d1 Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Sun, 3 Apr 2011 10:29:23 +0000 Subject: [PATCH] new marker for required fields added fixed image dimensions --- lam/lib/html.inc | 24 ++++++++++++++++++++++-- lam/lib/lists.inc | 20 ++++++++++---------- lam/lib/modules.inc | 4 ++-- lam/templates/config/confmain.php | 2 -- lam/templates/main_header.php | 12 ++++++------ lam/templates/masscreate.php | 12 ++++++++---- 6 files changed, 48 insertions(+), 26 deletions(-) diff --git a/lam/lib/html.inc b/lam/lib/html.inc index 633edfbb..4a38ae2f 100644 --- a/lam/lib/html.inc +++ b/lam/lib/html.inc @@ -482,7 +482,9 @@ class htmlTableExtendedInputField extends htmlInputField { // print label text echo $this->label; if ($this->required) { - echo '*'; + $graphicsPath = "../../graphics"; + if (is_dir("../graphics")) $graphicsPath = "../graphics"; + echo 'required'; } echo "\n\n\n"; // print input field @@ -1165,6 +1167,8 @@ class htmlOutputText extends htmlElement { private $escapeHTML; /** bold text */ private $isBold = false; + /** mark as required */ + private $markAsRequired = false; /** * Constructor. @@ -1198,6 +1202,11 @@ class htmlOutputText extends htmlElement { else { echo $this->string; } + if ($this->markAsRequired) { + $graphicsPath = "../../graphics"; + if (is_dir("../graphics")) $graphicsPath = "../graphics"; + echo 'required'; + } if ($this->isBold) { echo ""; } @@ -1213,6 +1222,15 @@ class htmlOutputText extends htmlElement { $this->isBold = $isBold; } + /** + * Adds a marker that indicates a required field. + * + * @param boolean $markAsRequired add marker + */ + public function setMarkAsRequired($markAsRequired) { + $this->markAsRequired = $markAsRequired; + } + } /** @@ -1568,7 +1586,9 @@ class htmlTableExtendedInputTextarea extends htmlInputTextarea { function generateHTML($module, $input, $values, $restricted, &$tabindex, $scope) { echo $this->label; if ($this->required) { - echo '*'; + $graphicsPath = "../../graphics"; + if (is_dir("../graphics")) $graphicsPath = "../graphics"; + echo 'required'; } echo "\n\n\n"; $return = parent::generateHTML($module, $input, $values, $restricted, $tabindex, $scope); diff --git a/lam/lib/lists.inc b/lam/lib/lists.inc index dac83dd4..4899a65f 100644 --- a/lam/lib/lists.inc +++ b/lam/lib/lists.inc @@ -279,12 +279,12 @@ class lamList { if ($this->page != 1) { echo("type . "&norefresh=true&page=1" . "&sort=" . $this->sortColumn . "&sortdirection=" . $this->sortDirection . $this->filterText . "\">" . - "\"\"\n"); + "\"\"\n"); } if ($this->page > 10) { echo("type . "&norefresh=true&page=" . ($this->page - 10) . "&sort=" . $this->sortColumn . "&sortdirection=" . $this->sortDirection . $this->filterText . "\">" . - "\"\"\n"); + "\"\"\n"); } for ($i = $this->page - 5; $i < ($this->page + 4); $i++) { if ($i >= ($count / $this->maxPageEntries)) { @@ -304,12 +304,12 @@ class lamList { if ($this->page < (($count / $this->maxPageEntries) - 10)) { echo("type . "&norefresh=true&page=" . ($this->page + 10) . "&sort=" . $this->sortColumn . "&sortdirection=" . $this->sortDirection . $this->filterText . "\">" . - "\"\"\n"); + "\"\"\n"); } if ($this->page < ($count / $this->maxPageEntries)) { echo("type . "&norefresh=true&page=" . round(($count / $this->maxPageEntries)) . "&sort=" . $this->sortColumn . "&sortdirection=" . $this->sortDirection . $this->filterText . "\">" . - "\"\"\n"); + "\"\"\n"); } echo ""; } @@ -332,7 +332,7 @@ class lamList { } echo "type . "&". "sort=" . strtolower($this->attrArray[$k]) . $this->filterText . "&norefresh=y" . "\">" . $this->descArray[$k] . - " \"sort\n"; + " \"sort\n"; } else echo "type . "&". "sort=" . strtolower($this->attrArray[$k]) . $this->filterText . "&norefresh=y" . "\">" . $this->descArray[$k] . "\n"; @@ -401,7 +401,7 @@ class lamList { // display select all link $colspan = sizeof($this->attrArray) + 1; echo "type . "list-bright\">\n"; - echo "\"select\n"; + echo "\"select\n"; echo " " . "" . _("Select all") . "\n"; echo "\n"; @@ -420,13 +420,13 @@ class lamList { $toolCount = 0; // edit image $output .= "type . "&DN='" . rawurlencode($account['dn']) . "'\">"; - $output .= "\"""; + $output .= "\"""; $output .= "\n "; $toolCount++; // delete image if (checkIfWriteAccessIsAllowed()) { $output .= "type . "&DN='" . rawurlencode($account['dn']) . "'\">"; - $output .= "\"""; + $output .= "\"""; $output .= "\n "; $toolCount++; } @@ -438,7 +438,7 @@ class lamList { $tools = $this->getAdditionalTools(); for ($i = 0; $i < sizeof($tools); $i++) { $output .= "getLinkTarget() . "?type=" . $this->type . "&DN='" . rawurlencode($account['dn']) . "'\">"; - $output .= "getImage() . "\" alt=\"" . $tools[$i]->getName() . "\" title=\"" . $tools[$i]->getName() . "\">"; + $output .= "getImage() . "\" alt=\"" . $tools[$i]->getName() . "\" title=\"" . $tools[$i]->getName() . "\">"; $output .= "\n "; $toolCount++; } @@ -716,7 +716,7 @@ class lamList { $this->listShowOUSelection(); echo ""; echo ' '; - echo '' . _('Change settings') . ''; + echo '' . _('Change settings') . ''; echo ''; echo "\n"; echo "\n"; diff --git a/lam/lib/modules.inc b/lam/lib/modules.inc index 56d13461..a1ff39b8 100644 --- a/lam/lib/modules.inc +++ b/lam/lib/modules.inc @@ -949,7 +949,7 @@ function printHelpLink($entry, $number, $module='', $scope='') { echo ""; - echo "\"""; + echo "\"""; echo ""; } @@ -1605,7 +1605,7 @@ class accountContainer { if ($buttonStatus == 'disabled') echo " disabled"; echo ' onmouseover="jQuery(this).addClass(\'tabs-hover\');" onmouseout="jQuery(this).removeClass(\'tabs-hover\');">'; if ($buttonImage != null) { - echo "\"\" "; + echo "\"\" "; } echo $this->module[$this->order[$i]]->get_alias(); echo " \n"; diff --git a/lam/templates/config/confmain.php b/lam/templates/config/confmain.php index 33b79c5e..84edb37f 100644 --- a/lam/templates/config/confmain.php +++ b/lam/templates/config/confmain.php @@ -361,8 +361,6 @@ $securitySettings = new htmlFieldset($securitySettingsContent, _("Security setti $container->addElement($securitySettings, true); $container->addElement(new htmlSpacer(null, '10px'), true); -$container->addElement(new htmlOutputText('*=' . _("required")), true); - parseHtml(null, $container, array(), false, $tabindex, 'user'); echo ""; diff --git a/lam/templates/main_header.php b/lam/templates/main_header.php index a7b88d8e..55dd52f7 100644 --- a/lam/templates/main_header.php +++ b/lam/templates/main_header.php @@ -101,18 +101,18 @@ foreach ($toSort as $key => $value) {