Enable AbstractViewSettings

This commit is contained in:
the-djmaze 2022-02-28 10:38:47 +01:00
parent 92cec80b73
commit 97bc3ef585
20 changed files with 149 additions and 212 deletions

View file

@ -856,13 +856,16 @@ class Actions
if ($oConfig->Get('webmail', 'allow_languages_on_settings', true)) {
$sLanguage = (string) $oSettings->GetConf('Language', $sLanguage);
}
if (!$oSettings->GetConf('MessagesPerPage')) {
$oSettings->SetConf('MessagesPerPage', $oSettings->GetConf('MPP', $aResult['MessagesPerPage']));
}
$aResult['EditorDefaultType'] = (string)$oSettings->GetConf('EditorDefaultType', $aResult['EditorDefaultType']);
$aResult['ViewHTML'] = (bool)$oSettings->GetConf('ViewHTML', $aResult['ViewHTML']);
$aResult['ShowImages'] = (bool)$oSettings->GetConf('ShowImages', $aResult['ShowImages']);
$aResult['RemoveColors'] = (bool)$oSettings->GetConf('RemoveColors', $aResult['RemoveColors']);
$aResult['ContactsAutosave'] = (bool)$oSettings->GetConf('ContactsAutosave', $aResult['ContactsAutosave']);
$aResult['MessagesPerPage'] = (int)$oSettings->GetConf('MPP', $aResult['MessagesPerPage']);
$aResult['MessagesPerPage'] = (int)$oSettings->GetConf('MessagesPerPage', $aResult['MessagesPerPage']);
$aResult['MessageReadDelay'] = (int)$oSettings->GetConf('MessageReadDelay', $aResult['MessageReadDelay']);
$aResult['SoundNotification'] = (bool)$oSettings->GetConf('SoundNotification', $aResult['SoundNotification']);
$aResult['NotificationSound'] = (string)$oSettings->GetConf('NotificationSound', $aResult['NotificationSound']);

View file

@ -918,13 +918,13 @@ trait Admin
$sValue = $mStringCallback($sValue);
}
$oConfig->Set($sConfigSector, $sConfigName, (string)$sValue);
$oConfig->Set($sConfigSector, $sConfigName, $sValue);
break;
case 'dummy':
$sValue = (string)$this->GetActionParam('ContactsPdoPassword', APP_DUMMY);
$sValue = (string) $this->GetActionParam($sParamName, APP_DUMMY);
if (APP_DUMMY !== $sValue) {
$oConfig->Set($sConfigSector, $sConfigName, (string)$sValue);
$oConfig->Set($sConfigSector, $sConfigName, $sValue);
}
break;
@ -934,7 +934,7 @@ trait Admin
break;
case 'bool':
$oConfig->Set($sConfigSector, $sConfigName, '1' === (string)$sValue);
$oConfig->Set($sConfigSector, $sConfigName, !empty($sValue) && 'false' !== $sValue);
break;
}
}

View file

@ -331,7 +331,7 @@ trait User
$oSettingsLocal->SetConf('Theme', $this->ValidateTheme($oConfig->Get('webmail', 'theme', 'Default')));
}
$this->setSettingsFromParams($oSettings, 'MPP', 'int', function ($iValue) {
$this->setSettingsFromParams($oSettings, 'MessagesPerPage', 'int', function ($iValue) {
return \min(50, \max(10, $iValue));
});
@ -556,7 +556,7 @@ trait User
break;
case 'bool':
$oSettings->SetConf($sConfigName, !empty($sValue));
$oSettings->SetConf($sConfigName, !empty($sValue) && 'false' !== $sValue);
break;
}
}

View file

@ -16,8 +16,8 @@
<div data-bind="component: {
name: 'Input',
params: {
value: loadingDesc,
trigger: loadingDescTrigger,
value: loadingDescription,
trigger: loadingDescriptionTrigger,
size: 5
}
}"></div>

View file

@ -28,32 +28,32 @@
params: {
options: contactsTypesOptions,
value: mainContactsType,
trigger: contactsTypeTrigger,
trigger: contactsPdoTypeTrigger,
optionsText: 'name',
optionsValue: 'id'
}
}"></div>
</div>
<div data-bind="visible: 'sqlite' !== contactsType()">
<div data-bind="visible: 'sqlite' !== contactsPdoType()">
<div class="control-group">
<label data-i18n="TAB_CONTACTS/LABEL_STORAGE_DSN"></label>
<div>
<input type="text" class="span6" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"
data-bind="value: pdoDsn, saveTrigger: pdoDsnTrigger" placeholder="mysql:host=127.0.0.1;port=3306;dbname=snappymail">
data-bind="value: contactsPdoDsn, saveTrigger: contactsPdoDsnTrigger" placeholder="mysql:host=127.0.0.1;port=3306;dbname=snappymail">
</div>
</div>
<div class="control-group">
<label data-i18n="TAB_CONTACTS/LABEL_STORAGE_USER"></label>
<div>
<input type="text" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"
data-bind="value: pdoUser, saveTrigger: pdoUserTrigger">
data-bind="value: contactsPdoUser, saveTrigger: contactsPdoUserTrigger">
</div>
</div>
<div class="control-group">
<label data-i18n="TAB_CONTACTS/LABEL_STORAGE_PASSWORD"></label>
<div>
<input type="password" autocomplete="current-password" autocorrect="off" autocapitalize="off" spellcheck="false"
data-bind="value: pdoPassword, saveTrigger: pdoPasswordTrigger">
data-bind="value: contactsPdoPassword, saveTrigger: contactsPdoPasswordTrigger">
</div>
</div>
<div class="control-group">
@ -64,7 +64,7 @@
</a>
</div>
</div>
<div data-bind="visible: 'sqlite' === contactsType()">
<div data-bind="visible: 'sqlite' === contactsPdoType()">
<div class="control-group">
<div class="alert">
<h4 data-i18n="TAB_CONTACTS/ALERT_NOTICE"></h4>

View file

@ -90,7 +90,7 @@
<div class="control-group">
<label data-i18n="TAB_GENERAL/LABEL_ATTACHMENT_SIZE_LIMIT"></label>
<div>
<input type="number" min="1" step="1" class="span1" data-bind="textInput: mainAttachmentLimit">
<input type="number" min="1" step="1" class="span1" data-bind="textInput: attachmentLimit">
&nbsp;
<span data-i18n="MB"></span>
<span data-bind="saveTrigger: attachmentLimitTrigger"></span>

View file

@ -5,8 +5,8 @@
<div data-bind="component: {
name: 'Input',
params: {
value: defaultDomain,
trigger: defaultDomainTrigger,
value: loginDefaultDomain,
trigger: loginDefaultDomainTrigger,
size: 3
}
}"></div>

View file

@ -42,7 +42,7 @@
<div>
<input type="number" min="10" max="50" step="1" class="span1" data-bind="textInput: messagesPerPage">
&nbsp;
<span data-bind="saveTrigger: mppTrigger"></span>
<span data-bind="saveTrigger: messagesPerPageTrigger"></span>
</div>
</div>
<div class="control-group">
@ -77,7 +77,7 @@
<div>
<input type="number" min="0" step="1" class="span1" data-bind="textInput: messageReadDelay">
&nbsp;
<span data-i18n="SETTINGS_GENERAL/SECONDS"></label>
<span data-i18n="SETTINGS_GENERAL/SECONDS"></span>
<span data-bind="saveTrigger: messageReadDelayTrigger"></span>
</div>
</div>