more tests and some fixes

This commit is contained in:
Dennis Eichhorn 2024-04-24 03:20:46 +00:00
parent 5475276b6e
commit d428a29d53
17 changed files with 347 additions and 1608 deletions

View File

@ -13,10 +13,15 @@ on:
- cron: '0 0 1,15 * *'
jobs:
general_module_workflow:
general_module_workflow_php:
uses: Karaka-Management/Karaka/.github/workflows/php_template.yml@develop
secrets:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_PAT: ${{ secrets.GH_PAT }}
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
general_module_workflow_js:
uses: Karaka-Management/Karaka/.github/workflows/js_template.yml@develop
secrets:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_PAT: ${{ secrets.GH_PAT }}
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

View File

@ -125,7 +125,7 @@
"type": 3,
"subtype": 1,
"name": "Info",
"uri": "{/base}/admin/module/info",
"uri": "{/base}/admin/module/info?id={?id}",
"target": "self",
"icon": null,
"order": 1,
@ -140,7 +140,7 @@
"type": 3,
"subtype": 1,
"name": "Settings",
"uri": "{/base}/admin/module/settings",
"uri": "{/base}/admin/module/settings?id={?id}",
"target": "self",
"icon": null,
"order": 5,
@ -155,7 +155,7 @@
"type": 3,
"subtype": 1,
"name": "Routes",
"uri": "{/base}/admin/module/route/list",
"uri": "{/base}/admin/module/route/list?id={?id}",
"target": "self",
"icon": null,
"order": 15,
@ -170,7 +170,7 @@
"type": 3,
"subtype": 1,
"name": "Hooks",
"uri": "{/base}/admin/module/hook/list",
"uri": "{/base}/admin/module/hook/list?id={?id}",
"target": "self",
"icon": null,
"order": 15,
@ -185,7 +185,7 @@
"type": 3,
"subtype": 1,
"name": "Log",
"uri": "{/base}/admin/module/log",
"uri": "{/base}/admin/module/log?id={?id}",
"target": "self",
"icon": null,
"order": 20,

View File

