Converted customer -> ftp to new formbuilder

Signed-off-by: Florian Aders (EleRas) <eleras@froxlor.org>
This commit is contained in:
Florian Aders (EleRas)
2011-02-12 16:08:05 +01:00
parent 8cb615df5f
commit 26aed64bf8
7 changed files with 158 additions and 79 deletions

View File

@@ -270,6 +270,12 @@ elseif($page == 'accounts')
$sendinfomail = makeyesno('sendinfomail', '1', '0', '0'); $sendinfomail = makeyesno('sendinfomail', '1', '0', '0');
$ftp_add_data = include_once dirname(__FILE__).'/lib/formfields/customer/ftp/formfield.ftp_add.php';
$ftp_add_form = htmlform::genHTMLForm($ftp_add_data);
$title = $ftp_add_data['ftp_add']['title'];
$image = $ftp_add_data['ftp_add']['image'];
eval("echo \"" . getTemplate("ftp/accounts_add") . "\";"); eval("echo \"" . getTemplate("ftp/accounts_add") . "\";");
} }
} }
@@ -353,6 +359,12 @@ elseif($page == 'accounts')
} }
} }
$ftp_edit_data = include_once dirname(__FILE__).'/lib/formfields/customer/ftp/formfield.ftp_edit.php';
$ftp_edit_form = htmlform::genHTMLForm($ftp_edit_data);
$title = $ftp_edit_data['ftp_edit']['title'];
$image = $ftp_edit_data['ftp_edit']['image'];
eval("echo \"" . getTemplate("ftp/accounts_edit") . "\";"); eval("echo \"" . getTemplate("ftp/accounts_edit") . "\";");
} }
} }

View File

@@ -0,0 +1,56 @@
<?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(
'ftp_add' => array(
'title' => $lng['ftp']['account_add'],
'image' => 'icons/add_user.png',
'sections' => array(
'section_a' => array(
'title' => $lng['ftp']['account_add'],
'image' => 'icons/add_user.png',
'fields' => array(
'ftp_username' => array(
'visible' => ($settings['customer']['ftpatdomain'] == '1' ? true : false),
'label' => $lng['login']['username'],
'type' => 'text'
),
'ftp_domain' => array(
'visible' => ($settings['customer']['ftpatdomain'] == '1' ? true : false),
'label' => $lng['domains']['domainname'],
'type' => 'select',
'select_var' => (isset($domains) ? $domains : ""),
),
'path' => array(
'label' => $lng['panel']['path'],
'desc' => ($settings['panel']['pathedit'] != 'Dropdown' ? $lng['panel']['pathDescription'] : null),
'type' => ($settings['panel']['pathedit'] != 'Dropdown' ? 'text' : 'select'),
'select_var' => $pathSelect,
),
'ftp_password' => array(
'label' => $lng['login']['password'],
'type' => 'password',
),
'sendinfomail' => array(
'label' => $lng['customer']['sendinfomail'],
'type' => 'yesno',
'yesno_var' => $sendinfomail,
),
)
)
)
)
);

View File

@@ -0,0 +1,57 @@
<?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(
'ftp_edit' => array(
'title' => $lng['ftp']['account_edit'],
'image' => 'icons/edit_user.png',
'sections' => array(
'section_a' => array(
'title' => $lng['ftp']['account_edit'],
'image' => 'icons/edit_user.png',
'fields' => array(
'username' => array(
'label' => $lng['login']['username'],
'type' => 'label',
'value' => $result['username'],
),
'ftp_username' => array(
'visible' => ($settings['customer']['ftpatdomain'] == '1' ? true : false),
'label' => $lng['login']['username'],
'type' => 'text'
),
'ftp_domain' => array(
'visible' => ($settings['customer']['ftpatdomain'] == '1' ? true : false),
'label' => $lng['domains']['domainname'],
'type' => 'select',
'select_var' => (isset($domains) ? $domains : ""),
),
'path' => array(
'label' => $lng['panel']['path'],
'desc' => ($settings['panel']['pathedit'] != 'Dropdown' ? $lng['panel']['pathDescription'] : NULL),
'type' => ($settings['panel']['pathedit'] != 'Dropdown' ? 'text' : 'select'),
'select_var' => $pathSelect
),
'ftp_password' => array(
'label' => $lng['login']['password'],
'desc' => $lng['ftp']['editpassdescription'],
'type' => 'password',
),
)
)
)
)
);

View File

