2 /********************************************************************
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 Pages
extends Controller
27 // wyciągamy segmenty URL-a (nazwa page'a) i mierzymy ich ilość
29 $page = URL
::$segments;
31 $segments = count($page);
33 // jeśli brak segmentów
41 // jeśli $page jest stringiem zamieniamy go na tablicę z jedną wartością
50 $page = implode('/', $page);
52 // sprawdzamy czy istnieje
54 $Pages = $this->load
->model('Pages');
56 $data = $Pages->getData($page);
60 $data = $data->to_obj();
66 $content = $data->content
;
68 // przetwarzamy pseudotagi
70 $content = ViewTags
::Process($content);
74 eval('?>' . $content . '<?php ');
83 private function e404($pageName = '')
85 setH1('Błąd 404 : Nie odnaleziono');
87 echo $this->load
->view('e404', array('pageName' => $pageName));