new marker for required fields

added fixed image dimensions
This commit is contained in:
Roland Gruber 2011-04-03 10:29:23 +00:00
parent 050a8574c0
commit 38f3463ffb
6 changed files with 48 additions and 26 deletions

View File

@ -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 '<img src="' . $graphicsPath . '/required.png" alt="required" width=16 height=16 title="' . _('required') . '">';
}
echo "\n</td>\n<td>\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 '<img src="' . $graphicsPath . '/required.png" alt="required" width=16 height=16 title="' . _('required') . '">';
}
if ($this->isBold) {
echo "</b>";
}
@ -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 '<img src="' . $graphicsPath . '/required.png" alt="required" width=16 height=16 title="' . _('required') . '">';
}
echo "\n</td>\n<td>\n";
$return = parent::generateHTML($module, $input, $values, $restricted, $tabindex, $scope);

View File

@ -279,12 +279,12 @@ class lamList {
if ($this->page != 1) {
echo("<a title=\"" . _('Jump to first page') . "\" href=\"list.php?type=" . $this->type . "&amp;norefresh=true&amp;page=1" .
"&amp;sort=" . $this->sortColumn . "&amp;sortdirection=" . $this->sortDirection . $this->filterText . "\">" .
"<img class=\"align-middle\" alt=\"\" src=\"../../graphics/go-first.png\"></a>\n");
"<img height=16 width=16 class=\"align-middle\" alt=\"\" src=\"../../graphics/go-first.png\"></a>\n");
}
if ($this->page > 10) {
echo("<a title=\"" . _('Jump 10 pages backward') . "\" href=\"list.php?type=" . $this->type . "&amp;norefresh=true&amp;page=" . ($this->page - 10) .
"&amp;sort=" . $this->sortColumn . "&amp;sortdirection=" . $this->sortDirection . $this->filterText . "\">" .
"<img class=\"align-middle\" alt=\"\" src=\"../../graphics/go-previous.png\"></a>\n");
"<img height=16 width=16 class=\"align-middle\" alt=\"\" src=\"../../graphics/go-previous.png\"></a>\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("<a title=\"" . _('Jump 10 pages forward') . "\" href=\"list.php?type=" . $this->type . "&amp;norefresh=true&amp;page=" . ($this->page + 10) .
"&amp;sort=" . $this->sortColumn . "&amp;sortdirection=" . $this->sortDirection . $this->filterText . "\">" .
"<img class=\"align-middle\" alt=\"\" src=\"../../graphics/go-next.png\"></a>\n");
"<img height=16 width=16 class=\"align-middle\" alt=\"\" src=\"../../graphics/go-next.png\"></a>\n");
}
if ($this->page < ($count / $this->maxPageEntries)) {
echo("<a title=\"" . _('Jump to last page') . "\" href=\"list.php?type=" . $this->type . "&amp;norefresh=true&amp;page=" . round(($count / $this->maxPageEntries)) .
"&amp;sort=" . $this->sortColumn . "&amp;sortdirection=" . $this->sortDirection . $this->filterText . "\">" .
"<img class=\"align-middle\" alt=\"\" src=\"../../graphics/go-last.png\"></a>\n");
"<img height=16 width=16 class=\"align-middle\" alt=\"\" src=\"../../graphics/go-last.png\"></a>\n");
}
echo "</td>";
}
@ -332,7 +332,7 @@ class lamList {
}
echo "<th><a href=\"list.php?type=" . $this->type . "&amp;".
"sort=" . strtolower($this->attrArray[$k]) . $this->filterText . "&amp;norefresh=y" . "\">" . $this->descArray[$k] .
"&nbsp;<img style=\"vertical-align: middle;\" src=\"../../graphics/$sortImage\" alt=\"sort direction\"></a></th>\n";
"&nbsp;<img height=16 width=16 style=\"vertical-align: middle;\" src=\"../../graphics/$sortImage\" alt=\"sort direction\"></a></th>\n";
}
else echo "<th><a href=\"list.php?type=" . $this->type . "&amp;".
"sort=" . strtolower($this->attrArray[$k]) . $this->filterText . "&amp;norefresh=y" . "\">" . $this->descArray[$k] . "</a></th>\n";
@ -401,7 +401,7 @@ class lamList {
// display select all link
$colspan = sizeof($this->attrArray) + 1;
echo "<tr class=\"" . $this->type . "list-bright\">\n";
echo "<td align=\"center\"><a href=\"#\" onClick=\"list_switchAccountSelection();\"><img src=\"../../graphics/select.png\" alt=\"select all\"></a></td>\n";
echo "<td align=\"center\"><a href=\"#\" onClick=\"list_switchAccountSelection();\"><img height=16 width=16 src=\"../../graphics/select.png\" alt=\"select all\"></a></td>\n";
echo "<td colspan=$colspan>&nbsp;<a href=\"#\" onClick=\"list_switchAccountSelection();\">" .
"<font color=\"black\">" . _("Select all") . "</font></a></td>\n";
echo "</tr>\n";
@ -420,13 +420,13 @@ class lamList {
$toolCount = 0;
// edit image
$output .= "<a href=\"../account/edit.php?type=" . $this->type . "&amp;DN='" . rawurlencode($account['dn']) . "'\">";
$output .= "<img src=\"../../graphics/edit.png\" alt=\"" . _("Edit") . "\" title=\"" . _("Edit") . "\">";
$output .= "<img height=16 width=16 src=\"../../graphics/edit.png\" alt=\"" . _("Edit") . "\" title=\"" . _("Edit") . "\">";
$output .= "</a>\n ";
$toolCount++;
// delete image
if (checkIfWriteAccessIsAllowed()) {
$output .= "<a href=\"deletelink.php?type=" . $this->type . "&amp;DN='" . rawurlencode($account['dn']) . "'\">";
$output .= "<img src=\"../../graphics/delete.png\" alt=\"" . _("Delete") . "\" title=\"" . _("Delete") . "\">";
$output .= "<img height=16 width=16 src=\"../../graphics/delete.png\" alt=\"" . _("Delete") . "\" title=\"" . _("Delete") . "\">";
$output .= "</a>\n ";
$toolCount++;
}
@ -438,7 +438,7 @@ class lamList {
$tools = $this->getAdditionalTools();
for ($i = 0; $i < sizeof($tools); $i++) {
$output .= "<a href=\"" . $tools[$i]->getLinkTarget() . "?type=" . $this->type . "&amp;DN='" . rawurlencode($account['dn']) . "'\">";
$output .= "<img src=\"../../graphics/" . $tools[$i]->getImage() . "\" alt=\"" . $tools[$i]->getName() . "\" title=\"" . $tools[$i]->getName() . "\">";
$output .= "<img height=16 width=16 src=\"../../graphics/" . $tools[$i]->getImage() . "\" alt=\"" . $tools[$i]->getName() . "\" title=\"" . $tools[$i]->getName() . "\">";
$output .= "</a>\n ";
$toolCount++;
}
@ -716,7 +716,7 @@ class lamList {
$this->listShowOUSelection();
echo "<input class=\"smallImageButton\" style=\"background-image: url(../../graphics/refresh.png);\" type=\"submit\" value=\" \" name=\"refresh\" title=\"" . _("Refresh") . "\">";
echo '&nbsp;<a href="list.php?type=' . $this->type . '&amp;openConfig=1">';
echo '<img src="../../graphics/tools.png" alt="' . _('Change settings') . '" title="' . _('Change settings') . '">';
echo '<img height=16 width=16 src="../../graphics/tools.png" alt="' . _('Change settings') . '" title="' . _('Change settings') . '">';
echo '</a>';
echo "</td>\n";
echo "</tr>\n";

View File

@ -949,7 +949,7 @@ function printHelpLink($entry, $number, $module='', $scope='') {
echo "<a href=\"" . $helpPath . "help.php?module=$module&amp;HelpNumber=". $number . "&amp;scope=" . $scope . "\" ";
echo "target=\"help\" ";
echo "onmouseover=\"Tip('" . $message . "', TITLE, '" . $title . "')\" onmouseout=\"UnTip()\">";
echo "<img src=\"../$helpPath/graphics/help.png\" alt=\"" . _('Help') . "\" title=\"" . _('Help') . "\">";
echo "<img width=16 height=16 src=\"../$helpPath/graphics/help.png\" alt=\"" . _('Help') . "\" title=\"" . _('Help') . "\">";
echo "</a>";
}
@ -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 "<img class=\"align-middle\" style=\"padding: 3px;\" alt=\"\" src=\"../../graphics/$buttonImage\">&nbsp;";
echo "<img height=32 width=32 class=\"align-middle\" style=\"padding: 3px;\" alt=\"\" src=\"../../graphics/$buttonImage\">&nbsp;";
}
echo $this->module[$this->order[$i]]->get_alias();
echo "&nbsp;</button>\n";

View File

@ -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 "</div></div>";

View File

@ -101,18 +101,18 @@ foreach ($toSort as $key => $value) {
</td>
<td align="right" height=30>
<ul id="dropmenu" class="dropmenu">
<li><a href="<?php echo $headerPrefix; ?>logout.php" target="_top"><img alt="logout" src="<?php echo $headerPrefix; ?>../graphics/exit.png">&nbsp;<?php echo _("Logout") ?></a></li>
<li><a href="<?php echo $headerPrefix; ?>logout.php" target="_top"><img height="16" width="16" alt="logout" src="<?php echo $headerPrefix; ?>../graphics/exit.png">&nbsp;<?php echo _("Logout") ?></a></li>
<?php
if (is_dir(dirname(__FILE__) . '/../docs/manual')) {
?>
<li>
<a target="_blank" href="<?php echo $headerPrefix; ?>../docs/manual/index.html"><img alt="help" src="<?php echo $headerPrefix; ?>../graphics/help.png">&nbsp;<?php echo _("Help") ?>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
<a target="_blank" href="<?php echo $headerPrefix; ?>../docs/manual/index.html"><img width="16" height="16" alt="help" src="<?php echo $headerPrefix; ?>../graphics/help.png">&nbsp;<?php echo _("Help") ?>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
</li>
<?php
}
?>
<li>
<a href="<?php echo $headerPrefix; ?>tools.php"><img alt="tools" src="<?php echo $headerPrefix; ?>../graphics/tools.png">&nbsp;<?php echo _("Tools") ?></a>
<a href="<?php echo $headerPrefix; ?>tools.php"><img height="16" width="16" alt="tools" src="<?php echo $headerPrefix; ?>../graphics/tools.png">&nbsp;<?php echo _("Tools") ?></a>
<ul>
<?php
for ($i = 0; $i < sizeof($tools); $i++) {
@ -120,7 +120,7 @@ foreach ($toSort as $key => $value) {
echo '<li title="' . $tools[$i]->getDescription() . '">';
$link = $headerPrefix . $tools[$i]->getLink();
echo '<a href="' . $link . "\">\n";
echo '<img alt="" src="' . $headerPrefix . '../graphics/' . $tools[$i]->getImageLink() . '"> ' . $tools[$i]->getName();
echo '<img height="16" width="16" alt="" src="' . $headerPrefix . '../graphics/' . $tools[$i]->getImageLink() . '"> ' . $tools[$i]->getName();
echo "</a>\n";
if (sizeof($subTools) > 0) {
echo "<ul>\n";
@ -142,7 +142,7 @@ foreach ($toSort as $key => $value) {
if ($_SESSION['config']->get_Suffix('tree') != "") {
?>
<li>
<a href="<?php echo $headerPrefix; ?>tree/treeViewContainer.php"><img alt="tree" src="<?php echo $headerPrefix; ?>../graphics/process.png">&nbsp;<?php echo _("Tree view") ?></a>
<a href="<?php echo $headerPrefix; ?>tree/treeViewContainer.php"><img height="16" width="16" alt="tree" src="<?php echo $headerPrefix; ?>../graphics/process.png">&nbsp;<?php echo _("Tree view") ?></a>
</li>
<?php
}
@ -171,7 +171,7 @@ jQuery(document).ready(function() {
for ($i = 0; $i < sizeof($types); $i++) {
$link = '<a href="' . $headerPrefix . 'lists/list.php?type=' . $types[$i] .
'" onmouseover="jQuery(this).addClass(\'tabs-hover\');" onmouseout="jQuery(this).removeClass(\'tabs-hover\');">' .
'<img alt="' . $types[$i] . '" src="' . $headerPrefix . '../graphics/' . $types[$i] . '.png">&nbsp;' .
'<img height="16" width="16" alt="' . $types[$i] . '" src="' . $headerPrefix . '../graphics/' . $types[$i] . '.png">&nbsp;' .
getTypeAlias($types[$i]) . '</a>';
echo '<li id="tab_' . $types[$i] . '" class="ui-state-default ui-corner-top">';
echo $link;

View File

@ -295,7 +295,9 @@ function showMainPage($scope, $selectedModules) {
$dnRDNRowCells[] = $columnSpacer;
$dnRDNRowCells[] = new htmlHelpLink('301');
$dnRDNRowCells[] = $columnSpacer;
$dnRDNRowCells[] = new htmlOutputText(_("RDN identifier") . '*');
$rdnText = new htmlOutputText(_("RDN identifier"));
$rdnText->setMarkAsRequired(true);
$dnRDNRowCells[] = $rdnText;
$dnRDNRowCells[] = $columnSpacer;
$dnRDNRowCells[] = new htmlOutputText('dn_rdn');
$dnRDNRowCells[] = $columnSpacer;
@ -326,15 +328,17 @@ function showMainPage($scope, $selectedModules) {
$columnContainer->addElement($moduleTitle);
$odd = true;
for ($i = 0; $i < sizeof($columns[$modules[$m]]); $i++) {
$required = '';
$required = false;
if (isset($columns[$modules[$m]][$i]['required']) && ($columns[$modules[$m]][$i]['required'] == true)) {
$required = '*';
$required = true;
}
$rowCells = array();
$rowCells[] = $columnSpacer;
$rowCells[] = new htmlHelpLink($columns[$modules[$m]][$i]['help'], $modules[$m], $scope);
$rowCells[] = $columnSpacer;
$rowCells[] = new htmlOutputText($columns[$modules[$m]][$i]['description'] . $required);
$descriptionText = new htmlOutputText($columns[$modules[$m]][$i]['description'] . $required);
$descriptionText->setMarkAsRequired($required);
$rowCells[] = $descriptionText;
$rowCells[] = $columnSpacer;
$rowCells[] = new htmlOutputText($columns[$modules[$m]][$i]['name']);
$rowCells[] = $columnSpacer;