more tablelistings and php-related formfields
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
@@ -200,7 +200,8 @@ if ($page == 'admins' && $userinfo['change_serversettings'] == '1') {
|
|||||||
|
|
||||||
UI::twigBuffer('user/form.html.twig', [
|
UI::twigBuffer('user/form.html.twig', [
|
||||||
'formaction' => $linker->getLink(array('section' => 'admins', 'id' => $id)),
|
'formaction' => $linker->getLink(array('section' => 'admins', 'id' => $id)),
|
||||||
'formdata' => $admin_edit_data['admin_edit']
|
'formdata' => $admin_edit_data['admin_edit'],
|
||||||
|
'editid' => $id
|
||||||
]);
|
]);
|
||||||
UI::twigOutputBuffer();
|
UI::twigOutputBuffer();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -310,7 +310,8 @@ if ($page == 'customers' && $userinfo['customers'] != '0') {
|
|||||||
|
|
||||||
UI::twigBuffer('user/form.html.twig', [
|
UI::twigBuffer('user/form.html.twig', [
|
||||||
'formaction' => $linker->getLink(array('section' => 'customers', 'id' => $id)),
|
'formaction' => $linker->getLink(array('section' => 'customers', 'id' => $id)),
|
||||||
'formdata' => $customer_edit_data['customer_edit']
|
'formdata' => $customer_edit_data['customer_edit'],
|
||||||
|
'editid' => $id
|
||||||
]);
|
]);
|
||||||
UI::twigOutputBuffer();
|
UI::twigOutputBuffer();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -131,7 +131,8 @@ if ($page == 'ipsandports' || $page == 'overview') {
|
|||||||
|
|
||||||
UI::twigBuffer('user/form.html.twig', [
|
UI::twigBuffer('user/form.html.twig', [
|
||||||
'formaction' => $linker->getLink(array('section' => 'ipsandports', 'id' => $id)),
|
'formaction' => $linker->getLink(array('section' => 'ipsandports', 'id' => $id)),
|
||||||
'formdata' => $ipsandports_edit_data['ipsandports_edit']
|
'formdata' => $ipsandports_edit_data['ipsandports_edit'],
|
||||||
|
'editid' => $id
|
||||||
]);
|
]);
|
||||||
UI::twigOutputBuffer();
|
UI::twigOutputBuffer();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,9 +20,10 @@
|
|||||||
const AREA = 'admin';
|
const AREA = 'admin';
|
||||||
require __DIR__ . '/lib/init.php';
|
require __DIR__ . '/lib/init.php';
|
||||||
|
|
||||||
use Froxlor\Api\Commands\FpmDaemons as FpmDaemons;
|
use Froxlor\Api\Commands\FpmDaemons;
|
||||||
use Froxlor\Api\Commands\PhpSettings as PhpSettings;
|
use Froxlor\Api\Commands\PhpSettings;
|
||||||
use Froxlor\Database\Database;
|
use Froxlor\Database\Database;
|
||||||
|
use Froxlor\UI\Panel\UI;
|
||||||
use Froxlor\UI\Request;
|
use Froxlor\UI\Request;
|
||||||
|
|
||||||
$id = (int) Request::get('id');
|
$id = (int) Request::get('id');
|
||||||
@@ -32,35 +33,21 @@ if ($page == 'overview') {
|
|||||||
if ($action == '') {
|
if ($action == '') {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$json_result = PhpSettings::getLocal($userinfo, array(
|
$phpconf_list_data = include_once dirname(__FILE__) . '/lib/tablelisting/admin/tablelisting.phpconfigs.php';
|
||||||
'with_subdomains' => true
|
$collection = (new \Froxlor\UI\Collection(\Froxlor\Api\Commands\PhpSettings::class, $userinfo, ['with_subdomains' => true]))
|
||||||
))->listing();
|
->withPagination($phpconf_list_data['phpconf_list']['columns']);
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
\Froxlor\UI\Response::dynamic_error($e->getMessage());
|
\Froxlor\UI\Response::dynamic_error($e->getMessage());
|
||||||
}
|
}
|
||||||
$result = json_decode($json_result, true)['data'];
|
|
||||||
|
|
||||||
$tablecontent = '';
|
UI::twigBuffer('user/table.html.twig', [
|
||||||
$count = 0;
|
'listing' => \Froxlor\UI\Listing::format($collection, $phpconf_list_data['phpconf_list']),
|
||||||
if (isset($result['count']) && $result['count'] > 0) {
|
'actions_links' => [[
|
||||||
foreach ($result['list'] as $row) {
|
'href' => $linker->getLink(['section' => 'phpsettings', 'page' => $page, 'action' => 'add']),
|
||||||
if (isset($row['is_default']) && $row['is_default'] == true) {
|
'label' => $lng['admin']['phpsettings']['addnew']
|
||||||
$row['description'] = "<b>" . $row['description'] . "</b>";
|
]]
|
||||||
}
|
]);
|
||||||
$domains = "";
|
UI::twigOutputBuffer();
|
||||||
$subdomains_count = count($row['subdomains']);
|
|
||||||
foreach ($row['domains'] as $configdomain) {
|
|
||||||
$domains .= $idna_convert->decode($configdomain) . "<br>";
|
|
||||||
}
|
|
||||||
$count ++;
|
|
||||||
if ($subdomains_count == 0 && empty($domains)) {
|
|
||||||
$domains = $lng['admin']['phpsettings']['notused'];
|
|
||||||
}
|
|
||||||
eval("\$tablecontent.=\"" . \Froxlor\UI\Template::getTemplate("phpconfig/overview_overview") . "\";");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
eval("echo \"" . \Froxlor\UI\Template::getTemplate("phpconfig/overview") . "\";");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action == 'add') {
|
if ($action == 'add') {
|
||||||
@@ -80,9 +67,9 @@ if ($page == 'overview') {
|
|||||||
} else {
|
} else {
|
||||||
|
|
||||||
if (file_exists(\Froxlor\Froxlor::getInstallDir() . '/templates/misc/php/default.ini.php')) {
|
if (file_exists(\Froxlor\Froxlor::getInstallDir() . '/templates/misc/php/default.ini.php')) {
|
||||||
require_once \Froxlor\Froxlor::getInstallDir() . '/templates/misc/php/default.ini.php';
|
include \Froxlor\Froxlor::getInstallDir() . '/templates/misc/php/default.ini.php';
|
||||||
$result = [
|
$result = [
|
||||||
'phpsettings' => DEFAULT_PHPINI
|
'phpsettings' => $phpini
|
||||||
];
|
];
|
||||||
} else {
|
} else {
|
||||||
// use first php-config as fallback
|
// use first php-config as fallback
|
||||||
@@ -90,23 +77,19 @@ if ($page == 'overview') {
|
|||||||
$result = $result_stmt->fetch(PDO::FETCH_ASSOC);
|
$result = $result_stmt->fetch(PDO::FETCH_ASSOC);
|
||||||
}
|
}
|
||||||
|
|
||||||
$fpmconfigs = '';
|
$fpmconfigs = [];
|
||||||
$configs = Database::query("SELECT * FROM `" . TABLE_PANEL_FPMDAEMONS . "` ORDER BY `description` ASC");
|
$configs = Database::query("SELECT * FROM `" . TABLE_PANEL_FPMDAEMONS . "` ORDER BY `description` ASC");
|
||||||
while ($row = $configs->fetch(PDO::FETCH_ASSOC)) {
|
while ($row = $configs->fetch(PDO::FETCH_ASSOC)) {
|
||||||
$fpmconfigs .= \Froxlor\UI\HTML::makeoption($row['description'], $row['id'], 1, true, true);
|
$fpmconfigs[$row['id']] = $row['description'];;
|
||||||
}
|
}
|
||||||
|
|
||||||
$pm_select = \Froxlor\UI\HTML::makeoption('static', 'static', 'dynamic', true, true);
|
|
||||||
$pm_select .= \Froxlor\UI\HTML::makeoption('dynamic', 'dynamic', 'dynamic', true, true);
|
|
||||||
$pm_select .= \Froxlor\UI\HTML::makeoption('ondemand', 'ondemand', 'dynamic', true, true);
|
|
||||||
|
|
||||||
$phpconfig_add_data = include_once dirname(__FILE__) . '/lib/formfields/admin/phpconfig/formfield.phpconfig_add.php';
|
$phpconfig_add_data = include_once dirname(__FILE__) . '/lib/formfields/admin/phpconfig/formfield.phpconfig_add.php';
|
||||||
$phpconfig_add_form = \Froxlor\UI\HtmlForm::genHTMLForm($phpconfig_add_data);
|
|
||||||
|
|
||||||
$title = $phpconfig_add_data['phpconfig_add']['title'];
|
UI::twigBuffer('user/form.html.twig', [
|
||||||
$image = $phpconfig_add_data['phpconfig_add']['image'];
|
'formaction' => $linker->getLink(array('section' => 'phpsettings')),
|
||||||
|
'formdata' => $phpconfig_add_data['phpconfig_add']
|
||||||
eval("echo \"" . \Froxlor\UI\Template::getTemplate("phpconfig/overview_add") . "\";");
|
]);
|
||||||
|
UI::twigOutputBuffer();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
\Froxlor\UI\Response::standard_error('nopermissionsorinvalidid');
|
\Froxlor\UI\Response::standard_error('nopermissionsorinvalidid');
|
||||||
@@ -176,23 +159,20 @@ if ($page == 'overview') {
|
|||||||
));
|
));
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
$fpmconfigs = '';
|
$fpmconfigs = [];
|
||||||
$configs = Database::query("SELECT * FROM `" . TABLE_PANEL_FPMDAEMONS . "` ORDER BY `description` ASC");
|
$configs = Database::query("SELECT * FROM `" . TABLE_PANEL_FPMDAEMONS . "` ORDER BY `description` ASC");
|
||||||
while ($row = $configs->fetch(PDO::FETCH_ASSOC)) {
|
while ($row = $configs->fetch(PDO::FETCH_ASSOC)) {
|
||||||
$fpmconfigs .= \Froxlor\UI\HTML::makeoption($row['description'], $row['id'], $result['fpmsettingid'], true, true);
|
$fpmconfigs[$row['id']] = $row['description'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$pm_select = \Froxlor\UI\HTML::makeoption('static', 'static', $result['pm'], true, true);
|
|
||||||
$pm_select .= \Froxlor\UI\HTML::makeoption('dynamic', 'dynamic', $result['pm'], true, true);
|
|
||||||
$pm_select .= \Froxlor\UI\HTML::makeoption('ondemand', 'ondemand', $result['pm'], true, true);
|
|
||||||
|
|
||||||
$phpconfig_edit_data = include_once dirname(__FILE__) . '/lib/formfields/admin/phpconfig/formfield.phpconfig_edit.php';
|
$phpconfig_edit_data = include_once dirname(__FILE__) . '/lib/formfields/admin/phpconfig/formfield.phpconfig_edit.php';
|
||||||
$phpconfig_edit_form = \Froxlor\UI\HtmlForm::genHTMLForm($phpconfig_edit_data);
|
|
||||||
|
|
||||||
$title = $phpconfig_edit_data['phpconfig_edit']['title'];
|
UI::twigBuffer('user/form.html.twig', [
|
||||||
$image = $phpconfig_edit_data['phpconfig_edit']['image'];
|
'formaction' => $linker->getLink(array('section' => 'phpsettings', 'id' => $id)),
|
||||||
|
'formdata' => $phpconfig_edit_data['phpconfig_edit'],
|
||||||
eval("echo \"" . \Froxlor\UI\Template::getTemplate("phpconfig/overview_edit") . "\";");
|
'editid' => $id
|
||||||
|
]);
|
||||||
|
UI::twigOutputBuffer();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
\Froxlor\UI\Response::standard_error('nopermissionsorinvalidid');
|
\Froxlor\UI\Response::standard_error('nopermissionsorinvalidid');
|
||||||
@@ -217,7 +197,7 @@ if ($page == 'overview') {
|
|||||||
foreach ($row['configs'] as $configused) {
|
foreach ($row['configs'] as $configused) {
|
||||||
$configs .= $configused . "<br>";
|
$configs .= $configused . "<br>";
|
||||||
}
|
}
|
||||||
$count ++;
|
$count++;
|
||||||
eval("\$tablecontent.=\"" . \Froxlor\UI\Template::getTemplate("phpconfig/fpmdaemons_overview") . "\";");
|
eval("\$tablecontent.=\"" . \Froxlor\UI\Template::getTemplate("phpconfig/fpmdaemons_overview") . "\";");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -240,17 +220,13 @@ if ($page == 'overview') {
|
|||||||
));
|
));
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
$pm_select = \Froxlor\UI\HTML::makeoption('static', 'static', 'dynamic', true, true);
|
|
||||||
$pm_select .= \Froxlor\UI\HTML::makeoption('dynamic', 'dynamic', 'dynamic', true, true);
|
|
||||||
$pm_select .= \Froxlor\UI\HTML::makeoption('ondemand', 'ondemand', 'dynamic', true, true);
|
|
||||||
|
|
||||||
$fpmconfig_add_data = include_once dirname(__FILE__) . '/lib/formfields/admin/phpconfig/formfield.fpmconfig_add.php';
|
$fpmconfig_add_data = include_once dirname(__FILE__) . '/lib/formfields/admin/phpconfig/formfield.fpmconfig_add.php';
|
||||||
$fpmconfig_add_form = \Froxlor\UI\HtmlForm::genHTMLForm($fpmconfig_add_data);
|
|
||||||
|
|
||||||
$title = $fpmconfig_add_data['fpmconfig_add']['title'];
|
UI::twigBuffer('user/form.html.twig', [
|
||||||
$image = $fpmconfig_add_data['fpmconfig_add']['image'];
|
'formaction' => $linker->getLink(array('section' => 'phpsettings', 'page' => 'fpmdaemons')),
|
||||||
|
'formdata' => $fpmconfig_add_data['fpmconfig_add']
|
||||||
eval("echo \"" . \Froxlor\UI\Template::getTemplate("phpconfig/fpmconfig_add") . "\";");
|
]);
|
||||||
|
UI::twigOutputBuffer();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
\Froxlor\UI\Response::standard_error('nopermissionsorinvalidid');
|
\Froxlor\UI\Response::standard_error('nopermissionsorinvalidid');
|
||||||
@@ -321,17 +297,14 @@ if ($page == 'overview') {
|
|||||||
));
|
));
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
$pm_select = \Froxlor\UI\HTML::makeoption('static', 'static', $result['pm'], true, true);
|
|
||||||
$pm_select .= \Froxlor\UI\HTML::makeoption('dynamic', 'dynamic', $result['pm'], true, true);
|
|
||||||
$pm_select .= \Froxlor\UI\HTML::makeoption('ondemand', 'ondemand', $result['pm'], true, true);
|
|
||||||
|
|
||||||
$fpmconfig_edit_data = include_once dirname(__FILE__) . '/lib/formfields/admin/phpconfig/formfield.fpmconfig_edit.php';
|
$fpmconfig_edit_data = include_once dirname(__FILE__) . '/lib/formfields/admin/phpconfig/formfield.fpmconfig_edit.php';
|
||||||
$fpmconfig_edit_form = \Froxlor\UI\HtmlForm::genHTMLForm($fpmconfig_edit_data);
|
|
||||||
|
|
||||||
$title = $fpmconfig_edit_data['fpmconfig_edit']['title'];
|
UI::twigBuffer('user/form.html.twig', [
|
||||||
$image = $fpmconfig_edit_data['fpmconfig_edit']['image'];
|
'formaction' => $linker->getLink(array('section' => 'phpsettings', 'page' => 'fpmdaemons', 'id' => $id)),
|
||||||
|
'formdata' => $fpmconfig_edit_data['fpmconfig_edit'],
|
||||||
eval("echo \"" . \Froxlor\UI\Template::getTemplate("phpconfig/fpmconfig_edit") . "\";");
|
'editid' => $id
|
||||||
|
]);
|
||||||
|
UI::twigOutputBuffer();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
\Froxlor\UI\Response::standard_error('nopermissionsorinvalidid');
|
\Froxlor\UI\Response::standard_error('nopermissionsorinvalidid');
|
||||||
|
|||||||
@@ -228,7 +228,8 @@ if ($page == '' || $page == 'overview') {
|
|||||||
|
|
||||||
UI::twigBuffer('user/form.html.twig', [
|
UI::twigBuffer('user/form.html.twig', [
|
||||||
'formaction' => $linker->getLink(array('section' => 'plans', 'id' => $id)),
|
'formaction' => $linker->getLink(array('section' => 'plans', 'id' => $id)),
|
||||||
'formdata' => $plans_add_data['plans_add']
|
'formdata' => $plans_edit_data['plans_edit'],
|
||||||
|
'editid' => $id
|
||||||
]);
|
]);
|
||||||
UI::twigOutputBuffer();
|
UI::twigOutputBuffer();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -349,7 +349,8 @@ if ($page == 'overview' || $page == 'domains') {
|
|||||||
|
|
||||||
UI::twigBuffer('user/form.html.twig', [
|
UI::twigBuffer('user/form.html.twig', [
|
||||||
'formaction' => $linker->getLink(array('section' => 'domains', 'id' => $id)),
|
'formaction' => $linker->getLink(array('section' => 'domains', 'id' => $id)),
|
||||||
'formdata' => $subdomain_edit_data['domain_edit']
|
'formdata' => $subdomain_edit_data['domain_edit'],
|
||||||
|
'editid' => $id
|
||||||
]);
|
]);
|
||||||
UI::twigOutputBuffer();
|
UI::twigOutputBuffer();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -195,7 +195,8 @@ if ($page == 'overview' || $page == 'emails') {
|
|||||||
|
|
||||||
UI::twigBuffer('user/form.html.twig', [
|
UI::twigBuffer('user/form.html.twig', [
|
||||||
'formaction' => $linker->getLink(array('section' => 'email')),
|
'formaction' => $linker->getLink(array('section' => 'email')),
|
||||||
'formdata' => $email_edit_data['emails_edit']
|
'formdata' => $email_edit_data['emails_edit'],
|
||||||
|
'editid' => $id
|
||||||
]);
|
]);
|
||||||
UI::twigOutputBuffer();
|
UI::twigOutputBuffer();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -149,7 +149,8 @@ if ($page == 'overview' || $page == 'htpasswds') {
|
|||||||
|
|
||||||
UI::twigBuffer('user/form.html.twig', [
|
UI::twigBuffer('user/form.html.twig', [
|
||||||
'formaction' => $linker->getLink(array('section' => 'extras', 'id' => $id)),
|
'formaction' => $linker->getLink(array('section' => 'extras', 'id' => $id)),
|
||||||
'formdata' => $htpasswd_edit_data['htpasswd_edit']
|
'formdata' => $htpasswd_edit_data['htpasswd_edit'],
|
||||||
|
'editid' => $id
|
||||||
]);
|
]);
|
||||||
UI::twigOutputBuffer();
|
UI::twigOutputBuffer();
|
||||||
}
|
}
|
||||||
@@ -269,7 +270,8 @@ if ($page == 'overview' || $page == 'htpasswds') {
|
|||||||
|
|
||||||
UI::twigBuffer('user/form.html.twig', [
|
UI::twigBuffer('user/form.html.twig', [
|
||||||
'formaction' => $linker->getLink(array('section' => 'extras', 'id' => $id)),
|
'formaction' => $linker->getLink(array('section' => 'extras', 'id' => $id)),
|
||||||
'formdata' => $htaccess_edit_data['htaccess_edit']
|
'formdata' => $htaccess_edit_data['htaccess_edit'],
|
||||||
|
'editid' => $id
|
||||||
]);
|
]);
|
||||||
UI::twigOutputBuffer();
|
UI::twigOutputBuffer();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -179,7 +179,8 @@ if ($page == 'overview' || $page == 'accounts') {
|
|||||||
|
|
||||||
UI::twigBuffer('user/form.html.twig', [
|
UI::twigBuffer('user/form.html.twig', [
|
||||||
'formaction' => $linker->getLink(array('section' => 'ftp', 'id' => $id)),
|
'formaction' => $linker->getLink(array('section' => 'ftp', 'id' => $id)),
|
||||||
'formdata' => $ftp_edit_data['ftp_edit']
|
'formdata' => $ftp_edit_data['ftp_edit'],
|
||||||
|
'editid' => $id
|
||||||
]);
|
]);
|
||||||
UI::twigOutputBuffer();
|
UI::twigOutputBuffer();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -185,7 +185,8 @@ if ($page == 'overview' || $page == 'mysqls') {
|
|||||||
|
|
||||||
UI::twigBuffer('user/form.html.twig', [
|
UI::twigBuffer('user/form.html.twig', [
|
||||||
'formaction' => $linker->getLink(array('section' => 'mysql', 'id' => $id)),
|
'formaction' => $linker->getLink(array('section' => 'mysql', 'id' => $id)),
|
||||||
'formdata' => $mysql_edit_data['mysql_edit']
|
'formdata' => $mysql_edit_data['mysql_edit'],
|
||||||
|
'editid' => $id
|
||||||
]);
|
]);
|
||||||
UI::twigOutputBuffer();
|
UI::twigOutputBuffer();
|
||||||
}
|
}
|
||||||
|
|||||||
62
lib/Froxlor/UI/Callbacks/PHPConf.php
Normal file
62
lib/Froxlor/UI/Callbacks/PHPConf.php
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Froxlor\UI\Callbacks;
|
||||||
|
|
||||||
|
use Froxlor\Idna\IdnaWrapper;
|
||||||
|
use Froxlor\UI\Panel\UI;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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 Froxlor\UI\Callbacks
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
class PHPConf
|
||||||
|
{
|
||||||
|
public static function domainList(array $attributes)
|
||||||
|
{
|
||||||
|
$idna = new IdnaWrapper;
|
||||||
|
$domains = "";
|
||||||
|
$subdomains_count = count($attributes['fields']['subdomains']);
|
||||||
|
foreach ($attributes['fields']['domains'] as $configdomain) {
|
||||||
|
$domains .= $idna->decode($configdomain) . "<br>";
|
||||||
|
}
|
||||||
|
if ($subdomains_count == 0 && empty($domains)) {
|
||||||
|
$domains = UI::getLng('admin.phpsettings.notused');
|
||||||
|
} else {
|
||||||
|
$domains .= (!empty($domains) ? '+ ' : '') . $subdomains_count . ' ' . UI::getLng(('customer.subdomains'));
|
||||||
|
}
|
||||||
|
|
||||||
|
return $domains;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function isNotDefault(array $attributes)
|
||||||
|
{
|
||||||
|
return $attributes['fields']['id'] != 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function fpmConfLink(array $attributes)
|
||||||
|
{
|
||||||
|
$linker = UI::getLinker();
|
||||||
|
return [
|
||||||
|
'type' => 'link',
|
||||||
|
'data' => [
|
||||||
|
'text' => $attributes['data'],
|
||||||
|
'href' => $linker->getLink([
|
||||||
|
'section' => 'phpsettings',
|
||||||
|
'page' => 'fpmdaemons',
|
||||||
|
'action' => 'edit',
|
||||||
|
'id' => $attributes['fields']['fpmsettingid'],
|
||||||
|
]),
|
||||||
|
]
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -43,8 +43,11 @@ return array(
|
|||||||
'pm' => array(
|
'pm' => array(
|
||||||
'label' => $lng['serversettings']['phpfpm_settings']['pm'],
|
'label' => $lng['serversettings']['phpfpm_settings']['pm'],
|
||||||
'type' => 'select',
|
'type' => 'select',
|
||||||
'select_var' => $pm_select,
|
'select_var' => [
|
||||||
'selected' => '@TODO'
|
'static' => 'static',
|
||||||
|
'dynamic' => 'dynamic',
|
||||||
|
'ondemand' => 'ondemand'
|
||||||
|
]
|
||||||
),
|
),
|
||||||
'max_children' => array(
|
'max_children' => array(
|
||||||
'label' => $lng['serversettings']['phpfpm_settings']['max_children']['title'],
|
'label' => $lng['serversettings']['phpfpm_settings']['max_children']['title'],
|
||||||
|
|||||||
@@ -44,8 +44,12 @@ return array(
|
|||||||
'pm' => array(
|
'pm' => array(
|
||||||
'label' => $lng['serversettings']['phpfpm_settings']['pm'],
|
'label' => $lng['serversettings']['phpfpm_settings']['pm'],
|
||||||
'type' => 'select',
|
'type' => 'select',
|
||||||
'select_var' => $pm_select,
|
'select_var' => [
|
||||||
'selected' => '@TODO'
|
'static' => 'static',
|
||||||
|
'dynamic' => 'dynamic',
|
||||||
|
'ondemand' => 'ondemand'
|
||||||
|
],
|
||||||
|
'selected' => $result['pm']
|
||||||
),
|
),
|
||||||
'max_children' => array(
|
'max_children' => array(
|
||||||
'label' => $lng['serversettings']['phpfpm_settings']['max_children']['title'],
|
'label' => $lng['serversettings']['phpfpm_settings']['max_children']['title'],
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ return array(
|
|||||||
'label' => $lng['admin']['phpsettings']['fpmdesc'],
|
'label' => $lng['admin']['phpsettings']['fpmdesc'],
|
||||||
'type' => 'select',
|
'type' => 'select',
|
||||||
'select_var' => $fpmconfigs,
|
'select_var' => $fpmconfigs,
|
||||||
'selected' => '@TODO'
|
'selected' => 1
|
||||||
),
|
),
|
||||||
'file_extensions' => array(
|
'file_extensions' => array(
|
||||||
'visible' => (\Froxlor\Settings::Get('system.mod_fcgid') == 1 ? true : false),
|
'visible' => (\Froxlor\Settings::Get('system.mod_fcgid') == 1 ? true : false),
|
||||||
@@ -107,8 +107,11 @@ return array(
|
|||||||
'label' => $lng['serversettings']['phpfpm_settings']['pm'],
|
'label' => $lng['serversettings']['phpfpm_settings']['pm'],
|
||||||
'desc' => $lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
|
'desc' => $lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
|
||||||
'type' => 'select',
|
'type' => 'select',
|
||||||
'select_var' => $pm_select,
|
'select_var' => [
|
||||||
'selected' => '@TODO'
|
'static' => 'static',
|
||||||
|
'dynamic' => 'dynamic',
|
||||||
|
'ondemand' => 'ondemand'
|
||||||
|
]
|
||||||
),
|
),
|
||||||
'max_children' => array(
|
'max_children' => array(
|
||||||
'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false),
|
'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false),
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ return array(
|
|||||||
'label' => $lng['admin']['phpsettings']['fpmdesc'],
|
'label' => $lng['admin']['phpsettings']['fpmdesc'],
|
||||||
'type' => 'select',
|
'type' => 'select',
|
||||||
'select_var' => $fpmconfigs,
|
'select_var' => $fpmconfigs,
|
||||||
'selected' => '@TODO'
|
'selected' => $result['fpmsettingid']
|
||||||
),
|
),
|
||||||
'file_extensions' => array(
|
'file_extensions' => array(
|
||||||
'visible' => (\Froxlor\Settings::Get('system.mod_fcgid') == 1 ? true : false),
|
'visible' => (\Froxlor\Settings::Get('system.mod_fcgid') == 1 ? true : false),
|
||||||
@@ -55,13 +55,13 @@ return array(
|
|||||||
'visible' => (\Froxlor\Settings::Get('system.mod_fcgid') == 1 ? true : false),
|
'visible' => (\Froxlor\Settings::Get('system.mod_fcgid') == 1 ? true : false),
|
||||||
'label' => $lng['admin']['mod_fcgid_starter']['title'],
|
'label' => $lng['admin']['mod_fcgid_starter']['title'],
|
||||||
'type' => 'number',
|
'type' => 'number',
|
||||||
'value' => ((int) $result['mod_fcgid_starter'] != - 1 ? $result['mod_fcgid_starter'] : '')
|
'value' => ((int) $result['mod_fcgid_starter'] != -1 ? $result['mod_fcgid_starter'] : '')
|
||||||
),
|
),
|
||||||
'mod_fcgid_maxrequests' => array(
|
'mod_fcgid_maxrequests' => array(
|
||||||
'visible' => (\Froxlor\Settings::Get('system.mod_fcgid') == 1 ? true : false),
|
'visible' => (\Froxlor\Settings::Get('system.mod_fcgid') == 1 ? true : false),
|
||||||
'label' => $lng['admin']['mod_fcgid_maxrequests']['title'],
|
'label' => $lng['admin']['mod_fcgid_maxrequests']['title'],
|
||||||
'type' => 'number',
|
'type' => 'number',
|
||||||
'value' => ((int) $result['mod_fcgid_maxrequests'] != - 1 ? $result['mod_fcgid_maxrequests'] : '')
|
'value' => ((int) $result['mod_fcgid_maxrequests'] != -1 ? $result['mod_fcgid_maxrequests'] : '')
|
||||||
),
|
),
|
||||||
'mod_fcgid_umask' => array(
|
'mod_fcgid_umask' => array(
|
||||||
'visible' => (\Froxlor\Settings::Get('system.mod_fcgid') == 1 ? true : false),
|
'visible' => (\Froxlor\Settings::Get('system.mod_fcgid') == 1 ? true : false),
|
||||||
@@ -109,8 +109,12 @@ return array(
|
|||||||
'label' => $lng['serversettings']['phpfpm_settings']['pm'],
|
'label' => $lng['serversettings']['phpfpm_settings']['pm'],
|
||||||
'desc' => $lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
|
'desc' => $lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
|
||||||
'type' => 'select',
|
'type' => 'select',
|
||||||
'select_var' => $pm_select,
|
'select_var' => [
|
||||||
'selected' => '@TODO'
|
'static' => 'static',
|
||||||
|
'dynamic' => 'dynamic',
|
||||||
|
'ondemand' => 'ondemand'
|
||||||
|
],
|
||||||
|
'selected' => $result['pm']
|
||||||
),
|
),
|
||||||
'max_children' => array(
|
'max_children' => array(
|
||||||
'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false),
|
'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false),
|
||||||
|
|||||||
85
lib/tablelisting/admin/tablelisting.phpconfigs.php
Normal file
85
lib/tablelisting/admin/tablelisting.phpconfigs.php
Normal file
@@ -0,0 +1,85 @@
|
|||||||
|
<?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-)
|
||||||
|
* @author Maurice Preuß <hello@envoyr.com>
|
||||||
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||||
|
* @package Tabellisting
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
use Froxlor\UI\Callbacks\PHPConf;
|
||||||
|
use Froxlor\UI\Listing;
|
||||||
|
use Froxlor\Settings;
|
||||||
|
|
||||||
|
return [
|
||||||
|
'phpconf_list' => [
|
||||||
|
'title' => $lng['menue']['phpsettings']['maintitle'],
|
||||||
|
'icon' => 'fa-brands fa-php',
|
||||||
|
'columns' => [
|
||||||
|
'c.description' => [
|
||||||
|
'label' => $lng['admin']['phpsettings']['description'],
|
||||||
|
'field' => 'description',
|
||||||
|
],
|
||||||
|
'domains' => [
|
||||||
|
'label' => $lng['admin']['phpsettings']['activedomains'],
|
||||||
|
'field' => 'domains',
|
||||||
|
'text' => [PHPConf::class, 'domainList']
|
||||||
|
],
|
||||||
|
'fpmdesc' => [
|
||||||
|
'label' => $lng['admin']['phpsettings']['fpmdesc'],
|
||||||
|
'field' => 'fpmdesc',
|
||||||
|
'visible' => (bool) Settings::Get('phpfpm.enabled'),
|
||||||
|
'format_callback' => [PHPConf::class, 'fpmConfLink']
|
||||||
|
],
|
||||||
|
'c.binary' => [
|
||||||
|
'label' => $lng['admin']['phpsettings']['binary'],
|
||||||
|
'field' => 'binary',
|
||||||
|
'visible' => !(bool) Settings::Get('phpfpm.enabled')
|
||||||
|
],
|
||||||
|
'c.file_extensions' => [
|
||||||
|
'label' => $lng['admin']['phpsettings']['file_extensions'],
|
||||||
|
'field' => 'file_extensions',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
'visible_columns' => Listing::getVisibleColumnsForListing('phpconf_list', [
|
||||||
|
'c.description',
|
||||||
|
'domains',
|
||||||
|
'fpmdesc',
|
||||||
|
'c.binary',
|
||||||
|
'c.file_extensions'
|
||||||
|
]),
|
||||||
|
'actions' => [
|
||||||
|
'edit' => [
|
||||||
|
'icon' => 'fa fa-edit',
|
||||||
|
'title' => $lng['panel']['edit'],
|
||||||
|
'href' => [
|
||||||
|
'section' => 'phpsettings',
|
||||||
|
'page' => 'overview',
|
||||||
|
'action' => 'edit',
|
||||||
|
'id' => ':id'
|
||||||
|
],
|
||||||
|
],
|
||||||
|
'delete' => [
|
||||||
|
'icon' => 'fa fa-trash',
|
||||||
|
'title' => $lng['panel']['delete'],
|
||||||
|
'class' => 'text-danger',
|
||||||
|
'href' => [
|
||||||
|
'section' => 'phpsettings',
|
||||||
|
'page' => 'overview',
|
||||||
|
'action' => 'delete',
|
||||||
|
'id' => ':id'
|
||||||
|
],
|
||||||
|
'visible' => [PHPConf::class, 'isNotDefault']
|
||||||
|
]
|
||||||
|
]
|
||||||
|
]
|
||||||
|
];
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
{% macro form(form_data, formaction, title = "") %}
|
{% macro form(form_data, formaction, title = "", hiddenid = "") %}
|
||||||
|
|
||||||
{% import "Froxlor/form/formfields.html.twig" as formfields %}
|
{% import "Froxlor/form/formfields.html.twig" as formfields %}
|
||||||
|
|
||||||
@@ -33,6 +33,9 @@
|
|||||||
<!-- submit buttons -->
|
<!-- submit buttons -->
|
||||||
<div class="card mb-3">
|
<div class="card mb-3">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
|
{% if hiddenid is not empty %}
|
||||||
|
<input type="hidden" name="id" value="{{ hiddenid }}"/>
|
||||||
|
{% endif %}
|
||||||
<input type="hidden" name="s" value="{{ s }}"/>
|
<input type="hidden" name="s" value="{{ s }}"/>
|
||||||
<input type="hidden" name="page" value="{{ page }}"/>
|
<input type="hidden" name="page" value="{{ page }}"/>
|
||||||
<input type="hidden" name="action" value="{{ action }}"/>
|
<input type="hidden" name="action" value="{{ action }}"/>
|
||||||
|
|||||||
@@ -4,6 +4,6 @@
|
|||||||
|
|
||||||
{% import "Froxlor/form/form.html.twig" as form %}
|
{% import "Froxlor/form/form.html.twig" as form %}
|
||||||
|
|
||||||
{{ form.form(formdata, formaction|default('#'), formdata.title) }}
|
{{ form.form(formdata, formaction|default('#'), formdata.title, editid|default('')) }}
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
@@ -70,5 +70,3 @@ upload_tmp_dir = "{TMP_DIR}"
|
|||||||
variables_order = "GPCS"
|
variables_order = "GPCS"
|
||||||
opcache.restrict_api = "{DOCUMENT_ROOT}"
|
opcache.restrict_api = "{DOCUMENT_ROOT}"
|
||||||
EOINI;
|
EOINI;
|
||||||
|
|
||||||
define('DEFAULT_PHPINI', $phpini);
|
|
||||||
|
|||||||
Reference in New Issue
Block a user