diff --git a/customer_mysql.php b/customer_mysql.php index 39c642da..c92639e0 100644 --- a/customer_mysql.php +++ b/customer_mysql.php @@ -283,11 +283,8 @@ if ($page == 'overview') { } Database::needRoot(false); - $mysql_add_data = include_once dirname(__FILE__).'/lib/formfields/customer/mysql/formfield.mysql_add.php'; - $mysql_add_form = htmlform::genHTMLForm($mysql_add_data); - - $title = $mysql_add_data['mysql_add']['title']; - $image = $mysql_add_data['mysql_add']['image']; + $mysql_add_data = include_once dirname(__FILE__).'/lib/formfields/customer/formfield.mysql.php'; + $mysql_add_form = HTMLform2::genHTMLForm($mysql_add_data); eval("echo \"" . getTemplate('mysql/mysqls_add') . "\";"); } @@ -355,11 +352,9 @@ if ($page == 'overview') { $sql_root = Database::getSqlData(); Database::needRoot(false); - $mysql_edit_data = include_once dirname(__FILE__).'/lib/formfields/customer/mysql/formfield.mysql_edit.php'; - $mysql_edit_form = htmlform::genHTMLForm($mysql_edit_data); - - $title = $mysql_edit_data['mysql_edit']['title']; - $image = $mysql_edit_data['mysql_edit']['image']; + $result['mysql_servers'] = isset($sql_root['caption']) ? $sql_root['caption'] : ''; + $mysql_edit_data = include_once dirname(__FILE__).'/lib/formfields/customer/formfield.mysql.php'; + $mysql_edit_form = HTMLform2::genHTMLForm($mysql_edit_data, $result); eval("echo \"" . getTemplate('mysql/mysqls_edit') . "\";"); } diff --git a/lib/formfields/customer/formfield.mysql.php b/lib/formfields/customer/formfield.mysql.php new file mode 100644 index 00000000..1cf17b73 --- /dev/null +++ b/lib/formfields/customer/formfield.mysql.php @@ -0,0 +1,53 @@ + (2010-) + * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt + * @package Formfields + * + */ + +return array( + 'section_a' => array( + 'fields' => array( + 'description' => array( + 'label' => $lng['mysql']['databasedescription'], + 'type' => 'text', + ), + 'mysql_server' => array( + 'label' => $lng['mysql']['mysql_server'], + 'type' => (isset($result)) ? 'select' : 'text', + 'visible' => (1 < $count_mysqlservers ? true : false), + ), + 'mysql_password' => array( + 'label' => $lng['login']['password'], + 'type' => 'password', + 'attributes' => array( + 'autocomplete' => 'off' + ) + ), + 'mysql_password_suggestion' => array( + 'label' => $lng['customer']['generated_pwd'], + 'type' => 'text', + 'visible' => (Settings::Get('panel.password_regex') == ''), + 'value' => generatePassword(), + ), + 'sendinfomail' => array( + 'label' => $lng['customer']['sendinfomail'], + 'type' => 'checkbox', + 'visible' => 'new', + 'attributes' => array( + 'checked' => true + ) + ) + ) + ) +); \ No newline at end of file diff --git a/templates/Sparkle/customer/mysql/mysqls_add.tpl b/templates/Sparkle/customer/mysql/mysqls_add.tpl index 3fa467f7..a147c78a 100644 --- a/templates/Sparkle/customer/mysql/mysqls_add.tpl +++ b/templates/Sparkle/customer/mysql/mysqls_add.tpl @@ -2,8 +2,8 @@ $header

- {$title}  - {$title} +   + {$lng['mysql']['database_create']}

diff --git a/templates/Sparkle/customer/mysql/mysqls_edit.tpl b/templates/Sparkle/customer/mysql/mysqls_edit.tpl index 7beacda2..732f931d 100644 --- a/templates/Sparkle/customer/mysql/mysqls_edit.tpl +++ b/templates/Sparkle/customer/mysql/mysqls_edit.tpl @@ -2,8 +2,8 @@ $header

- {$title}  - {$title} +   + {$lng['mysql']['database_edit']}