usuniety syf (powroty karetki i trailing spaces) z kodu
[watermeloncms.git] / cms / wtrmln / admin / index.php
bloba5c1f050647ac7d030d74f914975ea87db7e0ae0
1 <?php
2 /********************************************************************
4 Watermelon CMS
6 Copyright 2008 Radosław Pietruszewski
8 This program is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License
10 version 2 as published by the Free Software Foundation.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 ********************************************************************/
23 include 'commons.php';
24 if(!AreLoggedIn()){ header("Location: login.php"); exit; }
26 ////////////////
28 // zamieniamy _ na /, tak aby można było robić kontrolery w podfolderach
30 $_w_controllerPath = str_replace('_', '/', $_url->class);
32 $_w_controllerPath = WTRMLN_ADMINCNT . $_w_controllerPath . '.php';
34 if(file_exists($_w_controllerPath))
36 include $_w_controllerPath;
38 else
40 panic('Nie moge znalesc pliku podanego controllera');
43 if(class_exists($_url->class))
45 $_controller = new $_url->class();
47 else
49 panic('Nie moge znalesc klasy podanego controllera');
52 if(!method_exists($_controller, $_url->method))
54 panic('Nie moge znalesc podanej funkcji składowej controllera');
57 // przystepujemy do roboty
59 $_controller->{$_url->method}();
61 $content = ob_get_contents();
62 @ob_end_clean();
64 // w łatwy sposób umożliwiamy tworzenie ścieżek do konkretnego modułu
66 $content = str_replace('<a href="$/', '<a href="' . WTRMLN_ADMIN . 'index.php/', $content);
68 $menu =
69 '<div id="menu">
70 <div>
71 <a href="#">Elo</a>
72 <a href="#">Elo</a>
73 <a href="#" class="current">Elo</a>
74 <a href="#">Elo</a>
75 <br>
76 </div>
77 </div>
78 <div id="submenu">
79 <div>
80 <a href="#">Elo</a>
81 <a href="#">Elo</a>
82 <a href="#" class="current">Elo</a>
83 <a href="#">Elo</a>
84 <br>
85 </div>
86 </div>';
88 $menua =
89 array(
90 '3',
91 '1', '#1',
92 array(
93 '3',
94 '1a', '#1a',
95 '1b', '#1b',
96 '1c', '#1c',
97 '1d', '#1d',
99 '2', '#2',
100 array(
101 '3',
102 '2a', '#2a',
103 '2b', '#2b',
104 '2c', '#2c',
105 '2d', '#2d',
107 '3', '#3',
108 array(
109 '3',
110 '3a', '#3a',
111 '3b', '#3b',
112 '3c', '#3c',
113 '3d', '#3d',
115 '4', '#4',
116 array(
117 '3',
118 '4a', '#4a',
119 '4b', '#4b',
120 '4c', '#4c',
121 '4d', '#4d',
127 include 'themes/' . WTRMLN_ADMIN_THEME . '/index.php';