Take values as parameter when editing something

Signed-off-by: Roman Schmerold (BNoiZe) <bnoize@froxlor.org>
This commit is contained in:
Roman Schmerold (BNoiZe)
2015-02-02 19:13:52 +01:00
parent 609bd557c5
commit 72ce20224d
7 changed files with 87 additions and 186 deletions

View File

@@ -454,7 +454,7 @@ if ($page == 'admins'
} }
$admin_add_data = include_once dirname(__FILE__).'/lib/formfields/admin/formfield.admin.php'; $admin_add_data = include_once dirname(__FILE__).'/lib/formfields/admin/formfield.admin.php';
$admin_add_form = HTMLform2::genHTMLForm($admin_add_data, true); $admin_add_form = HTMLform2::genHTMLForm($admin_add_data);
eval("echo \"" . getTemplate("admins/admins_add") . "\";"); eval("echo \"" . getTemplate("admins/admins_add") . "\";");
} }
@@ -779,7 +779,7 @@ if ($page == 'admins'
$result = htmlentities_array($result); $result = htmlentities_array($result);
$admin_edit_data = include_once dirname(__FILE__).'/lib/formfields/admin/formfield.admin.php'; $admin_edit_data = include_once dirname(__FILE__).'/lib/formfields/admin/formfield.admin.php';
$admin_edit_form = HTMLform2::genHTMLForm($admin_edit_data); $admin_edit_form = HTMLform2::genHTMLForm($admin_edit_data, $result);
eval("echo \"" . getTemplate("admins/admins_edit") . "\";"); eval("echo \"" . getTemplate("admins/admins_edit") . "\";");
} }

View File

@@ -107,7 +107,7 @@ if ($page == 'cronjobs' || $page == 'overview') {
// interval // interval
$interval_nfo = explode(' ', $result['interval']); $interval_nfo = explode(' ', $result['interval']);
$interval_value = $interval_nfo[0]; $result['interval_value'] = $interval_nfo[0];
$interval_interval = ''; $interval_interval = '';
$interval_interval .= makeoption($lng['cronmgmt']['minutes'], 'MINUTE', $interval_nfo[1]); $interval_interval .= makeoption($lng['cronmgmt']['minutes'], 'MINUTE', $interval_nfo[1]);
@@ -123,7 +123,7 @@ if ($page == 'cronjobs' || $page == 'overview') {
} }
$cronjobs_edit_data = include_once dirname(__FILE__).'/lib/formfields/admin/formfield.cronjobs.php'; $cronjobs_edit_data = include_once dirname(__FILE__).'/lib/formfields/admin/formfield.cronjobs.php';
$cronjobs_edit_form = HTMLform2::genHTMLForm($cronjobs_edit_data); $cronjobs_edit_form = HTMLform2::genHTMLForm($cronjobs_edit_data, $result);
eval("echo \"" . getTemplate('cronjobs/cronjob_edit') . "\";"); eval("echo \"" . getTemplate('cronjobs/cronjob_edit') . "\";");
} }

View File

@@ -988,7 +988,7 @@ if ($page == 'customers'
} else { } else {
$customer_add_data = include_once dirname(__FILE__).'/lib/formfields/admin/formfield.customer.php'; $customer_add_data = include_once dirname(__FILE__).'/lib/formfields/admin/formfield.customer.php';
$customer_add_form = HTMLform2::genHTMLform($customer_add_data, true); $customer_add_form = HTMLform2::genHTMLform($customer_add_data);
eval("echo \"" . getTemplate("customers/customers_add") . "\";"); eval("echo \"" . getTemplate("customers/customers_add") . "\";");
} }
@@ -1561,7 +1561,7 @@ if ($page == 'customers'
$result = htmlentities_array($result); $result = htmlentities_array($result);
$customer_edit_data = include_once dirname(__FILE__).'/lib/formfields/admin/formfield.customer.php'; $customer_edit_data = include_once dirname(__FILE__).'/lib/formfields/admin/formfield.customer.php';
$customer_edit_form = HTMLform2::genHTMLform($customer_edit_data); $customer_edit_form = HTMLform2::genHTMLform($customer_edit_data, $result);
eval("echo \"" . getTemplate("customers/customers_edit") . "\";"); eval("echo \"" . getTemplate("customers/customers_edit") . "\";");
} }

View File

