kolejna partia drobniejszych zmian (wciąż możliwe, że zacommitowany watermelon nie...
[watermeloncms.git] / wtrmln / libs / controller.php
blobc0bbe3e79e9903443e12086db736ec1d23093b1a
1 <?php
2 /********************************************************************
4 Watermelon CMS
6 Copyright 2008-2009 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 class Controller
25 static public $_user;
27 public function Controller()
29 $this->url = new URL();
30 $this->db = new DB();
31 $this->load = new Loader();
32 $this->user = new User();
33 self::$_user = $this->user;
35 if(defined('ADMIN_MODE'))
37 if(!$this->user->IsAdmin())
39 header('Location: ' . WTRMLN_MAINURL . 'login');
40 exit;
46 * static public void addMeta(string $data);
48 * dodaje element do sekcji <head>
50 * string $data - element do wstawienia, np. '<style type="text/css">*{display:none}</style>'
53 static public function addMeta($data)
55 $metaSrc = Watermelon::$metaSrc;
57 $metaSrc[] = $data;
59 Watermelon::$metaSrc = $metaSrc;