2 /********************************************************************
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 class Pages
extends Controller
32 // wyciągamy człony ścieżki (nazwa page'a)
34 $page = URL
::$segments;
38 $page = implode('/', $page);
40 // sprawdzamy czy istnieje
42 $Pages = $this->load
->model('Pages');
44 $data = $Pages->getData($page);
46 if($data->num_rows() > 0)
48 $data = $data->to_obj();
51 $content = $data->content
;
53 // w razie gdyby nie można było używać <? i <?=
55 if(@ini_get
('short_open_tag') === FALSE)
57 $content = str_replace('<?=', '<?php echo ', $content);
58 $content = str_replace('<?', '<?php', $content);
63 eval('?>' . $content);
75 echo 'Błąd czterysta cztery - przykro mnie bardzo :P';