Even more HTMLform2 migrations

Signed-off-by: Roman Schmerold (BNoiZe) <bnoize@froxlor.org>
This commit is contained in:
Roman Schmerold (BNoiZe)
2015-02-16 17:56:37 +01:00
parent 52afba5a86
commit 6dad29cae7
4 changed files with 104 additions and 201 deletions

View File

@@ -121,9 +121,9 @@ if ($page == 'overview') {
$fpm_reqslowtimeout = 0;
}
elseif (Settings::Get('phpfpm.enabled') == 1) {
$fpm_enableslowlog = isset($_POST['phpfpm_enable_slowlog']) ? (int)$_POST['phpfpm_enable_slowlog'] : 0;
$fpm_reqtermtimeout = validate($_POST['phpfpm_reqtermtimeout'], 'phpfpm_reqtermtimeout', '/^([0-9]+)(|s|m|h|d)$/');
$fpm_reqslowtimeout = validate($_POST['phpfpm_reqslowtimeout'], 'phpfpm_reqslowtimeout', '/^([0-9]+)(|s|m|h|d)$/');
$fpm_enableslowlog = isset($_POST['fpm_slowlog']) ? (int)$_POST['fpm_slowlog'] : 0;
$fpm_reqtermtimeout = validate($_POST['fpm_reqterm'], 'fpm_reqterm', '/^([0-9]+)(|s|m|h|d)$/');
$fpm_reqslowtimeout = validate($_POST['fpm_reqslow'], 'fpm_reqslow', '/^([0-9]+)(|s|m|h|d)$/');
// disable fcgid stuff
$binary = '/usr/bin/php-cgi';
$file_extensions = 'php';
@@ -171,11 +171,10 @@ if ($page == 'overview') {
$result_stmt = Database::query("SELECT * FROM `" . TABLE_PANEL_PHPCONFIGS . "` WHERE `id` = 1");
$result = $result_stmt->fetch(PDO::FETCH_ASSOC);
$phpconfig_add_data = include_once dirname(__FILE__).'/lib/formfields/admin/phpconfig/formfield.phpconfig_add.php';
$phpconfig_add_form = htmlform::genHTMLForm($phpconfig_add_data);
$phpconfig_add_data = include_once dirname(__FILE__).'/lib/formfields/admin/formfield.phpconfig.php';
$phpconfig_add_form = HTMLform2::genHTMLForm($phpconfig_add_data);
$title = $phpconfig_add_data['phpconfig_add']['title'];
$image = $phpconfig_add_data['phpconfig_add']['image'];
$title = $lng['admin']['phpsettings']['addsettings'];
eval("echo \"" . getTemplate("phpconfig/overview_add") . "\";");
}
@@ -271,9 +270,9 @@ if ($page == 'overview') {
$fpm_reqslowtimeout = 0;
}
elseif (Settings::Get('phpfpm.enabled') == 1) {
$fpm_enableslowlog = isset($_POST['phpfpm_enable_slowlog']) ? (int)$_POST['phpfpm_enable_slowlog'] : 0;
$fpm_reqtermtimeout = validate($_POST['phpfpm_reqtermtimeout'], 'phpfpm_reqtermtimeout', '/^([0-9]+)(|s|m|h|d)$/');
$fpm_reqslowtimeout = validate($_POST['phpfpm_reqslowtimeout'], 'phpfpm_reqslowtimeout', '/^([0-9]+)(|s|m|h|d)$/');
$fpm_enableslowlog = isset($_POST['fpm_slowlog']) ? (int)$_POST['fpm_slowlog'] : 0;
$fpm_reqtermtimeout = validate($_POST['fpm_reqterm'], 'fpm_reqterm', '/^([0-9]+)(|s|m|h|d)$/');
$fpm_reqslowtimeout = validate($_POST['fpm_reqslow'], 'fpm_reqslow', '/^([0-9]+)(|s|m|h|d)$/');
// disable fcgid stuff
$binary = '/usr/bin/php-cgi';
$file_extensions = 'php';
@@ -320,11 +319,10 @@ if ($page == 'overview') {
} else {
$phpconfig_edit_data = include_once dirname(__FILE__).'/lib/formfields/admin/phpconfig/formfield.phpconfig_edit.php';
$phpconfig_edit_form = htmlform::genHTMLForm($phpconfig_edit_data);
$phpconfig_edit_data = include_once dirname(__FILE__).'/lib/formfields/admin/formfield.phpconfig.php';
$phpconfig_edit_form = HTMLform2::genHTMLForm($phpconfig_edit_data, $result);
$title = $phpconfig_edit_data['phpconfig_edit']['title'];
$image = $phpconfig_edit_data['phpconfig_edit']['image'];
$title = $lng['admin']['phpsettings']['editsettings'];
eval("echo \"" . getTemplate("phpconfig/overview_edit") . "\";");
}

View File

@@ -0,0 +1,92 @@
<?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 Formfields
*
*/
return array(
'section_a' => array(
'title' => $lng['admin']['phpsettings']['addsettings'],
'fields' => array(
'description' => array(
'label' => $lng['admin']['phpsettings']['description'],
'type' => 'text',
'attributes' => array(
'maxlength' => 50
)
),
'binary' => array(
'visible' => (Settings::Get('system.mod_fcgid') == 1 ? true : false),
'label' => $lng['admin']['phpsettings']['binary'],
'type' => 'text',
'value' => '/usr/bin/php-cgi',
'attributes' => array(
'maxlength' => 255
)
),
'file_extensions' => array(
'visible' => (Settings::Get('system.mod_fcgid') == 1 ? true : false),
'label' => $lng['admin']['phpsettings']['file_extensions'],
'desc' => $lng['admin']['phpsettings']['file_extensions_note'],
'type' => 'text',
'value' => 'php',
'attributes' => array(
'maxlength' => 255
)
),
'mod_fcgid_starter' => array(
'visible' => (Settings::Get('system.mod_fcgid') == 1 ? true : false),
'label' => $lng['admin']['mod_fcgid_starter']['title'],
'type' => 'text'
),
'mod_fcgid_maxrequests' => array(
'visible' => (Settings::Get('system.mod_fcgid') == 1 ? true : false),
'label' => $lng['admin']['mod_fcgid_maxrequests']['title'],
'type' => 'text'
),
'fpm_slowlog' => array(
'visible' => (Settings::Get('phpfpm.enabled') == 1 ? true : false),
'label' => $lng['admin']['phpsettings']['enable_slowlog'],
'type' => 'checkbox',
'value' => '1'
),
'fpm_reqterm' => array(
'visible' => (Settings::Get('phpfpm.enabled') == 1 ? true : false),
'label' => $lng['admin']['phpsettings']['request_terminate_timeout'],
'type' => 'text',
'value' => '60s',
'attributes' => array(
'maxlength' => 10
)
),
'fpm_reqslow' => array(
'visible' => (Settings::Get('phpfpm.enabled') == 1 ? true : false),
'label' => $lng['admin']['phpsettings']['request_slowlog_timeout'],
'type' => 'text',
'maxlength' => 10,
'value' => '5s'
),
'phpsettings' => array(
'style' => 'align-top',
'label' => $lng['admin']['phpsettings']['phpinisettings'],
'type' => 'textarea',
'value' => $result['phpsettings'],
'attributes' => array(
'cols' => 80,
'rows' => 20
)
)
)
)
);

View File

@@ -1,92 +0,0 @@
<?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 Formfields
*
*/
return array(
'phpconfig_add' => array(
'title' => $lng['admin']['phpsettings']['addsettings'],
'image' => 'icons/phpsettings_add.png',
'sections' => array(
'section_a' => array(
'title' => $lng['admin']['phpsettings']['addsettings'],
'image' => 'icons/phpsettings_add.png',
'fields' => array(
'description' => array(
'label' => $lng['admin']['phpsettings']['description'],
'type' => 'text',
'maxlength' => 50
),
'binary' => array(
'visible' => (Settings::Get('system.mod_fcgid') == 1 ? true : false),
'label' => $lng['admin']['phpsettings']['binary'],
'type' => 'text',
'maxlength' => 255,
'value' => '/usr/bin/php-cgi'
),
'file_extensions' => array(
'visible' => (Settings::Get('system.mod_fcgid') == 1 ? true : false),
'label' => $lng['admin']['phpsettings']['file_extensions'],
'desc' => $lng['admin']['phpsettings']['file_extensions_note'],
'type' => 'text',
'maxlength' => 255,
'value' => 'php'
),
'mod_fcgid_starter' => array(
'visible' => (Settings::Get('system.mod_fcgid') == 1 ? true : false),
'label' => $lng['admin']['mod_fcgid_starter']['title'],
'type' => 'text'
),
'mod_fcgid_maxrequests' => array(
'visible' => (Settings::Get('system.mod_fcgid') == 1 ? true : false),
'label' => $lng['admin']['mod_fcgid_maxrequests']['title'],
'type' => 'text'
),
'phpfpm_enable_slowlog' => array(
'visible' => (Settings::Get('phpfpm.enabled') == 1 ? true : false),
'label' => $lng['admin']['phpsettings']['enable_slowlog'],
'type' => 'checkbox',
'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1')
),
'value' => array()
),
'phpfpm_reqtermtimeout' => array(
'visible' => (Settings::Get('phpfpm.enabled') == 1 ? true : false),
'label' => $lng['admin']['phpsettings']['request_terminate_timeout'],
'type' => 'text',
'maxlength' => 10,
'value' => '60s'
),
'phpfpm_reqslowtimeout' => array(
'visible' => (Settings::Get('phpfpm.enabled') == 1 ? true : false),
'label' => $lng['admin']['phpsettings']['request_slowlog_timeout'],
'type' => 'text',
'maxlength' => 10,
'value' => '5s'
),
'phpsettings' => array(
'style' => 'align-top',
'label' => $lng['admin']['phpsettings']['phpinisettings'],
'type' => 'textarea',
'cols' => 80,
'rows' => 20,
'value' => $result['phpsettings']
)
)
)
)
)
);