@@ -17,11 +17,11 @@
return array( return array(
'mysql_add' => array( 'mysql_add' => array(
'title' => $lng['mysql']['database_create'], 'title' => $lng['mysql']['database_create'],
'image' => 'icons/mysql_add.png', 'image' => 'icons/add_mysql.png',
'sections' => array( 'sections' => array(
'section_a' => array( 'section_a' => array(
'title' => $lng['mysql']['database_create'], 'title' => $lng['mysql']['database_create'],
'image' => 'icons/mysql_add.png', 'image' => 'icons/add_mysql.png',
'fields' => array( 'fields' => array(
'description' => array( 'description' => array(
'label' => $lng['mysql']['databasedescription'], 'label' => $lng['mysql']['databasedescription'],

View File

@@ -17,11 +17,11 @@
return array( return array(
'mysql_edit' => array( 'mysql_edit' => array(
'title' => $lng['mysql']['database_edit'], 'title' => $lng['mysql']['database_edit'],
'image' => 'icons/mysql_edit.png', 'image' => 'icons/edit_mysql.png',
'sections' => array( 'sections' => array(
'section_a' => array( 'section_a' => array(
'title' => $lng['mysql']['database_edit'], 'title' => $lng['mysql']['database_edit'],
'image' => 'icons/mysql_edit.png', 'image' => 'icons/edit_mysql.png',
'fields' => array( 'fields' => array(
'databasename' => array( 'databasename' => array(
'label' => $lng['mysql']['databasename'], 'label' => $lng['mysql']['databasename'],

View File

@@ -2,8 +2,8 @@ $header
<article> <article>
<header> <header>
<h2> <h2>
<img src="images/Froxlor/icons/add_user.png" alt="{$lng['ftp']['account_add']}" />&nbsp; <img src="images/Froxlor/{$image}" alt="{$title}" />&nbsp;
{$lng['ftp']['account_add']} {$title}
</h2> </h2>
</header> </header>
@@ -11,34 +11,10 @@ $header
<form action="$filename" method="post" enctype="application/x-www-form-urlencoded"> <form action="$filename" method="post" enctype="application/x-www-form-urlencoded">
<fieldset> <fieldset>
<legend>Froxlor&nbsp;-&nbsp;{$lng['ftp']['account_add']}</legend> <legend>Froxlor&nbsp;-&nbsp;{$title}</legend>
<table class="formtable"> <table class="formtable">
<if $settings['customer']['ftpatdomain'] == '1'> {$ftp_add_form}
<tr>
<td>{$lng['login']['username']}:</td>
<td><input type="text" name="ftp_username" size="30" /></td>
</tr>
<tr>
<td>{$lng['domains']['domainname']}:</td>
<td><select name="ftp_domain">$domains</select></td>
</tr>
</if>
<tr>
<td>{$lng['panel']['path']}:<if $settings['panel']['pathedit'] != 'Dropdown'><br /><font size="1">{$lng['panel']['pathDescription']}</font></if></td>
<td>{$pathSelect}</td>
</tr>
<tr>
<td>{$lng['login']['password']}:</td>
<td><input type="password" name="ftp_password" size="30" /></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" value="{$lng['ftp']['account_add']}" /></td>
</tr>
</table> </table>
<p style="display: none;"> <p style="display: none;">
@@ -49,6 +25,7 @@ $header
</p> </p>
</fieldset> </fieldset>
</form> </form>
</section> </section>
</article> </article>
$footer $footer

View File

@@ -2,8 +2,8 @@ $header
<article> <article>
<header> <header>
<h2> <h2>
<img src="images/Froxlor/icons/user_edit.png" alt="{$lng['ftp']['account_edit']}" />&nbsp; <img src="images/Froxlor/{$image}" alt="{$title}" />&nbsp;
{$lng['ftp']['account_edit']} {$title}
</h2> </h2>
</header> </header>
@@ -11,34 +11,10 @@ $header
<form action="$filename" method="post" enctype="application/x-www-form-urlencoded"> <form action="$filename" method="post" enctype="application/x-www-form-urlencoded">
<fieldset> <fieldset>
<legend>Froxlor&nbsp;-&nbsp;{$lng['ftp']['account_edit']}</legend> <legend>Froxlor&nbsp;-&nbsp;{$title}</legend>
<table class="formtable"> <table class="formtable">
<tr> {$ftp_edit_form}
<td>{$lng['login']['username']}:</td>
<td>{$result['username']}</td>
</tr>
<if $settings['customer']['ftpatdomain'] == '1'>
<tr>
<td>{$lng['login']['username']}:</td>
<td><input type="text" name="ftp_username" size="30" /></td>
</tr>
<tr>
<td>{$lng['domains']['domainname']}:</td>
<td><select name="ftp_domain">$domains</select></td>
</tr>
</if>
<tr>
<td>{$lng['panel']['path']}:<if $settings['panel']['pathedit'] != 'Dropdown'><br /><small>{$lng['panel']['pathDescription']}</small></if></td>
<td>{$pathSelect}</td>
</tr>
<tr>
<td>{$lng['login']['password']}:<br /><small>{$lng['ftp']['editpassdescription']}</small></td>
<td><input type="password" name="ftp_password" /></td>
</tr>
<tr>
<td colspan="2"><input type="hidden" name="send" value="send" /><input type="submit" value="{$lng['panel']['save']}" /></td>
</tr>
</table> </table>
<p style="display: none;"> <p style="display: none;">
@@ -49,6 +25,7 @@ $header
</p> </p>
</fieldset> </fieldset>
</form> </form>
</section> </section>
</article> </article>
$footer $footer