common functions for config pages

This commit is contained in:
Roland Gruber 2017-11-11 16:39:53 +01:00
parent 83074b5fb4
commit 213c973dd9
8 changed files with 182 additions and 294 deletions

147
lam/lib/configPages.inc Normal file
View File

@ -0,0 +1,147 @@
<?php
namespace LAM\CONFIG;
/*
This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/)
Copyright (C) 2017 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
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/**
* Common functions for configuration pages.
*
* @package configuration
* @author Roland Gruber
*/
/**
* List of tabs.
*
* @author Roland Gruber
*/
class ConfigurationPageTab {
/** general settings */
const GENERAL = 'general';
/** account types */
const TYPES = 'types';
/** account modules */
const MODULES = 'modules';
/** module settings */
const MODULE_SETTINGS = 'moduleSettings';
/** jobs */
const JOBS = 'jobs';
/** job history */
const JOB_HISTORY = 'jobHistory';
}
/**
* Prints the header bar.
*
* @param \LAMConfig $conf configuration object
*/
function printConfigurationPageHeaderBar($conf) {
?>
<table border=0 width="100%" class="lamHeader ui-corner-all">
<tr>
<td align="left" height="30">
<a class="lamLogo" href="http://www.ldap-account-manager.org/" target="new_window">LDAP Account Manager</a>
</td>
<td align="right">
<?php echo _('Server profile') . ': ' . $conf->getName(); ?>
&nbsp;&nbsp;
</td>
</tr>
</table>
<br>
<?php
}
/**
* Prints the tab list.
*
* @param ConfigurationPageTab $active active tab
*/
function printConfigurationPageTabs($active) {
$tabs = array(
ConfigurationPageTab::GENERAL => 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
?>
<div style="display: none;">
<input name="generalSettingsButton" type="submit" value=" ">
<input name="edittypes" type="submit" value=" ">
<input name="editmodules" type="submit" value=" ">
<input name="moduleSettings" type="submit" value=" ">
<input name="jobs" type="submit" value=" ">
</div>
<?php
// tabs
?>
<div class="ui-tabs ui-widget ui-widget-content ui-corner-all">
<ul class="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all">
<?php
foreach ($tabs as $tab => $settings) {
$isActive = ($tab === $active);
$liClasses = 'ui-state-default ui-corner-top';
$hover = ' onmouseover="jQuery(this).addClass(\'tabs-hover\');" onmouseout="jQuery(this).removeClass(\'tabs-hover\');"';
if ($isActive) {
$liClasses .= ' lam-active-tab';
$hover = '';
}
echo '<li id="' . $settings['id'] . '" class="' . $liClasses . '"' . $hover . '>';
echo '<a href="#" onclick="document.getElementsByName(\'' . $settings['id'] . '\')[0].click();"><img src="../../graphics/' . $settings['icon'] . '" alt=""> ';
echo '<span class="hide-on-mobile">' . $settings['label'] . '</span>';
echo '</a>';
echo '</li>';
}
?>
</ul>
<div class="ui-tabs-panel ui-widget-content ui-corner-bottom user-bright">
<?php
}
?>

View File

@ -1759,6 +1759,7 @@ class htmlOutputText extends htmlElement {
* @return array List of input field names and their type (name => type) * @return array List of input field names and their type (name => type)
*/ */
function generateHTML($module, $input, $values, $restricted, &$tabindex, $scope) { function generateHTML($module, $input, $values, $restricted, &$tabindex, $scope) {
$cssClasses = empty($this->cssClasses) ? '' : 'class="' . implode(' ', $this->cssClasses) . '"';
if ($this->noWrap) { if ($this->noWrap) {
echo "<div class=\"nowrap\">"; echo "<div class=\"nowrap\">";
} }
@ -1766,7 +1767,7 @@ class htmlOutputText extends htmlElement {
echo "<b>"; echo "<b>";
} }
if ($this->isPreformatted) { if ($this->isPreformatted) {
echo "<pre>"; echo "<pre $cssClasses>";
} }
if ($this->escapeHTML) { if ($this->escapeHTML) {
echo htmlspecialchars($this->string); echo htmlspecialchars($this->string);

View File

@ -146,6 +146,10 @@ input {
margin-right: 5px; margin-right: 5px;
} }
.noMarginTop {
margin-top: 0px;
}
.padding05 { .padding05 {
padding: 0.5em; padding: 0.5em;
} }

View File

@ -57,6 +57,8 @@ include_once("../../lib/modules.inc");
include_once("../../lib/tools.inc"); include_once("../../lib/tools.inc");
/** 2-factor */ /** 2-factor */
include_once '../../lib/2factor.inc'; include_once '../../lib/2factor.inc';
/** common functions */
include_once '../../lib/configPages.inc';
// start session // start session
if (strtolower(session_module_name()) == 'files') { if (strtolower(session_module_name()) == 'files') {
@ -183,20 +185,7 @@ sort($jsFiles);
foreach ($jsFiles as $jsEntry) { foreach ($jsFiles as $jsEntry) {
echo "<script type=\"text/javascript\" src=\"../lib/" . $jsEntry . "\"></script>\n"; echo "<script type=\"text/javascript\" src=\"../lib/" . $jsEntry . "\"></script>\n";
} }
?> printConfigurationPageHeaderBar($conf);
<table border=0 width="100%" class="lamHeader ui-corner-all">
<tr>
<td align="left" height="30">
<a class="lamLogo" href="http://www.ldap-account-manager.org/" target="new_window">LDAP Account Manager</a>
</td>
<td align="right">
<?php echo _('Server profile') . ': ' . $conf->getName(); ?>
&nbsp;&nbsp;
</td>
</tr>
</table>
<br>
<?php
if (!$conf->isWritable()) { if (!$conf->isWritable()) {
StatusMessage('WARN', _('The config file is not writable.'), _('Your changes cannot be saved until you make the file writable for the webserver user.')); 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 // display formular
echo ("<form enctype=\"multipart/form-data\" action=\"confmain.php\" method=\"post\" autocomplete=\"off\">\n"); echo ("<form enctype=\"multipart/form-data\" action=\"confmain.php\" method=\"post\" autocomplete=\"off\">\n");
// hidden submit buttons which are clicked by tabs printConfigurationPageTabs(ConfigurationPageTab::GENERAL);
echo "<div style=\"display: none;\">\n";
echo "<input name=\"generalSettingsButton\" type=\"submit\" value=\" \">";
echo "<input name=\"edittypes\" type=\"submit\" value=\" \">";
echo "<input name=\"editmodules\" type=\"submit\" value=\" \">";
echo "<input name=\"moduleSettings\" type=\"submit\" value=\" \">";
echo "<input name=\"jobs\" type=\"submit\" value=\" \">";
echo "</div>\n";
// tabs
echo '<div class="ui-tabs ui-widget ui-widget-content ui-corner-all">';
echo '<ul class="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all">';
echo '<li id="generalSettingsButton" class="ui-state-default ui-corner-top">';
echo '<a href="#" onclick="document.getElementsByName(\'generalSettingsButton\')[0].click();"><img src="../../graphics/tools.png" alt=""> ';
echo _('General settings') . '</a>';
echo '</li>';
echo '<li id="edittypes" class="ui-state-default ui-corner-top" onmouseover="jQuery(this).addClass(\'tabs-hover\');" onmouseout="jQuery(this).removeClass(\'tabs-hover\');">';
echo '<a href="#" onclick="document.getElementsByName(\'edittypes\')[0].click();"><img src="../../graphics/gear.png" alt=""> ';
echo _('Account types') . '</a>';
echo '</li>';
echo '<li id="editmodules" class="ui-state-default ui-corner-top" onmouseover="jQuery(this).addClass(\'tabs-hover\');" onmouseout="jQuery(this).removeClass(\'tabs-hover\');">';
echo '<a href="#" onclick="document.getElementsByName(\'editmodules\')[0].click();"><img src="../../graphics/modules.png" alt=""> ';
echo _('Modules') . '</a>';
echo '</li>';
echo '<li id="moduleSettings" class="ui-state-default ui-corner-top" onmouseover="jQuery(this).addClass(\'tabs-hover\');" onmouseout="jQuery(this).removeClass(\'tabs-hover\');">';
echo '<a href="#" onclick="document.getElementsByName(\'moduleSettings\')[0].click();"><img src="../../graphics/moduleSettings.png" alt=""> ';
echo _('Module settings') . '</a>';
echo '</li>';
if (isLAMProVersion()) {
echo '<li id="jobs" class="ui-state-default ui-corner-top" onmouseover="jQuery(this).addClass(\'tabs-hover\');" onmouseout="jQuery(this).removeClass(\'tabs-hover\');">';
echo '<a href="#" onclick="document.getElementsByName(\'jobs\')[0].click();"><img src="../../graphics/clock.png" alt=""> ';
echo _('Jobs') . '</a>';
echo '</li>';
}
echo '</ul>';
?> ?>
<script type="text/javascript">
jQuery(document).ready(function() {
jQuery('#generalSettingsButton').addClass('ui-tabs-active');
jQuery('#generalSettingsButton').addClass('ui-state-active');
jQuery('#generalSettingsButton').addClass('user-bright');
});
</script>
<div class="ui-tabs-panel ui-widget-content ui-corner-bottom user-bright">
<input type="text" name="hiddenPreventAutocomplete" autocomplete="false" class="hidden" value=""> <input type="text" name="hiddenPreventAutocomplete" autocomplete="false" class="hidden" value="">
<input type="password" name="hiddenPreventAutocompletePwd1" autocomplete="false" class="hidden" value=""> <input type="password" name="hiddenPreventAutocompletePwd1" autocomplete="false" class="hidden" value="">
<input type="password" name="hiddenPreventAutocompletePwd2" autocomplete="false" class="hidden" value=""> <input type="password" name="hiddenPreventAutocompletePwd2" autocomplete="false" class="hidden" value="">

View File

@ -46,6 +46,8 @@ use \htmlGroup;
include_once('../../lib/config.inc'); include_once('../../lib/config.inc');
/** Access to module lists */ /** Access to module lists */
include_once('../../lib/modules.inc'); include_once('../../lib/modules.inc');
/** common functions */
include_once '../../lib/configPages.inc';
// start session // start session
if (strtolower(session_module_name()) == 'files') { if (strtolower(session_module_name()) == 'files') {
@ -112,83 +114,14 @@ printHeaderContents(_("LDAP Account Manager Configuration"), '../..');
echo "</head><body class=\"admin\">\n"; echo "</head><body class=\"admin\">\n";
// include all JavaScript files // include all JavaScript files
printJsIncludes('../..'); printJsIncludes('../..');
printConfigurationPageHeaderBar($conf);
?>
<table border=0 width="100%" class="lamHeader ui-corner-all">
<tr>
<td align="left" height="30">
<a class="lamLogo" href="http://www.ldap-account-manager.org/" target="new_window">LDAP Account Manager</a>
</td>
<td align="right">
<?php echo '<span class="hide-on-mobile">' . _('Server profile') . ': </span>' . $conf->getName(); ?>
&nbsp;&nbsp;
</td>
</tr>
</table>
<br>
<?php
// print error messages // print error messages
for ($i = 0; $i < sizeof($errorsToDisplay); $i++) call_user_func_array('StatusMessage', $errorsToDisplay[$i]); for ($i = 0; $i < sizeof($errorsToDisplay); $i++) call_user_func_array('StatusMessage', $errorsToDisplay[$i]);
echo ("<form id=\"inputForm\" action=\"confmodules.php\" method=\"post\" onSubmit=\"saveScrollPosition('inputForm')\">\n"); echo ("<form id=\"inputForm\" action=\"confmodules.php\" method=\"post\" onSubmit=\"saveScrollPosition('inputForm')\">\n");
// hidden submit buttons which are clicked by tabs printConfigurationPageTabs(ConfigurationPageTab::MODULES);
echo "<div style=\"display: none;\">\n";
echo "<input name=\"generalSettingsButton\" type=\"submit\" value=\" \">";
echo "<input name=\"edittypes\" type=\"submit\" value=\" \">";
echo "<input name=\"editmodules\" type=\"submit\" value=\" \">";
echo "<input name=\"moduleSettings\" type=\"submit\" value=\" \">";
echo "<input name=\"jobs\" type=\"submit\" value=\" \">";
echo "</div>\n";
// tabs
echo '<div class="ui-tabs ui-widget ui-widget-content ui-corner-all">';
echo '<ul class="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all">';
echo '<li id="generalSettingsButton" class="ui-state-default ui-corner-top" onmouseover="jQuery(this).addClass(\'tabs-hover\');" onmouseout="jQuery(this).removeClass(\'tabs-hover\');">';
echo '<a href="#" onclick="document.getElementsByName(\'generalSettingsButton\')[0].click();"><img src="../../graphics/tools.png" alt=""> ';
echo '<span class="hide-on-mobile">' . _('General settings') . '</span></a>';
echo '</li>';
echo '<li id="edittypes" class="ui-state-default ui-corner-top" onmouseover="jQuery(this).addClass(\'tabs-hover\');" onmouseout="jQuery(this).removeClass(\'tabs-hover\');">';
echo '<a href="#" onclick="document.getElementsByName(\'edittypes\')[0].click();"><img src="../../graphics/gear.png" alt=""> ';
echo '<span class="hide-on-mobile">' . _('Account types') . '</span></a>';
echo '</li>';
echo '<li id="editmodules" class="ui-state-default ui-corner-top">';
echo '<a href="#" onclick="document.getElementsByName(\'editmodules\')[0].click();"><img src="../../graphics/modules.png" alt=""> ';
echo '<span class="hide-on-mobile">' . _('Modules') . '</span></a>';
echo '</li>';
echo '<li id="moduleSettings" class="ui-state-default ui-corner-top" onmouseover="jQuery(this).addClass(\'tabs-hover\');" onmouseout="jQuery(this).removeClass(\'tabs-hover\');">';
echo '<a href="#" onclick="document.getElementsByName(\'moduleSettings\')[0].click();"><img src="../../graphics/moduleSettings.png" alt=""> ';
echo '<span class="hide-on-mobile">' . _('Module settings') . '</span></a>';
echo '</li>';
if (isLAMProVersion()) {
echo '<li id="jobs" class="ui-state-default ui-corner-top" onmouseover="jQuery(this).addClass(\'tabs-hover\');" onmouseout="jQuery(this).removeClass(\'tabs-hover\');">';
echo '<a href="#" onclick="document.getElementsByName(\'jobs\')[0].click();"><img src="../../graphics/clock.png" alt=""> ';
echo '<span class="hide-on-mobile">' . _('Jobs') . '</span></a>';
echo '</li>';
}
echo '</ul>';
?>
<script type="text/javascript">
jQuery(document).ready(function() {
jQuery('#editmodules').addClass('ui-tabs-active');
jQuery('#editmodules').addClass('ui-state-active');
jQuery('#editmodules').addClass('user-bright');
// set common width for select boxes
var maxWidth = 0;
jQuery("select").each(function(){
if (jQuery(this).width() > maxWidth)
maxWidth = jQuery(this).width();
});
jQuery("select").width(maxWidth);
});
</script>
<div class="ui-tabs-panel ui-widget-content ui-corner-bottom user-bright">
<?php
$typeManager = new \LAM\TYPES\TypeManager($conf); $typeManager = new \LAM\TYPES\TypeManager($conf);
$types = $typeManager->getConfiguredTypes(); $types = $typeManager->getConfiguredTypes();

View File

@ -12,8 +12,6 @@ use \htmlTableExtendedInputField;
use \LAMConfig; use \LAMConfig;
use \htmlTableExtendedInputCheckbox; use \htmlTableExtendedInputCheckbox;
/* /*
$Id$
This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/) This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/)
Copyright (C) 2004 - 2017 Roland Gruber Copyright (C) 2004 - 2017 Roland Gruber
@ -43,9 +41,11 @@ $Id$
/** Access to config functions */ /** Access to config functions */
include_once('../../lib/config.inc'); include_once '../../lib/config.inc';
/** Access to account types */ /** Access to account types */
include_once('../../lib/types.inc'); include_once '../../lib/types.inc';
/** common functions */
include_once '../../lib/configPages.inc';
// start session // start session
if (strtolower(session_module_name()) == 'files') { if (strtolower(session_module_name()) == 'files') {
@ -135,110 +135,18 @@ foreach ($allScopes as $scope) {
usort($availableScopes, '\LAM\CONFIG\compareTypesByAlias'); usort($availableScopes, '\LAM\CONFIG\compareTypesByAlias');
echo $_SESSION['header']; echo $_SESSION['header'];
printHeaderContents(_("LDAP Account Manager Configuration"), '../..');
echo "<title>" . _("LDAP Account Manager Configuration") . "</title>\n"; echo "</head><body class=\"admin\">\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 "<link rel=\"stylesheet\" type=\"text/css\" href=\"../../style/" . $cssEntry . "\">\n";
}
echo "<link rel=\"shortcut icon\" type=\"image/x-icon\" href=\"../../graphics/favicon.ico\">\n";
echo "<link rel=\"icon\" href=\"../../graphics/logo136.png\">\n";
echo "</head><body>\n";
// include all JavaScript files // include all JavaScript files
$jsDirName = dirname(__FILE__) . '/../lib'; printJsIncludes('../..');
$jsDir = dir($jsDirName); printConfigurationPageHeaderBar($conf);
$jsFiles = array();
while ($jsEntry = $jsDir->read()) {
if (substr($jsEntry, strlen($jsEntry) - 3, 3) != '.js') continue;
$jsFiles[] = $jsEntry;
}
sort($jsFiles);
foreach ($jsFiles as $jsEntry) {
echo "<script type=\"text/javascript\" src=\"../lib/" . $jsEntry . "\"></script>\n";
}
?>
<table border=0 width="100%" class="lamHeader ui-corner-all">
<tr>
<td align="left" height="30">
<a class="lamLogo" href="http://www.ldap-account-manager.org/" target="new_window">LDAP Account Manager</a>
</td>
<td align="right">
<?php echo _('Server profile') . ': ' . $conf->getName(); ?>
&nbsp;&nbsp;
</td>
</tr>
</table>
<br>
<?php
// print error messages // print error messages
for ($i = 0; $i < sizeof($errorsToDisplay); $i++) call_user_func_array('StatusMessage', $errorsToDisplay[$i]); for ($i = 0; $i < sizeof($errorsToDisplay); $i++) call_user_func_array('StatusMessage', $errorsToDisplay[$i]);
echo ("<form action=\"conftypes.php\" method=\"post\">\n"); echo ("<form action=\"conftypes.php\" method=\"post\">\n");
// hidden submit buttons which are clicked by tabs printConfigurationPageTabs(ConfigurationPageTab::TYPES);
echo "<div style=\"display: none;\">\n";
echo "<input name=\"generalSettingsButton\" type=\"submit\" value=\" \">";
echo "<input name=\"edittypes\" type=\"submit\" value=\" \">";
echo "<input name=\"editmodules\" type=\"submit\" value=\" \">";
echo "<input name=\"moduleSettings\" type=\"submit\" value=\" \">";
echo "<input name=\"jobs\" type=\"submit\" value=\" \">";
echo "</div>\n";
// tabs
echo '<div class="ui-tabs ui-widget ui-widget-content ui-corner-all">';
echo '<ul class="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all">';
echo '<li id="generalSettingsButton" class="ui-state-default ui-corner-top" onmouseover="jQuery(this).addClass(\'tabs-hover\');" onmouseout="jQuery(this).removeClass(\'tabs-hover\');">';
echo '<a href="#" onclick="document.getElementsByName(\'generalSettingsButton\')[0].click();"><img src="../../graphics/tools.png" alt=""> ';
echo _('General settings') . '</a>';
echo '</li>';
echo '<li id="edittypes" class="ui-state-default ui-corner-top">';
echo '<a href="#" onclick="document.getElementsByName(\'edittypes\')[0].click();"><img src="../../graphics/gear.png" alt=""> ';
echo _('Account types') . '</a>';
echo '</li>';
echo '<li id="editmodules" class="ui-state-default ui-corner-top" onmouseover="jQuery(this).addClass(\'tabs-hover\');" onmouseout="jQuery(this).removeClass(\'tabs-hover\');">';
echo '<a href="#" onclick="document.getElementsByName(\'editmodules\')[0].click();"><img src="../../graphics/modules.png" alt=""> ';
echo _('Modules') . '</a>';
echo '</li>';
echo '<li id="moduleSettings" class="ui-state-default ui-corner-top" onmouseover="jQuery(this).addClass(\'tabs-hover\');" onmouseout="jQuery(this).removeClass(\'tabs-hover\');">';
echo '<a href="#" onclick="document.getElementsByName(\'moduleSettings\')[0].click();"><img src="../../graphics/moduleSettings.png" alt=""> ';
echo _('Module settings') . '</a>';
echo '</li>';
if (isLAMProVersion()) {
echo '<li id="jobs" class="ui-state-default ui-corner-top" onmouseover="jQuery(this).addClass(\'tabs-hover\');" onmouseout="jQuery(this).removeClass(\'tabs-hover\');">';
echo '<a href="#" onclick="document.getElementsByName(\'jobs\')[0].click();"><img src="../../graphics/clock.png" alt=""> ';
echo _('Jobs') . '</a>';
echo '</li>';
}
echo '</ul>';
?>
<script type="text/javascript">
jQuery(document).ready(function() {
jQuery('#edittypes').addClass('ui-tabs-active');
jQuery('#edittypes').addClass('ui-state-active');
jQuery('#edittypes').addClass('user-bright');
});
</script>
<div class="ui-tabs-panel ui-widget-content ui-corner-bottom user-bright">
<?php
$container = new htmlTable(); $container = new htmlTable();

View File

@ -39,6 +39,8 @@ $Id$
include_once('../../lib/config.inc'); include_once('../../lib/config.inc');
/** Access to account types */ /** Access to account types */
include_once('../../lib/types.inc'); include_once('../../lib/types.inc');
/** common functions */
include_once '../../lib/configPages.inc';
// start session // start session
if (strtolower(session_module_name()) == 'files') { if (strtolower(session_module_name()) == 'files') {
@ -136,75 +138,16 @@ sort($jsFiles);
foreach ($jsFiles as $jsEntry) { foreach ($jsFiles as $jsEntry) {
echo "<script type=\"text/javascript\" src=\"../lib/" . $jsEntry . "\"></script>\n"; echo "<script type=\"text/javascript\" src=\"../lib/" . $jsEntry . "\"></script>\n";
} }
printConfigurationPageHeaderBar($conf);
?>
<table border=0 width="100%" class="lamHeader ui-corner-all">
<tr>
<td align="left" height="30">
<a class="lamLogo" href="http://www.ldap-account-manager.org/" target="new_window">LDAP Account Manager</a>
</td>
<td align="right">
<?php echo _('Server profile') . ': ' . $conf->getName(); ?>
&nbsp;&nbsp;
</td>
</tr>
</table>
<br>
<?php
// print error messages // print error messages
for ($i = 0; $i < sizeof($errorsToDisplay); $i++) call_user_func_array('StatusMessage', $errorsToDisplay[$i]); for ($i = 0; $i < sizeof($errorsToDisplay); $i++) call_user_func_array('StatusMessage', $errorsToDisplay[$i]);
echo ("<form id=\"inputForm\" action=\"moduleSettings.php\" method=\"post\" autocomplete=\"off\" onSubmit=\"saveScrollPosition('inputForm')\">\n"); echo ("<form id=\"inputForm\" action=\"moduleSettings.php\" method=\"post\" autocomplete=\"off\" onSubmit=\"saveScrollPosition('inputForm')\">\n");
// hidden submit buttons which are clicked by tabs printConfigurationPageTabs(ConfigurationPageTab::MODULE_SETTINGS);
echo "<div style=\"display: none;\">\n";
echo "<input name=\"generalSettingsButton\" type=\"submit\" value=\" \">";
echo "<input name=\"edittypes\" type=\"submit\" value=\" \">";
echo "<input name=\"editmodules\" type=\"submit\" value=\" \">";
echo "<input name=\"moduleSettings\" type=\"submit\" value=\" \">";
echo "<input name=\"jobs\" type=\"submit\" value=\" \">";
echo "</div>\n";
// tabs
echo '<div class="ui-tabs ui-widget ui-widget-content ui-corner-all">';
echo '<ul class="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all">';
echo '<li id="generalSettingsButton" class="ui-state-default ui-corner-top" onmouseover="jQuery(this).addClass(\'tabs-hover\');" onmouseout="jQuery(this).removeClass(\'tabs-hover\');">';
echo '<a href="#" onclick="document.getElementsByName(\'generalSettingsButton\')[0].click();"><img src="../../graphics/tools.png" alt=""> ';
echo _('General settings') . '</a>';
echo '</li>';
echo '<li id="edittypes" class="ui-state-default ui-corner-top" onmouseover="jQuery(this).addClass(\'tabs-hover\');" onmouseout="jQuery(this).removeClass(\'tabs-hover\');">';
echo '<a href="#" onclick="document.getElementsByName(\'edittypes\')[0].click();"><img src="../../graphics/gear.png" alt=""> ';
echo _('Account types') . '</a>';
echo '</li>';
echo '<li id="editmodules" class="ui-state-default ui-corner-top" onmouseover="jQuery(this).addClass(\'tabs-hover\');" onmouseout="jQuery(this).removeClass(\'tabs-hover\');">';
echo '<a href="#" onclick="document.getElementsByName(\'editmodules\')[0].click();"><img src="../../graphics/modules.png" alt=""> ';
echo _('Modules') . '</a>';
echo '</li>';
echo '<li id="moduleSettings" class="ui-state-default ui-corner-top">';
echo '<a href="#" onclick="document.getElementsByName(\'moduleSettings\')[0].click();"><img src="../../graphics/moduleSettings.png" alt=""> ';
echo _('Module settings') . '</a>';
echo '</li>';
if (isLAMProVersion()) {
echo '<li id="jobs" class="ui-state-default ui-corner-top" onmouseover="jQuery(this).addClass(\'tabs-hover\');" onmouseout="jQuery(this).removeClass(\'tabs-hover\');">';
echo '<a href="#" onclick="document.getElementsByName(\'jobs\')[0].click();"><img src="../../graphics/clock.png" alt=""> ';
echo _('Jobs') . '</a>';
echo '</li>';
}
echo '</ul>';
?> ?>
<script type="text/javascript">
jQuery(document).ready(function() {
jQuery('#moduleSettings').addClass('ui-tabs-active');
jQuery('#moduleSettings').addClass('ui-state-active');
jQuery('#moduleSettings').addClass('user-bright');
});
</script>
<div class="ui-tabs-panel ui-widget-content ui-corner-bottom user-bright">
<input type="text" name="hiddenPreventAutocomplete" autocomplete="false" class="hidden" value=""> <input type="text" name="hiddenPreventAutocomplete" autocomplete="false" class="hidden" value="">
<input type="password" name="hiddenPreventAutocompletePwd1" autocomplete="false" class="hidden" value=""> <input type="password" name="hiddenPreventAutocompletePwd1" autocomplete="false" class="hidden" value="">
<input type="password" name="hiddenPreventAutocompletePwd2" autocomplete="false" class="hidden" value=""> <input type="password" name="hiddenPreventAutocompletePwd2" autocomplete="false" class="hidden" value="">

View File

@ -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() { jQuery(document).ready(function() {
window.lam.gui.equalHeight(); window.lam.gui.equalHeight();
window.lam.form.autoTrim(); window.lam.form.autoTrim();
window.lam.account.addDefaultProfileListener(); window.lam.account.addDefaultProfileListener();
window.lam.tools.addSavedSelectListener(); window.lam.tools.addSavedSelectListener();
window.lam.tools.activateTab();
}); });