View File

@@ -1,95 +0,0 @@
<?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 Formfields
*
*/
return array(
'phpconfig_edit' => array(
'title' => $lng['admin']['phpsettings']['editsettings'],
'image' => 'icons/phpsettings_edit.png',
'sections' => array(
'section_a' => array(
'title' => $lng['admin']['phpsettings']['editsettings'],
'image' => 'icons/phpsettings_edit.png',
'fields' => array(
'description' => array(
'label' => $lng['admin']['phpsettings']['description'],
'type' => 'text',
'maxlength' => 50,
'value' => $result['description']
),
'binary' => array(
'visible' => (Settings::Get('system.mod_fcgid') == 1 ? true : false),
'label' => $lng['admin']['phpsettings']['binary'],
'type' => 'text',
'maxlength' => 255,
'value' => $result['binary']
),
'file_extensions' => array(
'visible' => (Settings::Get('system.mod_fcgid') == 1 ? true : false),
'label' => $lng['admin']['phpsettings']['file_extensions'],
'desc' => $lng['admin']['phpsettings']['file_extensions_note'],
'type' => 'text',
'maxlength' => 255,
'value' => $result['file_extensions']
),
'mod_fcgid_starter' => array(
'visible' => (Settings::Get('system.mod_fcgid') == 1 ? true : false),
'label' => $lng['admin']['mod_fcgid_starter']['title'],
'type' => 'text',
'value' => ((int)$result['mod_fcgid_starter'] != - 1 ? $result['mod_fcgid_starter'] : '')
),
'mod_fcgid_maxrequests' => array(
'visible' => (Settings::Get('system.mod_fcgid') == 1 ? true : false),
'label' => $lng['admin']['mod_fcgid_maxrequests']['title'],
'type' => 'text',
'value' => ((int)$result['mod_fcgid_maxrequests'] != - 1 ? $result['mod_fcgid_maxrequests'] : '')
),
'phpfpm_enable_slowlog' => array(
'visible' => (Settings::Get('phpfpm.enabled') == 1 ? true : false),
'label' => $lng['admin']['phpsettings']['enable_slowlog'],
'type' => 'checkbox',
'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1')
),
'value' => array($result['fpm_slowlog'])
),
'phpfpm_reqtermtimeout' => array(
'visible' => (Settings::Get('phpfpm.enabled') == 1 ? true : false),
'label' => $lng['admin']['phpsettings']['request_terminate_timeout'],
'type' => 'text',
'maxlength' => 10,
'value' => $result['fpm_reqterm']
),
'phpfpm_reqslowtimeout' => array(
'visible' => (Settings::Get('phpfpm.enabled') == 1 ? true : false),
'label' => $lng['admin']['phpsettings']['request_slowlog_timeout'],
'type' => 'text',
'maxlength' => 10,
'value' => $result['fpm_reqslow']
),
'phpsettings' => array(
'style' => 'align-top',
'label' => $lng['admin']['phpsettings']['phpinisettings'],
'type' => 'textarea',
'cols' => 80,
'rows' => 20,
'value' => $result['phpsettings']
)
)
)
)
)
);