theme and language selector can be turn off on login page

This commit is contained in:
Uwe Steinmann 2014-02-01 16:06:12 +01:00
parent 2f18e2416b
commit 94b107b7bd
5 changed files with 21 additions and 2 deletions

View File

@ -153,6 +153,8 @@ class Settings { /* {{{ */
var $_maxRecursiveCount = 10000;
// enable/disable language selection menu
var $_enableLanguageSelector = true;
// enable/disable theme selector
var $_enableThemeSelector = true;
// expandFolderTree
var $_expandFolderTree = 1;
// enable/disable editing of users own profile
@ -317,6 +319,7 @@ class Settings { /* {{{ */
$this->_enableRecursiveCount = Settings::boolVal($tab["enableRecursiveCount"]);
$this->_maxRecursiveCount = intval($tab["maxRecursiveCount"]);
$this->_enableLanguageSelector = Settings::boolVal($tab["enableLanguageSelector"]);
$this->_enableThemeSelector = Settings::boolVal($tab["enableThemeSelector"]);
$this->_enableFullSearch = Settings::boolVal($tab["enableFullSearch"]);
$this->_stopWordsFile = strval($tab["stopWordsFile"]);
$this->_sortUsersInList = strval($tab["sortUsersInList"]);
@ -574,6 +577,7 @@ class Settings { /* {{{ */
$this->setXMLAttributValue($node, "enableRecursiveCount", $this->_enableRecursiveCount);
$this->setXMLAttributValue($node, "maxRecursiveCount", $this->_maxRecursiveCount);
$this->setXMLAttributValue($node, "enableLanguageSelector", $this->_enableLanguageSelector);
$this->setXMLAttributValue($node, "enableThemeSelector", $this->_enableThemeSelector);
$this->setXMLAttributValue($node, "enableFullSearch", $this->_enableFullSearch);
$this->setXMLAttributValue($node, "expandFolderTree", $this->_expandFolderTree);
$this->setXMLAttributValue($node, "stopWordsFile", $this->_stopWordsFile);

View File

@ -70,6 +70,7 @@ if ($action == "saveSettings")
$settings->_enableRecursiveCount = getBoolValue("enableRecursiveCount");
$settings->_maxRecursiveCount = intval($_POST["maxRecursiveCount"]);
$settings->_enableLanguageSelector = getBoolValue("enableLanguageSelector");
$settings->_enableThemeSelector = getBoolValue("enableThemeSelector");
$settings->_expandFolderTree = intval($_POST["expandFolderTree"]);
$settings->_stopWordsFile = $_POST["stopWordsFile"];
$settings->_sortUsersInList = $_POST["sortUsersInList"];

View File

@ -37,7 +37,7 @@ else if (isset($_POST["referuri"]) && strlen($_POST["referuri"])>0) {
$themes = UI::getStyles();
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
$view = UI::factory($theme, $tmp[1], array('enableguestlogin'=>$settings->_enableGuestLogin, 'enablepasswordforgotten'=>$settings->_enablePasswordForgotten, 'referrer'=>$refer, 'themes'=>$themes));
$view = UI::factory($theme, $tmp[1], array('enableguestlogin'=>$settings->_enableGuestLogin, 'enablepasswordforgotten'=>$settings->_enablePasswordForgotten, 'referrer'=>$refer, 'themes'=>$themes, 'languages'=>getLanguages(), 'enablelanguageselector'=>$settings->_enableLanguageSelector, 'enablethemeselector'=>$settings->_enableThemeSelector));
if($view) {
$view->show();
exit;

View File

@ -36,6 +36,9 @@ class SeedDMS_View_Login extends SeedDMS_Bootstrap_Style {
$enablepasswordforgotten = $this->params['enablepasswordforgotten'];
$refer = $this->params['referrer'];
$themes = $this->params['themes'];
$languages = $this->params['languages'];
$enableLanguageSelector = $this->params['enablelanguageselector'];
$enableThemeSelector = $this->params['enablethemeselector'];
$this->htmlStartPage(getMLText("sign_in"), "login");
$this->globalBanner();
@ -94,13 +97,13 @@ function guestLogin()
<input type="Password" id="pwd" name="pwd">
</div>
</div>
<?php if($enableLanguageSelector) { ?>
<div class="control-group">
<label class="control-label" for="pwd"><?php printMLText("language");?>:</label>
<div class="controls">
<?php
print "<select name=\"lang\">";
print "<option value=\"\">-";
$languages = getLanguages();
foreach ($languages as $currLang) {
print "<option value=\"".$currLang."\">".getMLText($currLang)."</option>";
}
@ -108,6 +111,10 @@ function guestLogin()
?>
</div>
</div>
<?php
}
if($enableThemeSelector) {
?>
<div class="control-group">
<label class="control-label" for="pwd"><?php printMLText("theme");?>:</label>
<div class="controls">
@ -122,6 +129,9 @@ function guestLogin()
?>
</div>
</div>
<?php
}
?>
<div class="control-group">
<div class="controls">
<button type="submit" class="btn"><?php printMLText("submit_login") ?></button>

View File

@ -176,6 +176,10 @@ if(!is_writeable($settings->_configFilePath)) {
<td><?php printMLText("settings_enableLanguageSelector");?>:</td>
<td><input name="enableLanguageSelector" type="checkbox" <?php if ($settings->_enableLanguageSelector) echo "checked" ?> /></td>
</tr>
<tr title="<?php printMLText("settings_enableThemeSelector_desc");?>">
<td><?php printMLText("settings_enableThemeSelector");?>:</td>
<td><input name="enableThemeSelector" type="checkbox" <?php if ($settings->_enableThemeSelector) echo "checked" ?> /></td>
</tr>
<tr title="<?php printMLText("settings_sortUsersInList_desc");?>">
<td><?php printMLText("settings_sortUsersInList");?>:</td>
<td>