@@ -26,10 +26,10 @@ class HTMLform2 {
* @access public * @access public
* @static * @static
* @param array $formdata (default: array()) * @param array $formdata (default: array())
* @param int $newForm (default: 0) * @param array $data (default: array())
* @return void * @return void
*/ */
public static function genHTMLform($formdata = array(), $newForm = false) { public static function genHTMLform($formdata = array(), $data = array()) {
global $lng, $theme; global $lng, $theme;
self::$_form = ''; self::$_form = '';
@@ -47,25 +47,20 @@ class HTMLform2 {
if (isset($fielddata['visible'])) { if (isset($fielddata['visible'])) {
if ($fielddata['visible'] == false) { if ($fielddata['visible'] == false) {
continue; continue;
} elseif ($fielddata['visible'] === 'new' && $newForm == false) { } elseif ($fielddata['visible'] === 'new' && !empty($data)) {
continue; continue;
} elseif ($fielddata['visible'] === 'edit' && $newForm == true) { } elseif ($fielddata['visible'] === 'edit' && empty($data)) {
continue; continue;
} }
} }
// Set value to default val if new form // Set value if given
if ($newForm) { if (!empty($data)) {
$fielddata = self::_checkForValue($fielddata); $fielddata = self::_setValue($fieldname, $fielddata, $data);
} }
$field = self::_parseDataField($fieldname, $fielddata); $field = self::_parseDataField($fieldname, $fielddata);
// Addons
foreach ($fielddata['addons'] as $addonname => $addondata) {
$field .= self::_parseDataField($addonname, $addondata);
}
$label = $fielddata['label'] . self::_getMandatoryFlag($fielddata); $label = $fielddata['label'] . self::_getMandatoryFlag($fielddata);
if (isset($fielddata['desc']) && $fielddata['desc'] != "") { if (isset($fielddata['desc']) && $fielddata['desc'] != "") {
$desc = $fielddata['desc']; $desc = $fielddata['desc'];
@@ -82,29 +77,19 @@ class HTMLform2 {
return self::$_form; return self::$_form;
} }
private static function _checkForValue($fielddata) { private static function _setValue($fieldname, $fielddata, $data) {
switch($fielddata['type']) { if (isset($data[$fieldname])) {
case 'checkbox': switch($fielddata['type']) {
if (isset($fielddata['default'])) { case 'checkbox':
$fielddata['attributes']['checked'] = $fielddata['default']; $fielddata['attributes']['checked'] = ($data[$fieldname] == 1) ? true : false;
} else { break;
$fielddata['attributes']['checked'] = false; case 'select':
} $fielddata['selected'] = $data[$fieldname];
break; break;
case 'select': default:
if (isset($fielddata['default'])) { $fielddata['value'] = $data[$fieldname];
$fielddata['selected'] = $fielddata['default']; break;
} else { }
unset($fielddata['selected']);
}
break;
default:
if (isset($fielddata['default'])) {
$fielddata['value'] = $fielddata['default'];
} else {
unset($fielddata['value']);
}
break;
} }
return $fielddata; return $fielddata;
@@ -399,8 +384,8 @@ class HTMLform2 {
$attributes = self::_parseAttributes($fieldname, $fielddata); $attributes = self::_parseAttributes($fieldname, $fielddata);
unset($attributes['value']); unset($attributes['value']);
$attributes = self::_glueAttributes($attributes); $attributes = self::_glueAttributes($attributes);
$value = $fielddata['value']; $value = isset($fielddata['value']) ? $fielddata['value'] : "";
eval("\$return = \"" . getTemplate("htmlform/textarea", "1") . "\";"); eval("\$return = \"" . getTemplate("htmlform/textarea", "1") . "\";");
return $return; return $return;
} }

View File

@@ -22,18 +22,13 @@ return array(
'loginname' => array( 'loginname' => array(
'label' => $lng['login']['username'], 'label' => $lng['login']['username'],
'type' => (isset($result['loginname'])) ? 'static' : 'text', 'type' => (isset($result['loginname'])) ? 'static' : 'text',
'mandatory' => true, 'mandatory' => true, ),
'value' => $result['loginname'],
),
'deactivated' => array( 'deactivated' => array(
'label' => $lng['admin']['deactivated_user'], 'label' => $lng['admin']['deactivated_user'],
'type' => 'checkbox', 'type' => 'checkbox',
'value' => '1', 'value' => '1',
'sublabel' => $lng['panel']['yes'], 'sublabel' => $lng['panel']['yes'],
'visible' => (isset($result['loginname']) && $result['adminid'] != $userinfo['userid']) ? true : false, 'visible' => (isset($result['loginname']) && $result['adminid'] != $userinfo['userid']),
'attributes' => array(
'checked' => ($result['deactivated'] != 0)
)
), ),
'admin_password' => array( 'admin_password' => array(
'label' => $lng['login']['password'], 'label' => $lng['login']['password'],
@@ -46,7 +41,6 @@ return array(
'type' => 'text', 'type' => 'text',
'visible' => (Settings::Get('panel.password_regex') == ''), 'visible' => (Settings::Get('panel.password_regex') == ''),
'value' => generatePassword(), 'value' => generatePassword(),
'default' => generatePassword(),
'attributes' => array( 'attributes' => array(
'readonly' => true 'readonly' => true
) )
@@ -55,8 +49,7 @@ return array(
'label' => $lng['login']['language'], 'label' => $lng['login']['language'],
'type' => 'select', 'type' => 'select',
'generate' => 'languages', 'generate' => 'languages',
'default' => Settings::Get('panel.standardlanguage'), 'selected' => Settings::Get('panel.standardlanguage')
'selected' => $result['def_language']
) )
) )
), ),
@@ -66,20 +59,17 @@ return array(
'name' => array( 'name' => array(
'label' => $lng['customer']['name'], 'label' => $lng['customer']['name'],
'type' => 'text', 'type' => 'text',
'mandatory' => true, 'mandatory' => true
'value' => $result['name']
), ),
'email' => array( 'email' => array(
'label' => $lng['customer']['email'], 'label' => $lng['customer']['email'],
'type' => 'email', 'type' => 'email',
'mandatory' => true, 'mandatory' => true
'value' => $result['email']
), ),
'custom_notes' => array( 'custom_notes' => array(
'label' => $lng['usersettings']['custom_notes']['title'], 'label' => $lng['usersettings']['custom_notes']['title'],
'desc' => $lng['usersettings']['custom_notes']['description'], 'desc' => $lng['usersettings']['custom_notes']['description'],
'type' => 'textarea', 'type' => 'textarea',
'value' => $result['custom_notes'],
'attributes' => array( 'attributes' => array(
'cols' => 60, 'cols' => 60,
'rows' => 12 'rows' => 12
@@ -89,17 +79,13 @@ return array(
'label' => $lng['usersettings']['custom_notes']['show'], 'label' => $lng['usersettings']['custom_notes']['show'],
'type' => 'checkbox', 'type' => 'checkbox',
'sublabel' => $lng['panel']['yes'], 'sublabel' => $lng['panel']['yes'],
'value' => '1', 'value' => '1'
'default' => false,
'attributes' => array(
'checked' => ($result['custom_notes_show'] != '0')
)
) )
) )
), ),
'servicedata' => array( 'servicedata' => array(
'title' => $lng['admin']['servicedata'], 'title' => $lng['admin']['servicedata'],
'visible' => ($result['adminid'] != $userinfo['userid']), 'visible' => (isset($result['adminid']) && $result['adminid'] != $userinfo['userid']),
'fields' => array( 'fields' => array(
'ipaddress' => array( 'ipaddress' => array(
'label' => $lng['serversettings']['ipaddress']['title'], 'label' => $lng['serversettings']['ipaddress']['title'],
@@ -110,16 +96,12 @@ return array(
'label' => $lng['admin']['change_serversettings'], 'label' => $lng['admin']['change_serversettings'],
'type' => 'checkbox', 'type' => 'checkbox',
'sublabel' => $lng['panel']['yes'], 'sublabel' => $lng['panel']['yes'],
'value' => 1, 'value' => 1
'attributes' => array(
'checked' => ($result['change_serversettings'] != '0')
)
), ),
'customers' => array( 'customers' => array(
'label' => $lng['admin']['customers'], 'label' => $lng['admin']['customers'],
'type' => 'textul', 'type' => 'textul',
'default' => 0, 'value' => 0,
'value' => $result['customers'],
'mandatory' => true, 'mandatory' => true,
'attributes' => array( 'attributes' => array(
'maxlength' => 9 'maxlength' => 9
@@ -129,16 +111,12 @@ return array(
'label' => $lng['admin']['customers_see_all'], 'label' => $lng['admin']['customers_see_all'],
'type' => 'checkbox', 'type' => 'checkbox',
'sublabel' => $lng['panel']['yes'], 'sublabel' => $lng['panel']['yes'],
'value' => '1', 'value' => '1'
'attributes' => array(
'checked' => ($result['customers_see_all'] != 0)
)
), ),
'domains' => array( 'domains' => array(
'label' => $lng['admin']['domains'], 'label' => $lng['admin']['domains'],
'type' => 'textul', 'type' => 'textul',
'default' => 0, 'value' => 0,
'value' => $result['domains'],
'mandatory' => true, 'mandatory' => true,
'attributes' => array( 'attributes' => array(
'maxlength' => 9 'maxlength' => 9
@@ -148,25 +126,18 @@ return array(
'label' => $lng['admin']['domains_see_all'], 'label' => $lng['admin']['domains_see_all'],
'type' => 'checkbox', 'type' => 'checkbox',
'sublabel' => $lng['panel']['yes'], 'sublabel' => $lng['panel']['yes'],
'value' => '1', 'value' => '1'
'attributes' => array(
'checked' => ($result['domains_see_all'] != 0)
)
), ),
'caneditphpsettings' => array( 'caneditphpsettings' => array(
'label' => $lng['admin']['caneditphpsettings'], 'label' => $lng['admin']['caneditphpsettings'],
'type' => 'checkbox', 'type' => 'checkbox',
'sublabel' => $lng['panel']['yes'], 'sublabel' => $lng['panel']['yes'],
'value' => '1', 'value' => '1'
'attributes' => array(
'checked' => ($result['caneditphpsettings'] != 0)
)
), ),
'diskspace' => array( 'diskspace' => array(
'label' => $lng['customer']['diskspace'], 'label' => $lng['customer']['diskspace'],
'type' => 'textul', 'type' => 'textul',
'value' => $result['diskspace'], 'value' => 0,
'default' => 0,
'mandatory' => true, 'mandatory' => true,
'attributes' => array( 'attributes' => array(
'maxlength' => 6 'maxlength' => 6
@@ -175,8 +146,7 @@ return array(
'traffic' => array( 'traffic' => array(
'label' => $lng['customer']['traffic'], 'label' => $lng['customer']['traffic'],
'type' => 'textul', 'type' => 'textul',
'value' => $result['traffic'], 'value' => 0,
'default' => 0,
'mandatory' => true, 'mandatory' => true,
'attributes' => array( 'attributes' => array(
'maxlength' => 4 'maxlength' => 4
@@ -185,8 +155,7 @@ return array(
'subdomains' => array( 'subdomains' => array(
'label' => $lng['customer']['subdomains'], 'label' => $lng['customer']['subdomains'],
'type' => 'textul', 'type' => 'textul',
'default' => 0, 'value' => 0,
'value' => $result['subdomains'],
'mandatory' => true, 'mandatory' => true,
'attributes' => array( 'attributes' => array(
'maxlength' => 9 'maxlength' => 9
@@ -195,8 +164,7 @@ return array(
'emails' => array( 'emails' => array(
'label' => $lng['customer']['emails'], 'label' => $lng['customer']['emails'],
'type' => 'textul', 'type' => 'textul',
'default' => 0, 'value' => 0,
'value' => $result['emails'],
'mandatory' => true, 'mandatory' => true,
'attributes' => array( 'attributes' => array(
'maxlength' => 9 'maxlength' => 9
@@ -205,8 +173,7 @@ return array(
'email_accounts' => array( 'email_accounts' => array(
'label' => $lng['customer']['accounts'], 'label' => $lng['customer']['accounts'],
'type' => 'textul', 'type' => 'textul',
'default' => 0, 'value' => 0,
'value' => $result['email_accounts'],
'mandatory' => true, 'mandatory' => true,
'attributes' => array( 'attributes' => array(
'maxlength' => 9 'maxlength' => 9
@@ -215,8 +182,7 @@ return array(
'email_forwarders' => array( 'email_forwarders' => array(
'label' => $lng['customer']['forwarders'], 'label' => $lng['customer']['forwarders'],
'type' => 'textul', 'type' => 'textul',
'default' => 0, 'value' => 0,
'value' => $result['email_forwarders'],
'mandatory' => true, 'mandatory' => true,
'attributes' => array( 'attributes' => array(
'maxlength' => 9 'maxlength' => 9
@@ -225,8 +191,7 @@ return array(
'email_quota' => array( 'email_quota' => array(
'label' => $lng['customer']['email_quota'], 'label' => $lng['customer']['email_quota'],
'type' => 'textul', 'type' => 'textul',
'default' => 0, 'value' => 0,
'value' => $result['email_quota'],
'visible' => (Settings::Get('system.mail_quota_enabled') == '1' ? true : false), 'visible' => (Settings::Get('system.mail_quota_enabled') == '1' ? true : false),
'mandatory' => true, 'mandatory' => true,
'attributes' => array( 'attributes' => array(
@@ -236,8 +201,7 @@ return array(
'ftps' => array( 'ftps' => array(
'label' => $lng['customer']['ftps'], 'label' => $lng['customer']['ftps'],
'type' => 'textul', 'type' => 'textul',
'default' => 0, 'value' => 0,
'value' => $result['ftps'],
'attributes' => array( 'attributes' => array(
'maxlength' => 9 'maxlength' => 9
) )
@@ -245,8 +209,7 @@ return array(
'tickets' => array( 'tickets' => array(
'label' => $lng['customer']['tickets'], 'label' => $lng['customer']['tickets'],
'type' => 'textul', 'type' => 'textul',
'default' => 0, 'value' => 0,
'value' => $result['tickets'],
'visible' => (Settings::Get('ticket.enabled') == '1' ? true : false), 'visible' => (Settings::Get('ticket.enabled') == '1' ? true : false),
'attributes' => array( 'attributes' => array(
'maxlength' => 9 'maxlength' => 9
@@ -256,16 +219,12 @@ return array(
'label' => $lng['admin']['tickets_see_all'], 'label' => $lng['admin']['tickets_see_all'],
'type' => 'checkbox', 'type' => 'checkbox',
'sublabel' => $lng['panel']['yes'], 'sublabel' => $lng['panel']['yes'],
'value' => '1', 'value' => '1'
'attributes' => array(
'checked' => ($result['tickets_see_all'] != '0')
)
), ),
'mysqls' => array( 'mysqls' => array(
'label' => $lng['customer']['mysqls'], 'label' => $lng['customer']['mysqls'],
'type' => 'textul', 'type' => 'textul',
'default' => 0, 'value' => 0,
'value' => $result['mysqls'],
'mandatory' => true, 'mandatory' => true,
'attributes' => array( 'attributes' => array(
'maxlength' => 9 'maxlength' => 9

View File

@@ -21,21 +21,16 @@ return array(
'cronfile' => array( 'cronfile' => array(
'label' => 'Cronjob', 'label' => 'Cronjob',
'type' => ($change_cronfile == 1 ? 'text' : 'static'), 'type' => ($change_cronfile == 1 ? 'text' : 'static'),
'value' => $result['cronfile']
), ),
'isactive' => array( 'isactive' => array(
'label' => $lng['admin']['activated'], 'label' => $lng['admin']['activated'],
'type' => 'checkbox', 'type' => 'checkbox',
'sublabel' => $lng['panel']['yes'], 'sublabel' => $lng['panel']['yes'],
'value' => 1, 'value' => 1,
'attributes' => array(
'checked' => ($result['isactive'] != 0) ? true : false
)
), ),
'interval_value' => array( 'interval_value' => array(
'label' => $lng['cronjob']['cronjobintervalv'], 'label' => $lng['cronjob']['cronjobintervalv'],
'type' => 'text', 'type' => 'text'
'value' => $interval_value
), ),
'interval_interval' => array( 'interval_interval' => array(
'label' => $lng['cronjob']['cronjobinterval'], 'label' => $lng['cronjob']['cronjobinterval'],

View File

@@ -27,13 +27,11 @@ return array(
'loginname' => array( 'loginname' => array(
'label' => $lng['login']['username'], 'label' => $lng['login']['username'],
'type' => 'static', 'type' => 'static',
'value' => $result['loginname'],
'visible' => 'edit' 'visible' => 'edit'
), ),
'documentroot' => array( 'documentroot' => array(
'label' => $lng['customer']['documentroot'], 'label' => $lng['customer']['documentroot'],
'type' => 'static', 'type' => 'static',
'value' => $result['documentroot'],
'visible' => 'edit' 'visible' => 'edit'
), ),
'createstdsubdomain' => array( 'createstdsubdomain' => array(
@@ -41,9 +39,8 @@ return array(
'type' => 'checkbox', 'type' => 'checkbox',
'sublabel' => $lng['panel']['yes'], 'sublabel' => $lng['panel']['yes'],
'value' => '1', 'value' => '1',
'default' => true,
'attributes' => array( 'attributes' => array(
'checked' => ($result['standardsubdomain'] != '0') ? true : false 'checked' => true
) )
), ),
'store_defaultindex' => array( 'store_defaultindex' => array(
@@ -51,18 +48,17 @@ return array(
'type' => 'checkbox', 'type' => 'checkbox',
'sublabel' => $lng['panel']['yes'], 'sublabel' => $lng['panel']['yes'],
'value' => '1', 'value' => '1',
'default' => true, 'visible' => 'new',
'visible' => 'new' 'attributes' => array(
'checked' => true
)
), ),
'deactivated' => array( 'deactivated' => array(
'label' => $lng['admin']['deactivated_user'], 'label' => $lng['admin']['deactivated_user'],
'type' => 'checkbox', 'type' => 'checkbox',
'sublabel' => $lng['panel']['yes'], 'sublabel' => $lng['panel']['yes'],
'value' => '1', 'value' => '1',
'visible' => 'edit', 'visible' => 'edit'
'attributes' => array(
'checked' => $result['deactivated']
)
), ),
'new_customer_password' => array( 'new_customer_password' => array(
'label' => $lng['login']['password'], 'label' => $lng['login']['password'],
@@ -76,7 +72,6 @@ return array(
'type' => 'text', 'type' => 'text',
'visible' => (Settings::Get('panel.password_regex') == ''), 'visible' => (Settings::Get('panel.password_regex') == ''),
'value' => generatePassword(), 'value' => generatePassword(),
'default' => generatePassword(),
'attributes' => array( 'attributes' => array(
'readonly' => true 'readonly' => true
) )
@@ -85,7 +80,6 @@ return array(
'label' => $lng['admin']['sendpassword'], 'label' => $lng['admin']['sendpassword'],
'type' => 'checkbox', 'type' => 'checkbox',
'sublabel' => $lng['panel']['yes'], 'sublabel' => $lng['panel']['yes'],
'default' => true,
'visible' => 'new', 'visible' => 'new',
'attributes' => array( 'attributes' => array(
'checked' => true 'checked' => true
@@ -95,8 +89,7 @@ return array(
'label' => $lng['login']['language'], 'label' => $lng['login']['language'],
'type' => 'select', 'type' => 'select',
'generate' => 'languages', 'generate' => 'languages',
'default' => Settings::Get('panel.standardlanguage'), 'selected' => Settings::Get('panel.standardlanguage'),
'selected' => $result['def_language']
) )
) )
), ),
@@ -107,68 +100,56 @@ return array(
'label' => $lng['gender']['title'], 'label' => $lng['gender']['title'],
'type' => 'select', 'type' => 'select',
'generate' => 'genders', 'generate' => 'genders',
'default' => '0', 'selected' => '0'
'selected' => $result['gender']
), ),
'name' => array( 'name' => array(
'label' => $lng['customer']['name'], 'label' => $lng['customer']['name'],
'type' => 'text', 'type' => 'text',
'mandatory_ex' => true, 'mandatory_ex' => true
'value' => $result['name']
), ),
'firstname' => array( 'firstname' => array(
'label' => $lng['customer']['firstname'], 'label' => $lng['customer']['firstname'],
'type' => 'text', 'type' => 'text',
'mandatory_ex' => true, 'mandatory_ex' => true
'value' => $result['firstname']
), ),
'company' => array( 'company' => array(
'label' => $lng['customer']['company'], 'label' => $lng['customer']['company'],
'type' => 'text', 'type' => 'text',
'mandatory_ex' => true, 'mandatory_ex' => true
'value' => $result['company']
), ),
'street' => array( 'street' => array(
'label' => $lng['customer']['street'], 'label' => $lng['customer']['street'],
'type' => 'text', 'type' => 'text'
'value' => $result['street']
), ),
'zipcode' => array( 'zipcode' => array(
'label' => $lng['customer']['zipcode'], 'label' => $lng['customer']['zipcode'],
'type' => 'text', 'type' => 'text'
'value' => $result['zipcode']
), ),
'city' => array( 'city' => array(
'label' => $lng['customer']['city'], 'label' => $lng['customer']['city'],
'type' => 'text', 'type' => 'text'
'value' => $result['city']
), ),
'phone' => array( 'phone' => array(
'label' => $lng['customer']['phone'], 'label' => $lng['customer']['phone'],
'type' => 'text', 'type' => 'text'
'value' => $result['phone']
), ),
'fax' => array( 'fax' => array(
'label' => $lng['customer']['fax'], 'label' => $lng['customer']['fax'],
'type' => 'text', 'type' => 'text'
'value' => $result['fax']
), ),
'email' => array( 'email' => array(
'label' => $lng['customer']['email'], 'label' => $lng['customer']['email'],
'type' => 'email', 'type' => 'email',
'mandatory' => true, 'mandatory' => true
'value' => $result['email']
), ),
'customernumber' => array( 'customernumber' => array(
'label' => $lng['customer']['customernumber'], 'label' => $lng['customer']['customernumber'],
'type' => 'text', 'type' => 'text'
'value' => $result['customernumber']
), ),
'custom_notes' => array( 'custom_notes' => array(
'label' => $lng['usersettings']['custom_notes']['title'], 'label' => $lng['usersettings']['custom_notes']['title'],
'desc' => $lng['usersettings']['custom_notes']['description'], 'desc' => $lng['usersettings']['custom_notes']['description'],
'type' => 'textarea', 'type' => 'textarea',
'value' => $result['custom_notes'],
'attributes' => array( 'attributes' => array(
'cols' => 60, 'cols' => 60,
'rows' => 12 'rows' => 12
@@ -178,10 +159,7 @@ return array(
'label' => $lng['usersettings']['custom_notes']['show'], 'label' => $lng['usersettings']['custom_notes']['show'],
'type' => 'checkbox', 'type' => 'checkbox',
'sublabel' => $lng['panel']['yes'], 'sublabel' => $lng['panel']['yes'],
'value' => '1', 'value' => '1'
'attributes' => array(
'checked' => ($result['custom_notes_show'] != '0') ? true : false
)
) )
) )
), ),
@@ -191,8 +169,7 @@ return array(
'diskspace' => array( 'diskspace' => array(
'label' => $lng['customer']['diskspace'], 'label' => $lng['customer']['diskspace'],
'type' => 'textul', 'type' => 'textul',
'default' => 0, 'value' => 0,
'value' => $result['diskspace'],
'mandatory' => true, 'mandatory' => true,
'attributes' => array( 'attributes' => array(
'maxlength' => 6, 'maxlength' => 6,
@@ -201,8 +178,7 @@ return array(
'traffic' => array( 'traffic' => array(
'label' => $lng['customer']['traffic'], 'label' => $lng['customer']['traffic'],
'type' => 'textul', 'type' => 'textul',
'default' => 0, 'value' => 0,
'value' => $result['traffic'],
'mandatory' => true, 'mandatory' => true,
'attributes' => array( 'attributes' => array(
'maxlength' => 4, 'maxlength' => 4,
@@ -211,8 +187,7 @@ return array(
'subdomains' => array( 'subdomains' => array(
'label' => $lng['customer']['subdomains'], 'label' => $lng['customer']['subdomains'],
'type' => 'textul', 'type' => 'textul',
'default' => 0, 'value' => 0,
'value' => $result['subdomains'],
'mandatory' => true, 'mandatory' => true,
'attributes' => array( 'attributes' => array(
'maxlength' => 9, 'maxlength' => 9,
@@ -221,8 +196,7 @@ return array(
'emails' => array( 'emails' => array(
'label' => $lng['customer']['emails'], 'label' => $lng['customer']['emails'],
'type' => 'textul', 'type' => 'textul',
'default' => 0, 'value' => 0,
'value' => $result['emails'],
'mandatory' => true, 'mandatory' => true,
'attributes' => array( 'attributes' => array(
'maxlength' => 9, 'maxlength' => 9,
@@ -231,8 +205,7 @@ return array(
'email_accounts' => array( 'email_accounts' => array(
'label' => $lng['customer']['accounts'], 'label' => $lng['customer']['accounts'],
'type' => 'textul', 'type' => 'textul',
'default' => 0, 'value' => 0,
'value' => $result['email_accounts'],
'mandatory' => true, 'mandatory' => true,
'attributes' => array( 'attributes' => array(
'maxlength' => 9, 'maxlength' => 9,
@@ -241,8 +214,7 @@ return array(
'email_forwarders' => array( 'email_forwarders' => array(
'label' => $lng['customer']['forwarders'], 'label' => $lng['customer']['forwarders'],
'type' => 'textul', 'type' => 'textul',
'default' => 0, 'value' => 0,
'value' => $result['email_forwarders'],
'mandatory' => true, 'mandatory' => true,
'attributes' => array( 'attributes' => array(
'maxlength' => 9, 'maxlength' => 9,
@@ -251,8 +223,7 @@ return array(
'email_quota' => array( 'email_quota' => array(
'label' => $lng['customer']['email_quota'], 'label' => $lng['customer']['email_quota'],
'type' => 'textul', 'type' => 'textul',
'default' => 0, 'value' => 0,
'value' => $result['email_quota'],
'visible' => (Settings::Get('system.mail_quota_enabled') == '1' ? true : false), 'visible' => (Settings::Get('system.mail_quota_enabled') == '1' ? true : false),
'mandatory' => true, 'mandatory' => true,
'attributes' => array( 'attributes' => array(
@@ -264,9 +235,8 @@ return array(
'type' => 'checkbox', 'type' => 'checkbox',
'sublabel' => $lng['panel']['yes'], 'sublabel' => $lng['panel']['yes'],
'value' => '1', 'value' => '1',
'default' => true,
'attributes' => array( 'attributes' => array(
'checked' => ($result['imap'] != '0') ? true : false 'checked' => true
) )
), ),
'email_pop3' => array( 'email_pop3' => array(
@@ -274,16 +244,14 @@ return array(
'type' => 'checkbox', 'type' => 'checkbox',
'sublabel' => $lng['panel']['yes'], 'sublabel' => $lng['panel']['yes'],
'value' => '1', 'value' => '1',
'default' => true,
'attributes' => array( 'attributes' => array(
'checked' => ($result['pop3'] != '0') ? true : false 'checked' => true
) )
), ),
'ftps' => array( 'ftps' => array(
'label' => $lng['customer']['ftps'], 'label' => $lng['customer']['ftps'],
'type' => 'textul', 'type' => 'textul',
'default' => 0, 'value' => 0,
'value' => $result['ftps'],
'attributes' => array( 'attributes' => array(
'maxlength' => 9, 'maxlength' => 9,
) )
@@ -291,8 +259,7 @@ return array(
'tickets' => array( 'tickets' => array(
'label' => $lng['customer']['tickets'], 'label' => $lng['customer']['tickets'],
'type' => 'textul', 'type' => 'textul',
'default' => 0, 'value' => 0,
'value' => $result['tickets'],
'visible' => (Settings::Get('ticket.enabled') == '1' ? true : false), 'visible' => (Settings::Get('ticket.enabled') == '1' ? true : false),
'attributes' => array( 'attributes' => array(
'maxlength' => 9, 'maxlength' => 9,
@@ -301,8 +268,7 @@ return array(
'mysqls' => array( 'mysqls' => array(
'label' => $lng['customer']['mysqls'], 'label' => $lng['customer']['mysqls'],
'type' => 'textul', 'type' => 'textul',
'default' => 0, 'value' => 0,
'value' => $result['mysqls'],
'mandatory' => true, 'mandatory' => true,
'attributes' => array( 'attributes' => array(
'maxlength' => 9, 'maxlength' => 9,
@@ -313,9 +279,8 @@ return array(
'type' => 'checkbox', 'type' => 'checkbox',
'sublabel' => $lng['panel']['yes'], 'sublabel' => $lng['panel']['yes'],
'value' => '1', 'value' => '1',
'default' => true,
'attributes' => array( 'attributes' => array(
'checked' => ($result['phpenabled'] != '0') ? true : false 'checked' => true
) )
), ),
'perlenabled' => array( 'perlenabled' => array(
@@ -323,20 +288,17 @@ return array(
'type' => 'checkbox', 'type' => 'checkbox',
'sublabel' => $lng['panel']['yes'], 'sublabel' => $lng['panel']['yes'],
'value' => '1', 'value' => '1',
'attributes' => array(
'checked' => ($result['perlenabled'] != '0') ? true : false
)
) )
) )
), ),
'movetoadmin' => array( 'movetoadmin' => array(
'title' => $lng['admin']['movetoadmin'], 'title' => $lng['admin']['movetoadmin'],
'visible' => ($admin_select_cnt > 1 && isset($result['loginname'])), 'visible' => (isset($admin_select_cnt) && $admin_select_cnt > 1 && isset($result['loginname'])),
'fields' => array( 'fields' => array(
'move_to_admin' => array( 'move_to_admin' => array(
'label' => $lng['admin']['movecustomertoadmin'], 'label' => $lng['admin']['movecustomertoadmin'],
'type' => 'select', 'type' => 'select',
'values' => $admin_select 'values' => (isset($admin_select)) ? $admin_select : null
) )
) )
) )