add new settings_mode setting to switch between basic and advanced view
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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');
|
||||
|
||||
|
||||
@@ -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');
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
0
install/updates/preconfig/0.11/index.html
Normal file
0
install/updates/preconfig/0.11/index.html
Normal file
49
install/updates/preconfig/0.11/preconfig_0.11.inc.php
Normal file
49
install/updates/preconfig/0.11/preconfig_0.11.inc.php
Normal file
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Froxlor project.
|
||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||
*
|
||||
* For the full copyright and license information, please view the COPYING
|
||||
* file that was distributed with this source code. You can also view the
|
||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||
*
|
||||
* @copyright (c) the authors
|
||||
* @author Froxlor team <team@froxlor.org> (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 = '<strong>Chose settings mode (you can change that at any time)</strong>';
|
||||
$return['panel_settings_mode'] = [
|
||||
'type' => 'select',
|
||||
'select_var' => [
|
||||
0 => 'Basic',
|
||||
1 => 'Advanced'
|
||||
],
|
||||
'selected' => 1,
|
||||
'label' => $question
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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';
|
||||
@@ -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';
|
||||
|
||||
@@ -1,5 +1,16 @@
|
||||
{% extends "Froxlor/settings/index.html.twig" %}
|
||||
|
||||
{% block actions %}
|
||||
<a class="btn btn-outline-primary" href="{{ linker({'section':'settings','page':'overview','part':'all'}) }}">
|
||||
<i class="fa-solid fa-grip me-1"></i>
|
||||
{{ lng('admin.configfiles.overview') }}
|
||||
</a>
|
||||
<a class="btn btn-outline-secondary" href="{{ linker({'section':'settings','page':'importexport'}) }}">
|
||||
<i class="fa-solid fa-file-import me-1"></i>
|
||||
{{ lng('admin.configfiles.importexport') }}
|
||||
</a>
|
||||
{% endblock %}
|
||||
|
||||
{% block settings %}
|
||||
|
||||
{% import "Froxlor/form/formfields.html.twig" as formfields %}
|
||||
|
||||
@@ -11,9 +11,14 @@
|
||||
{% endblock %}
|
||||
|
||||
{% block actions %}
|
||||
<a class="btn btn-outline-primary" href="{{ linker({'section':'settings','page':'overview','part':'all'}) }}">
|
||||
<i class="fa-solid fa-grip me-1"></i>
|
||||
{{ lng('admin.configfiles.overview') }}
|
||||
<a class="btn btn-outline-secondary" href="{{ linker({'section':'settings','page':'toggleSettingsMode'}) }}" title="{{ lng('panel.settingsmodetoggle') }}">
|
||||
{% if get_setting('panel.settings_mode') == 0 %}
|
||||
<i class="fa-solid fa-maximize me-1"></i>
|
||||
{{ lng('panel.settingsmode') }}: {{ lng('panel.settingsmodebasic') }}
|
||||
{% else %}
|
||||
<i class="fa-solid fa-minimize me-1"></i>
|
||||
{{ lng('panel.settingsmode') }}: {{ lng('panel.settingsmodeadvanced') }}
|
||||
{% endif %}
|
||||
</a>
|
||||
<a class="btn btn-outline-secondary" href="{{ linker({'section':'settings','page':'importexport'}) }}">
|
||||
<i class="fa-solid fa-file-import me-1"></i>
|
||||
|
||||
Reference in New Issue
Block a user