예제 #1
0
파일: blocks.php 프로젝트: jinzora/jinzora3
 /**
  * Displays the Playlist block
  *
  * @author Ben Dodson, Ross Carlson
  * @since 2.28.06
  * @version 2.28.06
  *
  **/
 function blockPlaylists()
 {
     global $jzUSER, $hierarchy, $skin, $root_dir, $secure_urls;
     if (!$jzUSER->getSetting('stream')) {
         return;
     }
     // Let's startup our Objects
     $smarty = smartySetup();
     $display = new jzDisplay();
     $arr = array();
     $arr['jz_path'] = $_GET['jz_path'];
     $smarty->assign('playlist_form_link', urlize($arr));
     $smarty->assign('cur_path', $_GET['jz_path']);
     $smarty->assign('skin', $skin);
     $smarty->assign('word_playlists', word("Playlists"));
     $lvls = @implode("|", $hierarchy);
     $smarty->assign('selected_playlist', $_SESSION['jz_playlist']);
     $smarty->assign('root_dir', $root_dir);
     $url_array = array();
     $url_array['action'] = "popup";
     $url_array['ptype'] = "playlistedit";
     $smarty->assign('playlist_edit_link', urlize($url_array));
     $secure = false;
     if ($secure_urls == "true") {
         $secure = true;
     }
     $smarty->assign('playlist_hidden_action', $display->hiddenVariableField('action', 'playlistAction', $secure, true));
     $smarty->assign('playlist_hidden_path', $display->hiddenVariableField('path', $_GET['jz_path'], $secure, true));
     $smarty->assign('playlist_play_button', $display->playListButton(true));
     $smarty->assign('playlist_play_random_button', $display->randomListButton(true));
     if ($jzUSER->getSetting('download')) {
         $smarty->assign('playlist_download_button', $display->downloadListButton(true));
     } else {
         $smarty->assign('playlist_download_button', "");
     }
     $smarty->assign('playlist_create_button', $display->createListButton(true));
     $smarty->assign('playlist_manager_button', $display->popupLink('plmanager', false, true));
     $lists = $jzUSER->listPlaylists("all");
     $i = 0;
     foreach ($lists as $id => $pname) {
         $lArr[$i]['value'] = $id;
         $lArr[$i]['name'] = $pname;
         if ($_SESSION['jz_playlist'] == $id) {
             $lArr[$i]['selected'] = "selected";
         } else {
             $lArr[$i]['selected'] = "";
         }
         $i++;
     }
     $smarty->assign('playlists', $lArr);
     $smarty->display(SMARTY_ROOT . 'templates/slick/block-playlists.tpl');
 }