From 2696e12bd643eaca85b9780b1c7d8ec1377df0fb Mon Sep 17 00:00:00 2001
From: latham <latham@ispconfig3>
Date: Fri, 04 Nov 2011 09:57:16 -0400
Subject: [PATCH] This will sort the modules by alpha before the dashboard is pushed to the front. This patch keeps the menu tabs stable instead of different on each user. Logging in as an admin, reseller, and user would show the tabs in different order each time do to user creation.
---
interface/web/admin/form/dbsync.tform.php | 362 +++++++++++++++++++++++++--------------------------
1 files changed, 178 insertions(+), 184 deletions(-)
diff --git a/interface/web/admin/form/dbsync.tform.php b/interface/web/admin/form/dbsync.tform.php
index 9199a52..27ad1f6 100644
--- a/interface/web/admin/form/dbsync.tform.php
+++ b/interface/web/admin/form/dbsync.tform.php
@@ -34,9 +34,9 @@
Tabellendefinition
Datentypen:
- - INTEGER (Wandelt Ausdr�cke in Int um)
+ - INTEGER (Wandelt Ausdr�cke in Int um)
- DOUBLE
- - CURRENCY (Formatiert Zahlen nach W�hrungsnotation)
+ - CURRENCY (Formatiert Zahlen nach W�hrungsnotation)
- VARCHAR (kein weiterer Format Check)
- TEXT (kein weiterer Format Check)
- DATE (Datumsformat, Timestamp Umwandlung)
@@ -55,18 +55,18 @@
- Wert oder Array
Hinweis:
- Das ID-Feld ist nicht bei den Table Values einzuf�gen.
+ Das ID-Feld ist nicht bei den Table Values einzuf�gen.
*/
-// lese Module aus
+//* Load modules
$modules_list = array();
-$handle = @opendir($conf["rootpath"]."/web");
+$handle = @opendir(ISPC_WEB_PATH);
while ($file = @readdir ($handle)) {
if ($file != "." && $file != "..") {
- if(@is_dir($conf["rootpath"]."/web/".$file)) {
- if(is_file($conf["rootpath"]."/web/".$file."/lib/module.conf.php") and $file != 'login') {
+ if(@is_dir(ISPC_WEB_PATH."/$file")) {
+ if(is_file(ISPC_WEB_PATH."/$file/lib/module.conf.php") and $file != 'login') {
$modules_list[$file] = $file;
}
}
@@ -74,197 +74,191 @@
}
closedir($handle);
-// lese Datenbanken mit aktivierter db_history ein.
+//* read data bases in with more activated db_history.
$db_tables = array();
foreach($modules_list as $md) {
- $handle = @opendir($conf["rootpath"]."/web/".$md."/form");
+ $handle = @opendir(ISPC_WEB_PATH."/$md/form");
while ($file = @readdir ($handle)) {
- if ($file != "." && $file != ".." && substr($file,0,1) != '.') {
- include_once($conf["rootpath"]."/web/".$md."/form/".$file);
- if($form["db_history"] == "yes") {
- $tmp_id = $form["db_table"];
- $db_tables[$tmp_id] = $form["db_table"];
+ if ($file != '.' && $file != '..' && substr($file, 0, 1) != '.') {
+ include_once(ISPC_WEB_PATH."/$md/form/$file");
+ if(isset($form['db_history']) && $form['db_history'] == 'yes') {
+ $tmp_id = $form['db_table'];
+ $db_tables[$tmp_id] = $form['db_table'];
}
unset($form);
}
}
closedir($handle);
}
-
unset($form);
+$form['title'] = 'DB sync';
+$form['description'] = 'ISPConfig database synchronisation tool.';
+$form['name'] = 'dbsync';
+$form['action'] = 'dbsync_edit.php';
+$form['db_table'] = 'sys_dbsync';
+$form['db_table_idx'] = 'id';
+$form['tab_default'] = 'dbsync';
+$form['list_default'] = 'dbsync_list.php';
+$form['auth'] = 'no';
-$form["title"] = "DB sync";
-$form["description"] = "Formular zum Anlegen von Datenbank-Synchronisierungen.";
-$form["name"] = "dbsync";
-$form["action"] = "dbsync_edit.php";
-$form["db_table"] = "sys_dbsync";
-$form["db_table_idx"] = "id";
-$form["tab_default"] = "dbsync";
-$form["list_default"] = "dbsync_list.php";
-$form["auth"] = 'no';
-
-
-
-
-
-$form["tabs"]['dbsync'] = array (
- 'title' => "DB sync",
- 'width' => 80,
- 'template' => "templates/dbsync_edit.htm",
- 'fields' => array (
- ##################################
- # Beginn Datenbankfelder
- ##################################
- 'jobname' => array (
- 'datatype' => 'VARCHAR',
- 'formtype' => 'TEXT',
- 'regex' => '/^.{1,30}$/',
- 'errmsg' => 'jobname_err',
- 'default' => '',
- 'value' => '',
- 'separator' => '',
- 'width' => '15',
- 'maxlength' => '255',
- 'rows' => '',
- 'cols' => ''
- ),
- 'sync_interval_minutes' => array (
- 'datatype' => 'INTEGER',
- 'formtype' => 'TEXT',
- 'regex' => '',
- 'errmsg' => '',
- 'default' => '',
- 'value' => '',
- 'separator' => '',
- 'width' => '15',
- 'maxlength' => '255',
- 'rows' => '',
- 'cols' => ''
- ),
- 'db_type' => array (
- 'datatype' => 'VARCHAR',
- 'formtype' => 'SELECT',
- 'regex' => '',
- 'errmsg' => '',
- 'default' => '',
- 'value' => array('mysql' => 'mysql'),
- 'separator' => '',
- 'width' => '30',
- 'maxlength' => '255',
- 'rows' => '',
- 'cols' => ''
- ),
- 'db_host' => array (
- 'datatype' => 'VARCHAR',
- 'formtype' => 'TEXT',
- 'regex' => '',
- 'errmsg' => '',
- 'default' => '',
- 'value' => '',
- 'separator' => '',
- 'width' => '30',
- 'maxlength' => '255',
- 'rows' => '',
- 'cols' => ''
- ),
- 'db_name' => array (
- 'datatype' => 'VARCHAR',
- 'formtype' => 'TEXT',
- 'regex' => '',
- 'errmsg' => '',
- 'default' => '',
- 'value' => '',
- 'separator' => '',
- 'width' => '30',
- 'maxlength' => '255',
- 'rows' => '',
- 'cols' => ''
- ),
- 'db_username' => array (
- 'datatype' => 'VARCHAR',
- 'formtype' => 'TEXT',
- 'regex' => '',
- 'errmsg' => '',
- 'default' => '',
- 'value' => '',
- 'separator' => '',
- 'width' => '30',
- 'maxlength' => '255',
- 'rows' => '',
- 'cols' => ''
- ),
- 'db_password' => array (
- 'datatype' => 'VARCHAR',
- 'formtype' => 'TEXT',
- 'regex' => '',
- 'errmsg' => '',
- 'default' => '',
- 'value' => '',
- 'separator' => '',
- 'width' => '30',
- 'maxlength' => '255',
- 'rows' => '',
- 'cols' => ''
- ),
- 'db_tables' => array (
- 'datatype' => 'VARCHAR',
- 'formtype' => 'CHECKBOXARRAY',
- 'regex' => '',
- 'errmsg' => '',
- 'default' => 'admin,forms',
- 'value' => $db_tables,
- 'separator' => ',',
- 'width' => '30',
- 'maxlength' => '255',
- 'rows' => '',
- 'cols' => ''
- ),
- 'empty_datalog' => array (
- 'datatype' => 'INTEGER',
- 'formtype' => 'CHECKBOX',
- 'regex' => '',
- 'errmsg' => '',
- 'default' => '',
- 'value' => '1',
- 'separator' => '',
- 'width' => '30',
- 'maxlength' => '255',
- 'rows' => '',
- 'cols' => ''
- ),
- 'sync_datalog_external' => array (
- 'datatype' => 'INTEGER',
- 'formtype' => 'CHECKBOX',
- 'regex' => '',
- 'errmsg' => '',
- 'default' => '',
- 'value' => '1',
- 'separator' => '',
- 'width' => '30',
- 'maxlength' => '255',
- 'rows' => '',
- 'cols' => ''
- ),
- 'active' => array (
- 'datatype' => 'INTEGER',
- 'formtype' => 'CHECKBOX',
- 'regex' => '',
- 'errmsg' => '',
- 'default' => '1',
- 'value' => '1',
- 'separator' => '',
- 'width' => '30',
- 'maxlength' => '255',
- 'rows' => '',
- 'cols' => ''
- )
- ##################################
- # ENDE Datenbankfelder
- ##################################
- )
+$form['tabs']['dbsync'] = array (
+ 'title' => 'DB sync',
+ 'width' => 80,
+ 'template' => 'templates/dbsync_edit.htm',
+ 'fields' => array (
+ ##################################
+ # Beginn Datenbankfelder
+ ##################################
+ 'jobname' => array (
+ 'datatype' => 'VARCHAR',
+ 'formtype' => 'TEXT',
+ 'regex' => '/^.{1,30}$/',
+ 'errmsg' => 'jobname_err',
+ 'default' => '',
+ 'value' => '',
+ 'separator' => '',
+ 'width' => '15',
+ 'maxlength' => '255',
+ 'rows' => '',
+ 'cols' => ''
+ ),
+ 'sync_interval_minutes' => array (
+ 'datatype' => 'INTEGER',
+ 'formtype' => 'TEXT',
+ 'regex' => '',
+ 'errmsg' => '',
+ 'default' => '',
+ 'value' => '',
+ 'separator' => '',
+ 'width' => '15',
+ 'maxlength' => '255',
+ 'rows' => '',
+ 'cols' => ''
+ ),
+ 'db_type' => array (
+ 'datatype' => 'VARCHAR',
+ 'formtype' => 'SELECT',
+ 'regex' => '',
+ 'errmsg' => '',
+ 'default' => '',
+ 'value' => array('mysql' => 'mysql'),
+ 'separator' => '',
+ 'width' => '30',
+ 'maxlength' => '255',
+ 'rows' => '',
+ 'cols' => ''
+ ),
+ 'db_host' => array (
+ 'datatype' => 'VARCHAR',
+ 'formtype' => 'TEXT',
+ 'regex' => '',
+ 'errmsg' => '',
+ 'default' => '',
+ 'value' => '',
+ 'separator' => '',
+ 'width' => '30',
+ 'maxlength' => '255',
+ 'rows' => '',
+ 'cols' => ''
+ ),
+ 'db_name' => array (
+ 'datatype' => 'VARCHAR',
+ 'formtype' => 'TEXT',
+ 'regex' => '',
+ 'errmsg' => '',
+ 'default' => '',
+ 'value' => '',
+ 'separator' => '',
+ 'width' => '30',
+ 'maxlength' => '255',
+ 'rows' => '',
+ 'cols' => ''
+ ),
+ 'db_username' => array (
+ 'datatype' => 'VARCHAR',
+ 'formtype' => 'TEXT',
+ 'regex' => '',
+ 'errmsg' => '',
+ 'default' => '',
+ 'value' => '',
+ 'separator' => '',
+ 'width' => '30',
+ 'maxlength' => '255',
+ 'rows' => '',
+ 'cols' => ''
+ ),
+ 'db_password' => array (
+ 'datatype' => 'VARCHAR',
+ 'formtype' => 'TEXT',
+ 'regex' => '',
+ 'errmsg' => '',
+ 'default' => '',
+ 'value' => '',
+ 'separator' => '',
+ 'width' => '30',
+ 'maxlength' => '255',
+ 'rows' => '',
+ 'cols' => ''
+ ),
+ 'db_tables' => array (
+ 'datatype' => 'VARCHAR',
+ 'formtype' => 'CHECKBOXARRAY',
+ 'regex' => '',
+ 'errmsg' => '',
+ 'default' => 'admin,forms',
+ 'value' => $db_tables,
+ 'separator' => ',',
+ 'width' => '30',
+ 'maxlength' => '255',
+ 'rows' => '',
+ 'cols' => ''
+ ),
+ 'empty_datalog' => array (
+ 'datatype' => 'INTEGER',
+ 'formtype' => 'CHECKBOX',
+ 'regex' => '',
+ 'errmsg' => '',
+ 'default' => '',
+ 'value' => array(0 => 0,1 => 1),
+ 'separator' => '',
+ 'width' => '30',
+ 'maxlength' => '255',
+ 'rows' => '',
+ 'cols' => ''
+ ),
+ 'sync_datalog_external' => array (
+ 'datatype' => 'INTEGER',
+ 'formtype' => 'CHECKBOX',
+ 'regex' => '',
+ 'errmsg' => '',
+ 'default' => '',
+ 'value' => array(0 => 0,1 => 1),
+ 'separator' => '',
+ 'width' => '30',
+ 'maxlength' => '255',
+ 'rows' => '',
+ 'cols' => ''
+ ),
+ 'active' => array (
+ 'datatype' => 'INTEGER',
+ 'formtype' => 'CHECKBOX',
+ 'regex' => '',
+ 'errmsg' => '',
+ 'default' => '1',
+ 'value' => array(0 => 0,1 => 1),
+ 'separator' => '',
+ 'width' => '30',
+ 'maxlength' => '255',
+ 'rows' => '',
+ 'cols' => ''
+ )
+ ##################################
+ # ENDE Datenbankfelder
+ ##################################
+ )
);
?>
\ No newline at end of file
--
Gitblit v1.9.1