CC-84: Smart Playlists

- audio preview on playlist
- cleaning up some code
This commit is contained in:
James 2012-08-02 16:36:12 -04:00
parent 3b5a3e6713
commit 0d2d8218bf
14 changed files with 202 additions and 72 deletions

View file

@ -81,6 +81,53 @@ class AudiopreviewController extends Zend_Controller_Action
$this->_helper->viewRenderer->setRender('audio-preview');
}
public function blockPreviewAction()
{
global $CC_CONFIG;
$blockIndex = $this->_getParam('blockIndex');
$blockId = $this->_getParam('blockId');
$request = $this->getRequest();
$baseUrl = $request->getBaseUrl();
$baseDir = dirname($_SERVER['SCRIPT_FILENAME']);
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/audiopreview/preview_jplayer.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'/js/jplayer/jplayer.playlist.min.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headLink()->appendStylesheet($baseUrl.'/js/jplayer/skin/jplayer.airtime.audio.preview.css?'.$CC_CONFIG['airtime_version']);
$this->_helper->layout->setLayout('audioPlayer');
$logo = Application_Model_Preference::GetStationLogo();
if ($logo) {
$this->view->logo = "data:image/png;base64,$logo";
} else {
$this->view->logo = "$baseUrl/css/images/airtime_logo_jp.png";
}
$this->view->blockIndex= $blockIndex;
$this->view->blockId = $blockId;
$this->_helper->viewRenderer->setRender('audio-preview');
}
public function getBlockAction()
{
// disable the view and the layout
$this->view->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender(true);
$blockId = $this->_getParam('blockId');
if (!isset($blockId)) {
return;
}
$bl = new Application_Model_Block($blockId);
$result = array();
foreach ($bl->getContents(true) as $ele) {
$result[] = $this->createElementMap($ele);
}
$this->_helper->json($result);
}
/**
*Function will load and return the contents of the requested playlist.
*/