* @version 0.1 * @copyright Adam Bugiel 2011 */ //detekcja wersji jzykowej /*$domain=explode('.',$_SERVER['HTTP_HOST']); $languagePostfix=''; if(($domain[0]=='en')||($domain[1]=='en')) { $languageSign='-en'; } if(($domain[0]=='de')||($domain[1]=='en')) { $languageSign='-de'; }*/ try { require_once 'application/framework.php'; // ladowanie frameworka $config = include 'application/config.php'; // ladowanie konfiguracji aplikacji _Controller::$config = $config['controller']; _View::$config = $config['view']; _Model::$config = $config['model']; //podzial zadan wg danych z adresu: *************************************** $environment=utilities_environment::create(); $environment->setParams(); $params=$environment->getParams(); if($params[0]=='') { //$controller='page'; //$action='showPage'; //$id='index'; $controller='gallery'; $action='showAll'; $id='aktualnosci'; } elseif(($params[0]=='aktualnosci')||($params[0]=='archiwum')||($params[0]=='galeria')) { $controller='gallery'; if($params[1]!='') { $action='showAlbum'; $id=$params[1]; } else { $action='showAll'; $id=$params[0]; } } /*elseif(($params[0]=='galeria')||($params[0]=='galeria2015')) { $controller='gallery'; $id=$params[0]; $action='showOneAlbum'; $id=$params[0]; / *if($params[1]!='') { $action='showAlbum'; $id=$params[1]; } else $action='showAll';* / }*/ /*elseif($params[0]=='zgloszenie') { $controller='question'; $action='sendEmail'; }*/ else { $controller='page'; $action='showPage'; $id=implode('/', $params); } //koniec podzialu zadan wg danych z adresu: ******************************* if($controller=='') $controller='page'; if($action=='') { $action='showPage'; $id=implode('/', $params); } $controller='controller_'.$controller; //echo $controller.'x'.$action; $controller = new $controller; echo $controller->$action($id.$languageSign); } catch (Exception $e) { echo 'Error '.$e->getCode().': '.$e->getMessage(); } ?>