Skip to content

Commit 4eb8d2a

Browse files
author
cfoe
committed
added interface + theme options for the end user
1 parent c163c5c commit 4eb8d2a

14 files changed

+673
-17
lines changed
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
<?php
2+
/*
3+
Copyright (c) 2008, Till Brehm, projektfarm Gmbh
4+
All rights reserved.
5+
6+
Redistribution and use in source and binary forms, with or without modification,
7+
are permitted provided that the following conditions are met:
8+
9+
* Redistributions of source code must retain the above copyright notice,
10+
this list of conditions and the following disclaimer.
11+
* Redistributions in binary form must reproduce the above copyright notice,
12+
this list of conditions and the following disclaimer in the documentation
13+
and/or other materials provided with the distribution.
14+
* Neither the name of ISPConfig nor the names of its contributors
15+
may be used to endorse or promote products derived from this software without
16+
specific prior written permission.
17+
18+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
19+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
21+
IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
22+
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23+
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
25+
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27+
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28+
*/
29+
30+
31+
/******************************************
32+
* Begin Form configuration
33+
******************************************/
34+
35+
$tform_def_file = "form/default-v2_settings.tform.php";
36+
37+
/******************************************
38+
* End Form configuration
39+
******************************************/
40+
41+
require_once('../../lib/config.inc.php');
42+
require_once('../../lib/app.inc.php');
43+
44+
//* Check permissions for module
45+
$app->auth->check_module_permissions('tools');
46+
$app->uses('tpl');
47+
//// Loading classes
48+
//$app->uses('tpl,tform,tform_actions');
49+
//$app->load('tform_actions');
50+
//
51+
//class page_action extends tform_actions {
52+
//
53+
// function onLoad() {
54+
// global $app, $conf, $tform_def_file;
55+
//
56+
// // Loading template classes and initialize template
57+
// if(!is_object($app->tpl)) $app->uses('tpl');
58+
// if(!is_object($app->tform)) $app->uses('tform');
59+
//
60+
// $app->tpl->newTemplate("tabbed_form.tpl.htm");
61+
//
62+
// // Load table definition from file
63+
// $app->tform->loadFormDef($tform_def_file);
64+
//
65+
// // Importing ID
66+
// $this->id = $_SESSION['s']['user']['userid'];
67+
// $_POST['id'] = $_SESSION['s']['user']['userid'];
68+
//
69+
// if(count($_POST) > 1) {
70+
// $this->dataRecord = $_POST;
71+
// $this->onSubmit();
72+
// } else {
73+
// $this->onShow();
74+
// }
75+
// }
76+
//
77+
// function onBeforeInsert() {
78+
// global $app, $conf;
79+
//
80+
// if(!in_array($this->dataRecord['startmodule'],$this->dataRecord['modules'])) {
81+
// $app->tform->errorMessage .= $app->tform->wordbook['startmodule_err'];
82+
// }
83+
// }
84+
//
85+
// function onInsert() {
86+
// die('No inserts allowed.');
87+
// }
88+
//
89+
// function onBeforeUpdate() {
90+
// global $app, $conf;
91+
//
92+
// if($conf['demo_mode'] == true && $this->id <= 3) $app->tform->errorMessage .= 'This function is disabled in demo mode.';
93+
//
94+
// $_SESSION['s']['user']['language'] = $_POST['language'];
95+
// $_SESSION['s']['language'] = $_POST['language'];
96+
//
97+
// if(@is_array($this->dataRecord['modules']) && !in_array($this->dataRecord['startmodule'],$this->dataRecord['modules'])) {
98+
// $app->tform->errorMessage .= $app->tform->wordbook['startmodule_err'];
99+
// }
100+
// }
101+
//
102+
//
103+
//}
104+
//
105+
//$page = new page_action;
106+
//$page->onLoad();
107+
108+
echo '<h2 class="frmTextHead">Default-v2 Settings</h2><p>No settings for this theme</p>';
109+
?>
Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
<?php
2+
3+
/*
4+
Copyright (c) 2005, Till Brehm, projektfarm Gmbh
5+
All rights reserved.
6+
7+
Redistribution and use in source and binary forms, with or without modification,
8+
are permitted provided that the following conditions are met:
9+
10+
* Redistributions of source code must retain the above copyright notice,
11+
this list of conditions and the following disclaimer.
12+
* Redistributions in binary form must reproduce the above copyright notice,
13+
this list of conditions and the following disclaimer in the documentation
14+
and/or other materials provided with the distribution.
15+
* Neither the name of ISPConfig nor the names of its contributors
16+
may be used to endorse or promote products derived from this software without
17+
specific prior written permission.
18+
19+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND
20+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
21+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
22+
IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
23+
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
24+
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
26+
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
28+
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29+
*/
30+
31+
/*
32+
Form Definition
33+
34+
Tabellendefinition
35+
36+
Datentypen:
37+
- INTEGER (Wandelt Ausdr�cke in Int um)
38+
- DOUBLE
39+
- CURRENCY (Formatiert Zahlen nach W�hrungsnotation)
40+
- VARCHAR (kein weiterer Format Check)
41+
- TEXT (kein weiterer Format Check)
42+
- DATE (Datumsformat, Timestamp Umwandlung)
43+
44+
Formtype:
45+
- TEXT (normales Textfeld)
46+
- TEXTAREA (normales Textfeld)
47+
- PASSWORD (Feldinhalt wird nicht angezeigt)
48+
- SELECT (Gibt Werte als option Feld aus)
49+
- RADIO
50+
- CHECKBOX
51+
- CHECKBOXARRAY
52+
- FILE
53+
54+
VALUE:
55+
- Wert oder Array
56+
57+
Hinweis:
58+
Das ID-Feld ist nicht bei den Table Values einzuf�gen.
59+
60+
61+
*/
62+
63+
$form['title'] = 'Default-v2 Settings';
64+
$form['description'] = '';
65+
$form['name'] = 'default-v2';
66+
$form['action'] = 'default-v2_settings.php';
67+
$form['db_table'] = 'sys_user'; // needs to be 'sys_user_theme'
68+
$form['db_table_idx'] = 'userid'; //??
69+
$form["db_history"] = "no";
70+
$form['tab_default'] = 'main';
71+
$form['list_default'] = 'index.php';
72+
$form['auth'] = 'no'; //?
73+
74+
//* 0 = id of the user, > 0 id must match with id of current user
75+
$form['auth_preset']['userid'] = 0;
76+
//* 0 = default groupid of the user, > 0 id must match with groupid of current user
77+
$form['auth_preset']['groupid'] = 0;
78+
79+
//** Permissions are: r = read, i = insert, u = update, d = delete
80+
$form['auth_preset']['perm_user'] = 'riud';
81+
$form['auth_preset']['perm_group'] = 'riud';
82+
$form['auth_preset']['perm_other'] = '';
83+
84+
//* Pick out modules
85+
//* TODO: limit to activated modules of the user
86+
$modules_list = array();
87+
$handle = @opendir(ISPC_WEB_PATH);
88+
while ($file = @readdir ($handle)) {
89+
if ($file != '.' && $file != '..') {
90+
if(@is_dir(ISPC_WEB_PATH."/$file")) {
91+
if(is_file(ISPC_WEB_PATH."/$file/lib/module.conf.php") and $file != 'login' && $file != 'designer' && $file != 'mailuser') {
92+
$modules_list[$file] = $file;
93+
}
94+
}
95+
}
96+
}
97+
98+
//* Languages
99+
$language_list = array();
100+
$handle = @opendir(ISPC_ROOT_PATH.'/lib/lang');
101+
while ($file = @readdir ($handle)) {
102+
if ($file != '.' && $file != '..') {
103+
if(@is_file(ISPC_ROOT_PATH.'/lib/lang/'.$file) and substr($file,-4,4) == '.lng') {
104+
$tmp = substr($file, 0, 2);
105+
$language_list[$tmp] = $tmp;
106+
}
107+
}
108+
}
109+
110+
//* Load themes
111+
$themes_list = array();
112+
$handle = @opendir(ISPC_THEMES_PATH);
113+
while ($file = @readdir ($handle)) {
114+
if (substr($file, 0, 1) != '.') {
115+
if(@is_dir(ISPC_THEMES_PATH."/$file")) {
116+
$themes_list[$file] = $file;
117+
}
118+
}
119+
}
120+
121+
$form['tabs']['main'] = array (
122+
'title' => 'Settings',
123+
'width' => 80,
124+
'template' => 'templates/interface_settings.htm',
125+
'fields' => array (
126+
##################################
127+
# Beginn Datenbankfelder
128+
##################################
129+
130+
##################################
131+
# ENDE Datenbankfelder
132+
##################################
133+
)
134+
);
135+
136+
137+
?>

0 commit comments

Comments
 (0)