|
28 | 28 | */ |
29 | 29 |
|
30 | 30 |
|
31 | | -/****************************************** |
32 | | -* Begin Form configuration |
33 | | -******************************************/ |
34 | | - |
35 | | -$tform_def_file = "form/tpl_default.tform.php"; |
36 | | - |
37 | | -/****************************************** |
38 | | -* End Form configuration |
39 | | -******************************************/ |
| 31 | +global $app, $conf; |
40 | 32 |
|
41 | 33 | require_once('../../lib/config.inc.php'); |
42 | 34 | require_once('../../lib/app.inc.php'); |
43 | 35 |
|
44 | 36 | //* Check permissions for module |
45 | 37 | $app->auth->check_module_permissions('tools'); |
46 | 38 |
|
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'); |
| 39 | +$app->uses('tpl'); |
59 | 40 |
|
60 | | - $app->tpl->newTemplate("tabbed_form.tpl.htm"); |
| 41 | +$app->tpl->newTemplate('listpage.tpl.htm'); |
| 42 | +$app->tpl->setInclude('content_tpl', 'templates/tpl_default.htm'); |
61 | 43 |
|
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']; |
| 44 | +$lng_file = 'lib/lang/'.$_SESSION['s']['language'].'_tpl_default.lng'; |
| 45 | +include($lng_file); |
68 | 46 |
|
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 | | -} |
| 47 | +$app->tpl->setVar($wb); |
104 | 48 |
|
105 | | -$page = new page_action; |
106 | | -$page->onLoad(); |
| 49 | +$app->tpl_defaults(); |
| 50 | +$app->tpl->pparse(); |
107 | 51 |
|
108 | 52 | ?> |
0 commit comments