Converted customer -> mysql to new formbuilder

This commit is contained in:
Florian Aders (EleRas)
2011-02-12 15:15:55 +01:00
parent 885bf7e88c
commit 8cb615df5f
6 changed files with 142 additions and 67 deletions

View File

@@ -256,6 +256,12 @@ elseif($page == 'mysqls')
$sendinfomail = makeyesno('sendinfomail', '1', '0', '0');
$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'];
eval("echo \"" . getTemplate("mysql/mysqls_add") . "\";");
}
}
@@ -307,6 +313,12 @@ elseif($page == 'mysqls')
}
else
{
$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'];
eval("echo \"" . getTemplate("mysql/mysqls_edit") . "\";");
}
}

1
lib/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
userdata.inc.php

View File

@@ -0,0 +1,49 @@
<?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(
'mysql_add' => array(
'title' => $lng['mysql']['database_create'],
'image' => 'icons/mysql_add.png',
'sections' => array(
'section_a' => array(
'title' => $lng['mysql']['database_create'],
'image' => 'icons/mysql_add.png',
'fields' => array(
'description' => array(
'label' => $lng['mysql']['databasedescription'],
'type' => 'text',
),
'mysql_server' => array(
'visible' => (1 < count($sql_root) ? true : false),
'label' => $lng['mysql']['mysql_server'],
'type' => 'select',
'select_var' => $mysql_servers,
),
'mysql_password' => array(
'label' => $lng['login']['password'],
'type' => 'password',
),
'sendinfomail' => array(
'label' => $lng['customer']['sendinfomail'],
'type' => 'yesno',
'yesno_var' => $sendinfomail,
)
)
)
)
)
);

View File

@@ -0,0 +1,50 @@
<?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(
'mysql_edit' => array(
'title' => $lng['mysql']['database_edit'],
'image' => 'icons/mysql_edit.png',
'sections' => array(
'section_a' => array(
'title' => $lng['mysql']['database_edit'],
'image' => 'icons/mysql_edit.png',
'fields' => array(
'databasename' => array(
'label' => $lng['mysql']['databasename'],
'type' => 'label',
'value' => $result['databasename'],
),
'description' => array(
'label' => $lng['mysql']['databasedescription'],
'type' => 'text',
'value' => $result['description'],
),
'mysql_server' => array(
'visible' => (1 < count($sql_root) ? true : false),
'label' => $lng['mysql']['mysql_server'],
'type' => 'label',
'value' => $sql_root[$result['dbserver']]['caption']
),
'mysql_password' => array(
'label' => $lng['changepassword']['new_password_ifnotempty'],
'type' => 'password',
),
)
)
)
)
);

View File

@@ -1,43 +1,23 @@
$header
<article>
<header>
<h2>
<img src="images/Froxlor/icons/add_mysql.png" alt="{$lng['mysql']['database_create']}" />&nbsp;
{$lng['mysql']['database_create']}
</h2>
</header>
<section class="fullform bradiusodd">
<article>
<header>
<h2>
<img src="images/Froxlor/{$image}" alt="{$title}" />&nbsp;
{$title}
</h2>
</header>
<section class="fullform bradiusodd">
<form action="$filename" method="post" enctype="application/x-www-form-urlencoded">
<fieldset>
<legend>Froxlor&nbsp;-&nbsp;{$lng['mysql']['database_create']}</legend>
<legend>Froxlor&nbsp;-&nbsp;{$title}</legend>
<table class="formtable">
<tr>
<td>{$lng['mysql']['databasedescription']}:</td>
<td><input type="text" class="text" name="description" /></td>
</tr>
<if 1 < count($sql_root)>
<tr>
<td>{$lng['mysql']['mysql_server']}:</td>
<td><select name="mysql_server">$mysql_servers</select></td>
</tr>
</if>
<tr>
<td>{$lng['login']['password']}:</td>
<td><input type="password" name="mysql_password" maxlength="50" /></td>
</tr>
<tr>
<td>{$lng['customer']['sendinfomail']}:</td>
<td>{$sendinfomail}</td>
</tr>
<tr>
<td colspan="2"><input type="hidden" name="send" value="send" /><input type="submit" class="bottom" value="{$lng['mysql']['database_create']}" /></td>
</tr>
{$mysql_add_form}
</table>
<p style="display: none;">
<p style="display: none;">
<input type="hidden" name="s" value="$s" />
<input type="hidden" name="page" value="$page" />
<input type="hidden" name="action" value="$action" />
@@ -45,6 +25,7 @@ $header
</p>
</fieldset>
</form>
</section>
</article>
</section>
</article>
$footer

View File

@@ -1,50 +1,32 @@
$header
<article>
<header>
<h2>
<img src="images/Froxlor/icons/mysql_edit.png" alt="{$lng['mysql']['database_edit']}" />&nbsp;
{$lng['mysql']['database_edit']}
</h2>
</header>
<section class="fullform bradiusodd">
<article>
<header>
<h2>
<img src="images/Froxlor/{$image}" alt="{$title}" />&nbsp;
{$title}
</h2>
</header>
<section class="fullform bradiusodd">
<form action="$filename" method="post" enctype="application/x-www-form-urlencoded">
<fieldset>
<legend>Froxlor&nbsp;-&nbsp;{$lng['mysql']['database_edit']}</legend>
<legend>Froxlor&nbsp;-&nbsp;{$title}</legend>
<table class="formtable">
<tr>
<td>{$lng['mysql']['databasename']}:</td>
<td>{$result['databasename']}</td>
</tr>
<tr>
<td>{$lng['mysql']['databasedescription']}:</td>
<td><input type="text" class="text" name="description" value="{$result['description']}" /></td>
</tr>
<if 1 < count($sql_root)>
<tr>
<td>{$lng['mysql']['mysql_server']}:</td>
<td>{$sql_root[$result['dbserver']]['caption']}</td>
</tr>
</if>
<tr>
<td>{$lng['changepassword']['new_password_ifnotempty']}:</td>
<td><input type="password" name="mysql_password" /></td>
</tr>
<tr>
<td colspan="2"><input type="hidden" name="send" value="send" /><input type="submit" value="{$lng['panel']['save']}" /></td>
</tr>
{$mysql_edit_form}
</table>
<p style="display: none;">
<input type="hidden" name="s" value="$s" />
<input type="hidden" name="page" value="$page" />
<input type="hidden" name="action" value="$action" />
<input type="hidden" name="id" value="$id" />
<input type="hidden" name="send" value="send" />
</p>
</fieldset>
</form>
</section>
</article>
</section>
</article>
$footer