diff --git a/lam/templates/config/confmain.php b/lam/templates/config/confmain.php index b343f1a8..f4323f47 100644 --- a/lam/templates/config/confmain.php +++ b/lam/templates/config/confmain.php @@ -3,7 +3,7 @@ $Id$ This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/) - Copyright (C) 2003 - 2010 Roland Gruber + Copyright (C) 2003 - 2011 Roland Gruber This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -171,12 +171,15 @@ if (sizeof($errorsToDisplay) > 0) { // display formular echo ("
\n"); -echo '
'; -echo ""; -echo " "; -echo ""; -echo "

\n"; -echo '
'; +$buttonContainer = new htmlTable(); +$saveButton = new htmlButton('saveSettings', _('Save')); +$saveButton->setIconClass('saveButton'); +$buttonContainer->addElement($saveButton); +$cancelButton = new htmlButton('cancelSettings', _('Cancel')); +$cancelButton->setIconClass('cancelButton'); +$buttonContainer->addElement($cancelButton, true); +$buttonContainer->addElement(new htmlSpacer(null, '10px')); +parseHtml(null, $buttonContainer, array(), false, $tabindex, 'user'); // hidden submit buttons which are clicked by tabs echo "
\n"; @@ -215,255 +218,106 @@ jQuery(document).ready(function() { jQuery('#generalSettingsButton').addClass('ui-tabs-selected'); jQuery('#generalSettingsButton').addClass('ui-state-active'); jQuery('#generalSettingsButton').addClass('userlist-bright'); - jQuery('#saveButton').button({ - icons: { - primary: 'saveButton' - } - }); - jQuery('#cancelButton').button({ - icons: { - primary: 'cancelButton' - } - }); });
\"profiles.png\" " . _("Server settings") . "
\n"); -echo (""); -// serverURL -echo ("". - "\n"); -echo "\n"; -$tabindex++; +$container = new htmlTable(); + +$serverSettingsContent = new htmlTable(); +// server URL +$urlInput = new htmlTableExtendedInputField(_("Server address"), 'serverurl', $conf->get_ServerURL(), '201'); +$urlInput->setRequired(true); +$serverSettingsContent->addElement($urlInput, true); // use TLS -echo "\n"; -echo "\n"; -echo "\n"; -$tabindex++; - -// new line -echo (""); - +$tlsOptions = array(_("yes") => 'yes', _("no") => 'no'); +$tlsSelect = new htmlTableExtendedSelect('useTLS', $tlsOptions, array($conf->getUseTLS()), _("Activate TLS"), '201'); +$tlsSelect->setHasDescriptiveElements(true); +$serverSettingsContent->addElement($tlsSelect, true); // tree suffix -echo ("". - "\n"); -echo "\n"; -$tabindex++; - -// new line -echo (""); - -// LDAP cache timeout -/*echo ("". - "\n"); -$tabindex++; -echo "\n";*/ - +$serverSettingsContent->addElement(new htmlTableExtendedInputField(_("Tree suffix"), 'sufftree', $conf->get_Suffix('tree'), '203'), true); // LDAP search limit $searchLimitOptions = array( -array(0, '-'), array(100, 100), array(500, 500), -array(1000, 1000), array(5000, 5000), array(10000, 10000), -array(50000, 50000), array(100000, 100000) -); -echo ("". - "\n"); -$tabindex++; -echo "\n"; - +'-' => 0, 100 => 100, 500 => 500, +1000 => 1000, 5000 => 5000, 10000 => 10000, +50000 => 50000, 100000 => 100000); +$limitSelect = new htmlTableExtendedSelect('searchLimit', $searchLimitOptions, array($conf->get_searchLimit()), _("LDAP search limit"), '222'); +$limitSelect->setHasDescriptiveElements(true); +$serverSettingsContent->addElement($limitSelect, true); // access level is only visible in Pro version if (isLAMProVersion()) { - // new line - echo (""); - - // access level - echo ("". - "\n"); - $tabindex++; - echo "\n"; + $accessOptions = array( + _('Write access') => LAMConfig::ACCESS_ALL, + _('Change passwords') => LAMConfig::ACCESS_PASSWORD_CHANGE, + _('Read only') => LAMConfig::ACCESS_READ_ONLY + ); + $accessSelect = new htmlTableExtendedSelect('accessLevel', $accessOptions, array($conf->getAccessLevel()), _("Access level"), '215'); + $accessSelect->setHasDescriptiveElements(true); + $serverSettingsContent->addElement($accessSelect, true); } - -echo ("
" . _("Server address") . " * ". - "get_ServerURL() . "\">". - ""; -printHelpLink(getHelp('', '201'), '201'); -echo "
" . _("Activate TLS") . " \n"; -echo "\n"; -echo ""; -printHelpLink(getHelp('', '201'), '201'); -echo "
 
". - _("Tree suffix") . " get_Suffix('tree') . "\">"; -printHelpLink(getHelp('', '203'), '203'); -echo "
 
". - _("Cache timeout") . " "; -printHelpLink(getHelp('', '214'), '214'); -echo "
". - _("LDAP search limit") . " "; -printHelpLink(getHelp('', '222'), '222'); -echo "
 
". - _("Access level") . " "; - printHelpLink(getHelp('', '215'), '215'); - echo "
"); -echo (""); - -echo ("
"); - -echo ("
\"language.png\" " . _("Language settings") . "
\n"); -echo ("\n"); +$serverSettings = new htmlFieldset($serverSettingsContent, _("Server settings"), '../../graphics/profiles.png'); +$container->addElement($serverSettings, true); +$container->addElement(new htmlSpacer(null, '10px'), true); // language -echo (""); -echo ("\n"); -echo "\n"; - -echo ("
" . _("Default language") . "\n"); +$languageSettingsContent = new htmlTable(); // read available languages $languagefile = "../../config/language"; -if(is_file($languagefile)) -{ +if(is_file($languagefile)) { $file = fopen($languagefile, "r"); - $i = 0; - while(!feof($file)) - { + while(!feof($file)) { $line = fgets($file, 1024); if($line == "\n" || $line[0] == "#" || $line == "") continue; // ignore comment and empty lines - $languages[$i] = chop($line); - $i++; + $line = chop($line); + $entry = explode(":", $line); + $languages[$entry[2]] = $line; } fclose($file); -// generate language list -echo ("\n"); -$tabindex++; +else { + $languageSettingsContent->addElement(new htmlStatusMessage('ERROR', "Unable to load available languages. Setting English as default language.")); } -else -{ - echo _("Unable to load available languages. Setting English as default language. For further instructions please contact the Admin of this site."); -} -echo (""; -printHelpLink(getHelp('', '209'), '209'); -echo "
\n"); -echo ("
\n"); - -echo ("
\n"); +$languageSettings = new htmlFieldset($languageSettingsContent, _("Language settings"), '../../graphics/language.png'); +$container->addElement($languageSettings, true); +$container->addElement(new htmlSpacer(null, '10px'), true); // lamdaemon settings -echo ("
\"lamdaemon.png\" " . _("Lamdaemon settings") . "
\n"); -echo ("\n"); - -echo ("". - "\n"); -$tabindex++; -echo "\n"; -echo ("". - "\n"); -$tabindex++; -echo "\n"; -echo "\n"; -$owr = ""; -$oww = ""; -$owe = ""; -$grr = ""; -$grw = ""; -$gre = ""; -$otr = ""; -$otw = ""; -$ote = ""; +$lamdaemonSettingsContent = new htmlTable(); +$lamdaemonSettingsContent->addElement(new htmlTableExtendedInputField(_("Server list"), 'scriptservers', $conf->get_scriptServers(), '218'), true); +$lamdaemonSettingsContent->addElement(new htmlTableExtendedInputField(_("Path to external script"), 'scriptpath', $conf->get_scriptPath(), '210'), true); +$lamdaemonSettingsContent->addElement(new htmlSpacer(null, '5px'), true); +$lamdaemonSettingsContent->addElement(new htmlOutputText(_("Rights for the home directory"))); $chmod = $conf->get_scriptRights(); -if (checkChmod("read","owner", $chmod)) $owr = 'checked'; -if (checkChmod("write","owner", $chmod)) $oww = 'checked'; -if (checkChmod("execute","owner", $chmod)) $owe = 'checked'; -if (checkChmod("read","group", $chmod)) $grr = 'checked'; -if (checkChmod("write","group", $chmod)) $grw = 'checked'; -if (checkChmod("execute","group", $chmod)) $gre = 'checked'; -if (checkChmod("read","other", $chmod)) $otr = 'checked'; -if (checkChmod("write","other", $chmod)) $otw = 'checked'; -if (checkChmod("execute","other", $chmod)) $ote = 'checked'; +$rightsTable = new htmlTable(); +$rightsTable->addElement(new htmlOutputText('')); +$rightsTable->addElement(new htmlOutputText(_("Read"))); +$rightsTable->addElement(new htmlOutputText(_("Write"))); +$rightsTable->addElement(new htmlOutputText(_("Execute")), true); +$rightsTable->addElement(new htmlOutputText(_("Owner"))); +$rightsTable->addElement(new htmlInputCheckbox('chmod_owr', checkChmod("read","owner", $chmod))); +$rightsTable->addElement(new htmlInputCheckbox('chmod_oww', checkChmod("write","owner", $chmod))); +$rightsTable->addElement(new htmlInputCheckbox('chmod_owe', checkChmod("execute","owner", $chmod)), true); +$rightsTable->addElement(new htmlOutputText(_("Group"))); +$rightsTable->addElement(new htmlInputCheckbox('chmod_grr', checkChmod("read","group", $chmod))); +$rightsTable->addElement(new htmlInputCheckbox('chmod_grw', checkChmod("write","group", $chmod))); +$rightsTable->addElement(new htmlInputCheckbox('chmod_gre', checkChmod("execute","group", $chmod)), true); +$rightsTable->addElement(new htmlOutputText(_("Other"))); +$rightsTable->addElement(new htmlInputCheckbox('chmod_otr', checkChmod("read","other", $chmod))); +$rightsTable->addElement(new htmlInputCheckbox('chmod_otw', checkChmod("write","other", $chmod))); +$rightsTable->addElement(new htmlInputCheckbox('chmod_ote', checkChmod("execute","other", $chmod)), true); +$lamdaemonSettingsContent->addElement($rightsTable); +$lamdaemonSettingsContent->addElement(new htmlHelpLink('219')); +$lamdaemonSettings = new htmlFieldset($lamdaemonSettingsContent, _("Lamdaemon settings"), '../../graphics/lamdaemon.png'); +$container->addElement($lamdaemonSettings, true); +$container->addElement(new htmlSpacer(null, '10px'), true); -echo "\n"; -echo ("
". - _("Server list") . " get_scriptServers(false) . "\">"; -printHelpLink(getHelp('', '218'), '218'); -echo "
". - _("Path to external script") . " get_scriptPath() . "\">"; -printHelpLink(getHelp('', '210'), '210'); -echo "
". _("Rights for the home directory") . " \n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
" . _("Read") . "" . _("Write") . ""._("Execute")."
"._("Owner")."
"._("Group")."
"._("Other")."
"; - $tabindex++; -echo "
"; -printHelpLink(getHelp('', '219'), '219'); -echo "
\n"); -echo ("
\n"); - -echo ("
\n"); +parseHtml(null, $container, array(), false, $tabindex, 'user'); // LAM Pro settings if (isLAMProVersion()) { diff --git a/lam/templates/config/confmodules.php b/lam/templates/config/confmodules.php index de9d341b..647f2796 100644 --- a/lam/templates/config/confmodules.php +++ b/lam/templates/config/confmodules.php @@ -3,7 +3,7 @@ $Id$ This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/) - Copyright (C) 2004 - 2010 Roland Gruber + Copyright (C) 2004 - 2011 Roland Gruber This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -138,12 +138,15 @@ for ($i = 0; $i < sizeof($errorsToDisplay); $i++) call_user_func_array('StatusMe echo ("\n"); -echo '
'; -echo ""; -echo " "; -echo ""; -echo "

\n"; -echo '
'; +$buttonContainer = new htmlTable(); +$saveButton = new htmlButton('saveSettings', _('Save')); +$saveButton->setIconClass('saveButton'); +$buttonContainer->addElement($saveButton); +$cancelButton = new htmlButton('cancelSettings', _('Cancel')); +$cancelButton->setIconClass('cancelButton'); +$buttonContainer->addElement($cancelButton, true); +$buttonContainer->addElement(new htmlSpacer(null, '10px')); +parseHtml(null, $buttonContainer, array(), false, $tabindex, 'user'); // hidden submit buttons which are clicked by tabs echo "
\n"; @@ -182,16 +185,6 @@ jQuery(document).ready(function() { jQuery('#editmodules').addClass('ui-tabs-selected'); jQuery('#editmodules').addClass('ui-state-active'); jQuery('#editmodules').addClass('userlist-bright'); - jQuery('#saveButton').button({ - icons: { - primary: 'saveButton' - } - }); - jQuery('#cancelButton').button({ - icons: { - primary: 'cancelButton' - } - }); // set common width for select boxes var maxWidth = 0; jQuery("select").each(function(){ @@ -215,19 +208,17 @@ $container = new htmlTable(); for ($i = 0; $i < sizeof($account_list); $i++) { config_showAccountModules($account_list[$i][0], $account_list[$i][1], $container); } + +$legendContainer = new htmlTable(); +$legendContainer->addElement(new htmlSpacer(null, '10px'), true); +$legendContainer->addElement(new htmlOutputText("(*) " . _("Base module"))); +$legendContainer->addElement(new htmlHelpLink('237')); +$container->addElement($legendContainer); +$container->addElement(new htmlHiddenInput('postAvailable', 'yes')); + $tabindex = 1; parseHtml(null, $container, array(), false, $tabindex, 'user'); - -echo "

\n"; -echo "(*) " . _("Base module"); -// help link -echo " "; -printHelpLink(getHelp('', '237'), '237'); -echo "

\n"; - -echo "\n"; - echo ("
\n"); echo "\n"; echo "\n"; diff --git a/lam/templates/config/conftypes.php b/lam/templates/config/conftypes.php index 43bb1836..03a8a204 100644 --- a/lam/templates/config/conftypes.php +++ b/lam/templates/config/conftypes.php @@ -3,7 +3,7 @@ $Id$ This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/) - Copyright (C) 2004 - 2010 Roland Gruber + Copyright (C) 2004 - 2011 Roland Gruber This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -156,12 +156,15 @@ for ($i = 0; $i < sizeof($errorsToDisplay); $i++) call_user_func_array('StatusMe echo ("
\n"); -echo '
'; -echo ""; -echo " "; -echo ""; -echo "

\n"; -echo '
'; +$buttonContainer = new htmlTable(); +$saveButton = new htmlButton('saveSettings', _('Save')); +$saveButton->setIconClass('saveButton'); +$buttonContainer->addElement($saveButton); +$cancelButton = new htmlButton('cancelSettings', _('Cancel')); +$cancelButton->setIconClass('cancelButton'); +$buttonContainer->addElement($cancelButton, true); +$buttonContainer->addElement(new htmlSpacer(null, '10px')); +parseHtml(null, $buttonContainer, array(), false, $tabindex, 'user'); // hidden submit buttons which are clicked by tabs echo "
\n"; @@ -200,16 +203,6 @@ jQuery(document).ready(function() { jQuery('#edittypes').addClass('ui-tabs-selected'); jQuery('#edittypes').addClass('ui-state-active'); jQuery('#edittypes').addClass('userlist-bright'); - jQuery('#saveButton').button({ - icons: { - primary: 'saveButton' - } - }); - jQuery('#cancelButton').button({ - icons: { - primary: 'cancelButton' - } - }); }); diff --git a/lam/templates/config/moduleSettings.php b/lam/templates/config/moduleSettings.php index 5cedcb74..8891ede0 100644 --- a/lam/templates/config/moduleSettings.php +++ b/lam/templates/config/moduleSettings.php @@ -3,7 +3,7 @@ $Id$ This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/) - Copyright (C) 2009 - 2010 Roland Gruber + Copyright (C) 2009 - 2011 Roland Gruber This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -137,12 +137,15 @@ for ($i = 0; $i < sizeof($errorsToDisplay); $i++) call_user_func_array('StatusMe echo ("\n"); -echo '
'; -echo ""; -echo " "; -echo ""; -echo "

\n"; -echo '
'; +$buttonContainer = new htmlTable(); +$saveButton = new htmlButton('saveSettings', _('Save')); +$saveButton->setIconClass('saveButton'); +$buttonContainer->addElement($saveButton); +$cancelButton = new htmlButton('cancelSettings', _('Cancel')); +$cancelButton->setIconClass('cancelButton'); +$buttonContainer->addElement($cancelButton, true); +$buttonContainer->addElement(new htmlSpacer(null, '10px')); +parseHtml(null, $buttonContainer, array(), false, $tabindex, 'user'); // hidden submit buttons which are clicked by tabs echo "
\n"; @@ -181,16 +184,6 @@ jQuery(document).ready(function() { jQuery('#moduleSettings').addClass('ui-tabs-selected'); jQuery('#moduleSettings').addClass('ui-state-active'); jQuery('#moduleSettings').addClass('userlist-bright'); - jQuery('#saveButton').button({ - icons: { - primary: 'saveButton' - } - }); - jQuery('#cancelButton').button({ - icons: { - primary: 'cancelButton' - } - }); });