public static function OutputVideoList() { // -------------------------------- // -- Fetch data // -------------------------------- $playlists = $playlistArray = $sections = array(); if (!class_exists("fromdb_youtube", FALSE)) { require_once PATH_CLASSES . "/fromdb/youtube.php"; } //TODO: perhaps merge to one callable method? //TODO: perhaps cache? $playlistArray["event"] = fromdb_youtube::getEventPlaylistArray(); $playlistArray["seminar"] = fromdb_youtube::getSeminarPlaylistArray(); $playlistArray["presentation"] = fromdb_youtube::getPresentationPlaylistArray(); $playlists["other"] = fromdb_youtube::getOtherVideoArray(); $i = 0; foreach ($playlistArray as $key => $pl) { if ($key != "other") { $sections[$key] = array_keys($pl); // used for sectioned list of all known playlists $playlists = array_merge($playlists, $pl); $i += count($pl); } } // -------------------------------- // -- If Error // -------------------------------- if ($i == 0) { return "<p class='red bold'>» ERROR: <em>No videos found</em>." . (isset($GLOBALS["nw_debug"]["fromcache_get"]) ? " [" . $GLOBALS["nw_debug"]["fromcache_get"] . "]" : "") . "</p>\r\n\r\n"; } // -------------------------------- // -- Output data // -------------------------------- functions::gpc_declare_input("ev", "", false); functions::gpc_declare_input("cl", "", false); if (!empty($playlists[$GLOBALS["ev"]])) { if (empty($GLOBALS["cl"])) { // $ev yes, $cl no return video::outputVideoListEvent($playlists[$GLOBALS["ev"]]); } else { // $ev yes, $cl yes return video::outputVideoSingle($playlists[$GLOBALS["ev"]], $GLOBALS["cl"]); } } else { // $ev no, $cl no return video::outputVideoListAll($playlists, $sections); } }