aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--index.php47
-rw-r--r--lib/bootstrap.php11
-rw-r--r--view/404.php (renamed from pages/404.php)2
-rw-r--r--view/about.php (renamed from pages/about.php)2
-rw-r--r--view/feedback.php (renamed from pages/feedback.php)2
-rw-r--r--view/overview.php (renamed from pages/overview.php)2
-rw-r--r--view/party.php (renamed from pages/party.php)2
-rw-r--r--view/program-json.php (renamed from pages/program-json.php)2
-rw-r--r--view/relive-player.php (renamed from pages/relive-player.php)2
-rw-r--r--view/relive.php (renamed from pages/relive.php)2
-rw-r--r--view/room.php (renamed from pages/room.php)3
11 files changed, 28 insertions, 49 deletions
diff --git a/index.php b/index.php
index e4b4417..1802af4 100644
--- a/index.php
+++ b/index.php
@@ -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');
}
diff --git a/lib/bootstrap.php b/lib/bootstrap.php
deleted file mode 100644
index 57d9174..0000000
--- a/lib/bootstrap.php
+++ /dev/null
@@ -1,11 +0,0 @@
-<?php
-
-require_once('lib/PhpTemplate.php');
-require_once('lib/helper.php');
-require_once('config.php');
-
-$tpl = new PhpTemplate('template/page.phtml');
-$tpl->set(array(
- 'baseurl' => baseurl(),
- 'assemblies' => './template/assemblies/',
-));
diff --git a/pages/404.php b/view/404.php
index 0e84e5f..1811239 100644
--- a/pages/404.php
+++ b/view/404.php
@@ -1,7 +1,5 @@
<?php
-require_once('lib/bootstrap.php');
-
header("HTTP/1.1 404 Not Found");
echo $tpl->render(array(
'page' => '404',
diff --git a/pages/about.php b/view/about.php
index 9586e73..cc81064 100644
--- a/pages/about.php
+++ b/view/about.php
@@ -1,7 +1,5 @@
<?php
-require_once('lib/bootstrap.php');
-
echo $tpl->render(array(
'page' => 'about',
'title' => 'About the Streams',
diff --git a/pages/feedback.php b/view/feedback.php
index 8b87b01..7417f24 100644
--- a/pages/feedback.php
+++ b/view/feedback.php
@@ -1,7 +1,5 @@
<?php
-require_once('lib/bootstrap.php');
-
if(
!isset($_POST['datetime']) ||
!isset($_POST['net']) ||
diff --git a/pages/overview.php b/view/overview.php
index 0b4434d..6305940 100644
--- a/pages/overview.php
+++ b/view/overview.php
@@ -1,7 +1,5 @@
<?php
-require_once('lib/bootstrap.php');
-
echo $tpl->render(array(
'page' => 'overview',
'title' => 'Live-Streams',
diff --git a/pages/party.php b/view/party.php
index a095df3..322cea6 100644
--- a/pages/party.php
+++ b/view/party.php
@@ -1,7 +1,5 @@
<?php
-require_once('lib/bootstrap.php');
-
$room = $_GET['room'];
echo $tpl->render(array(
'page' => 'party',
diff --git a/pages/program-json.php b/view/program-json.php
index 2b5e38b..4cce716 100644
--- a/pages/program-json.php
+++ b/view/program-json.php
@@ -1,6 +1,4 @@
<?php
-require_once('lib/bootstrap.php');
-
header('Content-Type: application/json');
echo json_encode(program());
diff --git a/pages/relive-player.php b/view/relive-player.php
index 84fc866..1517b92 100644
--- a/pages/relive-player.php
+++ b/view/relive-player.php
@@ -1,7 +1,5 @@
<?php
-require_once('lib/bootstrap.php');
-
$talks_by_id = relive_talks();
$talk = @$talks_by_id[intval($_GET['id'])];
diff --git a/pages/relive.php b/view/relive.php
index 33e0d5a..0608423 100644
--- a/pages/relive.php
+++ b/view/relive.php
@@ -1,7 +1,5 @@
<?php
-require_once('lib/bootstrap.php');
-
echo $tpl->render(array(
'page' => 'relive',
'title' => 'Relive!',
diff --git a/pages/room.php b/view/room.php
index 77f4fdf..4484a14 100644
--- a/pages/room.php
+++ b/view/room.php
@@ -1,8 +1,5 @@
<?php
-require_once('lib/bootstrap.php');
-
-
$room = $_GET['room'];
$language = $_GET['language'];
$selection = $_GET['selection'];