diff options
author | MaZderMind | 2015-03-07 17:58:07 +0100 |
---|---|---|
committer | MaZderMind | 2015-03-14 13:46:47 +0100 |
commit | 844a7d53f2d78bafba479c0d931277246ade61de (patch) | |
tree | 7a9ab7e3ddcafa878f89deecc03c6de742fa2efa /index.php | |
parent | 8bb9b119a34717782e41124030917bd86d47f754 (diff) |
Renames pages -> view
Diffstat (limited to '')
-rw-r--r-- | index.php | 47 |
1 files changed, 28 insertions, 19 deletions
@@ -1,63 +1,72 @@ <?php +require_once('config.php'); +require_once('lib/PhpTemplate.php'); +require_once('lib/helper.php'); + $route = @$_GET['route']; $route = rtrim($route, '/'); $GLOBALS['ROUTE'] = $route; -require_once('config.php'); -require_once('lib/helper.php'); + +$GLOBALS['tpl'] = new PhpTemplate('template/page.phtml'); +$GLOBALS['tpl']->set(array( + 'baseurl' => baseurl(), + 'assemblies' => './template/assemblies/', +)); + if($route == '') { - include('pages/overview.php'); + include('view/overview.php'); } else if(preg_match('@^about$@', $route, $m)) { - include('pages/about.php'); + include('view/about.php'); } else if(preg_match('@^program.json$@', $route, $m)) { if(!has('SCHEDULE')) - return include('pages/404.php'); + return include('view/404.php'); - include('pages/program-json.php'); + include('view/program-json.php'); } else if(preg_match('@^feedback$@', $route, $m)) { if(!has('FEEDBACK')) - return include('pages/404.php'); + return include('view/404.php'); - include('pages/feedback.php'); + include('view/feedback.php'); } else if(preg_match('@^feedback/read$@', $route, $m)) { if(!has('FEEDBACK')) - return include('pages/404.php'); + return include('view/404.php'); - include('pages/feedback-read.php'); + include('view/feedback-read.php'); } else if(preg_match('@^relive/([0-9]+)$@', $route, $m)) { if(!has('OVERVIEW.RELIVE_JSON')) - return include('pages/404.php'); + return include('view/404.php'); $_GET = array( 'id' => $m[1], ); - include('pages/relive-player.php'); + include('view/relive-player.php'); } else if(preg_match('@^relive$@', $route, $m)) { if(!has('OVERVIEW.RELIVE_JSON')) - return include('pages/404.php'); + return include('view/404.php'); - include('pages/relive.php'); + include('view/relive.php'); } else if(preg_match('@^([^/]+)$@', $route, $m)) @@ -67,7 +76,7 @@ else if(preg_match('@^([^/]+)$@', $route, $m)) 'selection' => '', 'language' => 'native', ); - include('pages/room.php'); + include('view/room.php'); } else if(preg_match('@^([^/]+)/translated$@', $route, $m)) @@ -77,7 +86,7 @@ else if(preg_match('@^([^/]+)/translated$@', $route, $m)) 'selection' => '', 'language' => 'translated', ); - include('pages/room.php'); + include('view/room.php'); } else if(preg_match('@^([^/]+)/(sd|audio|slides)$@', $route, $m)) @@ -87,7 +96,7 @@ else if(preg_match('@^([^/]+)/(sd|audio|slides)$@', $route, $m)) 'selection' => $m[2], 'language' => 'native', ); - include('pages/room.php'); + include('view/room.php'); } else if(preg_match('@^([^/]+)/(sd|audio|slides)/translated$@', $route, $m)) @@ -97,10 +106,10 @@ else if(preg_match('@^([^/]+)/(sd|audio|slides)/translated$@', $route, $m)) 'selection' => $m[2], 'language' => 'translated', ); - include('pages/room.php'); + include('view/room.php'); } else { - include('pages/404.php'); + include('view/404.php'); } |