diff --git a/admin_settings.php b/admin_settings.php index 86c69eeb..7995d7eb 100644 --- a/admin_settings.php +++ b/admin_settings.php @@ -396,4 +396,10 @@ if ($page == 'overview' && $userinfo['change_serversettings'] == '1') { 'type' => $note_type, 'alert_msg' => $note_msg ]); +} elseif ($page == 'toggleSettingsMode') { + if ($userinfo['change_serversettings'] == '1') { + $cmode = Settings::Get('panel.settings_mode'); + Settings::Set('panel.settings_mode', (int)(!(bool)$cmode)); + } + \Froxlor\UI\Response::redirectTo($filename); } diff --git a/install/froxlor.sql b/install/froxlor.sql index 59ecdf65..ff3f5e04 100644 --- a/install/froxlor.sql +++ b/install/froxlor.sql @@ -723,6 +723,7 @@ opcache.validate_timestamps'), ('panel', 'logo_image_login', ''), ('panel', 'logo_overridetheme', '0'), ('panel', 'logo_overridecustom', '0'), + ('panel', 'settings_mode', '0'), ('panel', 'version', '0.11.0-dev1'), ('panel', 'db_version', '202112310'); diff --git a/install/updates/froxlor/0.11/update_0.11.inc.php b/install/updates/froxlor/0.11/update_0.11.inc.php index 0abcd805..51534228 100644 --- a/install/updates/froxlor/0.11/update_0.11.inc.php +++ b/install/updates/froxlor/0.11/update_0.11.inc.php @@ -56,9 +56,10 @@ if (\Froxlor\Froxlor::isFroxlorVersion('0.10.99')) { showUpdateStep("Cleaning up old files"); $to_clean = array( "templates/Sparkle", + "lib/version.inc.php" ); $disabled = explode(',', ini_get('disable_functions')); - $exec_allowed = ! in_array('exec', $disabled); + $exec_allowed = !in_array('exec', $disabled); $del_list = ""; foreach ($to_clean as $filedir) { $complete_filedir = \Froxlor\Froxlor::getInstallDir() . $filedir; @@ -81,6 +82,11 @@ if (\Froxlor\Froxlor::isFroxlorVersion('0.10.99')) { } } + showUpdateStep("Adding new settings"); + $panel_settings_mode = isset($_POST['panel_settings_mode']) ? (int) $_POST['panel_settings_mode'] : 0; + Settings::AddNew("panel.settings_mode", $panel_settings_mode); + lastStepStatus(0); + if (\Froxlor\Froxlor::isFroxlorVersion('0.10.99')) { showUpdateStep("Updating from 0.10.99 to 0.11.0-dev1", false); \Froxlor\Froxlor::updateToVersion('0.11.0-dev1'); diff --git a/install/updates/preconfig.php b/install/updates/preconfig.php index ad2c748e..688983fc 100644 --- a/install/updates/preconfig.php +++ b/install/updates/preconfig.php @@ -35,14 +35,21 @@ function getPreConfig($current_version, $current_db_version): array 'title' => '0.9.x updates', 'fields' => [] ]; - parseAndOutputPreconfig($has_preconfig, $return['section_09']['fields'], $current_version, $current_db_version); + parseAndOutputPreconfig09($has_preconfig, $return['section_09']['fields'], $current_version, $current_db_version); include_once \Froxlor\FileDir::makeCorrectFile(dirname(__FILE__) . '/preconfig/0.10/preconfig_0.10.inc.php'); $return['section_010'] = [ 'title' => '0.10.x updates', 'fields' => [] ]; - parseAndOutputPreconfig2($has_preconfig, $return['section_010']['fields'], $current_version, $current_db_version); + parseAndOutputPreconfig010($has_preconfig, $return['section_010']['fields'], $current_version, $current_db_version); + + include_once \Froxlor\FileDir::makeCorrectFile(dirname(__FILE__) . '/preconfig/0.11/preconfig_0.11.inc.php'); + $return['section_011'] = [ + 'title' => '0.11.x updates', + 'fields' => [] + ]; + parseAndOutputPreconfig011($has_preconfig, $return['section_011']['fields'], $current_version, $current_db_version); if (empty($return['section_09']['fields'])) { unset($return['section_09']); @@ -50,6 +57,9 @@ function getPreConfig($current_version, $current_db_version): array if (empty($return['section_010']['fields'])) { unset($return['section_010']); } + if (empty($return['section_011']['fields'])) { + unset($return['section_011']); + } if (!empty($return)) { $has_preconfig = true; diff --git a/install/updates/preconfig/0.10/preconfig_0.10.inc.php b/install/updates/preconfig/0.10/preconfig_0.10.inc.php index bdb9b4c1..ede8bb38 100644 --- a/install/updates/preconfig/0.10/preconfig_0.10.inc.php +++ b/install/updates/preconfig/0.10/preconfig_0.10.inc.php @@ -27,7 +27,7 @@ * * @return void */ -function parseAndOutputPreconfig2(&$has_preconfig, &$return, $current_version, $current_db_version) +function parseAndOutputPreconfig010(&$has_preconfig, &$return, $current_version, $current_db_version) { global $lng; diff --git a/install/updates/preconfig/0.11/index.html b/install/updates/preconfig/0.11/index.html new file mode 100644 index 00000000..e69de29b diff --git a/install/updates/preconfig/0.11/preconfig_0.11.inc.php b/install/updates/preconfig/0.11/preconfig_0.11.inc.php new file mode 100644 index 00000000..8266abee --- /dev/null +++ b/install/updates/preconfig/0.11/preconfig_0.11.inc.php @@ -0,0 +1,49 @@ + (2010-) + * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt + * @package Updater + * + */ + +/** + * checks if the new-version has some updating to do + * + * @param boolean $has_preconfig + * pointer to check if any preconfig has to be output + * @param string $return + * pointer to output string + * @param string $current_version + * current froxlor version + * + * @return void + */ +function parseAndOutputPreconfig011(&$has_preconfig, &$return, $current_version, $current_db_version) +{ + global $lng; + + if (versionInUpdate($current_version, '0.10.99')) { + $has_preconfig = true; + $description = 'We have rearranged the settings and split them into basic and advanced categories. This makes it easier for users who do not need all the detailed or very specific settings and options and gives a better overview of the basic/mostly used settings.'; + $return['panel_settings_mode_note'] = ['type' => 'infotext', 'value' => $description]; + $question = 'Chose settings mode (you can change that at any time)'; + $return['panel_settings_mode'] = [ + 'type' => 'select', + 'select_var' => [ + 0 => 'Basic', + 1 => 'Advanced' + ], + 'selected' => 1, + 'label' => $question + ]; + } +} diff --git a/install/updates/preconfig/0.9/preconfig_0.9.inc.php b/install/updates/preconfig/0.9/preconfig_0.9.inc.php index aa40f5a3..310d8217 100644 --- a/install/updates/preconfig/0.9/preconfig_0.9.inc.php +++ b/install/updates/preconfig/0.9/preconfig_0.9.inc.php @@ -17,8 +17,8 @@ use Froxlor\Database\Database; use Froxlor\Settings; -use PHPMailer\PHPMailer; use Froxlor\UI\Panel\UI; +use PHPMailer\PHPMailer\PHPMailer; /** * checks if the new-version has some updating to do @@ -32,7 +32,7 @@ use Froxlor\UI\Panel\UI; * * @return void */ -function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version, $current_db_version) +function parseAndOutputPreconfig09(&$has_preconfig, &$return, $current_version, $current_db_version) { global $lng; diff --git a/lng/english.lng.php b/lng/english.lng.php index d488a541..228af112 100644 --- a/lng/english.lng.php +++ b/lng/english.lng.php @@ -2161,3 +2161,7 @@ $lng['panel']['unspecified'] = 'unspecified'; $lng['admin']['smtptestaddr'] = 'Send test-mail to'; $lng['admin']['smtptestnote'] = 'Note that the values below reflect your current settings and can only be adjusted there (see link in top right corner)'; $lng['panel']['backtooverview'] = 'Back to overview'; +$lng['panel']['settingsmode'] = 'Mode'; +$lng['panel']['settingsmodebasic'] = 'Basic'; +$lng['panel']['settingsmodeadvanced'] = 'Advanced'; +$lng['panel']['settingsmodetoggle'] = 'Click to toggle mode'; \ No newline at end of file diff --git a/lng/german.lng.php b/lng/german.lng.php index c1af74d8..fb9961e9 100644 --- a/lng/german.lng.php +++ b/lng/german.lng.php @@ -1799,3 +1799,7 @@ $lng['panel']['unspecified'] = 'keine Angabe'; $lng['admin']['smtptestaddr'] = 'Test-Email senden an'; $lng['admin']['smtptestnote'] = 'Bitte beachten: Die untenstehenden Werte reflektieren die aktuellen Einstellungen und können auch nur dort angepasst werden (siehe Link in der oberen rechten Ecke)'; $lng['panel']['backtooverview'] = 'Zurück zur Übersicht'; +$lng['panel']['settingsmode'] = 'Modus'; +$lng['panel']['settingsmodebasic'] = 'Einfach'; +$lng['panel']['settingsmodeadvanced'] = 'Erweitert'; +$lng['panel']['settingsmodetoggle'] = 'Modus umschalten'; diff --git a/templates/Froxlor/settings/detailpart.html.twig b/templates/Froxlor/settings/detailpart.html.twig index 0f43060a..97188832 100644 --- a/templates/Froxlor/settings/detailpart.html.twig +++ b/templates/Froxlor/settings/detailpart.html.twig @@ -1,5 +1,16 @@ {% extends "Froxlor/settings/index.html.twig" %} +{% block actions %} + + + {{ lng('admin.configfiles.overview') }} + + + + {{ lng('admin.configfiles.importexport') }} + +{% endblock %} + {% block settings %} {% import "Froxlor/form/formfields.html.twig" as formfields %} diff --git a/templates/Froxlor/settings/index.html.twig b/templates/Froxlor/settings/index.html.twig index 6f3983c0..70b6ecf3 100644 --- a/templates/Froxlor/settings/index.html.twig +++ b/templates/Froxlor/settings/index.html.twig @@ -11,9 +11,14 @@ {% endblock %} {% block actions %} - - - {{ lng('admin.configfiles.overview') }} + + {% if get_setting('panel.settings_mode') == 0 %} + + {{ lng('panel.settingsmode') }}: {{ lng('panel.settingsmodebasic') }} + {% else %} + + {{ lng('panel.settingsmode') }}: {{ lng('panel.settingsmodeadvanced') }} + {% endif %}