diff --git a/lam/docs/devel/upgrade.htm b/lam/docs/devel/upgrade.htm index 12757568..26ac307e 100644 --- a/lam/docs/devel/upgrade.htm +++ b/lam/docs/devel/upgrade.htm @@ -14,6 +14,7 @@ + Upgrade notes @@ -37,6 +38,12 @@ This is a list of API changes for all LAM releases.
  • function doUploadPostActions() contains attributes by reference
  • +List interface:
    +

    3.8 -> 3.9

    Module interface:
    diff --git a/lam/lib/lists.inc b/lam/lib/lists.inc index f9e4c084..89f1937b 100644 --- a/lam/lib/lists.inc +++ b/lam/lib/lists.inc @@ -669,10 +669,12 @@ class lamList { /** * Prints a combobox with possible sub-DNs. + * + * @return htmlGroup OU selection (may be empty) */ protected function listShowOUSelection() { + $group = new htmlGroup(); if (sizeof($this->possibleSuffixes) > 1) { - $group = new htmlGroup(); $suffixList = array(); for ($i = 0; $i < sizeof($this->possibleSuffixes); $i++) { $suffixList[getAbstractDN($this->possibleSuffixes[$i])] = $this->possibleSuffixes[$i]; @@ -684,64 +686,69 @@ class lamList { $suffixSelect->setHasDescriptiveElements(true); $group->addElement($suffixSelect); $group->addElement(new htmlSpacer('5px', null)); - parseHtml(null, $group, array(), true, $this->tabindex, $this->type); } + return $group; } /** * Prints the create and delete buttons. * * @param boolean $createOnly true if only the create button should be displayed + * @param int $tabindex HTML tabindex counter */ protected function listPrintButtons($createOnly) { - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
    \n"; + $table = new htmlTable('100%'); + $left = new htmlGroup(); + // button part + $left->alignment = htmlElement::ALIGN_LEFT; if (checkIfWriteAccessIsAllowed()) { // add/delete buttons - echo "\n"; + $newButton = new htmlButton('new', $this->labels['newEntry']); + $newButton->setIconClass('createButton'); + $left->addElement($newButton); if (!$createOnly) { - echo "\n"; + $left->addElement(new htmlSpacer('1px', null)); + $delButton = new htmlButton('del', $this->labels['deleteEntry']); + $delButton->setIconClass('deleteButton'); + $left->addElement($delButton); } $type = new $this->type(); $toolSettings = $_SESSION['config']->getToolSettings(); if ($type->supportsFileUpload() && !(isset($toolSettings['tool_hide_toolFileUpload']) && ($toolSettings['tool_hide_toolFileUpload'] == 'true'))) { - echo '      '; - echo "\n"; + $left->addElement(new htmlSpacer('20px', null)); + $uploadButton = new htmlButton('fileUpload', _('File upload')); + $uploadButton->setIconClass('upButton'); + $left->addElement($uploadButton); } - ?> -     - - \n"; - echo "\n"; - $this->listShowOUSelection(); - echo ""; - echo ' '; - echo '' . _('Change settings') . ''; - echo ''; - echo "
    \n"; + + // OU selection and settings + $right = new htmlGroup(); + $right->alignment = htmlElement::ALIGN_RIGHT; + $right->addElement($this->listShowOUSelection()); + $refreshButton = new htmlButton('refresh', 'refresh.png', true); + $refreshButton->setTitle(_("Refresh")); + $right->addElement($refreshButton); + $right->addElement(new htmlSpacer('1px', null)); + $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 } /** diff --git a/lam/lib/types/dhcp.inc b/lam/lib/types/dhcp.inc index 46a7a4bc..ceda9925 100644 --- a/lam/lib/types/dhcp.inc +++ b/lam/lib/types/dhcp.inc @@ -233,69 +233,21 @@ class lamDHCPList extends lamList { } } - /** - * Prints the create, delete and PDF buttons. - * - * @param boolean $createOnly true if only the create button should be displayed + * Add DCP main settings button. + * + * @param htmlGroup $left left part + * @param htmlGroup $right right part */ - function listPrintButtons($createOnly) { - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
    \n"; + protected function addExtraInputElementsToTopArea(&$left, &$right) { if (checkIfWriteAccessIsAllowed()) { - // add/delete buttons - echo ("\n"); - if (!$createOnly) { - echo ("\n"); - } - $toolSettings = $_SESSION['config']->getToolSettings(); - if (!(isset($toolSettings['tool_hide_toolFileUpload']) && ($toolSettings['tool_hide_toolFileUpload'] == 'true'))) { - echo '      '; - echo "\n"; - } - echo '      '; - echo ("\n"); - echo "   "; - ?> - - addElement(new htmlSpacer('20px', null)); + $dhcpButton = new htmlButton('dhcpDefaults', $this->labels['dhcpDefaults']); + $dhcpButton->setIconClass('settingsButton'); + $left->addElement($dhcpButton); } - echo "\n"; - $this->listShowOUSelection(); - echo ""; - echo ' '; - echo '' . _('Change settings') . ''; - echo ''; - echo "
    \n"; } - + /** * Manages all POST actions (e.g. button pressed) for the account lists. */