Migrate to new HTMLform2 class
Signed-off-by: Roman Schmerold (BNoiZe) <bnoize@froxlor.org>
This commit is contained in:
@@ -259,11 +259,10 @@ if ($page == 'ipsandports'
|
||||
|
||||
} else {
|
||||
|
||||
$ipsandports_add_data = include_once dirname(__FILE__).'/lib/formfields/admin/ipsandports/formfield.ipsandports_add.php';
|
||||
$ipsandports_add_form = htmlform::genHTMLForm($ipsandports_add_data);
|
||||
$ipsandports_add_data = include_once dirname(__FILE__).'/lib/formfields/admin/formfield.ipsandports.php';
|
||||
$ipsandports_add_form = HTMLform2::genHTMLForm($ipsandports_add_data);
|
||||
|
||||
$title = $ipsandports_add_data['ipsandports_add']['title'];
|
||||
$image = $ipsandports_add_data['ipsandports_add']['image'];
|
||||
$title = $lng['admin']['ipsandports']['add'];
|
||||
|
||||
eval("echo \"" . getTemplate("ipsandports/ipsandports_add") . "\";");
|
||||
}
|
||||
@@ -420,11 +419,10 @@ if ($page == 'ipsandports'
|
||||
|
||||
$result = htmlentities_array($result);
|
||||
|
||||
$ipsandports_edit_data = include_once dirname(__FILE__).'/lib/formfields/admin/ipsandports/formfield.ipsandports_edit.php';
|
||||
$ipsandports_edit_form = htmlform::genHTMLForm($ipsandports_edit_data);
|
||||
$ipsandports_edit_data = include_once dirname(__FILE__).'/lib/formfields/admin/formfield.ipsandports.php';
|
||||
$ipsandports_edit_form = HTMLform2::genHTMLForm($ipsandports_edit_data, $result);
|
||||
|
||||
$title = $ipsandports_edit_data['ipsandports_edit']['title'];
|
||||
$image = $ipsandports_edit_data['ipsandports_edit']['image'];
|
||||
$title = $lng['admin']['ipsandports']['edit'];
|
||||
|
||||
eval("echo \"" . getTemplate("ipsandports/ipsandports_edit") . "\";");
|
||||
}
|
||||
|
||||
126
lib/formfields/admin/formfield.ipsandports.php
Normal file
126
lib/formfields/admin/formfield.ipsandports.php
Normal file
@@ -0,0 +1,126 @@
|
||||
<?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']['ipsandports']['ipandport'],
|
||||
'fields' => array(
|
||||
'ip' => array(
|
||||
'label' => $lng['admin']['ipsandports']['ip'],
|
||||
'type' => 'text'
|
||||
),
|
||||
'port' => array(
|
||||
'label' => $lng['admin']['ipsandports']['port'],
|
||||
'type' => 'text',
|
||||
'size' => 5
|
||||
)
|
||||
)
|
||||
),
|
||||
'section_b' => array(
|
||||
'title' => $lng['admin']['ipsandports']['webserverdefaultconfig'],
|
||||
'fields' => array(
|
||||
'listen_statement' => array(
|
||||
'label' => $lng['admin']['ipsandports']['create_listen_statement'],
|
||||
'type' => 'checkbox',
|
||||
'value' => '1',
|
||||
'attributes' => array(
|
||||
'checked' => true
|
||||
)
|
||||
),
|
||||
'namevirtualhost_statement' => array(
|
||||
'label' => $lng['admin']['ipsandports']['create_namevirtualhost_statement'],
|
||||
'type' => 'checkbox',
|
||||
'value' => '1',
|
||||
'attributes' => array(
|
||||
'checked' => true
|
||||
)
|
||||
),
|
||||
'vhostcontainer' => array(
|
||||
'label' => $lng['admin']['ipsandports']['create_vhostcontainer'],
|
||||
'type' => 'checkbox',
|
||||
'value' => '1',
|
||||
'attributes' => array(
|
||||
'checked' => true
|
||||
)
|
||||
),
|
||||
'docroot' => array(
|
||||
'label' => $lng['admin']['ipsandports']['docroot']['title'],
|
||||
'desc' => $lng['admin']['ipsandports']['docroot']['description'],
|
||||
'type' => 'text'
|
||||
),
|
||||
'specialsettings' => array(
|
||||
'label' => $lng['admin']['ownvhostsettings'],
|
||||
'desc' => $lng['serversettings']['default_vhostconf']['description'],
|
||||
'type' => 'textarea',
|
||||
'attributes' => array(
|
||||
'cols' => 60,
|
||||
'rows' => 12
|
||||
)
|
||||
),
|
||||
'vhostcontainer_servername_statement' => array(
|
||||
'label' => $lng['admin']['ipsandports']['create_vhostcontainer_servername_statement'],
|
||||
'type' => 'checkbox',
|
||||
'value' => '1',
|
||||
'attributes' => array(
|
||||
'checked' => true
|
||||
)
|
||||
)
|
||||
)
|
||||
),
|
||||
'section_c' => array(
|
||||
'title' => $lng['admin']['ipsandports']['webserverdomainconfig'],
|
||||
'fields' => array(
|
||||
'default_vhostconf_domain' => array(
|
||||
'label' => $lng['admin']['ipsandports']['default_vhostconf_domain'],
|
||||
'desc' => $lng['serversettings']['default_vhostconf_domain']['description'],
|
||||
'type' => 'textarea',
|
||||
'attributes' => array(
|
||||
'cols' => 60,
|
||||
'rows' => 12
|
||||
)
|
||||
)
|
||||
)
|
||||
),
|
||||
'section_d' => array(
|
||||
'title' => $lng['admin']['ipsandports']['webserverssldomainconfig'],
|
||||
'visible' => (Settings::Get('system.use_ssl') == 1 ? true : false),
|
||||
'fields' => array(
|
||||
'ssl' => array(
|
||||
'label' => $lng['admin']['ipsandports']['enable_ssl'],
|
||||
'type' => 'checkbox',
|
||||
'value' => '1'
|
||||
),
|
||||
'ssl_cert_file' => array(
|
||||
'label' => $lng['admin']['ipsandports']['ssl_cert_file'],
|
||||
'type' => 'text'
|
||||
),
|
||||
'ssl_key_file' => array(
|
||||
'label' => $lng['admin']['ipsandports']['ssl_key_file'],
|
||||
'type' => 'text'
|
||||
),
|
||||
'ssl_ca_file' => array(
|
||||
'label' => $lng['admin']['ipsandports']['ssl_ca_file'],
|
||||
'type' => 'text'
|
||||
),
|
||||
'ssl_cert_chainfile' => array(
|
||||
'label' => $lng['admin']['ipsandports']['ssl_cert_chainfile']['title'],
|
||||
'desc' => $lng['admin']['ipsandports']['ssl_cert_chainfile']['description'],
|
||||
'type' => 'text'
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
@@ -1,137 +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(
|
||||
'ipsandports_add' => array(
|
||||
'title' => $lng['admin']['ipsandports']['add'],
|
||||
'image' => 'icons/ipsports_add.png',
|
||||
'sections' => array(
|
||||
'section_a' => array(
|
||||
'title' => $lng['admin']['ipsandports']['ipandport'],
|
||||
'image' => 'icons/ipsports_add.png',
|
||||
'fields' => array(
|
||||
'ip' => array(
|
||||
'label' => $lng['admin']['ipsandports']['ip'],
|
||||
'type' => 'text'
|
||||
),
|
||||
'port' => array(
|
||||
'label' => $lng['admin']['ipsandports']['port'],
|
||||
'type' => 'text',
|
||||
'size' => 5
|
||||
)
|
||||
)
|
||||
),
|
||||
'section_b' => array(
|
||||
'title' => $lng['admin']['ipsandports']['webserverdefaultconfig'],
|
||||
'image' => 'icons/ipsports_add.png',
|
||||
'fields' => array(
|
||||
'listen_statement' => array(
|
||||
'label' => $lng['admin']['ipsandports']['create_listen_statement'],
|
||||
'type' => 'checkbox',
|
||||
'values' => array(
|
||||
array ('label' => $lng['panel']['yes'], 'value' => '1')
|
||||
),
|
||||
'value' => array('1')
|
||||
),
|
||||
'namevirtualhost_statement' => array(
|
||||
'label' => $lng['admin']['ipsandports']['create_namevirtualhost_statement'],
|
||||
'type' => 'checkbox',
|
||||
'values' => array(
|
||||
array ('label' => $lng['panel']['yes'], 'value' => '1')
|
||||
),
|
||||
'value' => array('1')
|
||||
),
|
||||
'vhostcontainer' => array(
|
||||
'label' => $lng['admin']['ipsandports']['create_vhostcontainer'],
|
||||
'type' => 'checkbox',
|
||||
'values' => array(
|
||||
array ('label' => $lng['panel']['yes'], 'value' => '1')
|
||||
),
|
||||
'value' => array('1')
|
||||
),
|
||||
'docroot' => array(
|
||||
'label' => $lng['admin']['ipsandports']['docroot']['title'],
|
||||
'desc' => $lng['admin']['ipsandports']['docroot']['description'],
|
||||
'type' => 'text'
|
||||
),
|
||||
'specialsettings' => array(
|
||||
'style' => 'align-top',
|
||||
'label' => $lng['admin']['ownvhostsettings'],
|
||||
'desc' => $lng['serversettings']['default_vhostconf']['description'],
|
||||
'type' => 'textarea',
|
||||
'cols' => 60,
|
||||
'rows' => 12
|
||||
),
|
||||
'vhostcontainer_servername_statement' => array(
|
||||
'label' => $lng['admin']['ipsandports']['create_vhostcontainer_servername_statement'],
|
||||
'type' => 'checkbox',
|
||||
'values' => array(
|
||||
array ('label' => $lng['panel']['yes'], 'value' => '1')
|
||||
),
|
||||
'value' => array('1')
|
||||
)
|
||||
)
|
||||
),
|
||||
'section_c' => array(
|
||||
'title' => $lng['admin']['ipsandports']['webserverdomainconfig'],
|
||||
'image' => 'icons/ipsports_add.png',
|
||||
'fields' => array(
|
||||
'default_vhostconf_domain' => array(
|
||||
'style' => 'align-top',
|
||||
'label' => $lng['admin']['ipsandports']['default_vhostconf_domain'],
|
||||
'desc' => $lng['serversettings']['default_vhostconf_domain']['description'],
|
||||
'type' => 'textarea',
|
||||
'cols' => 60,
|
||||
'rows' => 12
|
||||
)
|
||||
)
|
||||
),
|
||||
'section_d' => array(
|
||||
'title' => $lng['admin']['ipsandports']['webserverssldomainconfig'],
|
||||
'image' => 'icons/ipsports_add.png',
|
||||
'visible' => (Settings::Get('system.use_ssl') == 1 ? true : false),
|
||||
'fields' => array(
|
||||
'ssl' => array(
|
||||
'label' => $lng['admin']['ipsandports']['enable_ssl'],
|
||||
'type' => 'checkbox',
|
||||
'values' => array(
|
||||
array ('label' => $lng['panel']['yes'], 'value' => '1')
|
||||
),
|
||||
'value' => array()
|
||||
),
|
||||
'ssl_cert_file' => array(
|
||||
'label' => $lng['admin']['ipsandports']['ssl_cert_file'],
|
||||
'type' => 'text'
|
||||
),
|
||||
'ssl_key_file' => array(
|
||||
'label' => $lng['admin']['ipsandports']['ssl_key_file'],
|
||||
'type' => 'text'
|
||||
),
|
||||
'ssl_ca_file' => array(
|
||||
'label' => $lng['admin']['ipsandports']['ssl_ca_file'],
|
||||
'type' => 'text'
|
||||
),
|
||||
'ssl_cert_chainfile' => array(
|
||||
'label' => $lng['admin']['ipsandports']['ssl_cert_chainfile']['title'],
|
||||
'desc' => $lng['admin']['ipsandports']['ssl_cert_chainfile']['description'],
|
||||
'type' => 'text'
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
@@ -1,146 +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(
|
||||
'ipsandports_edit' => array(
|
||||
'title' => $lng['admin']['ipsandports']['edit'],
|
||||
'image' => 'icons/ipsports_edit.png',
|
||||
'sections' => array(
|
||||
'section_a' => array(
|
||||
'title' => $lng['admin']['ipsandports']['ipandport'],
|
||||
'image' => 'icons/ipsports_add.png',
|
||||
'fields' => array(
|
||||
'ip' => array(
|
||||
'label' => $lng['admin']['ipsandports']['ip'],
|
||||
'type' => 'text',
|
||||
'value' => $result['ip']
|
||||
),
|
||||
'port' => array(
|
||||
'label' => $lng['admin']['ipsandports']['port'],
|
||||
'type' => 'text',
|
||||
'value' => $result['port'],
|
||||
'size' => 5
|
||||
)
|
||||
)
|
||||
),
|
||||
'section_b' => array(
|
||||
'title' => $lng['admin']['ipsandports']['webserverdefaultconfig'],
|
||||
'image' => 'icons/ipsports_edit.png',
|
||||
'fields' => array(
|
||||
'listen_statement' => array(
|
||||
'label' => $lng['admin']['ipsandports']['create_listen_statement'],
|
||||
'type' => 'checkbox',
|
||||
'values' => array(
|
||||
array ('label' => $lng['panel']['yes'], 'value' => '1')
|
||||
),
|
||||
'value' => array($result['listen_statement'])
|
||||
),
|
||||
'namevirtualhost_statement' => array(
|
||||
'label' => $lng['admin']['ipsandports']['create_namevirtualhost_statement'],
|
||||
'type' => 'checkbox',
|
||||
'values' => array(
|
||||
array ('label' => $lng['panel']['yes'], 'value' => '1')
|
||||
),
|
||||
'value' => array($result['namevirtualhost_statement'])
|
||||
),
|
||||
'vhostcontainer' => array(
|
||||
'label' => $lng['admin']['ipsandports']['create_vhostcontainer'],
|
||||
'type' => 'checkbox',
|
||||
'values' => array(
|
||||
array ('label' => $lng['panel']['yes'], 'value' => '1')
|
||||
),
|
||||
'value' => array($result['vhostcontainer'])
|
||||
),
|
||||
'docroot' => array(
|
||||
'label' => $lng['admin']['ipsandports']['docroot']['title'],
|
||||
'desc' => $lng['admin']['ipsandports']['docroot']['description'],
|
||||
'type' => 'text',
|
||||
'value' => $result['docroot']
|
||||
),
|
||||
'specialsettings' => array(
|
||||
'style' => 'align-top',
|
||||
'label' => $lng['admin']['ownvhostsettings'],
|
||||
'desc' => $lng['serversettings']['default_vhostconf']['description'],
|
||||
'type' => 'textarea',
|
||||
'cols' => 60,
|
||||
'rows' => 12,
|
||||
'value' => $result['specialsettings']
|
||||
),
|
||||
'vhostcontainer_servername_statement' => array(
|
||||
'label' => $lng['admin']['ipsandports']['create_vhostcontainer_servername_statement'],
|
||||
'type' => 'checkbox',
|
||||
'values' => array(
|
||||
array ('label' => $lng['panel']['yes'], 'value' => '1')
|
||||
),
|
||||
'value' => array($result['vhostcontainer_servername_statement'])
|
||||
)
|
||||
)
|
||||
),
|
||||
'section_c' => array(
|
||||
'title' => $lng['admin']['ipsandports']['webserverdomainconfig'],
|
||||
'image' => 'icons/ipsports_edit.png',
|
||||
'fields' => array(
|
||||
'default_vhostconf_domain' => array(
|
||||
'style' => 'align-top',
|
||||
'label' => $lng['admin']['ipsandports']['default_vhostconf_domain'],
|
||||
'desc' => $lng['serversettings']['default_vhostconf_domain']['description'],
|
||||
'type' => 'textarea',
|
||||
'cols' => 60,
|
||||
'rows' => 12,
|
||||
'value' => $result['default_vhostconf_domain']
|
||||
)
|
||||
)
|
||||
),
|
||||
'section_d' => array(
|
||||
'title' => $lng['admin']['ipsandports']['webserverssldomainconfig'],
|
||||
'image' => 'icons/ipsports_edit.png',
|
||||
'visible' => (Settings::Get('system.use_ssl') == 1 ? true : false),
|
||||
'fields' => array(
|
||||
'ssl' => array(
|
||||
'label' => $lng['admin']['ipsandports']['enable_ssl'],
|
||||
'type' => 'checkbox',
|
||||
'values' => array(
|
||||
array ('label' => $lng['panel']['yes'], 'value' => '1')
|
||||
),
|
||||
'value' => array($result['ssl'])
|
||||
),
|
||||
'ssl_cert_file' => array(
|
||||
'label' => $lng['admin']['ipsandports']['ssl_cert_file'],
|
||||
'type' => 'text',
|
||||
'value' => $result['ssl_cert_file']
|
||||
),
|
||||
'ssl_key_file' => array(
|
||||
'label' => $lng['admin']['ipsandports']['ssl_key_file'],
|
||||
'type' => 'text',
|
||||
'value' => $result['ssl_key_file']
|
||||
),
|
||||
'ssl_ca_file' => array(
|
||||
'label' => $lng['admin']['ipsandports']['ssl_ca_file'],
|
||||
'type' => 'text',
|
||||
'value' => $result['ssl_ca_file']
|
||||
),
|
||||
'ssl_cert_chainfile' => array(
|
||||
'label' => $lng['admin']['ipsandports']['ssl_cert_chainfile']['title'],
|
||||
'desc' => $lng['admin']['ipsandports']['ssl_cert_chainfile']['description'],
|
||||
'type' => 'text',
|
||||
'value' => $result['ssl_cert_chainfile']
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
Reference in New Issue
Block a user