/** * Render a list page * * @param string $page_title * The page title (displayed in the top bar) * * @param array|null $album_stats * The album stats, if this is a list of songs from an album * * @param array $list_items * The list of items to display * * @return string * The HTML of the rendered page */ public static function render($page_title, $previous, $shuffle, $allsongs, $list) { // instantiate the template engine $parser = new Rain\Tpl(); // assign the values to the template parser $parser->assign(array('page_title' => $page_title, 'list' => $list, 'previous' => $previous, 'shuffle' => $shuffle, 'all_songs' => $allsongs, 'now_playing' => Music::isPlayingOrPaused(), 'album_stats' => $album_stats, 'include_all_songs' => $include_all_songs, 'base_uri' => static::$base_uri, 'object_type' => $type)); // return the HTML return $parser->draw("list-page", true); }
/** * Render a list page * * @param Song $song * The song that is currently playing * * @return string * The HTML of the rendered page */ public static function render($song, $previous) { // instantiate the template engine $parser = new Rain\Tpl(); // get the image data for the song $image_data = Song::getImageData($song['Artist'], $song['Album'], 320); // assign the values to the template parser $parser->assign(array('image' => $image_data, 'song' => $song, 'volume' => Music::getVolume(), 'previous' => $previous)); // return the HTML return $parser->draw("now-playing-page", true); }
<?php require_once "config.php"; require_once "Rain/tpl.php"; $link = base64_decode($_REQUEST["video"]); $tpl = new Rain\Tpl(); $tpl->configure(array('production' => PRODUCTION)); $tpl->assign("title", $link); $tpl->draw("play"); unset($tpl);
<?php require_once "config.php"; require_once "Rain/tpl.php"; $cat = isset($_REQUEST["cat"]) ? $_REQUEST["cat"] : "Category_1"; $tpl = new Rain\Tpl(); $tpl->configure(array('production' => PRODUCTION)); $tpl->assign("cat", $cat); $tpl->assign("cat_list", $video_cat_list); $tpl->draw("videos/views/view_all"); unset($tpl);