From 844a7d53f2d78bafba479c0d931277246ade61de Mon Sep 17 00:00:00 2001 From: MaZderMind Date: Sat, 7 Mar 2015 17:58:07 +0100 Subject: Renames pages -> view --- index.php | 47 ++++++++++-------- lib/bootstrap.php | 11 ----- pages/404.php | 9 ---- pages/about.php | 8 ---- pages/feedback.php | 43 ----------------- pages/overview.php | 8 ---- pages/party.php | 15 ------ pages/program-json.php | 6 --- pages/relive-player.php | 18 ------- pages/relive.php | 9 ---- pages/room.php | 124 ------------------------------------------------ view/404.php | 7 +++ view/about.php | 6 +++ view/feedback.php | 41 ++++++++++++++++ view/overview.php | 6 +++ view/party.php | 13 +++++ view/program-json.php | 4 ++ view/relive-player.php | 16 +++++++ view/relive.php | 7 +++ view/room.php | 121 ++++++++++++++++++++++++++++++++++++++++++++++ 20 files changed, 249 insertions(+), 270 deletions(-) delete mode 100644 lib/bootstrap.php delete mode 100644 pages/404.php delete mode 100644 pages/about.php delete mode 100644 pages/feedback.php delete mode 100644 pages/overview.php delete mode 100644 pages/party.php delete mode 100644 pages/program-json.php delete mode 100644 pages/relive-player.php delete mode 100644 pages/relive.php delete mode 100644 pages/room.php create mode 100644 view/404.php create mode 100644 view/about.php create mode 100644 view/feedback.php create mode 100644 view/overview.php create mode 100644 view/party.php create mode 100644 view/program-json.php create mode 100644 view/relive-player.php create mode 100644 view/relive.php create mode 100644 view/room.php diff --git a/index.php b/index.php index e4b4417..1802af4 100644 --- a/index.php +++ b/index.php @@ -1,63 +1,72 @@ 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 @@ -set(array( - 'baseurl' => baseurl(), - 'assemblies' => './template/assemblies/', -)); diff --git a/pages/404.php b/pages/404.php deleted file mode 100644 index 0e84e5f..0000000 --- a/pages/404.php +++ /dev/null @@ -1,9 +0,0 @@ -render(array( - 'page' => '404', - 'title' => '404 Not Found', -)); diff --git a/pages/about.php b/pages/about.php deleted file mode 100644 index 9586e73..0000000 --- a/pages/about.php +++ /dev/null @@ -1,8 +0,0 @@ -render(array( - 'page' => 'about', - 'title' => 'About the Streams', -)); diff --git a/pages/feedback.php b/pages/feedback.php deleted file mode 100644 index 8b87b01..0000000 --- a/pages/feedback.php +++ /dev/null @@ -1,43 +0,0 @@ -render(array( - 'page' => 'feedback', - 'title' => 'Give Feedback', - 'room' => null, - )); -} -else -{ - $db = new PDO(get('FEEDBACK.DSN')); - $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); - - $stm = $db->prepare(' - INSERT INTO feedback (reported, datetime, net, os, player, stream, ipproto_v4, ipproto_v6, provider, issues, issuetext) - VALUES (:reported, :datetime, :net, :os, :player, :stream, :ipproto_v4, :ipproto_v6, :provider, :issues, :issuetext) - '); - - $stm->execute(array( - 'reported' => time(), - 'datetime' => strtotime($_POST['datetime']), - 'net' => $_POST['net'], - 'os' => $_POST['os'], - 'player' => $_POST['player'], - 'stream' => $_POST['stream'], - 'ipproto_v4' => isset($_POST['ipproto']) && is_array($_POST['ipproto']) && in_array('v4', $_POST['ipproto']), - 'ipproto_v6' => isset($_POST['ipproto']) && is_array($_POST['ipproto']) && in_array('v6', $_POST['ipproto']), - 'provider' => $_POST['provider'], - 'issues' => isset($_POST['issues']) && is_array($_POST['issues']) ? implode(',', $_POST['issues']) : '', - 'issuetext' => $_POST['issuetext'], - )); -} diff --git a/pages/overview.php b/pages/overview.php deleted file mode 100644 index 0b4434d..0000000 --- a/pages/overview.php +++ /dev/null @@ -1,8 +0,0 @@ -render(array( - 'page' => 'overview', - 'title' => 'Live-Streams', -)); diff --git a/pages/party.php b/pages/party.php deleted file mode 100644 index a095df3..0000000 --- a/pages/party.php +++ /dev/null @@ -1,15 +0,0 @@ -render(array( - 'page' => 'party', - - 'title' => $GLOBALS['CONFIG']['ROOMS'][$room], - - 'rooms' => $GLOBALS['CONFIG']['ROOMS'], - - 'room' => $room, - 'roomname' => $GLOBALS['CONFIG']['ROOMS'][$room], -)); diff --git a/pages/program-json.php b/pages/program-json.php deleted file mode 100644 index 2b5e38b..0000000 --- a/pages/program-json.php +++ /dev/null @@ -1,6 +0,0 @@ -render(array( - 'page' => 'relive-player', - 'title' => 'Relive!', - 'talk' => $talk, - - 'width' => 1024, - 'height' => 576, -)); diff --git a/pages/relive.php b/pages/relive.php deleted file mode 100644 index 33e0d5a..0000000 --- a/pages/relive.php +++ /dev/null @@ -1,9 +0,0 @@ -render(array( - 'page' => 'relive', - 'title' => 'Relive!', - 'talks' => relive_talks(), -)); diff --git a/pages/room.php b/pages/room.php deleted file mode 100644 index 77f4fdf..0000000 --- a/pages/room.php +++ /dev/null @@ -1,124 +0,0 @@ -render(array( - 'page' => 'room', - - 'title' => get("ROOMS.$room.DISPLAY").' – '.$title, - 'room' => $room, - - 'program' => program(), - - 'tab' => $tab, - 'tabs' => $tabs, - - 'width' => @$width, - 'height' => @$height, - 'language' => $language, - 'translated' => ($language == 'translated'), - 'selection' => $selection, - 'hlsformat' => ($selection == 'hd' ? 'auto' : $selection), - - 'has_translation' => $has_translation, - 'formats' => $formats, - 'protos' => $protos, - 'videores' => $videores, -)); diff --git a/view/404.php b/view/404.php new file mode 100644 index 0000000..1811239 --- /dev/null +++ b/view/404.php @@ -0,0 +1,7 @@ +render(array( + 'page' => '404', + 'title' => '404 Not Found', +)); diff --git a/view/about.php b/view/about.php new file mode 100644 index 0000000..cc81064 --- /dev/null +++ b/view/about.php @@ -0,0 +1,6 @@ +render(array( + 'page' => 'about', + 'title' => 'About the Streams', +)); diff --git a/view/feedback.php b/view/feedback.php new file mode 100644 index 0000000..7417f24 --- /dev/null +++ b/view/feedback.php @@ -0,0 +1,41 @@ +render(array( + 'page' => 'feedback', + 'title' => 'Give Feedback', + 'room' => null, + )); +} +else +{ + $db = new PDO(get('FEEDBACK.DSN')); + $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); + + $stm = $db->prepare(' + INSERT INTO feedback (reported, datetime, net, os, player, stream, ipproto_v4, ipproto_v6, provider, issues, issuetext) + VALUES (:reported, :datetime, :net, :os, :player, :stream, :ipproto_v4, :ipproto_v6, :provider, :issues, :issuetext) + '); + + $stm->execute(array( + 'reported' => time(), + 'datetime' => strtotime($_POST['datetime']), + 'net' => $_POST['net'], + 'os' => $_POST['os'], + 'player' => $_POST['player'], + 'stream' => $_POST['stream'], + 'ipproto_v4' => isset($_POST['ipproto']) && is_array($_POST['ipproto']) && in_array('v4', $_POST['ipproto']), + 'ipproto_v6' => isset($_POST['ipproto']) && is_array($_POST['ipproto']) && in_array('v6', $_POST['ipproto']), + 'provider' => $_POST['provider'], + 'issues' => isset($_POST['issues']) && is_array($_POST['issues']) ? implode(',', $_POST['issues']) : '', + 'issuetext' => $_POST['issuetext'], + )); +} diff --git a/view/overview.php b/view/overview.php new file mode 100644 index 0000000..6305940 --- /dev/null +++ b/view/overview.php @@ -0,0 +1,6 @@ +render(array( + 'page' => 'overview', + 'title' => 'Live-Streams', +)); diff --git a/view/party.php b/view/party.php new file mode 100644 index 0000000..322cea6 --- /dev/null +++ b/view/party.php @@ -0,0 +1,13 @@ +render(array( + 'page' => 'party', + + 'title' => $GLOBALS['CONFIG']['ROOMS'][$room], + + 'rooms' => $GLOBALS['CONFIG']['ROOMS'], + + 'room' => $room, + 'roomname' => $GLOBALS['CONFIG']['ROOMS'][$room], +)); diff --git a/view/program-json.php b/view/program-json.php new file mode 100644 index 0000000..4cce716 --- /dev/null +++ b/view/program-json.php @@ -0,0 +1,4 @@ +render(array( + 'page' => 'relive-player', + 'title' => 'Relive!', + 'talk' => $talk, + + 'width' => 1024, + 'height' => 576, +)); diff --git a/view/relive.php b/view/relive.php new file mode 100644 index 0000000..0608423 --- /dev/null +++ b/view/relive.php @@ -0,0 +1,7 @@ +render(array( + 'page' => 'relive', + 'title' => 'Relive!', + 'talks' => relive_talks(), +)); diff --git a/view/room.php b/view/room.php new file mode 100644 index 0000000..4484a14 --- /dev/null +++ b/view/room.php @@ -0,0 +1,121 @@ +render(array( + 'page' => 'room', + + 'title' => get("ROOMS.$room.DISPLAY").' – '.$title, + 'room' => $room, + + 'program' => program(), + + 'tab' => $tab, + 'tabs' => $tabs, + + 'width' => @$width, + 'height' => @$height, + 'language' => $language, + 'translated' => ($language == 'translated'), + 'selection' => $selection, + 'hlsformat' => ($selection == 'hd' ? 'auto' : $selection), + + 'has_translation' => $has_translation, + 'formats' => $formats, + 'protos' => $protos, + 'videores' => $videores, +)); -- cgit v1.2.3