redray
2008-11-19 7d78160cfc5041e43a330708c264b0de32f08098
commit | author | age
b5a2f8 1 <?php
T 2 /*
3 Copyright (c) 2005, 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 require_once('../../lib/config.inc.php');
31 require_once('../../lib/app.inc.php');
32
910093 33 //* Check permissions for module
T 34 $app->auth->check_module_permissions('designer');
b5a2f8 35
T 36 if($_SESSION["s"]["user"]["typ"] != "admin") die("Admin permissions required.");
37
38 $app->uses('tpl');
39
40 $app->tpl->newTemplate("form.tpl.htm");
41 $app->tpl->setInclude('content_tpl','templates/module_show.htm');
42
43
44 $module_name = $_REQUEST["id"];
45 if(!preg_match('/^[A-Za-z0-9_]{0,50}$/',$module_name)) die("id contains invalid chars.");
46
47 include_once("../".$module_name."/lib/module.conf.php");
48 $navi = $module["nav"];
49 unset($module["nav"]);
50 $record = $module;
51
52 // loading language file 
53 $lng_file = "lib/lang/".$_SESSION["s"]["user"]["language"]."_module_show.lng";
54 include($lng_file);
55 $app->tpl->setVar($wb);
56
57 // baue Modul navi
58 $content = "";
59 $n1 = 0;
60 $n2 = 0;
61 if(is_array($navi)) {
62 foreach($navi as $nav_id => $section) {
63     $content .= "<tr>
64     <td colspan='2' class='frmText11'>
65       <table width='100%'>
66           <tr>
67           <td class='tblHead'>$section[title]</td>
68           <td class='tblHead' width='280' align='right'>
cf71a4 69           <input type=\"button\" name=\"bt1$n2\" value=\"$wb[edit_txt]\" onClick=\"loadContent('designer/module_nav_edit.php?module_name=$module_name&nav_id=$nav_id');\" class=\"button\" /><div class=\"buttonEnding\"></div>
T 70           <input type=\"button\" name=\"bt2$n2\" value=\"$wb[delete_txt]\" onClick=\"del_record('designer/module_nav_del.php?module_name=$module_name&nav_id=$nav_id');\" class=\"button\" /><div class=\"buttonEnding\"></div>
71           <input type=\"button\" name=\"bt3$n2\" value=\"$wb[new_txt]\" onClick=\"loadContent('designer/module_nav_item_edit.php?module_name=$module_name&nav_id=$nav_id');\" class=\"button\" /><div class=\"buttonEnding\"></div>
72           <input type=\"button\" name=\"bt4$n2\" value=\"$wb[up_txt]\" onClick=\"loadContent('designer/module_nav_flip.php?module_name=$module_name&nav_id=$nav_id&dir=up');\" class=\"button\" /><div class=\"buttonEnding\"></div>
73           <input type=\"button\" name=\"bt5$n2\" value=\"$wb[down_txt]\" onClick=\"loadContent('designer/module_nav_flip.php?module_name=$module_name&nav_id=$nav_id&dir=down');\" class=\"button\" /><div class=\"buttonEnding\"></div>
b5a2f8 74           </td>
T 75         </tr>";
76     //$content .= "<tr><td bgcolor='#EEEEEE' class='frmText11'>Bereich:</td><td class='frmText11' bgcolor='#EEEEEE'><input name=\"module[nav][$n1][title]\" type=\"text\" class=\"text\" value=\"$section[title]\" size=\"30\" maxlength=\"255\"><input name=\"module[nav][$n1][open]\" type=\"hidden\" value=\"$section[open]\"></td></tr>\r\n";
77     foreach($section["items"] as $item_id => $item) {
78         //$content .= "<tr><td class='frmText11'>Titel:</td><td class='frmText11'><input name=\"module[nav][$n1][items][$n2][title]\" type=\"text\" class=\"text\" value=\"$item[title]\" size=\"30\" maxlength=\"255\"></td></tr>\r\n";
79         //$content .= "<tr><td class='frmText11'>Ziel:</td><td class='frmText11'>&nbsp; &nbsp; &nbsp; &nbsp;<input name=\"module[nav][$n1][items][$n2][target]\" type=\"text\" class=\"text\" value=\"$item[target]\" size=\"10\" maxlength=\"255\"></td></tr>\r\n";
80         //$content .= "<tr><td class='frmText11'>Link:</td><td class='frmText11'>&nbsp; &nbsp; &nbsp; &nbsp;<input name=\"module[nav][$n1][items][$n2][link]\" type=\"text\" class=\"text\" value=\"$item[link]\" size=\"30\" maxlength=\"255\"></td></tr>\r\n";
81         $content .= "<tr>
82           <td class='frmText11'>$item[title]</td>
83           <td class='frmText11' width='280' align='right'>
cf71a4 84           <input type=\"button\" name=\"bt6$n2\" value=\"$wb[edit_txt]\" onClick=\"loadContent('designer/module_nav_item_edit.php?module_name=$module_name&nav_id=$nav_id&item_id=$item_id');\" class=\"button\" /><div class=\"buttonEnding\"></div>
T 85           <input type=\"button\" name=\"bt7$n2\" value=\"$wb[delete_txt]\" onClick=\"del_record('designer/module_nav_item_del.php?module_name=$module_name&nav_id=$nav_id&item_id=$item_id');\" class=\"button\" /><div class=\"buttonEnding\"></div>
86           <input type=\"button\" name=\"bt8$n2\" value=\"$wb[up_txt]\" onClick=\"loadContent('designer/module_nav_item_flip.php?module_name=$module_name&nav_id=$nav_id&item_id=$item_id&dir=up');\" class=\"button\" /><div class=\"buttonEnding\"></div>
87           <input type=\"button\" name=\"bt9$n2\" value=\"$wb[down_txt]\" onClick=\"loadContent('designer/module_nav_item_flip.php?module_name=$module_name&nav_id=$nav_id&item_id=$item_id&dir=down');\" class=\"button\" /><div class=\"buttonEnding\"></div>
b5a2f8 88           </td>
T 89         </tr>";
90         $n2++;
91     }
92     $content .= "<tr><td colspan='2' class='tblFooter'>&nbsp;</td></tr>
93       </table>
94     </td>
95   </tr>";
96     $n1++;
97 }
98 }
99
100 $record["nav"] = $content;
101
102
103 $app->tpl->setVar($record);
104
105
106 $app->tpl->setLoop('records',$modules_list);
107
108 $app->tpl_defaults();
109 $app->tpl->pparse();
110
111
112
113 ?>