commit | author | age
|
b5a2f8
|
1 |
<?php |
T |
2 |
|
|
3 |
/* |
436ed8
|
4 |
Copyright (c) 2007, Till Brehm, projektfarm Gmbh |
b5a2f8
|
5 |
All rights reserved. |
T |
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 |
|
6bb878
|
31 |
error_reporting(E_ALL|E_STRICT); |
P |
32 |
|
b5a2f8
|
33 |
require_once('../lib/config.inc.php'); |
T |
34 |
require_once('../lib/app.inc.php'); |
|
35 |
|
|
36 |
$app->uses('tpl'); |
5fcaec
|
37 |
$app->tpl->newTemplate('main.tpl.htm'); |
b5a2f8
|
38 |
|
cf71a4
|
39 |
/* |
b5a2f8
|
40 |
|
T |
41 |
// Checke User Login and current module |
|
42 |
if(!is_array($_SESSION["s"]['user']) or !is_array($_SESSION["s"]["module"])) { |
|
43 |
// Loading Login Module |
|
44 |
include_once('login/lib/module.conf.php'); |
|
45 |
$_SESSION["s"]['module'] = $module; |
|
46 |
$topnav[] = array( 'title' => "Login", |
|
47 |
'active' => 1); |
|
48 |
$module = null; |
|
49 |
unset($module); |
|
50 |
} else { |
|
51 |
// Loading modules of the user and building top navigation |
|
52 |
$modules = explode(',',$_SESSION["s"]["user"]["modules"]); |
|
53 |
if(is_array($modules)) { |
|
54 |
foreach($modules as $mt) { |
|
55 |
if(is_file($mt."/lib/module.conf.php")) { |
|
56 |
include_once($mt."/lib/module.conf.php"); |
|
57 |
$active = ($module["name"] == $_SESSION["s"]["module"]["name"])?1:0; |
|
58 |
$topnav[] = array( 'title' => $app->lng($module["title"]), |
|
59 |
'active' => $active, |
|
60 |
'module' => $module["name"]); |
|
61 |
} |
|
62 |
} |
|
63 |
} |
|
64 |
} |
|
65 |
|
|
66 |
// Topnavigation |
|
67 |
$app->tpl->setLoop('nav_top',$topnav); |
|
68 |
|
|
69 |
// Loading Module part |
|
70 |
$app->tpl->setInclude('module_tpl',$_SESSION["s"]["module"]["template"]); |
|
71 |
|
|
72 |
// translating module navigation |
|
73 |
$nav_translated = array(); |
|
74 |
if(is_array($_SESSION["s"]["module"]["nav"])) { |
|
75 |
foreach($_SESSION["s"]["module"]["nav"] as $nav) { |
|
76 |
$tmp_items = array(); |
|
77 |
foreach($nav["items"] as $item) { |
|
78 |
$item["title"] = $app->lng($item["title"]); |
|
79 |
$tmp_items[] = $item; |
|
80 |
} |
|
81 |
$nav["title"] = $app->lng($nav["title"]); |
|
82 |
$nav["items"] = $tmp_items; |
|
83 |
$nav_translated[] = $nav; |
|
84 |
} |
|
85 |
} else { |
|
86 |
$nav_translated = null; |
|
87 |
} |
|
88 |
|
|
89 |
// Loading left navigation |
|
90 |
//$app->tpl->setLoop('nav_left',$_SESSION["s"]["module"]["nav"]); |
|
91 |
$app->tpl->setLoop('nav_left',$nav_translated); |
|
92 |
|
|
93 |
// Setting startpage |
|
94 |
$app->tpl->setVar('startpage',$_SESSION["s"]["module"]["startpage"]); |
|
95 |
$app->tpl->setVar('navframe_page',$_SESSION["s"]["module"]["navframe_page"]); |
|
96 |
|
cf71a4
|
97 |
*/ |
T |
98 |
|
b5a2f8
|
99 |
$app->tpl_defaults(); |
T |
100 |
$app->tpl->pparse(); |
|
101 |
?> |