@ -250,7 +250,7 @@ return [
],
],
],
'^.*/admin/account/localization(\?.*|$)' => [
'^.*/admin/localization(\?.*|$)' => [
[
'dest' => '\Modules\Admin\Controller\ApiController:apiSettingsAccountLocalizationSet',
'verb' => RouteVerb::SET,

View File

@ -53,9 +53,9 @@ return [
],
],
],
'^/admin/account/settings(\?.*$|$)' => [
'^/admin/account/view(\?.*$|$)' => [
[
'dest' => '\Modules\Admin\Controller\BackendController:viewAccountSettings',
'dest' => '\Modules\Admin\Controller\BackendController:viewAccountView',
'verb' => RouteVerb::GET,
'active' => true,
'permission' => [
@ -89,9 +89,9 @@ return [
],
],
],
'^/admin/group/settings(\?.*$|$)' => [
'^/admin/group/view(\?.*$|$)' => [
[
'dest' => '\Modules\Admin\Controller\BackendController:viewGroupSettings',
'dest' => '\Modules\Admin\Controller\BackendController:viewGroupView',
'verb' => RouteVerb::GET,
'active' => true,
'permission' => [

View File

@ -12,30 +12,18 @@
*/
declare(strict_types=1);
use Modules\Admin\Models\SettingsEnum;
use Modules\Organization\Models\UnitMapper;
use phpOMS\Application\ApplicationStatus;
use phpOMS\Localization\NullLocalization;
use phpOMS\Message\Mail\SubmitType;
use phpOMS\Uri\UriFactory;
$generalSettings = $this->data['generalSettings'] ?? [];
$settings = $this->data['settings'] ?? [];
$countryCodes = \phpOMS\Localization\ISO3166TwoEnum::getConstants();
$countries = \phpOMS\Localization\ISO3166NameEnum::getConstants();
$timezones = \phpOMS\Localization\TimeZoneEnumArray::getConstants();
$timeformats = \phpOMS\Localization\ISO8601EnumArray::getConstants();
$languages = \phpOMS\Localization\ISO639Enum::getConstants();
$currencies = \phpOMS\Localization\ISO4217Enum::getConstants();
$l11nDefinitions = \phpOMS\System\File\Local\Directory::list(__DIR__ . '/../../../../phpOMS/Localization/Defaults/Definitions');
$weights = \phpOMS\Utils\Converter\WeightType::getConstants();
$speeds = \phpOMS\Utils\Converter\SpeedType::getConstants();
$areas = \phpOMS\Utils\Converter\AreaType::getConstants();
$lengths = \phpOMS\Utils\Converter\LengthType::getConstants();
$volumes = \phpOMS\Utils\Converter\VolumeType::getConstants();
$temperatures = \phpOMS\Utils\Converter\TemperatureType::getConstants();
$serverModes = ApplicationStatus::getConstants();
$mailServerModes = SubmitType::getConstants();
$l11n = $this->data['default_localization'] ?? new NullLocalization();
@ -62,7 +50,7 @@ echo $this->data['nav']->render();
<div class="portlet-body">
<div class="form-group">
<label for="iOname"><?= $this->getHtml('OrganizationName'); ?></label>
<select id="iOname" name="settings_1000000009">
<select id="iOname" name="settings_<?= SettingsEnum::DEFAULT_UNIT; ?>">
<?php $unit = UnitMapper::get()->where('id', 1)->execute(); ?>
<option value="<?= $unit->id; ?>"><?= $this->printHtml($unit->name); ?>
</select>
@ -75,14 +63,14 @@ echo $this->data['nav']->render();
<div class="col-xs-12 col-md-6">
<section class="portlet">
<form id="iGeneralSettings" action="<?= UriFactory::build('{/api}admin/settings/general?csrf={$CSRF}'); ?>" method="post">
<form id="iGeneralSettings" action="<?= UriFactory::build('{/api}admin/settings?csrf={$CSRF}'); ?>" method="post">
<div class="portlet-head"><?= $this->getHtml('ServerStatus'); ?></div>
<div class="portlet-body">
<div class="form-group">
<label for="iOname"><?= $this->getHtml('ServerStatus'); ?></label>
<select id="iOname" name="settings_1000000009">
<label for="iStatus"><?= $this->getHtml('ServerStatus'); ?></label>
<select id="iStatus" name="settings_<?= SettingsEnum::LOGIN_STATUS; ?>">
<?php foreach ($serverModes as $mode) : ?>
<option value="<?= $this->printHtml((string) $mode); ?>"<?= $mode === 1 ? ' selected' : ''; ?>><?= $this->getHtml('ServerMode-' . $mode); ?>
<option value="<?= $this->printHtml((string) $mode); ?>"<?= $mode === $generalSettings[SettingsEnum::LOGIN_STATUS]->content ? ' selected' : ''; ?>><?= $this->getHtml('ServerMode-' . $mode); ?>
<?php endforeach; ?>
</select>
</div>
@ -94,7 +82,7 @@ echo $this->data['nav']->render();
<div class="col-xs-12 col-md-6">
<section class="portlet">
<form id="iSecuritySettings" action="<?= UriFactory::build('{/api}admin/settings/general?csrf={$CSRF}'); ?>" method="post">
<form id="iSecuritySettings" action="<?= UriFactory::build('{/api}admin/settings?csrf={$CSRF}'); ?>" method="post">
<div class="portlet-head"><?= $this->getHtml('Security'); ?></div>
<div class="portlet-body">
<div class="form-group">
@ -103,9 +91,10 @@ echo $this->data['nav']->render();
<i class="tooltip" data-tooltip="<?= $this->getHtml('i:PasswordRegex'); ?>"><i class="g-icon">info</i></i>
</label>
<input id="iPassword" name="settings_1000000001" type="text" value="<?= $this->printHtml($generalSettings['1000000001']->content); ?>" placeholder="^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[$@$!%*?&;:\(\)\[\]=\{\}\+\-])[A-Za-z\d$@$!%*?&;:\(\)\[\]=\{\}\+\-]{8,}">
<input id="iPassword" name="settings_<?= SettingsEnum::PASSWORD_PATTERN; ?>" type="text" value="<?= $this->printHtml($generalSettings[SettingsEnum::PASSWORD_PATTERN]->content); ?>" placeholder="^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[$@$!%*?&;:\(\)\[\]=\{\}\+\-])[A-Za-z\d$@$!%*?&;:\(\)\[\]=\{\}\+\-]{8,}">
</div>
<!-- @implement
<div class="form-group">
<label for="iLoginRetries">
<?= $this->getHtml('LoginRetries'); ?>
@ -141,6 +130,7 @@ echo $this->data['nav']->render();
<input id="iPasswordHistory" name="settings_1000000004" type="number" value="<?= $this->printHtml($generalSettings['1000000004']->content); ?>">
</div>
-->
</div>
<div class="portlet-foot">
@ -152,509 +142,66 @@ echo $this->data['nav']->render();
<div class="col-xs-12 col-md-6">
<section class="portlet">
<form id="iLoggingSettings"
action="<?= UriFactory::build('{/api}admin/settings/general?csrf={$CSRF}'); ?>"
method="post">
<div class="portlet-head"><?= $this->getHtml('Logging'); ?></div>
<form id="iEmailSettings" action="<?= UriFactory::build('{/api}admin/settings?csrf={$CSRF}'); ?>" method="post">
<div class="portlet-head"><?= $this->getHtml('Email'); ?></div>
<div class="portlet-body">
<div class="form-group">
<label class="checkbox" for="iLog">
<input id="iLog" type="checkbox" name="settings_1000000006" value="1">
<span class="checkmark"></span>
<?= $this->getHtml('Log'); ?>
</label>
<label for="iOutServer"><?= $this->getHtml('OutServer'); ?></label>
<input id="iOutServer" type="text" name="settings_<?= SettingsEnum::MAIL_SERVER_OUT; ?>" value="<?= $this->printHtml($generalSettings[SettingsEnum::MAIL_SERVER_OUT]->content); ?>">
</div>
<div class="form-group">
<label for="iLogPath"><?= $this->getHtml('LogPath'); ?></label>
<input id="iLogPath" name="settings_1000000007" type="text" value="<?= $this->printHtml($generalSettings['1000000007']->content); ?>" placeholder="/Logs">
<label for="iOutPort"><?= $this->getHtml('OutPort'); ?></label>
<input id="iOutPort" type="text" name="settings_<?= SettingsEnum::MAIL_SERVER_PORT_OUT; ?>" value="<?= $this->printHtml($generalSettings[SettingsEnum::MAIL_SERVER_PORT_OUT]->content); ?>">
</div>
<div class="form-group">
<label for="iInServer"><?= $this->getHtml('InServer'); ?></label>
<input id="iInServer" type="text" name="settings_<?= SettingsEnum::MAIL_SERVER_IN; ?>" value="<?= $this->printHtml($generalSettings[SettingsEnum::MAIL_SERVER_IN]->content); ?>">
</div>
<div class="form-group">
<label for="iInPort"><?= $this->getHtml('InPort'); ?></label>
<input id="iInPort" type="text" name="settings_<?= SettingsEnum::MAIL_SERVER_PORT_IN; ?>" value="<?= $this->printHtml($generalSettings[SettingsEnum::MAIL_SERVER_PORT_IN]->content); ?>">
</div>
<div class="form-group">
<label for="iEmailType"><?= $this->getHtml('EmailType'); ?></label>
<select id="iEmailType" name="settings_<?= SettingsEnum::MAIL_SERVER_TYPE; ?>">
<?php foreach ($mailServerModes as $mode) : ?>
<option value="<?= $this->printHtml((string) $mode); ?>"<?= $mode === $generalSettings[SettingsEnum::MAIL_SERVER_TYPE]->content ? ' selected' : ''; ?>><?= $this->printHtml($mode); ?>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label for="iEmailUsername"><?= $this->getHtml('EmailUsername'); ?></label>
<input id="iEmailUsername" type="text" name="settings_<?= SettingsEnum::MAIL_SERVER_USER; ?>" value="<?= $this->printHtml($generalSettings[SettingsEnum::MAIL_SERVER_USER]->content); ?>">
</div>
<div class="form-group">
<label for="iEmailPassword"><?= $this->getHtml('EmailPassword'); ?></label>
<input id="iEmailPassword" type="password" name="settings_<?= SettingsEnum::MAIL_SERVER_PASS; ?>" value="<?= $this->printHtml($generalSettings[SettingsEnum::MAIL_SERVER_PASS]->content); ?>">
</div>
<div class="form-group">
<label for="iEmailAddress"><?= $this->getHtml('EmailAddress'); ?></label>
<input id="iEmailAddress" type="text" name="settings_<?= SettingsEnum::MAIL_SERVER_ADDR; ?>" value="<?= $this->printHtml($generalSettings[SettingsEnum::MAIL_SERVER_ADDR]->content); ?>">
</div>
</div>
<div class="portlet-foot">
<input id="iSubmitGeneral" name="submitGeneral" type="submit" value="<?= $this->getHtml('Save', '0', '0'); ?>">
<input type="hidden" name="module" value="Admin">
<input id="iSubmitEmail" name="submitEmail" type="submit" value="<?= $this->getHtml('Save', '0', '0'); ?>">
</div>
</form>
</section>
</div>
</div>
</div>
<input type="radio" id="c-tab-2" name="tabular-2"<?= $this->request->uri->fragment === 'c-tab-2' ? ' checked' : ''; ?>>
<div class="tab">
<div class="row">
<div class="col-xs-12 col-md-4">
<section class="portlet">
<form id="fLocalization"
name="fLocalization"
action="<?= UriFactory::build('{/api}profile/settings/localization?csrf={$CSRF}'); ?>"
method="post">
<div class="portlet-head"><?= $this->getHtml('Localization'); ?></div>
<div class="portlet-body">
<div class="form-group">
<label for="iDefaultLocalizations"><?= $this->getHtml('Defaults'); ?></label>
<div class="ipt-wrap wf-100">
<div class="ipt-first"><select id="iDefaultLocalizations" name="localization_load">
<option selected disabled><?= $this->getHtml('Customized'); ?>
<?php foreach ($l11nDefinitions as $def) : ?>
<option value="<?= $this->printHtml(\explode('.', $def)[0]); ?>"><?= $this->printHtml(\explode('.', $def)[0]); ?>
<?php endforeach; ?>
</select>
</div>
<div class="ipt-second"><input type="submit" name="loadDefaultLocalization" formaction="<?= UriFactory::build('{/api}profile/settings/localization?load=1&csrf={$CSRF}'); ?>" value="<?= $this->getHtml('Load'); ?>"></div>
</div>
</div>
<div class="form-group">
<label for="iCountries"><?= $this->getHtml('Country'); ?></label>
<select id="iCountries" name="settings_country">
<?php foreach ($countryCodes as $code3 => $code2) : ?>
<option value="<?= $this->printHtml($code2); ?>"<?= $this->printHtml($code2 === $l11n->country ? ' selected' : ''); ?>><?= $this->printHtml($countries[$code3]); ?>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label for="iLanguages"><?= $this->getHtml('Language'); ?></label>
<select id="iLanguages" name="settings_language">
<?php foreach ($languages as $code => $language) : $code = \strtolower(\substr($code, 1)); ?>
<option value="<?= $this->printHtml($code); ?>"<?= $this->printHtml($code === $l11n->language ? ' selected' : ''); ?>><?= $this->printHtml($language); ?>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label for="iTemperature"><?= $this->getHtml('Temperature'); ?></label>
<select id="iTemperature" name="settings_temperature">
<?php foreach ($temperatures as $temperature) : ?>
<option value="<?= $this->printHtml($temperature); ?>"<?= $this->printHtml($temperature === $l11n->getTemperature() ? ' selected' : ''); ?>><?= $this->printHtml($temperature); ?>
<?php endforeach; ?>
</select>
</div>
</div>
<div class="portlet-foot">
<input id="iSubmitLocalization" name="submitLocalization" type="submit" value="<?= $this->getHtml('Save', '0', '0'); ?>">
</div>
</form>
</section>
</div>
<div class="col-xs-12 col-md-4">
<div id="settings-localization-time" class="portlet">
<div class="portlet-head"><?= $this->getHtml('Time'); ?></div>
<div class="portlet-body">
<div class="form-group">
<label for="iTimezones"><?= $this->getHtml('Timezone'); ?></label>
<select form="fLocalization" id="iTimezones" name="settings_timezone">
<?php foreach ($timezones as $timezone) : ?>
<option value="<?= $this->printHtml($timezone); ?>"<?= $this->printHtml($timezone === $l11n->getTimezone() ? ' selected' : ''); ?>><?= $this->printHtml($timezone); ?>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label for="iTimeformatVeryShort"><?= $this->getHtml('VeryShort'); ?></label>
<input form="fLocalization" id="iTimeformatVeryShort" name="settings_timeformat_vs" type="text" value="<?= $this->printHtml($l11n->getDatetime()['very_short']); ?>" placeholder="Y" required>
</div>
<h2><?= $this->getHtml('Timeformat'); ?></h2>
<div class="form-group">
<label for="iTimeformatShort"><?= $this->getHtml('Short'); ?></label>
<input form="fLocalization" id="iTimeformatShort" name="settings_timeformat_s" type="text" value="<?= $this->printHtml($l11n->getDatetime()['short']); ?>" placeholder="Y" required>
</div>
<div class="form-group">
<label for="iTimeformatMedium"><?= $this->getHtml('Medium'); ?></label>
<input form="fLocalization" id="iTimeformatMedium" name="settings_timeformat_m" type="text" value="<?= $this->printHtml($l11n->getDatetime()['medium']); ?>" placeholder="Y" required>
</div>
<div class="form-group">
<label for="iTimeformatLong"><?= $this->getHtml('Long'); ?></label>
<input form="fLocalization" id="iTimeformatLong" name="settings_timeformat_l" type="text" value="<?= $this->printHtml($l11n->getDatetime()['long']); ?>" placeholder="Y" required>
</div>
<div class="form-group">
<label for="iTimeformatVeryLong"><?= $this->getHtml('VeryLong'); ?></label>
<input form="fLocalization" id="iTimeformatVeryLong" name="settings_timeformat_vl" type="text" value="<?= $this->printHtml($l11n->getDatetime()['very_long']); ?>" placeholder="Y" required>
</div>
</div>
</div>
</div>
<div class="col-xs-12 col-md-4">
<div id="settings-localization-numeric" class="portlet">
<div class="portlet-head"><?= $this->getHtml('Numeric'); ?></div>
<div class="portlet-body">
<div class="form-group">
<label for="iCurrencies"><?= $this->getHtml('Currency'); ?></label>
<select form="fLocalization" id="iCurrencies" name="settings_currency">
<?php foreach ($currencies as $code => $currency) : $code = \substr($code, 1); ?>
<option value="<?= $this->printHtml($code); ?>"<?= $this->printHtml($code === $l11n->currency ? ' selected' : ''); ?>><?= $this->printHtml($currency); ?>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label><?= $this->getHtml('Currencyformat'); ?></label>
<select form="fLocalization" name="settings_currencyformat">
<option value="0"<?= $this->printHtml($l11n->getCurrencyFormat() === '0' ? ' selected' : ''); ?>><?= $this->getHtml('Amount') , ' ' , $this->printHtml($l11n->currency); ?>
<option value="1"<?= $this->printHtml($l11n->getCurrencyFormat() === '1' ? ' selected' : ''); ?>><?= $this->printHtml($l11n->currency) , ' ' , $this->getHtml('Amount'); ?>
</select>
</div>
<h2><?= $this->getHtml('Numberformat'); ?></h2>
<div class="form-group">
<div class="input-control">
<label for="iDecimalPoint"><?= $this->getHtml('DecimalPoint'); ?></label>
<input form="fLocalization" id="iDecimalPoint" name="settings_decimal" type="text" value="<?= $this->printHtml($l11n->getDecimal()); ?>" placeholder="." required>
</div>
<div class="input-control">
<label for="iThousandSep"><?= $this->getHtml('ThousandsSeparator'); ?></label>
<input form="fLocalization" id="iThousandSep" name="settings_thousands" type="text" value="<?= $this->printHtml($l11n->getThousands()); ?>" placeholder="," required>
</div>
</div>
</div>
</div>
</div>
<div class="col-xs-12 col-md-4">
<div id="settings-localization-precision" class="portlet">
<div class="portlet-head"><?= $this->getHtml('Precision'); ?></div>
<div class="portlet-body">
<div class="form-group">
<label for="iPrecisionVeryShort"><?= $this->getHtml('VeryShort'); ?></label>
<input form="fLocalization" id="iPrecisionVeryShort" name="settings_precision_vs" value="<?= $l11n->getPrecision()['very_short']; ?>" type="number">
</div>
<div class="form-group">
<label for="iPrecisionShort"><?= $this->getHtml('Short'); ?></label>
<input form="fLocalization" id="iPrecisionLight" name="settings_precision_s" value="<?= $l11n->getPrecision()['short']; ?>" type="number">
</div>
<div class="form-group">
<label for="iPrecisionMedium"><?= $this->getHtml('Medium'); ?></label>
<input form="fLocalization" id="iPrecisionMedium" name="settings_precision_m" value="<?= $l11n->getPrecision()['medium']; ?>" type="number">
</div>
<div class="form-group">
<label for="iPrecisionLong"><?= $this->getHtml('Long'); ?></label>
<input form="fLocalization" id="iPrecisionLong" name="settings_precision_l" value="<?= $l11n->getPrecision()['long']; ?>" type="number">
</div>
<div class="form-group">
<label for="iPrecisionVeryLong"><?= $this->getHtml('VeryLong'); ?></label>
<input form="fLocalization" id="iPrecisionVeryLong" name="settings_precision_vl" value="<?= $l11n->getPrecision()['very_long']; ?>" type="number">
</div>
</div>
</div>
</div>
<div class="col-xs-12 col-md-4">
<div id="settings-localization-weight" class="portlet">
<div class="portlet-head"><?= $this->getHtml('Weight'); ?></div>
<div class="portlet-body">
<div class="form-group">
<label for="iWeightVeryLight"><?= $this->getHtml('VeryLight'); ?></label>
<select form="fLocalization" id="iWeightVeryLight" name="settings_weight_vl">
<?php foreach ($weights as $code => $weight) : ?>
<option value="<?= $this->printHtml($weight); ?>"<?= $this->printHtml($weight === $l11n->getWeight()['very_light'] ? ' selected' : ''); ?>><?= $this->printHtml($weight); ?>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label for="iWeightLight"><?= $this->getHtml('Light'); ?></label>
<select form="fLocalization" id="iWeightLight" name="settings_weight_l">
<?php foreach ($weights as $code => $weight) : ?>
<option value="<?= $this->printHtml($weight); ?>"<?= $this->printHtml($weight === $l11n->getWeight()['light'] ? ' selected' : ''); ?>><?= $this->printHtml($weight); ?>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label for="iWeightMedium"><?= $this->getHtml('Medium'); ?></label>
<select form="fLocalization" id="iWeightMedium" name="settings_weight_m">
<?php foreach ($weights as $code => $weight) : ?>
<option value="<?= $this->printHtml($weight); ?>"<?= $this->printHtml($weight === $l11n->getWeight()['medium'] ? ' selected' : ''); ?>><?= $this->printHtml($weight); ?>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label for="iWeightHeavy"><?= $this->getHtml('Heavy'); ?></label>
<select form="fLocalization" id="iWeightHeavy" name="settings_weight_h">
<?php foreach ($weights as $code => $weight) : ?>
<option value="<?= $this->printHtml($weight); ?>"<?= $this->printHtml($weight === $l11n->getWeight()['heavy'] ? ' selected' : ''); ?>><?= $this->printHtml($weight); ?>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label for="iWeightVeryHeavy"><?= $this->getHtml('VeryHeavy'); ?></label>
<select form="fLocalization" id="iWeightVeryHeavy" name="settings_weight_vh">
<?php foreach ($weights as $code => $weight) : ?>
<option value="<?= $this->printHtml($weight); ?>"<?= $this->printHtml($weight === $l11n->getWeight()['very_heavy'] ? ' selected' : ''); ?>><?= $this->printHtml($weight); ?>
<?php endforeach; ?>
</select>
</div>
</div>
</div>
</div>
<div class="col-xs-12 col-md-4">
<div id="settings-localization-speed" class="portlet">
<div class="portlet-head"><?= $this->getHtml('Speed'); ?></div>
<div class="portlet-body">
<div class="form-group">
<label for="iSpeedVerySlow"><?= $this->getHtml('VerySlow'); ?></label>
<select form="fLocalization" id="iSpeedVerySlow" name="settings_speed_vs">
<?php foreach ($speeds as $code => $speed) : ?>
<option value="<?= $this->printHtml($speed); ?>"<?= $this->printHtml($speed === $l11n->getSpeed()['very_slow'] ? ' selected' : ''); ?>><?= $this->printHtml($speed); ?>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label for="iSpeedSlow"><?= $this->getHtml('Slow'); ?></label>
<select form="fLocalization" id="iSpeedSlow" name="settings_speed_s">
<?php foreach ($speeds as $code => $speed) : ?>
<option value="<?= $this->printHtml($speed); ?>"<?= $this->printHtml($speed === $l11n->getSpeed()['slow'] ? ' selected' : ''); ?>><?= $this->printHtml($speed); ?>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label for="iSpeedMedium"><?= $this->getHtml('Medium'); ?></label>
<select form="fLocalization" id="iSpeedMedium" name="settings_speed_m">
<?php foreach ($speeds as $code => $speed) : ?>
<option value="<?= $this->printHtml($speed); ?>"<?= $this->printHtml($speed === $l11n->getSpeed()['medium'] ? ' selected' : ''); ?>><?= $this->printHtml($speed); ?>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label for="iSpeedFast"><?= $this->getHtml('Fast'); ?></label>
<select form="fLocalization" id="iSpeedFast" name="settings_speed_f">
<?php foreach ($speeds as $code => $speed) : ?>
<option value="<?= $this->printHtml($speed); ?>"<?= $this->printHtml($speed === $l11n->getSpeed()['fast'] ? ' selected' : ''); ?>><?= $this->printHtml($speed); ?>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label for="iSpeedVeryFast"><?= $this->getHtml('VeryFast'); ?></label>
<select form="fLocalization" id="iSpeedVeryFast" name="settings_speed_vf">
<?php foreach ($speeds as $code => $speed) : ?>
<option value="<?= $this->printHtml($speed); ?>"<?= $this->printHtml($speed === $l11n->getSpeed()['very_fast'] ? ' selected' : ''); ?>><?= $this->printHtml($speed); ?>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label for="iSpeedSea"><?= $this->getHtml('Sea'); ?></label>
<select form="fLocalization" id="iSpeedSea" name="settings_speed_sea">
<?php foreach ($speeds as $code => $speed) : ?>
<option value="<?= $this->printHtml($speed); ?>"<?= $this->printHtml($speed === $l11n->getSpeed()['sea'] ? ' selected' : ''); ?>><?= $this->printHtml($speed); ?>
<?php endforeach; ?>
</select>
</div>
</div>
</div>
</div>
<div class="col-xs-12 col-md-4">
<div id="settings-localization-length" class="portlet">
<div class="portlet-head"><?= $this->getHtml('Length'); ?></div>
<div class="portlet-body">
<div class="form-group">
<label for="iLengthVeryShort"><?= $this->getHtml('VeryShort'); ?></label>
<select form="fLocalization" id="iLengthVeryShort" name="settings_length_vs">
<?php foreach ($lengths as $code => $length) : ?>
<option value="<?= $this->printHtml($length); ?>"<?= $this->printHtml($length === $l11n->getLength()['very_short'] ? ' selected' : ''); ?>><?= $this->printHtml($length); ?>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label for="iLengthShort"><?= $this->getHtml('Short'); ?></label>
<select form="fLocalization" id="iLengthShort" name="settings_length_s">
<?php foreach ($lengths as $code => $length) : ?>
<option value="<?= $this->printHtml($length); ?>"<?= $this->printHtml($length === $l11n->getLength()['short'] ? ' selected' : ''); ?>><?= $this->printHtml($length); ?>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label for="iLengthMedium"><?= $this->getHtml('Medium'); ?></label>
<select form="fLocalization" id="iLengthMedium" name="settings_length_m">
<?php foreach ($lengths as $code => $length) : ?>
<option value="<?= $this->printHtml($length); ?>"<?= $this->printHtml($length === $l11n->getLength()['medium'] ? ' selected' : ''); ?>><?= $this->printHtml($length); ?>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label for="iLengthLong"><?= $this->getHtml('Long'); ?></label>
<select form="fLocalization" id="iLengthLong" name="settings_length_l">
<?php foreach ($lengths as $code => $length) : ?>
<option value="<?= $this->printHtml($length); ?>"<?= $this->printHtml($length === $l11n->getLength()['long'] ? ' selected' : ''); ?>><?= $this->printHtml($length); ?>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label for="iLengthVeryLong"><?= $this->getHtml('VeryLong'); ?></label>
<select form="fLocalization" id="iLengthVeryLong" name="settings_length_vl">
<?php foreach ($lengths as $code => $length) : ?>
<option value="<?= $this->printHtml($length); ?>"<?= $this->printHtml($length === $l11n->getLength()['very_long'] ? ' selected' : ''); ?>><?= $this->printHtml($length); ?>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label for="iLengthSea"><?= $this->getHtml('Sea'); ?></label>
<select form="fLocalization" id="iLengthSea" name="settings_length_sea">
<?php foreach ($lengths as $code => $length) : ?>
<option value="<?= $this->printHtml($length); ?>"<?= $this->printHtml($length === $l11n->getLength()['sea'] ? ' selected' : ''); ?>><?= $this->printHtml($length); ?>
<?php endforeach; ?>
</select>
</div>
</div>
</div>
</div>
<div class="col-xs-12 col-md-4">
<div id="settings-localization-area" class="portlet">
<div class="portlet-head"><?= $this->getHtml('Area'); ?></div>
<div class="portlet-body">
<div class="form-group">
<label for="iAreaVerySmall"><?= $this->getHtml('VerySmall'); ?></label>
<select form="fLocalization" id="iAreaVerySmall" name="settings_area_vs">
<?php foreach ($areas as $code => $area) : ?>
<option value="<?= $this->printHtml($area); ?>"<?= $this->printHtml($area === $l11n->getArea()['very_small'] ? ' selected' : ''); ?>><?= $this->printHtml($area); ?>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label for="iAreaSmall"><?= $this->getHtml('Small'); ?></label>
<select form="fLocalization" id="iAreaSmall" name="settings_area_s">
<?php foreach ($areas as $code => $area) : ?>
<option value="<?= $this->printHtml($area); ?>"<?= $this->printHtml($area === $l11n->getArea()['small'] ? ' selected' : ''); ?>><?= $this->printHtml($area); ?>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label for="iAreaMedium"><?= $this->getHtml('Medium'); ?></label>
<select form="fLocalization" id="iAreaMedium" name="settings_area_m">
<?php foreach ($areas as $code => $area) : ?>
<option value="<?= $this->printHtml($area); ?>"<?= $this->printHtml($area === $l11n->getArea()['medium'] ? ' selected' : ''); ?>><?= $this->printHtml($area); ?>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label for="iAreaLarge"><?= $this->getHtml('Large'); ?></label>
<select form="fLocalization" id="iAreaLarge" name="settings_area_l">
<?php foreach ($areas as $code => $area) : ?>
<option value="<?= $this->printHtml($area); ?>"<?= $this->printHtml($area === $l11n->getArea()['large'] ? ' selected' : ''); ?>><?= $this->printHtml($area); ?>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label for="iAreaVeryLarge"><?= $this->getHtml('VeryLarge'); ?></label>
<select form="fLocalization" id="iAreaVeryLarge" name="settings_area_vl">
<?php foreach ($areas as $code => $area) : ?>
<option value="<?= $this->printHtml($area); ?>"<?= $this->printHtml($area === $l11n->getArea()['very_large'] ? ' selected' : ''); ?>><?= $this->printHtml($area); ?>
<?php endforeach; ?>
</select>
</div>
</div>
</div>
</div>
<div class="col-xs-12 col-md-4">
<div id="settings-localization-volume" class="portlet">
<div class="portlet-head"><?= $this->getHtml('Volume'); ?></div>
<div class="portlet-body">
<div class="form-group">
<label for="iVolumeVerySmall"><?= $this->getHtml('VerySmall'); ?></label>
<select form="fLocalization" id="iVolumeVerySmall" name="settings_volume_vs">
<?php foreach ($volumes as $code => $volume) : ?>
<option value="<?= $this->printHtml($volume); ?>"<?= $this->printHtml($volume === $l11n->getVolume()['very_small'] ? ' selected' : ''); ?>><?= $this->printHtml($volume); ?>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label for="iVolumeSmall"><?= $this->getHtml('Small'); ?></label>
<select form="fLocalization" id="iVolumeSmall" name="settings_volume_s">
<?php foreach ($volumes as $code => $volume) : ?>
<option value="<?= $this->printHtml($volume); ?>"<?= $this->printHtml($volume === $l11n->getVolume()['small'] ? ' selected' : ''); ?>><?= $this->printHtml($volume); ?>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label for="iVolumeMedium"><?= $this->getHtml('Medium'); ?></label>
<select form="fLocalization" id="iVolumeMedium" name="settings_volume_m">
<?php foreach ($volumes as $code => $volume) : ?>
<option value="<?= $this->printHtml($volume); ?>"<?= $this->printHtml($volume === $l11n->getVolume()['medium'] ? ' selected' : ''); ?>><?= $this->printHtml($volume); ?>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label for="iVolumeLarge"><?= $this->getHtml('Large'); ?></label>
<select form="fLocalization" id="iVolumeLarge" name="settings_volume_l">
<?php foreach ($volumes as $code => $volume) : ?>
<option value="<?= $this->printHtml($volume); ?>"<?= $this->printHtml($volume === $l11n->getVolume()['large'] ? ' selected' : ''); ?>><?= $this->printHtml($volume); ?>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label for="iVolumeVeryLarge"><?= $this->getHtml('VeryLarge'); ?></label>
<select form="fLocalization" id="iVolumeVeryLarge" name="settings_volume_vl">
<?php foreach ($volumes as $code => $volume) : ?>
<option value="<?= $this->printHtml($volume); ?>"<?= $this->printHtml($volume === $l11n->getVolume()['very_large'] ? ' selected' : ''); ?>><?= $this->printHtml($volume); ?>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label for="iVolumeTeaspoon"><?= $this->getHtml('Teaspoon'); ?></label>
<select form="fLocalization" id="iVolumeTeaspoon" name="settings_volume_teaspoon">
<?php foreach ($volumes as $code => $volume) : ?>
<option value="<?= $this->printHtml($volume); ?>"<?= $this->printHtml($volume === $l11n->getVolume()['teaspoon'] ? ' selected' : ''); ?>><?= $this->printHtml($volume); ?>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label for="iVolumeTablespoon"><?= $this->getHtml('Tablespoon'); ?></label>
<select form="fLocalization" id="iVolumeTablespoon" name="settings_volume_tablespoon">
<?php foreach ($volumes as $code => $volume) : ?>
<option value="<?= $this->printHtml($volume); ?>"<?= $this->printHtml($volume === $l11n->getVolume()['tablespoon'] ? ' selected' : ''); ?>><?= $this->printHtml($volume); ?>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label for="iVolumeGlass"><?= $this->getHtml('Glass'); ?></label>
<select form="fLocalization" id="iVolumeGlass" name="settings_volume_glass">
<?php foreach ($volumes as $code => $volume) : ?>
<option value="<?= $this->printHtml($volume); ?>"<?= $this->printHtml($volume === $l11n->getVolume()['glass'] ? ' selected' : ''); ?>><?= $this->printHtml($volume); ?>
<?php endforeach; ?>
</select>
</div>
</div>
</div>
</div>
</div>
<?= include __DIR__ . "/../../../../Theme/Backend/Components/Localization/l11n-view.tpl.php"; ?>
</div>
<input type="radio" id="c-tab-3"
name="tabular-2"<?= $this->request->uri->fragment === 'c-tab-3' ? ' checked' : ''; ?>>
@ -695,140 +242,7 @@ echo $this->data['nav']->render();
<input type="radio" id="c-tab-5"
name="tabular-2"<?= $this->request->uri->fragment === 'c-tab-5' ? ' checked' : ''; ?>>
<div class="tab">
<div class="col-xs-12">
<section class="portlet">
<div class="portlet-head"><?= $this->getHtml('Settings'); ?><i class="g-icon download btn end-xs">download</i></div>
<div class="slider">
<table id="settingsList" class="default sticky">
<thead>
<tr>
<td>
<td><?= $this->getHtml('ID', '0', '0'); ?>
<label for="settingsList-sort-1">
<input type="radio" name="settingsList-sort" id="settingsList-sort-1">
<i class="sort-asc g-icon">expand_less</i>
</label>
<label for="settingsList-sort-2">
<input type="radio" name="settingsList-sort" id="settingsList-sort-2">
<i class="sort-desc g-icon">expand_more</i>
</label>
<label>
<i class="filter g-icon">filter_alt</i>
</label>
<td><?= $this->getHtml('Name'); ?>
<label for="settingsList-sort-3">
<input type="radio" name="settingsList-sort" id="settingsList-sort-3">
<i class="sort-asc g-icon">expand_less</i>
</label>
<label for="settingsList-sort-4">
<input type="radio" name="settingsList-sort" id="settingsList-sort-4">
<i class="sort-desc g-icon">expand_more</i>
</label>
<label>
<i class="filter g-icon">filter_alt</i>
</label>
<td class="wf-100"><?= $this->getHtml('Value'); ?>
<td><?= $this->getHtml('Unit'); ?>
<label for="settingsList-sort-5">
<input type="radio" name="settingsList-sort" id="settingsList-sort-5">
<i class="sort-asc g-icon">expand_less</i>
</label>
<label for="settingsList-sort-6">
<input type="radio" name="settingsList-sort" id="settingsList-sort-6">
<i class="sort-desc g-icon">expand_more</i>
</label>
<label>
<i class="filter g-icon">filter_alt</i>
</label>
<td><?= $this->getHtml('App'); ?>
<label for="settingsList-sort-5">
<input type="radio" name="settingsList-sort" id="settingsList-sort-5">
<i class="sort-asc g-icon">expand_less</i>
</label>
<label for="settingsList-sort-6">
<input type="radio" name="settingsList-sort" id="settingsList-sort-6">
<i class="sort-desc g-icon">expand_more</i>
</label>
<label>
<i class="filter g-icon">filter_alt</i>
</label>
<td><?= $this->getHtml('Module'); ?>
<label for="settingsList-sort-5">
<input type="radio" name="settingsList-sort" id="settingsList-sort-5">
<i class="sort-asc g-icon">expand_less</i>
</label>
<label for="settingsList-sort-6">
<input type="radio" name="settingsList-sort" id="settingsList-sort-6">
<i class="sort-desc g-icon">expand_more</i>
</label>
<label>
<i class="filter g-icon">filter_alt</i>
</label>
<td><?= $this->getHtml('Group'); ?>
<label for="settingsList-sort-7">
<input type="radio" name="settingsList-sort" id="settingsList-sort-7">
<i class="sort-asc g-icon">expand_less</i>
</label>
<label for="settingsList-sort-8">
<input type="radio" name="settingsList-sort" id="settingsList-sort-8">
<i class="sort-desc g-icon">expand_more</i>
</label>
<label>
<i class="filter g-icon">filter_alt</i>
</label>
<td><?= $this->getHtml('Account'); ?>
<label for="settingsList-sort-9">
<input type="radio" name="settingsList-sort" id="settingsList-sort-9">
<i class="sort-asc g-icon">expand_less</i>
</label>
<label for="settingsList-sort-10">
<input type="radio" name="settingsList-sort" id="settingsList-sort-10">
<i class="sort-desc g-icon">expand_more</i>
</label>
<label>
<i class="filter g-icon">filter_alt</i>
</label>
<tbody>
<?php $count = 0;
$previousSettings = empty($settings) ? 'admin/settings/general?csrf={$CSRF}' : 'admin/settings/general?{?}&sid=' . \reset($settings)->id . '&ptype=p';
$nextSettings = empty($settings) ? 'admin/settings/general?csrf={$CSRF}' : 'admin/settings/general?{?}&sid=' . \end($settings)->id . '&ptype=n';
foreach ($settings as $key => $setting) : ++$count;
?>
<tr tabindex="0">
<td><i class="g-icon">settings</i>
<td data-label="<?= $this->getHtml('ID', '0', '0'); ?>"><?= $setting->id; ?>
<td data-label="<?= $this->getHtml('Name'); ?>">
<?php
$name = $setting->name;
if ($this->getData('settings_class') !== null) {
$name = $this->getData('settings_class')::getName($setting->name);
if (!\is_string($name)) {
$name = $setting->name;
}
}
?>
<?= $this->printHtml($name); ?>
<td data-label="<?= $this->getHtml('Value'); ?>"><?= $this->printHtml((string) $setting->content); ?>
<td data-label="<?= $this->getHtml('Unit'); ?>"><?= $this->printHtml((string) $setting->unit); ?>
<td data-label="<?= $this->getHtml('App'); ?>"><?= $this->printHtml((string) $setting->app); ?>
<td data-label="<?= $this->getHtml('Module'); ?>"><?= $this->printHtml($setting->module); ?>
<td data-label="<?= $this->getHtml('Group'); ?>"><?= $this->printHtml((string) $setting->group); ?>
<td data-label="<?= $this->getHtml('Account'); ?>"><?= $this->printHtml((string) $setting->account); ?>
<?php endforeach; ?>
<?php if ($count === 0) : ?>
<tr><td colspan="9" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
<?php endif; ?>
</table>
</div>
<div class="portlet-foot">
<a tabindex="0" class="button" href="<?= UriFactory::build($previousSettings); ?>"><?= $this->getHtml('Previous', '0', '0'); ?></a>
<a tabindex="0" class="button" href="<?= UriFactory::build($nextSettings); ?>"><?= $this->getHtml('Next', '0', '0'); ?></a>
</div>
</section>
</div>
<?php include __DIR__ . '/../../../../Theme/Backend/settings.tpl.php'; ?>
</div>
</div>
</div>

View File

@ -89,6 +89,7 @@ use phpOMS\Utils\RnG\StringUtils as StringRng;
use phpOMS\Utils\StringUtils;
use phpOMS\Validation\Network\Email as EmailValidator;
use phpOMS\Version\Version;
use Modules\Media\Models\UploadStatus;
/**
* Admin controller class.
@ -661,6 +662,18 @@ final class ApiController extends Controller
public function apiSettingsSet(RequestAbstract $request, ResponseAbstract $response, array $data = []) : void
{
$dataSettings = $request->getDataJson('settings');
if (empty($dataSettings)) {
$tmp = $request->getLike('settings_(.*)');
foreach ($tmp as $idx => $value) {
$name = \substr($idx, 9);
$dataSettings[$name] = [
'name' => $name,
'content' => $value,
'app' => $request->getDataInt('app'),
'unit' => $request->getDataInt('unit'),
];
}
}
foreach ($dataSettings as $data) {
$id = isset($data['id']) && !empty($data['id']) ? (int) $data['id'] : null;
@ -676,7 +689,12 @@ final class ApiController extends Controller
/** @var \Model\Setting $old */
$old = $this->app->appSettings->get($id, $name, $unit, $app, $module, $group, $account);
if ($old->id === 0) {
if ($old === false || $old->id === 0) {
continue;
/*
// @todo There might be situations where we want to create the setting if it doesn't exist?!
// Maybe we should require a flag in the request in such a case?!
$internalResponse = new HttpResponse();
$internalRequest = new HttpRequest($request->uri);
@ -693,17 +711,20 @@ final class ApiController extends Controller
$internalRequest->setData('encrypted', $encrypted);
$this->apiSettingsCreate($internalRequest, $internalResponse, $data);
*/
continue;
}
$new = clone $old;
$new->name = $name ?? $new->name;
$new->name = $name ?? $new->name;
// @question Do we want to allow changes in encryption?!
$new->isEncrypted = $encrypted ?? $new->isEncrypted;
$new->content = $new->isEncrypted && !empty($content) && !empty($_SERVER['OMS_PRIVATE_KEY_I'] ?? '')
? EncryptionHelper::encryptShared($content, $_SERVER['OMS_PRIVATE_KEY_I'])
: $content ?? $new->content;
: ($content ?? $new->content);
$new->unit = $unit ?? $new->unit;
$new->app = $app ?? $new->app;
$new->module = $module ?? $new->module;
@ -899,17 +920,21 @@ final class ApiController extends Controller
*/
public function apiSettingsAccountLocalizationSet(RequestAbstract $request, ResponseAbstract $response, array $data = []) : void
{
$requestAccount = $request->header->account;
$accountId = (int) $request->getData('account_id');
/** @var \Modules\Admin\Models\Account $account */
$account = AccountMapper::get()
->with('l11n')
->where('l11n/id', (int) $request->getData('id'))
->execute();
if ($requestAccount !== $accountId
&& !$this->app->accountManager->get($accountId)->hasPermission(
$requestAccount = $request->header->account;
if ($requestAccount !== $account->id
&& !$this->app->accountManager->get($account->id)->hasPermission(
PermissionType::MODIFY,
$this->app->unitId,
$this->app->appId,
self::NAME,
PermissionCategory::ACCOUNT_SETTINGS,
$accountId
$account->id
)
) {
$this->fillJsonResponse($request, $response, NotificationLevel::HIDDEN, '', '', []);
@ -918,34 +943,36 @@ final class ApiController extends Controller
return;
}
/** @var \Modules\Admin\Models\Account $account */
$account = AccountMapper::get()
->with('l11n')
->where('id', $accountId)
->execute();
if ($account->l11n->id === 0) {
$l11n = LocalizationMapper::get()
->where('id', (int) $request->getData('id'))
->execute();
} else {
$l11n = $account->l11n;
}
if (($request->getDataString('localization_load') ?? '-1') !== '-1') {
$locale = \explode('_', $request->getDataString('localization_load') ?? '');
$old = clone $account->l11n;
$old = clone $l11n;
$account->l11n->loadFromLanguage($locale[0], $locale[1]);
$l11n->loadFromLanguage($locale[0], $locale[1]);
$this->updateModel($request->header->account, $old, $account->l11n, LocalizationMapper::class, 'l11n', $request->getOrigin());
$this->createStandardUpdateResponse($request, $response, $account->l11n);
$this->updateModel($request->header->account, $old, $l11n, LocalizationMapper::class, 'l11n', $request->getOrigin());
$this->createStandardUpdateResponse($request, $response, $l11n);
return;
}
$old = clone $account->l11n;
$old = clone $l11n;
$dataSettings = $request->getLike('settings_(.*)');
$account->l11n->setCountry($dataSettings['settings_country']);
$account->l11n->language = $dataSettings['settings_language'];
$account->l11n->setTemperature($dataSettings['settings_temperature']);
$l11n->setCountry($dataSettings['settings_country']);
$l11n->language = $dataSettings['settings_language'];
$l11n->setTemperature($dataSettings['settings_temperature']);
$account->l11n->setTimezone($dataSettings['settings_timezone']);
$account->l11n->setDatetime(
$l11n->setTimezone($dataSettings['settings_timezone']);
$l11n->setDatetime(
[
'very_short' => $dataSettings['settings_timeformat_vs'],
'short' => $dataSettings['settings_timeformat_s'],
@ -955,13 +982,13 @@ final class ApiController extends Controller
]
);
$account->l11n->currency = $dataSettings['settings_currency'];
$account->l11n->setCurrencyFormat($dataSettings['settings_currencyformat']);
$l11n->currency = $dataSettings['settings_currency'];
$l11n->setCurrencyFormat($dataSettings['settings_currencyformat']);
$account->l11n->setDecimal($dataSettings['settings_decimal']);
$account->l11n->setThousands($dataSettings['settings_thousands']);
$l11n->setDecimal($dataSettings['settings_decimal']);
$l11n->setThousands($dataSettings['settings_thousands']);
$account->l11n->setPrecision(
$l11n->setPrecision(
[
'very_short' => $dataSettings['settings_precision_vs'],
'short' => $dataSettings['settings_precision_s'],
@ -971,7 +998,7 @@ final class ApiController extends Controller
]
);
$account->l11n->setWeight(
$l11n->setWeight(
[
'very_light' => $dataSettings['settings_weight_vl'],
'light' => $dataSettings['settings_weight_l'],
@ -981,7 +1008,7 @@ final class ApiController extends Controller
]
);
$account->l11n->setSpeed(
$l11n->setSpeed(
[
'very_slow' => $dataSettings['settings_speed_vs'],
'slow' => $dataSettings['settings_speed_s'],
@ -992,7 +1019,7 @@ final class ApiController extends Controller
]
);
$account->l11n->setLength(
$l11n->setLength(
[
'very_short' => $dataSettings['settings_length_vs'],
'short' => $dataSettings['settings_length_s'],
@ -1003,7 +1030,7 @@ final class ApiController extends Controller
]
);
$account->l11n->setArea(
$l11n->setArea(
[
'very_small' => $dataSettings['settings_area_vs'],
'small' => $dataSettings['settings_area_s'],
@ -1013,7 +1040,7 @@ final class ApiController extends Controller
]
);
$account->l11n->setVolume(
$l11n->setVolume(
[
'very_small' => $dataSettings['settings_volume_vs'],
'small' => $dataSettings['settings_volume_s'],
@ -1026,8 +1053,8 @@ final class ApiController extends Controller
]
);
$this->updateModel($request->header->account, $old, $account->l11n, LocalizationMapper::class, 'l11n', $request->getOrigin());
$this->createStandardUpdateResponse($request, $response, $account->l11n);
$this->updateModel($request->header->account, $old, $l11n, LocalizationMapper::class, 'l11n', $request->getOrigin());
$this->createStandardUpdateResponse($request, $response, $l11n);
}
/**
@ -1041,16 +1068,29 @@ final class ApiController extends Controller
*
* @api
*
* @todo This should happen in the CMS module since we are modifying a CMS app
*
* @since 1.0.0
*/
public function apiSettingsDesignSet(RequestAbstract $request, ResponseAbstract $response, array $data = []) : void
{
if (!empty($request->files)) {
$upload = new UploadFile();
$upload->preserveFileName = false;
$upload->outputDir = __DIR__ . '/../../../Web/Backend/img';
if (empty($request->files)) {
$response->header->status = RequestStatusCode::R_400;
$status = $upload->upload($request->files, ['logo.png'], true);
$this->createInvalidUpdateResponse($request, $response, []);
return;
}
$upload = new UploadFile();
$upload->preserveFileName = false;
$upload->outputDir = __DIR__ . '/../../../Web/Backend/img';
$status = $upload->upload($request->files, ['logo.png'], true);
if ($status[0]['status'] !== UploadStatus::OK) {
$response->header->status = RequestStatusCode::R_400;
$this->createInvalidUpdateResponse($request, $response, []);
return;
}
$this->createStandardUpdateResponse($request, $response, []);

View File

@ -180,7 +180,7 @@ final class BackendController extends Controller
*
* @since 1.0.0
*/
public function viewAccountSettings(RequestAbstract $request, ResponseAbstract $response, array $data = []) : RenderableInterface
public function viewAccountView(RequestAbstract $request, ResponseAbstract $response, array $data = []) : RenderableInterface
{
$view = new View($this->app->l11nManager, $request, $response);
$view->setTemplate('/Modules/Admin/Theme/Backend/accounts-view');
@ -399,7 +399,7 @@ final class BackendController extends Controller
*
* @since 1.0.0
*/
public function viewGroupSettings(RequestAbstract $request, ResponseAbstract $response, array $data = []) : RenderableInterface
public function viewGroupView(RequestAbstract $request, ResponseAbstract $response, array $data = []) : RenderableInterface
{
$view = new View($this->app->l11nManager, $request, $response);
$view->setTemplate('/Modules/Admin/Theme/Backend/groups-view');
@ -714,9 +714,7 @@ final class BackendController extends Controller
/** @var \Model\Setting[] $settings */
$settings = SettingMapper::getAll()->where('module', $id)->executeGetArray();
if (empty($settings)) {
$view->data['settings'] = $settings;
}
$view->data['settings'] = $settings;
$class = '\\Modules\\' . $request->getData('id') . '\\Models\\SettingsEnum';
if (!Autoloader::exists($class)) {
@ -738,7 +736,13 @@ final class BackendController extends Controller
$generalSettings = $this->app->appSettings->get(
names: [
SettingsEnum::PASSWORD_PATTERN, SettingsEnum::LOGIN_TIMEOUT, SettingsEnum::PASSWORD_INTERVAL, SettingsEnum::PASSWORD_HISTORY, SettingsEnum::LOGIN_TRIES, SettingsEnum::LOGGING_STATUS, SettingsEnum::LOGGING_PATH, SettingsEnum::DEFAULT_UNIT,
SettingsEnum::LOGIN_STATUS, SettingsEnum::MAIL_SERVER_ADDR,
SettingsEnum::LOGIN_STATUS,
SettingsEnum::MAIL_SERVER_OUT, SettingsEnum::MAIL_SERVER_PORT_OUT,
SettingsEnum::MAIL_SERVER_IN, SettingsEnum::MAIL_SERVER_PORT_IN,
SettingsEnum::MAIL_SERVER_TYPE,
SettingsEnum::MAIL_SERVER_USER, SettingsEnum::MAIL_SERVER_PASS,
SettingsEnum::MAIL_SERVER_ADDR,
],
module: 'Admin'
);

View File

@ -21,7 +21,7 @@ $timezones = TimeZoneEnumArray::getConstants();
$timeformats = ISO8601EnumArray::getConstants();
$languages = ISO639Enum::getConstants();
$currencies = ISO4217Enum::getConstants();
$l11nDefinitions = Directory::list(__DIR__ . '/../../../../phpOMS/Localization/Defaults/Definitions');
$l11nDefinitions = Directory::list(__DIR__ . '/../../../../../../phpOMS/Localization/Defaults/Definitions');
$weights = WeightType::getConstants();
$speeds = SpeedType::getConstants();
@ -33,7 +33,7 @@ $temperatures = TemperatureType::getConstants();
<div class="row">
<div class="col-xs-12 col-md-4">
<section class="portlet">
<form id="fLocalization" name="fLocalization" action="<?= UriFactory::build('{/api}profile/settings/localization?csrf={$CSRF}'); ?>" method="post">
<form id="fLocalization" name="fLocalization" action="<?= UriFactory::build('{/api}admin/localization?csrf={$CSRF}'); ?>" method="post">
<div class="portlet-head"><?= $this->getHtml('Localization'); ?></div>
<div class="portlet-body">
<div class="form-group">
@ -46,7 +46,7 @@ $temperatures = TemperatureType::getConstants();
<?php endforeach; ?>
</select>
</div>
<div class="ipt-second"><input type="submit" name="loadDefaultLocalization" formaction="<?= UriFactory::build('{/api}profile/settings/localization?csrf={$CSRF}'); ?>" value="<?= $this->getHtml('Load'); ?>"></div>
<div class="ipt-second"><input id="iLoadLocalization" type="submit" name="loadDefaultLocalization" formaction="<?= UriFactory::build('{/api}admin/localization?csrf={$CSRF}'); ?>" value="<?= $this->getHtml('Load'); ?>"></div>
</div>
</div>
@ -78,7 +78,7 @@ $temperatures = TemperatureType::getConstants();
</div>
</div>
<div class="portlet-foot">
<input type="hidden" name="account_id" value="<?= $account->id; ?>">
<input type="hidden" name="id" value="<?= $l11n->id; ?>">
<input id="iSubmitLocalization" name="submitLocalization" type="submit" value="<?= $this->getHtml('Save', '0', '0'); ?>">
</div>
</form>
@ -99,7 +99,7 @@ $temperatures = TemperatureType::getConstants();
</div>
<div class="form-group">
<h2><?= $this->getHtml('Timeformat'); ?></h2>
<h2><?= $this->getHtml('Timeformat'); ?></h2>
</div>
<div class="form-group">
@ -152,9 +152,11 @@ $temperatures = TemperatureType::getConstants();
</div>
<div class="form-group">
<h2><?= $this->getHtml('Numberformat'); ?></h2>
<h2><?= $this->getHtml('Numberformat'); ?></h2>
</div>
<!-- @question consider to change to input-control (/var/www/html/Karaka/Modules/Admin/Admin/Settings/Theme/Backend/settings.tpl.php)
input-control seems to have less issues with smaller screen sizes -->
<div class="flex-line">
<div>
<div class="form-group">

View File

@ -150,6 +150,7 @@ return ['Admin' => [
'ServerMode-3' => 'Deaktiviert',
'ServerStatus' => 'Serverstatus',
'Settings' => 'Einstellungen',
'Setting' => 'Einstellung',
'SettingsGeneral' => 'Einstellungen - Allgemein',
'Short' => 'Kurz',
'Single' => 'Single',
@ -221,4 +222,12 @@ return ['Admin' => [
'Contacts' => 'Kontakte',
'Subtype' => 'Untertyp',
'Content' => 'Inhalt',
'OutServer' => 'Ausgangsserver',
'OutPort' => 'Ausgangsport',
'InServer' => 'Eingangsserver',
'InPort' => 'Eingangsport',
'EmailType' => 'Emailtyp',
'EmailUsername' => 'Email Benutzername',
'EmailPassword' => 'Email Password',
'EmailAddress' => 'Email Adresse',
]];

View File

@ -150,6 +150,7 @@ return ['Admin' => [
'ServerMode-3' => 'Disabled',
'ServerStatus' => 'Server Status',
'Settings' => 'Settings',
'Setting' => 'Setting',
'SettingsGeneral' => 'Settings - General',
'Short' => 'Short',
'Single' => 'Single',
@ -221,4 +222,12 @@ return ['Admin' => [
'Contacts' => 'Contacts',
'Subtype' => 'Subtype',
'Content' => 'Content',
'OutServer' => 'Out Server',
'OutPort' => 'Out Port',
'InServer' => 'In Server',
'InPort' => 'In Port',
'EmailType' => 'Email Type',
'EmailUsername' => 'Email Username',
'EmailPassword' => 'Email Password',
'EmailAddress' => 'Email Address',
]];

View File

@ -92,7 +92,7 @@ echo $this->data['nav']->render(); ?>
</div>
</div>
<div class="portlet-foot">
<input id="account-create-submit" name="createSubmit" type="submit" value="<?= $this->getHtml('Create', '0', '0'); ?>">
<input id="iCreateAccount" name="createSubmit" type="submit" value="<?= $this->getHtml('Create', '0', '0'); ?>">
</div>
</form>
</section>

View File

@ -86,7 +86,7 @@ echo $this->data['nav']->render(); ?>
<?php
$c = 0;
foreach ($accounts as $key => $value) : ++$c;
$url = UriFactory::build('{/base}/admin/account/settings?{?}&id=' . $value->id);
$url = UriFactory::build('{/base}/admin/account/view?{?}&id=' . $value->id);
$color = 'darkred';
if ($value->status === AccountStatus::ACTIVE) { $color = 'green'; }

View File

@ -41,13 +41,13 @@ echo $this->data['nav']->render(); ?>
</div>
<div class="form-group">
<?= $this->getData('editor')->render('group-editor'); ?>
<?= $this->data['editor']->render('group-editor'); ?>
</div>
<?= $this->getData('editor')->getData('text')->render('group-editor', 'description', 'fGroupCreate'); ?>
<?= $this->data['editor']->getData('text')->render('group-editor', 'description', 'fGroupCreate'); ?>
</div>
<div class="portlet-foot">
<input type="submit" id="iCreate" name="create" value="<?= $this->getHtml('Create', '0', '0'); ?>">
<input type="submit" id="iCreateGroup" name="create" value="<?= $this->getHtml('Create', '0', '0'); ?>">
</div>
</form>
</section>

View File

@ -85,7 +85,7 @@ echo $this->data['nav']->render(); ?>
<tbody>
<?php $c = 0;
foreach ($groups as $key => $value) : ++$c;
$url = UriFactory::build('{/base}/admin/group/settings?{?}&id=' . $value->id);
$url = UriFactory::build('{/base}/admin/group/view?{?}&id=' . $value->id);
$color = 'darkred';
if ($value->status === GroupStatus::ACTIVE) { $color = 'green'; }

View File

@ -23,121 +23,6 @@ if ($this->hasData('settingsTpl')
&& \is_file($this->getData('settingsTpl'))
) :
include $this->data['settingsTpl'];
else : ?>
<div class="row">
<div class="col-xs-12">
<section class="portlet">
<div class="portlet-head"><?= $this->getHtml('Settings'); ?><i class="g-icon download btn end-xs">download</i></div>
<div class="slider">
<table id="settingsList" class="default sticky">
<thead>
<tr>
<td>
<td><?= $this->getHtml('ID', '0', '0'); ?>
<label for="settingsList-sort-1">
<input type="radio" name="settingsList-sort" id="settingsList-sort-1">
<i class="sort-asc g-icon">expand_less</i>
</label>
<label for="settingsList-sort-2">
<input type="radio" name="settingsList-sort" id="settingsList-sort-2">
<i class="sort-desc g-icon">expand_more</i>
</label>
<label>
<i class="filter g-icon">filter_alt</i>
</label>
<td><?= $this->getHtml('Name'); ?>
<label for="settingsList-sort-3">
<input type="radio" name="settingsList-sort" id="settingsList-sort-3">
<i class="sort-asc g-icon">expand_less</i>
</label>
<label for="settingsList-sort-4">
<input type="radio" name="settingsList-sort" id="settingsList-sort-4">
<i class="sort-desc g-icon">expand_more</i>
</label>
<label>
<i class="filter g-icon">filter_alt</i>
</label>
<td class="wf-100"><?= $this->getHtml('Value'); ?>
<td><?= $this->getHtml('Unit'); ?>
<label for="settingsList-sort-5">
<input type="radio" name="settingsList-sort" id="settingsList-sort-5">
<i class="sort-asc g-icon">expand_less</i>
</label>
<label for="settingsList-sort-6">
<input type="radio" name="settingsList-sort" id="settingsList-sort-6">
<i class="sort-desc g-icon">expand_more</i>
</label>
<label>
<i class="filter g-icon">filter_alt</i>
</label>
<td><?= $this->getHtml('App'); ?>
<label for="settingsList-sort-5">
<input type="radio" name="settingsList-sort" id="settingsList-sort-5">
<i class="sort-asc g-icon">expand_less</i>
</label>
<label for="settingsList-sort-6">
<input type="radio" name="settingsList-sort" id="settingsList-sort-6">
<i class="sort-desc g-icon">expand_more</i>
</label>
<label>
<i class="filter g-icon">filter_alt</i>
</label>
<td><?= $this->getHtml('Group'); ?>
<label for="settingsList-sort-7">
<input type="radio" name="settingsList-sort" id="settingsList-sort-7">
<i class="sort-asc g-icon">expand_less</i>
</label>
<label for="settingsList-sort-8">
<input type="radio" name="settingsList-sort" id="settingsList-sort-8">
<i class="sort-desc g-icon">expand_more</i>
</label>
<label>
<i class="filter g-icon">filter_alt</i>
</label>
<td><?= $this->getHtml('Account'); ?>
<label for="settingsList-sort-9">
<input type="radio" name="settingsList-sort" id="settingsList-sort-9">
<i class="sort-asc g-icon">expand_less</i>
</label>
<label for="settingsList-sort-10">
<input type="radio" name="settingsList-sort" id="settingsList-sort-10">
<i class="sort-desc g-icon">expand_more</i>
</label>
<label>
<i class="filter g-icon">filter_alt</i>
</label>
<tbody>
<?php $count = 0;
foreach ($settings as $key => $setting) : ++$count;
?>
<tr tabindex="0">
<td><i class="g-icon">settings</i>
<td data-label="<?= $this->getHtml('ID', '0', '0'); ?>"><?= $setting->id; ?>
<td data-label="<?= $this->getHtml('Name'); ?>">
<?php
$name = $setting->name;
if ($this->getData('settings_class') !== null) {
$name = $this->getData('settings_class')::getName($setting->name);
if (!\is_string($name)) {
$name = $setting->name;
}
}
?>
<?= $this->printHtml($name); ?>
<td data-label="<?= $this->getHtml('Value'); ?>"><?= $this->printHtml($setting->content); ?>
<td data-label="<?= $this->getHtml('Unit'); ?>"><?= $this->printHtml((string) $setting->unit); ?>
<td data-label="<?= $this->getHtml('App'); ?>"><?= $this->printHtml((string) $setting->app); ?>
<td data-label="<?= $this->getHtml('Group'); ?>"><?= $this->printHtml($setting->group); ?>
<td data-label="<?= $this->getHtml('Account'); ?>"><?= $this->printHtml($setting->account); ?>
<?php endforeach; ?>
<?php if ($count === 0) : ?>
<tr><td colspan="8" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
<?php endif; ?>
</table>
</div>
</section>
</div>
</div>
<?php endif; ?>
else :
include __DIR__ . '/settings.tpl.php';
endif; ?>

View File

@ -1,777 +0,0 @@
<?php
/**
* Jingga
*
* PHP Version 8.2
*
* @package Modules\Admin\Template\Backend
* @copyright Dennis Eichhorn
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
use Modules\Organization\Models\UnitMapper;
use phpOMS\Localization\NullLocalization;
use phpOMS\Uri\UriFactory;
/**
* @var \phpOMS\Views\View $this
*/
$generalSettings = $this->data['generalSettings'] ?? [];
$settings = $this->data['settings'] ?? [];
$countryCodes = \phpOMS\Localization\ISO3166TwoEnum::getConstants();
$countries = \phpOMS\Localization\ISO3166NameEnum::getConstants();
$timezones = \phpOMS\Localization\TimeZoneEnumArray::getConstants();
$timeformats = \phpOMS\Localization\ISO8601EnumArray::getConstants();
$languages = \phpOMS\Localization\ISO639Enum::getConstants();
$currencies = \phpOMS\Localization\ISO4217Enum::getConstants();
$l11nDefinitions = \phpOMS\System\File\Local\Directory::list(__DIR__ . '/../../../../phpOMS/Localization/Defaults/Definitions');
$weights = \phpOMS\Utils\Converter\WeightType::getConstants();
$speeds = \phpOMS\Utils\Converter\SpeedType::getConstants();
$areas = \phpOMS\Utils\Converter\AreaType::getConstants();
$lengths = \phpOMS\Utils\Converter\LengthType::getConstants();
$volumes = \phpOMS\Utils\Converter\VolumeType::getConstants();
$temperatures = \phpOMS\Utils\Converter\TemperatureType::getConstants();
$l11n = $this->data['default_localization'] ?? new NullLocalization();
?>
<div class="tabview tab-2 url-rewrite">
<div class="box">
<ul class="tab-links">
<li><label for="c-tab-1"><?= $this->getHtml('General'); ?></label>
<li><label for="c-tab-2"><?= $this->getHtml('Localization'); ?></label>
<li><label for="c-tab-3"><?= $this->getHtml('Settings'); ?></label>
<li><label for="c-tab-4"><?= $this->getHtml('Design'); ?></label>
</ul>
</div>
<div class="tab-content">
<input type="radio" id="c-tab-1" name="tabular-2"<?= $this->request->uri->fragment === 'c-tab-1' ? ' checked' : ''; ?>>
<div class="tab">
<div class="row">
<div class="col-xs-12 col-md-6">
<section class="portlet">
<form id="iGeneralSettings" action="<?= UriFactory::build('{/api}admin/settings/general?csrf={$CSRF}'); ?>" method="post">
<div class="portlet-head"><?= $this->getHtml('Settings'); ?></div>
<div class="portlet-body">
<div class="form-group">
<label for="iOname"><?= $this->getHtml('OrganizationName'); ?></label>
<select id="iOname" name="settings_1000000009">
<?php $unit = UnitMapper::get()->where('id', (int) $generalSettings[1000000009])->execute(); ?>
<option value="<?= $unit->id; ?>"><?= $this->printHtml($unit->name); ?>
</select>
</div>
</div>
<div class="portlet-foot"><input id="iSubmitGeneral" name="submitGeneral" type="submit" value="<?= $this->getHtml('Save', '0', '0'); ?>"></div>
</form>
</section>
</div>
<div class="col-xs-12 col-md-6">
<section class="portlet">
<form id="iSecuritySettings" action="<?= UriFactory::build('{/api}admin/settings/general?csrf={$CSRF}'); ?>" method="post">
<div class="portlet-head"><?= $this->getHtml('Security'); ?></div>
<div class="portlet-body">
<div class="form-group">
<label for="iPassword">
<?= $this->getHtml('PasswordRegex'); ?>
<i class="tooltip" data-tooltip="<?= $this->getHtml('i:PasswordRegex'); ?>"><i class="g-icon">info</i></i>
</label>
<input id="iPassword" name="settings_1000000001" type="text" value="<?= $this->printHtml($generalSettings['1000000001']->content); ?>" placeholder="^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[$@$!%*?&;:\(\)\[\]=\{\}\+\-])[A-Za-z\d$@$!%*?&;:\(\)\[\]=\{\}\+\-]{8,}">
</div>
<div class="form-group">
<label for="iLoginRetries">
<?= $this->getHtml('LoginRetries'); ?>
<i class="tooltip" data-tooltip="<?= $this->getHtml('i:LoginRetries'); ?>"><i class="g-icon">info</i></i>
</label>
<input id="iLoginRetries" name="settings_1000000005" type="number" value="<?= $this->printHtml($generalSettings['1000000005']->content); ?>" min="-1">
</div>
<div class="form-group">
<label for="iTimeoutPeriod">
<?= $this->getHtml('TimeoutPeriod'); ?>
<i class="tooltip" data-tooltip="<?= $this->getHtml('i:TimeoutPeriod'); ?>"><i class="g-icon">info</i></i>
</label>
<input id="iTimeoutPeriod" name="settings_1000000002" type="number" value="<?= $this->printHtml($generalSettings['1000000002']->content); ?>">
</div>
<div class="form-group">
<label for="iPasswordChangeInterval">
<?= $this->getHtml('PasswordChangeInterval'); ?>
<i class="tooltip" data-tooltip="<?= $this->getHtml('i:PasswordChangeInterval'); ?>"><i class="g-icon">info</i></i>
</label>
<input id="iPasswordChangeInterval" name="settings_1000000003" type="number" value="<?= $this->printHtml($generalSettings['1000000003']->content); ?>">
</div>
<div class="form-group">
<label for="iPasswordHistory">
<?= $this->getHtml('PasswordHistory'); ?>
<i class="tooltip" data-tooltip="<?= $this->getHtml('i:PasswordHistory'); ?>"><i class="g-icon">info</i></i>
</label>
<input id="iPasswordHistory" name="settings_1000000004" type="number" value="<?= $this->printHtml($generalSettings['1000000004']->content); ?>">
</div>
</div>
<div class="portlet-foot">
<input id="iSubmitGeneral" name="submitGeneral" type="submit" value="<?= $this->getHtml('Save', '0', '0'); ?>">
</div>
</form>
</section>
</div>
<div class="col-xs-12 col-md-6">
<section class="portlet">
<form id="iLoggingSettings"
action="<?= UriFactory::build('{/api}admin/settings/general?csrf={$CSRF}'); ?>"
method="post">
<div class="portlet-head"><?= $this->getHtml('Logging'); ?></div>
<div class="portlet-body">
<div class="form-group">
<label class="checkbox" for="iLog">
<input id="iLog" type="checkbox" name="settings_1000000006" value="1">
<span class="checkmark"></span>
<?= $this->getHtml('Log'); ?>
</label>
</div>
<div class="form-group">
<label for="iLogPath"><?= $this->getHtml('LogPath'); ?></label>
<input id="iLogPath" name="settings_1000000007" type="text" value="<?= $this->printHtml($generalSettings['1000000007']->content); ?>" placeholder="/Logs">
</div>
</div>
<div class="portlet-foot">
<input id="iSubmitGeneral" name="submitGeneral" type="submit" value="<?= $this->getHtml('Save', '0', '0'); ?>">
</div>
</form>
</section>
</div>
</div>
</div>
<input type="radio" id="c-tab-2" name="tabular-2"<?= $this->request->uri->fragment === 'c-tab-2' ? ' checked' : ''; ?>>
<div class="tab">
<div class="row">
<div class="col-xs-12 col-md-4">
<div class="portlet">
<form id="fLocalization"
name="fLocalization"
action="<?= UriFactory::build('{/api}profile/settings/localization?csrf={$CSRF}'); ?>"
method="post">
<div class="portlet-head"><?= $this->getHtml('Localization'); ?></div>
<div class="portlet-body">
<div class="form-group">
<label for="iDefaultLocalizations"><?= $this->getHtml('Defaults'); ?></label>
<div class="ipt-wrap wf-100">
<div class="ipt-first"><select id="iDefaultLocalizations" name="localization_load">
<option selected disabled><?= $this->getHtml('Customized'); ?>
<?php foreach ($l11nDefinitions as $def) : ?>
<option value="<?= $this->printHtml(\explode('.', $def)[0]); ?>"><?= $this->printHtml(\explode('.', $def)[0]); ?>
<?php endforeach; ?>
</select>
</div>
<div class="ipt-second"><input type="submit" name="loadDefaultLocalization" formaction="<?= UriFactory::build('{/api}profile/settings/localization?load=1&csrf={$CSRF}'); ?>" value="<?= $this->getHtml('Load'); ?>"></div>
</div>
</div>
<div class="form-group">
<label for="iCountries"><?= $this->getHtml('Country'); ?></label>
<select id="iCountries" name="settings_country">
<?php foreach ($countryCodes as $code3 => $code2) : ?>
<option value="<?= $this->printHtml($code2); ?>"<?= $this->printHtml($code2 === $l11n->country ? ' selected' : ''); ?>><?= $this->printHtml($countries[$code3]); ?>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label for="iLanguages"><?= $this->getHtml('Language'); ?></label>
<select id="iLanguages" name="settings_language">
<?php foreach ($languages as $code => $language) : $code = \strtolower(\substr($code, 1)); ?>
<option value="<?= $this->printHtml($code); ?>"<?= $this->printHtml($code === $l11n->language ? ' selected' : ''); ?>><?= $this->printHtml($language); ?>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label for="iTemperature"><?= $this->getHtml('Temperature'); ?></label>
<select id="iTemperature" name="settings_temperature">
<?php foreach ($temperatures as $temperature) : ?>
<option value="<?= $this->printHtml($temperature); ?>"<?= $this->printHtml($temperature === $l11n->getTemperature() ? ' selected' : ''); ?>><?= $this->printHtml($temperature); ?>
<?php endforeach; ?>
</select>
</div>
</div>
<div class="portlet-foot">
<input id="iSubmitLocalization" name="submitLocalization" type="submit" value="<?= $this->getHtml('Save', '0', '0'); ?>">
</div>
</form>
</div>
</div>
<div class="col-xs-12 col-md-4">
<div id="settings-localization-time" class="portlet">
<div class="portlet-head"><?= $this->getHtml('Time'); ?></div>
<div class="portlet-body">
<div class="form-group">
<label for="iTimezones"><?= $this->getHtml('Timezone'); ?></label>
<select form="fLocalization" id="iTimezones" name="settings_timezone">
<?php foreach ($timezones as $timezone) : ?>
<option value="<?= $this->printHtml($timezone); ?>"<?= $this->printHtml($timezone === $l11n->getTimezone() ? ' selected' : ''); ?>><?= $this->printHtml($timezone); ?>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label for="iTimeformatVeryShort"><?= $this->getHtml('VeryShort'); ?></label>
<input form="fLocalization" id="iTimeformatVeryShort" name="settings_timeformat_vs" type="text" value="<?= $this->printHtml($l11n->getDatetime()['very_short']); ?>" placeholder="Y" required>
</div>
<h2><?= $this->getHtml('Timeformat'); ?></h2>
<div class="form-group">
<label for="iTimeformatShort"><?= $this->getHtml('Short'); ?></label>
<input form="fLocalization" id="iTimeformatShort" name="settings_timeformat_s" type="text" value="<?= $this->printHtml($l11n->getDatetime()['short']); ?>" placeholder="Y" required>
</div>
<div class="form-group">
<label for="iTimeformatMedium"><?= $this->getHtml('Medium'); ?></label>
<input form="fLocalization" id="iTimeformatMedium" name="settings_timeformat_m" type="text" value="<?= $this->printHtml($l11n->getDatetime()['medium']); ?>" placeholder="Y" required>
</div>
<div class="form-group">
<label for="iTimeformatLong"><?= $this->getHtml('Long'); ?></label>
<input form="fLocalization" id="iTimeformatLong" name="settings_timeformat_l" type="text" value="<?= $this->printHtml($l11n->getDatetime()['long']); ?>" placeholder="Y" required>
</div>
<div class="form-group">
<label for="iTimeformatVeryLong"><?= $this->getHtml('VeryLong'); ?></label>
<input form="fLocalization" id="iTimeformatVeryLong" name="settings_timeformat_vl" type="text" value="<?= $this->printHtml($l11n->getDatetime()['very_long']); ?>" placeholder="Y" required>
</div>
</div>
</div>
</div>
<div class="col-xs-12 col-md-4">
<div id="settings-localization-numeric" class="portlet">
<div class="portlet-head"><?= $this->getHtml('Numeric'); ?></div>
<div class="portlet-body">
<div class="form-group">
<label for="iCurrencies"><?= $this->getHtml('Currency'); ?></label>
<select form="fLocalization" id="iCurrencies" name="settings_currency">
<?php foreach ($currencies as $code => $currency) : $code = \substr($code, 1); ?>
<option value="<?= $this->printHtml($code); ?>"<?= $this->printHtml($code === $l11n->currency ? ' selected' : ''); ?>><?= $this->printHtml($currency); ?>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label><?= $this->getHtml('Currencyformat'); ?></label>
<select form="fLocalization" name="settings_currencyformat">
<option value="0"<?= $this->printHtml($l11n->getCurrencyFormat() === '0' ? ' selected' : ''); ?>><?= $this->getHtml('Amount') , ' ' , $this->printHtml($l11n->currency); ?>
<option value="1"<?= $this->printHtml($l11n->getCurrencyFormat() === '1' ? ' selected' : ''); ?>><?= $this->printHtml($l11n->currency) , ' ' , $this->getHtml('Amount'); ?>
</select>
</div>
<h2><?= $this->getHtml('Numberformat'); ?></h2>
<div class="form-group">
<div class="input-control">
<label for="iDecimalPoint"><?= $this->getHtml('DecimalPoint'); ?></label>
<input form="fLocalization" id="iDecimalPoint" name="settings_decimal" type="text" value="<?= $this->printHtml($l11n->getDecimal()); ?>" placeholder="." required>
</div>
<div class="input-control">
<label for="iThousandSep"><?= $this->getHtml('ThousandsSeparator'); ?></label>
<input form="fLocalization" id="iThousandSep" name="settings_thousands" type="text" value="<?= $this->printHtml($l11n->getThousands()); ?>" placeholder="," required>
</div>
</div>
</div>
</div>
</div>
<div class="col-xs-12 col-md-4">
<div id="settings-localization-precision" class="portlet">
<div class="portlet-head"><?= $this->getHtml('Precision'); ?></div>
<div class="portlet-body">
<div class="form-group">
<label for="iPrecisionVeryShort"><?= $this->getHtml('VeryShort'); ?></label>
<input form="fLocalization" id="iPrecisionVeryShort" name="settings_precision_vs" value="<?= $l11n->getPrecision()['very_short']; ?>" type="number">
</div>
<div class="form-group">
<label for="iPrecisionShort"><?= $this->getHtml('Short'); ?></label>
<input form="fLocalization" id="iPrecisionLight" name="settings_precision_s" value="<?= $l11n->getPrecision()['short']; ?>" type="number">
</div>
<div class="form-group">
<label for="iPrecisionMedium"><?= $this->getHtml('Medium'); ?></label>
<input form="fLocalization" id="iPrecisionMedium" name="settings_precision_m" value="<?= $l11n->getPrecision()['medium']; ?>" type="number">
</div>
<div class="form-group">
<label for="iPrecisionLong"><?= $this->getHtml('Long'); ?></label>
<input form="fLocalization" id="iPrecisionLong" name="settings_precision_l" value="<?= $l11n->getPrecision()['long']; ?>" type="number">
</div>
<div class="form-group">
<label for="iPrecisionVeryLong"><?= $this->getHtml('VeryLong'); ?></label>
<input form="fLocalization" id="iPrecisionVeryLong" name="settings_precision_vl" value="<?= $l11n->getPrecision()['very_long']; ?>" type="number">
</div>
</div>
</div>
</div>
<div class="col-xs-12 col-md-4">
<div id="settings-localization-weight" class="portlet">
<div class="portlet-head"><?= $this->getHtml('Weight'); ?></div>
<div class="portlet-body">
<div class="form-group">
<label for="iWeightVeryLight"><?= $this->getHtml('VeryLight'); ?></label>
<select form="fLocalization" id="iWeightVeryLight" name="settings_weight_vl">
<?php foreach ($weights as $code => $weight) : ?>
<option value="<?= $this->printHtml($weight); ?>"<?= $this->printHtml($weight === $l11n->getWeight()['very_light'] ? ' selected' : ''); ?>><?= $this->printHtml($weight); ?>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label for="iWeightLight"><?= $this->getHtml('Light'); ?></label>
<select form="fLocalization" id="iWeightLight" name="settings_weight_l">
<?php foreach ($weights as $code => $weight) : ?>
<option value="<?= $this->printHtml($weight); ?>"<?= $this->printHtml($weight === $l11n->getWeight()['light'] ? ' selected' : ''); ?>><?= $this->printHtml($weight); ?>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label for="iWeightMedium"><?= $this->getHtml('Medium'); ?></label>
<select form="fLocalization" id="iWeightMedium" name="settings_weight_m">
<?php foreach ($weights as $code => $weight) : ?>
<option value="<?= $this->printHtml($weight); ?>"<?= $this->printHtml($weight === $l11n->getWeight()['medium'] ? ' selected' : ''); ?>><?= $this->printHtml($weight); ?>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label for="iWeightHeavy"><?= $this->getHtml('Heavy'); ?></label>
<select form="fLocalization" id="iWeightHeavy" name="settings_weight_h">
<?php foreach ($weights as $code => $weight) : ?>
<option value="<?= $this->printHtml($weight); ?>"<?= $this->printHtml($weight === $l11n->getWeight()['heavy'] ? ' selected' : ''); ?>><?= $this->printHtml($weight); ?>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label for="iWeightVeryHeavy"><?= $this->getHtml('VeryHeavy'); ?></label>
<select form="fLocalization" id="iWeightVeryHeavy" name="settings_weight_vh">
<?php foreach ($weights as $code => $weight) : ?>
<option value="<?= $this->printHtml($weight); ?>"<?= $this->printHtml($weight === $l11n->getWeight()['very_heavy'] ? ' selected' : ''); ?>><?= $this->printHtml($weight); ?>
<?php endforeach; ?>
</select>
</div>
</div>
</div>
</div>
<div class="col-xs-12 col-md-4">
<div id="settings-localization-speed" class="portlet">
<div class="portlet-head"><?= $this->getHtml('Speed'); ?></div>
<div class="portlet-body">
<div class="form-group">
<label for="iSpeedVerySlow"><?= $this->getHtml('VerySlow'); ?></label>
<select form="fLocalization" id="iSpeedVerySlow" name="settings_speed_vs">
<?php foreach ($speeds as $code => $speed) : ?>
<option value="<?= $this->printHtml($speed); ?>"<?= $this->printHtml($speed === $l11n->getSpeed()['very_slow'] ? ' selected' : ''); ?>><?= $this->printHtml($speed); ?>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label for="iSpeedSlow"><?= $this->getHtml('Slow'); ?></label>
<select form="fLocalization" id="iSpeedSlow" name="settings_speed_s">
<?php foreach ($speeds as $code => $speed) : ?>
<option value="<?= $this->printHtml($speed); ?>"<?= $this->printHtml($speed === $l11n->getSpeed()['slow'] ? ' selected' : ''); ?>><?= $this->printHtml($speed); ?>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label for="iSpeedMedium"><?= $this->getHtml('Medium'); ?></label>
<select form="fLocalization" id="iSpeedMedium" name="settings_speed_m">
<?php foreach ($speeds as $code => $speed) : ?>
<option value="<?= $this->printHtml($speed); ?>"<?= $this->printHtml($speed === $l11n->getSpeed()['medium'] ? ' selected' : ''); ?>><?= $this->printHtml($speed); ?>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label for="iSpeedFast"><?= $this->getHtml('Fast'); ?></label>
<select form="fLocalization" id="iSpeedFast" name="settings_speed_f">
<?php foreach ($speeds as $code => $speed) : ?>
<option value="<?= $this->printHtml($speed); ?>"<?= $this->printHtml($speed === $l11n->getSpeed()['fast'] ? ' selected' : ''); ?>><?= $this->printHtml($speed); ?>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label for="iSpeedVeryFast"><?= $this->getHtml('VeryFast'); ?></label>
<select form="fLocalization" id="iSpeedVeryFast" name="settings_speed_vf">
<?php foreach ($speeds as $code => $speed) : ?>
<option value="<?= $this->printHtml($speed); ?>"<?= $this->printHtml($speed === $l11n->getSpeed()['very_fast'] ? ' selected' : ''); ?>><?= $this->printHtml($speed); ?>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label for="iSpeedSea"><?= $this->getHtml('Sea'); ?></label>
<select form="fLocalization" id="iSpeedSea" name="settings_speed_sea">
<?php foreach ($speeds as $code => $speed) : ?>
<option value="<?= $this->printHtml($speed); ?>"<?= $this->printHtml($speed === $l11n->getSpeed()['sea'] ? ' selected' : ''); ?>><?= $this->printHtml($speed); ?>
<?php endforeach; ?>
</select>
</div>
</div>
</div>
</div>
<div class="col-xs-12 col-md-4">
<div id="settings-localization-length" class="portlet">
<div class="portlet-head"><?= $this->getHtml('Length'); ?></div>
<div class="portlet-body">
<div class="form-group">
<label for="iLengthVeryShort"><?= $this->getHtml('VeryShort'); ?></label>
<select form="fLocalization" id="iLengthVeryShort" name="settings_length_vs">
<?php foreach ($lengths as $code => $length) : ?>
<option value="<?= $this->printHtml($length); ?>"<?= $this->printHtml($length === $l11n->getLength()['very_short'] ? ' selected' : ''); ?>><?= $this->printHtml($length); ?>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label for="iLengthShort"><?= $this->getHtml('Short'); ?></label>
<select form="fLocalization" id="iLengthShort" name="settings_length_s">
<?php foreach ($lengths as $code => $length) : ?>
<option value="<?= $this->printHtml($length); ?>"<?= $this->printHtml($length === $l11n->getLength()['short'] ? ' selected' : ''); ?>><?= $this->printHtml($length); ?>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label for="iLengthMedium"><?= $this->getHtml('Medium'); ?></label>
<select form="fLocalization" id="iLengthMedium" name="settings_length_m">
<?php foreach ($lengths as $code => $length) : ?>
<option value="<?= $this->printHtml($length); ?>"<?= $this->printHtml($length === $l11n->getLength()['medium'] ? ' selected' : ''); ?>><?= $this->printHtml($length); ?>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label for="iLengthLong"><?= $this->getHtml('Long'); ?></label>
<select form="fLocalization" id="iLengthLong" name="settings_length_l">
<?php foreach ($lengths as $code => $length) : ?>
<option value="<?= $this->printHtml($length); ?>"<?= $this->printHtml($length === $l11n->getLength()['long'] ? ' selected' : ''); ?>><?= $this->printHtml($length); ?>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label for="iLengthVeryLong"><?= $this->getHtml('VeryLong'); ?></label>
<select form="fLocalization" id="iLengthVeryLong" name="settings_length_vl">
<?php foreach ($lengths as $code => $length) : ?>
<option value="<?= $this->printHtml($length); ?>"<?= $this->printHtml($length === $l11n->getLength()['very_long'] ? ' selected' : ''); ?>><?= $this->printHtml($length); ?>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label for="iLengthSea"><?= $this->getHtml('Sea'); ?></label>
<select form="fLocalization" id="iLengthSea" name="settings_length_sea">
<?php foreach ($lengths as $code => $length) : ?>
<option value="<?= $this->printHtml($length); ?>"<?= $this->printHtml($length === $l11n->getLength()['sea'] ? ' selected' : ''); ?>><?= $this->printHtml($length); ?>
<?php endforeach; ?>
</select>
</div>
</div>
</div>
</div>
<div class="col-xs-12 col-md-4">
<div id="settings-localization-area" class="portlet">
<div class="portlet-head"><?= $this->getHtml('Area'); ?></div>
<div class="portlet-body">
<div class="form-group">
<label for="iAreaVerySmall"><?= $this->getHtml('VerySmall'); ?></label>
<select form="fLocalization" id="iAreaVerySmall" name="settings_area_vs">
<?php foreach ($areas as $code => $area) : ?>
<option value="<?= $this->printHtml($area); ?>"<?= $this->printHtml($area === $l11n->getArea()['very_small'] ? ' selected' : ''); ?>><?= $this->printHtml($area); ?>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label for="iAreaSmall"><?= $this->getHtml('Small'); ?></label>
<select form="fLocalization" id="iAreaSmall" name="settings_area_s">
<?php foreach ($areas as $code => $area) : ?>
<option value="<?= $this->printHtml($area); ?>"<?= $this->printHtml($area === $l11n->getArea()['small'] ? ' selected' : ''); ?>><?= $this->printHtml($area); ?>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label for="iAreaMedium"><?= $this->getHtml('Medium'); ?></label>
<select form="fLocalization" id="iAreaMedium" name="settings_area_m">
<?php foreach ($areas as $code => $area) : ?>
<option value="<?= $this->printHtml($area); ?>"<?= $this->printHtml($area === $l11n->getArea()['medium'] ? ' selected' : ''); ?>><?= $this->printHtml($area); ?>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label for="iAreaLarge"><?= $this->getHtml('Large'); ?></label>
<select form="fLocalization" id="iAreaLarge" name="settings_area_l">
<?php foreach ($areas as $code => $area) : ?>
<option value="<?= $this->printHtml($area); ?>"<?= $this->printHtml($area === $l11n->getArea()['large'] ? ' selected' : ''); ?>><?= $this->printHtml($area); ?>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label for="iAreaVeryLarge"><?= $this->getHtml('VeryLarge'); ?></label>
<select form="fLocalization" id="iAreaVeryLarge" name="settings_area_vl">
<?php foreach ($areas as $code => $area) : ?>
<option value="<?= $this->printHtml($area); ?>"<?= $this->printHtml($area === $l11n->getArea()['very_large'] ? ' selected' : ''); ?>><?= $this->printHtml($area); ?>
<?php endforeach; ?>
</select>
</div>
</div>
</div>
</div>
<div class="col-xs-12 col-md-4">
<div id="settings-localization-volume" class="portlet">
<div class="portlet-head"><?= $this->getHtml('Volume'); ?></div>
<div class="portlet-body">
<div class="form-group">
<label for="iVolumeVerySmall"><?= $this->getHtml('VerySmall'); ?></label>
<select form="fLocalization" id="iVolumeVerySmall" name="settings_volume_vs">
<?php foreach ($volumes as $code => $volume) : ?>
<option value="<?= $this->printHtml($volume); ?>"<?= $this->printHtml($volume === $l11n->getVolume()['very_small'] ? ' selected' : ''); ?>><?= $this->printHtml($volume); ?>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label for="iVolumeSmall"><?= $this->getHtml('Small'); ?></label>
<select form="fLocalization" id="iVolumeSmall" name="settings_volume_s">
<?php foreach ($volumes as $code => $volume) : ?>
<option value="<?= $this->printHtml($volume); ?>"<?= $this->printHtml($volume === $l11n->getVolume()['small'] ? ' selected' : ''); ?>><?= $this->printHtml($volume); ?>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label for="iVolumeMedium"><?= $this->getHtml('Medium'); ?></label>
<select form="fLocalization" id="iVolumeMedium" name="settings_volume_m">
<?php foreach ($volumes as $code => $volume) : ?>
<option value="<?= $this->printHtml($volume); ?>"<?= $this->printHtml($volume === $l11n->getVolume()['medium'] ? ' selected' : ''); ?>><?= $this->printHtml($volume); ?>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label for="iVolumeLarge"><?= $this->getHtml('Large'); ?></label>
<select form="fLocalization" id="iVolumeLarge" name="settings_volume_l">
<?php foreach ($volumes as $code => $volume) : ?>
<option value="<?= $this->printHtml($volume); ?>"<?= $this->printHtml($volume === $l11n->getVolume()['large'] ? ' selected' : ''); ?>><?= $this->printHtml($volume); ?>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label for="iVolumeVeryLarge"><?= $this->getHtml('VeryLarge'); ?></label>
<select form="fLocalization" id="iVolumeVeryLarge" name="settings_volume_vl">
<?php foreach ($volumes as $code => $volume) : ?>
<option value="<?= $this->printHtml($volume); ?>"<?= $this->printHtml($volume === $l11n->getVolume()['very_large'] ? ' selected' : ''); ?>><?= $this->printHtml($volume); ?>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label for="iVolumeTeaspoon"><?= $this->getHtml('Teaspoon'); ?></label>
<select form="fLocalization" id="iVolumeTeaspoon" name="settings_volume_teaspoon">
<?php foreach ($volumes as $code => $volume) : ?>
<option value="<?= $this->printHtml($volume); ?>"<?= $this->printHtml($volume === $l11n->getVolume()['teaspoon'] ? ' selected' : ''); ?>><?= $this->printHtml($volume); ?>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label for="iVolumeTablespoon"><?= $this->getHtml('Tablespoon'); ?></label>
<select form="fLocalization" id="iVolumeTablespoon" name="settings_volume_tablespoon">
<?php foreach ($volumes as $code => $volume) : ?>
<option value="<?= $this->printHtml($volume); ?>"<?= $this->printHtml($volume === $l11n->getVolume()['tablespoon'] ? ' selected' : ''); ?>><?= $this->printHtml($volume); ?>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label for="iVolumeGlass"><?= $this->getHtml('Glass'); ?></label>
<select form="fLocalization" id="iVolumeGlass" name="settings_volume_glass">
<?php foreach ($volumes as $code => $volume) : ?>
<option value="<?= $this->printHtml($volume); ?>"<?= $this->printHtml($volume === $l11n->getVolume()['glass'] ? ' selected' : ''); ?>><?= $this->printHtml($volume); ?>
<?php endforeach; ?>
</select>
</div>
</div>
</div>
</div>
</div>
</div>
<input type="radio" id="c-tab-3"
name="tabular-2"<?= $this->request->uri->fragment === 'c-tab-3' ? ' checked' : ''; ?>>
<div class="tab">
<div class="row">
<div class="col-xs-12">
<div class="portlet">
<div class="portlet-head"><?= $this->getHtml('Settings'); ?><i class="g-icon download btn end-xs">download</i></div>
<div class="slider">
<table id="settingsList" class="default sticky">
<thead>
<tr>
<td>
<td><?= $this->getHtml('ID', '0', '0'); ?>
<label for="settingsList-sort-1">
<input type="radio" name="settingsList-sort" id="settingsList-sort-1">
<i class="sort-asc g-icon">expand_less</i>
</label>
<label for="settingsList-sort-2">
<input type="radio" name="settingsList-sort" id="settingsList-sort-2">
<i class="sort-desc g-icon">expand_more</i>
</label>
<label>
<i class="filter g-icon">filter_alt</i>
</label>
<td><?= $this->getHtml('Name'); ?>
<label for="settingsList-sort-3">
<input type="radio" name="settingsList-sort" id="settingsList-sort-3">
<i class="sort-asc g-icon">expand_less</i>
</label>
<label for="settingsList-sort-4">
<input type="radio" name="settingsList-sort" id="settingsList-sort-4">
<i class="sort-desc g-icon">expand_more</i>
</label>
<label>
<i class="filter g-icon">filter_alt</i>
</label>
<td class="wf-100"><?= $this->getHtml('Value'); ?>
<td><?= $this->getHtml('Module'); ?>
<label for="settingsList-sort-5">
<input type="radio" name="settingsList-sort" id="settingsList-sort-5">
<i class="sort-asc g-icon">expand_less</i>
</label>
<label for="settingsList-sort-6">
<input type="radio" name="settingsList-sort" id="settingsList-sort-6">
<i class="sort-desc g-icon">expand_more</i>
</label>
<label>
<i class="filter g-icon">filter_alt</i>
</label>
<td><?= $this->getHtml('Group'); ?>
<label for="settingsList-sort-7">
<input type="radio" name="settingsList-sort" id="settingsList-sort-7">
<i class="sort-asc g-icon">expand_less</i>
</label>
<label for="settingsList-sort-8">
<input type="radio" name="settingsList-sort" id="settingsList-sort-8">
<i class="sort-desc g-icon">expand_more</i>
</label>
<label>
<i class="filter g-icon">filter_alt</i>
</label>
<td><?= $this->getHtml('Account'); ?>
<label for="settingsList-sort-9">
<input type="radio" name="settingsList-sort" id="settingsList-sort-9">
<i class="sort-asc g-icon">expand_less</i>
</label>
<label for="settingsList-sort-10">
<input type="radio" name="settingsList-sort" id="settingsList-sort-10">
<i class="sort-desc g-icon">expand_more</i>
</label>
<label>
<i class="filter g-icon">filter_alt</i>
</label>
<tbody>
<?php $count = 0;
$previousSettings = empty($settings) ? 'admin/settings/general' : 'admin/settings/general?{?}&sid=' . \reset($settings)->id . '&ptype=p';
$nextSettings = empty($settings) ? 'admin/settings/general' : 'admin/settings/general?{?}&sid=' . \end($settings)->id . '&ptype=n';
foreach ($settings as $key => $setting) : ++$count;
?>
<tr tabindex="0">
<td><i class="g-icon">settings</i>
<td data-label="<?= $this->getHtml('ID', '0', '0'); ?>"><?= $setting->id; ?>
<td data-label="<?= $this->getHtml('Name'); ?>"><?= $this->printHtml($setting->name); ?>
<td data-label="<?= $this->getHtml('Value'); ?>"><?= $this->printHtml($setting->content); ?>
<td data-label="<?= $this->getHtml('Module'); ?>"><?= $this->printHtml($setting->module); ?>
<td data-label="<?= $this->getHtml('Group'); ?>"><?= $this->printHtml($setting->group); ?>
<td data-label="<?= $this->getHtml('Account'); ?>"><?= $this->printHtml($setting->account); ?>
<?php endforeach; ?>
<?php if ($count === 0) : ?>
<tr><td colspan="7" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
<?php endif; ?>
</table>
</div>
<div class="portlet-foot">
<a tabindex="0" class="button" href="<?= UriFactory::build($previousSettings); ?>"><?= $this->getHtml('Previous', '0', '0'); ?></a>
<a tabindex="0" class="button" href="<?= UriFactory::build($nextSettings); ?>"><?= $this->getHtml('Next', '0', '0'); ?></a>
</div>
</div>
</div>
</div>
</div>
<input type="radio" id="c-tab-4"
name="tabular-2"<?= $this->request->uri->fragment === 'c-tab-4' ? ' checked' : ''; ?>>
<div class="tab">
<div class="row">
<div class="col-xs-12 col-md-6">
<section class="portlet">
<div class="portlet-head"><?= $this->getHtml('Images'); ?></div>
<div class="portlet-body">
<div class="form-group">
<label for="iLoginImage"><?= $this->getHtml('LoginImage'); ?></label>
<div>
<img id="preview-loginImage"
alt="<?= $this->getHtml('LoginImage'); ?>"
itemprop="logo" loading="lazy"
src="<?= UriFactory::build('Web/Backend/img/logo.png'); ?>"
width="50px">
<div>
<a id="iLoginImageUploadButton" href="#upload" data-action='[
{"listener": "click", "key": 1, "action": [
{"key": 1, "type": "event.prevent"},
{"key": 2, "type": "dom.click", "selector": "#iLoginImageUpload"}
]}]'><?= $this->getHtml('Change'); ?></a>
<form id="iLoginImageUploadForm" action="<?= UriFactory::build('{/api}admin/settings/design?csrf={$CSRF}'); ?>" method="post">
<input class="preview" data-action='[
{"listener": "change", "key": 1, "action": [
{"key": 1, "type": "form.submit", "selector": "#iLoginImageUploadForm"}
]}]' id="iLoginImageUpload" name="loginImage" type="file" accept="image/png" style="display: none;">
</form>
</div>
</div>
</div>
</div>
</section>
</div>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,148 @@
<?php
use phpOMS\Uri\UriFactory;
?>
<div class="row">
<div class="col-xs-12">
<section class="portlet">
<div class="portlet-head"><?= $this->getHtml('Settings'); ?><i class="g-icon download btn end-xs">download</i></div>
<div class="slider">
<table id="settingsList" class="default sticky"
data-uri="<?= UriFactory::build('{/api}admin/settings?csrf={$CSRF}'); ?>"
data-tag="form"
data-ui-container="tbody"
data-ui-element="tr"
data-update-tpl="#settingsList tbody .oms-update-tpl-setting">
<thead>
<tr>
<td>
<td><?= $this->getHtml('ID', '0', '0'); ?>
<label for="settingsList-sort-1">
<input type="radio" name="settingsList-sort" id="settingsList-sort-1">
<i class="sort-asc g-icon">expand_less</i>
</label>
<label for="settingsList-sort-2">
<input type="radio" name="settingsList-sort" id="settingsList-sort-2">
<i class="sort-desc g-icon">expand_more</i>
</label>
<label>
<i class="filter g-icon">filter_alt</i>
</label>
<td><?= $this->getHtml('Name'); ?>
<label for="settingsList-sort-3">
<input type="radio" name="settingsList-sort" id="settingsList-sort-3">
<i class="sort-asc g-icon">expand_less</i>
</label>
<label for="settingsList-sort-4">
<input type="radio" name="settingsList-sort" id="settingsList-sort-4">
<i class="sort-desc g-icon">expand_more</i>
</label>
<label>
<i class="filter g-icon">filter_alt</i>
</label>
<td class="wf-100"><?= $this->getHtml('Value'); ?>
<td><?= $this->getHtml('Unit'); ?>
<label for="settingsList-sort-5">
<input type="radio" name="settingsList-sort" id="settingsList-sort-5">
<i class="sort-asc g-icon">expand_less</i>
</label>
<label for="settingsList-sort-6">
<input type="radio" name="settingsList-sort" id="settingsList-sort-6">
<i class="sort-desc g-icon">expand_more</i>
</label>
<label>
<i class="filter g-icon">filter_alt</i>
</label>
<td><?= $this->getHtml('App'); ?>
<label for="settingsList-sort-5">
<input type="radio" name="settingsList-sort" id="settingsList-sort-5">
<i class="sort-asc g-icon">expand_less</i>
</label>
<label for="settingsList-sort-6">
<input type="radio" name="settingsList-sort" id="settingsList-sort-6">
<i class="sort-desc g-icon">expand_more</i>
</label>
<label>
<i class="filter g-icon">filter_alt</i>
</label>
<td><?= $this->getHtml('Group'); ?>
<label for="settingsList-sort-7">
<input type="radio" name="settingsList-sort" id="settingsList-sort-7">
<i class="sort-asc g-icon">expand_less</i>
</label>
<label for="settingsList-sort-8">
<input type="radio" name="settingsList-sort" id="settingsList-sort-8">
<i class="sort-desc g-icon">expand_more</i>
</label>
<label>
<i class="filter g-icon">filter_alt</i>
</label>
<td><?= $this->getHtml('Account'); ?>
<label for="settingsList-sort-9">
<input type="radio" name="settingsList-sort" id="settingsList-sort-9">
<i class="sort-asc g-icon">expand_less</i>
</label>
<label for="settingsList-sort-10">
<input type="radio" name="settingsList-sort" id="settingsList-sort-10">
<i class="sort-desc g-icon">expand_more</i>
</label>
<label>
<i class="filter g-icon">filter_alt</i>
</label>
<tbody>
<template class="oms-update-tpl-setting">
<tr data-id="" draggable="false">
<td><i class="g-icon btn save-form">check</i>
<i class="g-icon btn cancel-form">close</i>
<td data-tpl-text="/id" data-tpl-value="/id">
<td data-tpl-text="/name" data-tpl-value="/name">
<td><input name="content" type="text" data-tpl-text="/content" data-tpl-value="/content">
<td data-tpl-text="/unit" data-tpl-value="/unit">
<td data-tpl-text="/app" data-tpl-value="/app">
<td data-tpl-text="/group" data-tpl-value="/group">
<td data-tpl-text="/account" data-tpl-value="/account">
</template>
<template class="oms-add-tpl-setting">
<tr data-id="" draggable="false">
<td><i class="g-icon btn save-form">settings</i>
<td data-tpl-text="/id" data-tpl-value="/id">
<td data-tpl-text="/name" data-tpl-value="/name">
<td><input name="content" type="text" data-tpl-text="/content" data-tpl-value="/content">
<td data-tpl-text="/unit" data-tpl-value="/unit">
<td data-tpl-text="/app" data-tpl-value="/app">
<td data-tpl-text="/group" data-tpl-value="/group">
<td data-tpl-text="/account" data-tpl-value="/account">
</template>
<?php $count = 0;
foreach ($settings as $key => $setting) : ++$count;
?>
<tr tabindex="0" data-id="<?= $setting->id; ?>">
<td><i class="g-icon btn update-form">settings</i>
<td data-tpl-text="/id" data-tpl-value="/id" data-label="<?= $this->getHtml('ID', '0', '0'); ?>"><?= $setting->id; ?>
<td data-tpl-text="/name" data-tpl-value="/name" data-label="<?= $this->getHtml('Name'); ?>">
<?php
$name = $setting->name;
if ($this->getData('settings_class') !== null) {
$name = $this->getData('settings_class')::getName($setting->name);
if (!\is_string($name)) {
$name = $setting->name;
}
}
?>
<?= $this->printHtml($name); ?>
<td data-tpl-text="/content" data-tpl-value="/content" data-label="<?= $this->getHtml('Value'); ?>"><?= $this->printHtml($setting->content); ?>
<td data-tpl-text="/unit" data-tpl-value="/unit" data-label="<?= $this->getHtml('Unit'); ?>"><?= $this->printHtml((string) $setting->unit); ?>
<td data-tpl-text="/app" data-tpl-value="/app" data-label="<?= $this->getHtml('App'); ?>"><?= $this->printHtml((string) $setting->app); ?>
<td data-tpl-text="/group" data-tpl-value="/group" data-label="<?= $this->getHtml('Group'); ?>"><?= $this->printHtml($setting->group); ?>
<td data-tpl-text="/account" data-tpl-value="/account" data-label="<?= $this->getHtml('Account'); ?>"><?= $this->printHtml($setting->account); ?>
<?php endforeach; ?>
<?php if ($count === 0) : ?>
<tr><td colspan="8" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
<?php endif; ?>
</table>
</div>
</section>
</div>
</div>