use more metaHTML

This commit is contained in:
Roland Gruber 2012-10-07 13:35:10 +00:00
parent 9e5f487b35
commit 4d02ce9607
3 changed files with 65 additions and 99 deletions

View File

@ -15,6 +15,7 @@
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-15"><title>Upgrade notes</title> <meta http-equiv="content-type" content="text/html; charset=ISO-8859-15"><title>Upgrade notes</title>
@ -37,6 +38,12 @@ This is a list of API changes for all LAM releases.
<li>function <span style="font-weight: bold;">doUploadPostActions() </span>contains attributes by reference<span style="font-weight: bold;"><br> <li>function <span style="font-weight: bold;">doUploadPostActions() </span>contains attributes by reference<span style="font-weight: bold;"><br>
</span></li> </span></li>
</ul> </ul>
List interface:<br>
<ul>
<li>new function: <span style="font-weight: bold;">addExtraInputElementsToTopArea()</span></li>
<li><span style="font-weight: bold;">listShowOUSelection()</span> now returns a <span style="font-style: italic;">htmlGroup</span><br>
</li>
</ul>
<br> <br>
<h2>3.8 -&gt; 3.9</h2> <h2>3.8 -&gt; 3.9</h2>
Module interface:<br> Module interface:<br>

View File

@ -669,10 +669,12 @@ class lamList {
/** /**
* Prints a combobox with possible sub-DNs. * Prints a combobox with possible sub-DNs.
*
* @return htmlGroup OU selection (may be empty)
*/ */
protected function listShowOUSelection() { protected function listShowOUSelection() {
$group = new htmlGroup();
if (sizeof($this->possibleSuffixes) > 1) { if (sizeof($this->possibleSuffixes) > 1) {
$group = new htmlGroup();
$suffixList = array(); $suffixList = array();
for ($i = 0; $i < sizeof($this->possibleSuffixes); $i++) { for ($i = 0; $i < sizeof($this->possibleSuffixes); $i++) {
$suffixList[getAbstractDN($this->possibleSuffixes[$i])] = $this->possibleSuffixes[$i]; $suffixList[getAbstractDN($this->possibleSuffixes[$i])] = $this->possibleSuffixes[$i];
@ -684,64 +686,69 @@ class lamList {
$suffixSelect->setHasDescriptiveElements(true); $suffixSelect->setHasDescriptiveElements(true);
$group->addElement($suffixSelect); $group->addElement($suffixSelect);
$group->addElement(new htmlSpacer('5px', null)); $group->addElement(new htmlSpacer('5px', null));
parseHtml(null, $group, array(), true, $this->tabindex, $this->type);
} }
return $group;
} }
/** /**
* Prints the create and delete buttons. * Prints the create and delete buttons.
* *
* @param boolean $createOnly true if only the create button should be displayed * @param boolean $createOnly true if only the create button should be displayed
* @param int $tabindex HTML tabindex counter
*/ */
protected function listPrintButtons($createOnly) { protected function listPrintButtons($createOnly) {
echo "<table border=0 width=\"100%\">\n"; $table = new htmlTable('100%');
echo "<tr>\n"; $left = new htmlGroup();
echo "<td align=\"left\">\n"; // button part
$left->alignment = htmlElement::ALIGN_LEFT;
if (checkIfWriteAccessIsAllowed()) { if (checkIfWriteAccessIsAllowed()) {
// add/delete buttons // add/delete buttons
echo "<button id=\"newButton\" name=\"new\">" . $this->labels['newEntry'] . "</button>\n"; $newButton = new htmlButton('new', $this->labels['newEntry']);
$newButton->setIconClass('createButton');
$left->addElement($newButton);
if (!$createOnly) { if (!$createOnly) {
echo "<button id=\"delButton\" name=\"del\">" . $this->labels['deleteEntry'] . "</button>\n"; $left->addElement(new htmlSpacer('1px', null));
$delButton = new htmlButton('del', $this->labels['deleteEntry']);
$delButton->setIconClass('deleteButton');
$left->addElement($delButton);
} }
$type = new $this->type(); $type = new $this->type();
$toolSettings = $_SESSION['config']->getToolSettings(); $toolSettings = $_SESSION['config']->getToolSettings();
if ($type->supportsFileUpload() && !(isset($toolSettings['tool_hide_toolFileUpload']) && ($toolSettings['tool_hide_toolFileUpload'] == 'true'))) { if ($type->supportsFileUpload() && !(isset($toolSettings['tool_hide_toolFileUpload']) && ($toolSettings['tool_hide_toolFileUpload'] == 'true'))) {
echo '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'; $left->addElement(new htmlSpacer('20px', null));
echo "<button id=\"fileUploadButton\" name=\"fileUpload\">" . _('File upload') . "</button>\n"; $uploadButton = new htmlButton('fileUpload', _('File upload'));
$uploadButton->setIconClass('upButton');
$left->addElement($uploadButton);
} }
?>
&nbsp;&nbsp;&nbsp;
<script type="text/javascript">
jQuery(document).ready(function() {
jQuery('#newButton').button({
icons: {
primary: 'createButton'
}
});
jQuery('#delButton').button({
icons: {
primary: 'deleteButton'
}
});
jQuery('#fileUploadButton').button({
icons: {
primary: 'upButton'
}
});
});
</script>
<?php
} }
echo "</td>\n";
echo "<td align=\"right\">\n"; // OU selection and settings
$this->listShowOUSelection(); $right = new htmlGroup();
echo "<input class=\"smallImageButton align-middle\" style=\"background-image: url(../../graphics/refresh.png);\" type=\"submit\" value=\" \" name=\"refresh\" title=\"" . _("Refresh") . "\">"; $right->alignment = htmlElement::ALIGN_RIGHT;
echo '&nbsp;<a class="align-middle" href="#" onclick="listShowSettingsDialog(\'' . _('Change list settings') . '\', \'' . _('Ok') . '\', \'' . _('Cancel') . '\');">'; $right->addElement($this->listShowOUSelection());
echo '<img height=16 width=16 src="../../graphics/tools.png" alt="' . _('Change settings') . '" title="' . _('Change settings') . '">'; $refreshButton = new htmlButton('refresh', 'refresh.png', true);
echo '</a>'; $refreshButton->setTitle(_("Refresh"));
echo "</td>\n"; $right->addElement($refreshButton);
echo "</tr>\n"; $right->addElement(new htmlSpacer('1px', null));
echo "</table>\n"; $settingsLink = new htmlLink('', '#', '../../graphics/tools.png');
$settingsLink->setOnClick('listShowSettingsDialog(\'' . _('Change list settings') . '\', \'' . _('Ok') . '\', \'' . _('Cancel') . '\');');
$settingsLink->setTitle(_('Change settings'));
$right->addElement($settingsLink);
$this->addExtraInputElementsToTopArea($left, $right);
$table->addElement($left);
$table->addElement($right);
parseHtml(null, $table, array(), false, $this->tabindex, $this->type);
}
/**
* Can be used by subclasses to add e.g. additional buttons to the top area.
*
* @param htmlGroup $left left part
* @param htmlGroup $right right part
*/
protected function addExtraInputElementsToTopArea(&$left, &$right) {
// only used by subclasses
} }
/** /**

View File

@ -233,67 +233,19 @@ class lamDHCPList extends lamList {
} }
} }
/** /**
* Prints the create, delete and PDF buttons. * Add DCP main settings button.
* *
* @param boolean $createOnly true if only the create button should be displayed * @param htmlGroup $left left part
* @param htmlGroup $right right part
*/ */
function listPrintButtons($createOnly) { protected function addExtraInputElementsToTopArea(&$left, &$right) {
echo "<table border=0 width=\"100%\">\n";
echo "<tr>\n";
echo "<td align=\"left\">\n";
if (checkIfWriteAccessIsAllowed()) { if (checkIfWriteAccessIsAllowed()) {
// add/delete buttons $left->addElement(new htmlSpacer('20px', null));
echo ("<button id=\"newButton\" name=\"new\">" . $this->labels['newEntry'] . "</button>\n"); $dhcpButton = new htmlButton('dhcpDefaults', $this->labels['dhcpDefaults']);
if (!$createOnly) { $dhcpButton->setIconClass('settingsButton');
echo ("<button id=\"delButton\" name=\"del\">" . $this->labels['deleteEntry'] . "</button>\n"); $left->addElement($dhcpButton);
}
$toolSettings = $_SESSION['config']->getToolSettings();
if (!(isset($toolSettings['tool_hide_toolFileUpload']) && ($toolSettings['tool_hide_toolFileUpload'] == 'true'))) {
echo '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
echo "<button id=\"fileUploadButton\" name=\"fileUpload\">" . _('File upload') . "</button>\n";
}
echo '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
echo ("<button id=\"dhcpDefaultsButton\" name=\"dhcpDefaults\">" . $this->labels['dhcpDefaults'] . "</button>\n");
echo "&nbsp;&nbsp;&nbsp;";
?>
<script type="text/javascript">
jQuery(document).ready(function() {
jQuery('#newButton').button({
icons: {
primary: 'createButton'
}
});
jQuery('#delButton').button({
icons: {
primary: 'deleteButton'
}
});
jQuery('#fileUploadButton').button({
icons: {
primary: 'upButton'
}
});
jQuery('#dhcpDefaultsButton').button({
icons: {
primary: 'settingsButton'
}
});
});
</script>
<?php
} }
echo "</td>\n";
echo "<td align=\"right\">\n";
$this->listShowOUSelection();
echo "<input class=\"smallImageButton\" style=\"background-image: url(../../graphics/refresh.png);\" type=\"submit\" value=\" \" name=\"refresh\" title=\"" . _("Refresh") . "\">";
echo '&nbsp;<a href="#" onclick="listShowSettingsDialog(\'' . _('Change list settings') . '\', \'' . _('Ok') . '\', \'' . _('Cancel') . '\');">';
echo '<img height=16 width=16 src="../../graphics/tools.png" alt="' . _('Change settings') . '" title="' . _('Change settings') . '">';
echo '</a>';
echo "</td>\n";
echo "</tr>\n";
echo "</table>\n";
} }
/** /**