diff --git a/lam/lib/configPages.inc b/lam/lib/configPages.inc new file mode 100644 index 00000000..423cab7b --- /dev/null +++ b/lam/lib/configPages.inc @@ -0,0 +1,147 @@ + + + + + + +
+ + + getName(); ?> +    +
+
+ array( + 'id' => 'generalSettingsButton', + 'icon' => 'tools.png', + 'label' => _('General settings') + ), + ConfigurationPageTab::TYPES => array( + 'id' => 'edittypes', + 'icon' => 'gear.png', + 'label' => _('Account types') + ), + ConfigurationPageTab::MODULES => array( + 'id' => 'editmodules', + 'icon' => 'modules.png', + 'label' => _('Modules') + ), + ConfigurationPageTab::MODULE_SETTINGS => array( + 'id' => 'moduleSettings', + 'icon' => 'moduleSettings.png', + 'label' => _('Module settings') + ), + ); + if (isLAMProVersion()) { + $tabs[ConfigurationPageTab::JOBS] = array( + 'id' => 'jobs', + 'icon' => 'clock.png', + 'label' => _('Jobs') + ); + } + // hidden submit buttons which are clicked by tabs + ?> +
+ + + + + +
+ +
+ + +
+ diff --git a/lam/lib/html.inc b/lam/lib/html.inc index c2605817..bd32d666 100644 --- a/lam/lib/html.inc +++ b/lam/lib/html.inc @@ -1759,6 +1759,7 @@ class htmlOutputText extends htmlElement { * @return array List of input field names and their type (name => type) */ function generateHTML($module, $input, $values, $restricted, &$tabindex, $scope) { + $cssClasses = empty($this->cssClasses) ? '' : 'class="' . implode(' ', $this->cssClasses) . '"'; if ($this->noWrap) { echo "
"; } @@ -1766,7 +1767,7 @@ class htmlOutputText extends htmlElement { echo ""; } if ($this->isPreformatted) { - echo "
";
+			echo "
";
 		}
 		if ($this->escapeHTML) {
 			echo htmlspecialchars($this->string);
diff --git a/lam/style/500_layout.css b/lam/style/500_layout.css
index 47af0d89..a9231d2b 100644
--- a/lam/style/500_layout.css
+++ b/lam/style/500_layout.css
@@ -146,6 +146,10 @@ input {
 	margin-right: 5px;
 }
 
+.noMarginTop {
+	margin-top: 0px;
+}
+
 .padding05 {
 	padding: 0.5em;
 }
diff --git a/lam/templates/config/confmain.php b/lam/templates/config/confmain.php
index bf2ff023..0898bf95 100644
--- a/lam/templates/config/confmain.php
+++ b/lam/templates/config/confmain.php
@@ -57,6 +57,8 @@ include_once("../../lib/modules.inc");
 include_once("../../lib/tools.inc");
 /** 2-factor */
 include_once '../../lib/2factor.inc';
+/** common functions */
+include_once '../../lib/configPages.inc';
 
 // start session
 if (strtolower(session_module_name()) == 'files') {
@@ -183,20 +185,7 @@ sort($jsFiles);
 foreach ($jsFiles as $jsEntry) {
 	echo "\n";
 }
-?>
-		
-			
-				
-				
-			
-		
- - - getName(); ?> -    -
-
-isWritable()) { StatusMessage('WARN', _('The config file is not writable.'), _('Your changes cannot be saved until you make the file writable for the webserver user.')); @@ -214,54 +203,9 @@ if (sizeof($errorsToDisplay) > 0) { // display formular echo ("
\n"); -// hidden submit buttons which are clicked by tabs -echo "
\n"; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; -echo "
\n"; - -// tabs -echo '
'; - -echo ''; +printConfigurationPageTabs(ConfigurationPageTab::GENERAL); ?> - - - -
diff --git a/lam/templates/config/confmodules.php b/lam/templates/config/confmodules.php index 46e42823..2b24c162 100644 --- a/lam/templates/config/confmodules.php +++ b/lam/templates/config/confmodules.php @@ -46,6 +46,8 @@ use \htmlGroup; include_once('../../lib/config.inc'); /** Access to module lists */ include_once('../../lib/modules.inc'); +/** common functions */ +include_once '../../lib/configPages.inc'; // start session if (strtolower(session_module_name()) == 'files') { @@ -112,83 +114,14 @@ printHeaderContents(_("LDAP Account Manager Configuration"), '../..'); echo "\n"; // include all JavaScript files printJsIncludes('../..'); - -?> - - - - - -
- - - ' . _('Server profile') . ': ' . $conf->getName(); ?> -    -
-
-\n"); -// hidden submit buttons which are clicked by tabs -echo "
\n"; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; -echo "
\n"; - -// tabs -echo '
'; - -echo ''; - -?> - - - -
-getConfiguredTypes(); diff --git a/lam/templates/config/conftypes.php b/lam/templates/config/conftypes.php index 9bb17018..fde35da2 100644 --- a/lam/templates/config/conftypes.php +++ b/lam/templates/config/conftypes.php @@ -12,8 +12,6 @@ use \htmlTableExtendedInputField; use \LAMConfig; use \htmlTableExtendedInputCheckbox; /* -$Id$ - This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/) Copyright (C) 2004 - 2017 Roland Gruber @@ -43,9 +41,11 @@ $Id$ /** Access to config functions */ -include_once('../../lib/config.inc'); +include_once '../../lib/config.inc'; /** Access to account types */ -include_once('../../lib/types.inc'); +include_once '../../lib/types.inc'; +/** common functions */ +include_once '../../lib/configPages.inc'; // start session if (strtolower(session_module_name()) == 'files') { @@ -135,110 +135,18 @@ foreach ($allScopes as $scope) { usort($availableScopes, '\LAM\CONFIG\compareTypesByAlias'); echo $_SESSION['header']; - -echo "" . _("LDAP Account Manager Configuration") . "\n"; - -// include all CSS files -$cssDirName = dirname(__FILE__) . '/../../style'; -$cssDir = dir($cssDirName); -$cssFiles = array(); -$cssEntry = $cssDir->read(); -while ($cssEntry !== false) { - if (substr($cssEntry, strlen($cssEntry) - 4, 4) == '.css') { - $cssFiles[] = $cssEntry; - } - $cssEntry = $cssDir->read(); -} -sort($cssFiles); -foreach ($cssFiles as $cssEntry) { - echo "\n"; -} - -echo "\n"; -echo "\n"; -echo "\n"; +printHeaderContents(_("LDAP Account Manager Configuration"), '../..'); +echo "\n"; // include all JavaScript files -$jsDirName = dirname(__FILE__) . '/../lib'; -$jsDir = dir($jsDirName); -$jsFiles = array(); -while ($jsEntry = $jsDir->read()) { - if (substr($jsEntry, strlen($jsEntry) - 3, 3) != '.js') continue; - $jsFiles[] = $jsEntry; -} -sort($jsFiles); -foreach ($jsFiles as $jsEntry) { - echo "\n"; -} - -?> - - - - - -
- - - getName(); ?> -    -
-
-\n"); -// hidden submit buttons which are clicked by tabs -echo "
\n"; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; -echo "
\n"; - -// tabs -echo '
'; - -echo ''; - -?> - - - -
-\n"; } - -?> - - - - - -
- - - getName(); ?> -    -
-
-\n"); -// hidden submit buttons which are clicked by tabs -echo "
\n"; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; -echo "
\n"; - -// tabs -echo '
'; - -echo ''; +printConfigurationPageTabs(ConfigurationPageTab::MODULE_SETTINGS); ?> - - - -
diff --git a/lam/templates/lib/500_lam.js b/lam/templates/lib/500_lam.js index 52b94bf4..197124d2 100644 --- a/lam/templates/lib/500_lam.js +++ b/lam/templates/lib/500_lam.js @@ -859,9 +859,17 @@ window.lam.tools.addSavedSelectListener = function() { } }; +/** + * Activates tabs. + */ +window.lam.tools.activateTab = function() { + jQuery('.lam-active-tab').addClass('ui-tabs-active ui-state-active user-bright'); +}; + jQuery(document).ready(function() { window.lam.gui.equalHeight(); window.lam.form.autoTrim(); window.lam.account.addDefaultProfileListener(); window.lam.tools.addSavedSelectListener(); + window.lam.tools.activateTab(); });