Format code using php-cs-fixer
This commit is contained in:
parent
43d7dc92cd
commit
d52c6184b9
352 changed files with 17473 additions and 17041 deletions
File diff suppressed because it is too large
Load diff
|
@ -6,11 +6,12 @@ class AudiopreviewController extends Zend_Controller_Action
|
|||
{
|
||||
$ajaxContext = $this->_helper->getHelper('AjaxContext');
|
||||
$ajaxContext->addActionContext('show-preview', 'json')
|
||||
->addActionContext('audio-preview', 'json')
|
||||
->addActionContext('get-show', 'json')
|
||||
->addActionContext('playlist-preview', 'json')
|
||||
->addActionContext('get-playlist', 'json')
|
||||
->initContext();
|
||||
->addActionContext('audio-preview', 'json')
|
||||
->addActionContext('get-show', 'json')
|
||||
->addActionContext('playlist-preview', 'json')
|
||||
->addActionContext('get-playlist', 'json')
|
||||
->initContext()
|
||||
;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -21,50 +22,51 @@ class AudiopreviewController extends Zend_Controller_Action
|
|||
{
|
||||
$CC_CONFIG = Config::getConfig();
|
||||
|
||||
$audioFileID = $this->_getParam('audioFileID');
|
||||
$audioFileID = $this->_getParam('audioFileID');
|
||||
$type = $this->_getParam('type');
|
||||
|
||||
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||
|
||||
$this->view->headScript()->appendFile(
|
||||
$baseUrl.'js/airtime/audiopreview/preview_jplayer.js?'.$CC_CONFIG['airtime_version'],
|
||||
'text/javascript');
|
||||
$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');
|
||||
$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']);
|
||||
$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";
|
||||
$this->view->logo = "data:image/png;base64,{$logo}";
|
||||
} else {
|
||||
$this->view->logo = $baseUrl."css/images/airtime_logo_jp.png";
|
||||
$this->view->logo = $baseUrl . 'css/images/airtime_logo_jp.png';
|
||||
}
|
||||
|
||||
if ($type == "audioclip") {
|
||||
if ($type == 'audioclip') {
|
||||
$media = Application_Model_StoredFile::RecallById($audioFileID);
|
||||
$uri = $baseUrl."api/get-media/file/".$audioFileID;
|
||||
$mime = $media->getPropelOrm()->getDbMime();
|
||||
$uri = $baseUrl . 'api/get-media/file/' . $audioFileID;
|
||||
$mime = $media->getPropelOrm()->getDbMime();
|
||||
$this->view->audioFileArtist = htmlspecialchars($media->getPropelOrm()->getDbArtistName());
|
||||
$this->view->audioFileTitle = htmlspecialchars($media->getPropelOrm()->getDbTrackTitle());
|
||||
|
||||
} elseif ($type == "stream") {
|
||||
$this->view->audioFileTitle = htmlspecialchars($media->getPropelOrm()->getDbTrackTitle());
|
||||
} elseif ($type == 'stream') {
|
||||
$webstream = CcWebstreamQuery::create()->findPk($audioFileID);
|
||||
$uri = $webstream->getDbUrl();
|
||||
$mime = $webstream->getDbMime();
|
||||
$this->view->audioFileTitle = htmlspecialchars($webstream->getDbName());
|
||||
|
||||
$uri = $webstream->getDbUrl();
|
||||
$mime = $webstream->getDbMime();
|
||||
$this->view->audioFileTitle = htmlspecialchars($webstream->getDbName());
|
||||
} else {
|
||||
throw new Exception("Unknown type for audio preview!.Type=$type");
|
||||
throw new Exception("Unknown type for audio preview!.Type={$type}");
|
||||
}
|
||||
|
||||
$this->view->uri = $uri;
|
||||
$this->view->mime = $mime;
|
||||
$this->view->audioFileID = $audioFileID;
|
||||
$this->view->uri = $uri;
|
||||
$this->view->mime = $mime;
|
||||
$this->view->audioFileID = $audioFileID;
|
||||
|
||||
$this->view->type = $type;
|
||||
$this->view->type = $type;
|
||||
|
||||
$this->_helper->viewRenderer->setRender('audio-preview');
|
||||
}
|
||||
|
@ -82,18 +84,18 @@ class AudiopreviewController extends Zend_Controller_Action
|
|||
|
||||
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||
|
||||
$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->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";
|
||||
$this->view->logo = "data:image/png;base64,{$logo}";
|
||||
} else {
|
||||
$this->view->logo = $baseUrl."css/images/airtime_logo_jp.png";
|
||||
$this->view->logo = $baseUrl . 'css/images/airtime_logo_jp.png';
|
||||
}
|
||||
$this->view->playlistIndex= $playlistIndex;
|
||||
$this->view->playlistIndex = $playlistIndex;
|
||||
$this->view->playlistID = $playlistID;
|
||||
|
||||
$this->_helper->viewRenderer->setRender('audio-preview');
|
||||
|
@ -108,22 +110,23 @@ class AudiopreviewController extends Zend_Controller_Action
|
|||
|
||||
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||
|
||||
$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->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";
|
||||
$this->view->logo = "data:image/png;base64,{$logo}";
|
||||
} else {
|
||||
$this->view->logo = $baseUrl."css/images/airtime_logo_jp.png";
|
||||
$this->view->logo = $baseUrl . 'css/images/airtime_logo_jp.png';
|
||||
}
|
||||
$this->view->blockIndex= $blockIndex;
|
||||
$this->view->blockIndex = $blockIndex;
|
||||
$this->view->blockId = $blockId;
|
||||
|
||||
$this->_helper->viewRenderer->setRender('audio-preview');
|
||||
}
|
||||
|
||||
public function getBlockAction()
|
||||
{
|
||||
// disable the view and the layout
|
||||
|
@ -137,12 +140,13 @@ class AudiopreviewController extends Zend_Controller_Action
|
|||
}
|
||||
|
||||
$bl = new Application_Model_Block($blockId);
|
||||
$result = array();
|
||||
$result = [];
|
||||
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.
|
||||
*/
|
||||
|
@ -159,7 +163,7 @@ class AudiopreviewController extends Zend_Controller_Action
|
|||
}
|
||||
|
||||
$pl = new Application_Model_Playlist($playlistID);
|
||||
$result = Array();
|
||||
$result = [];
|
||||
|
||||
foreach ($pl->getContents(true) as $ele) {
|
||||
if ($ele['type'] == 2) {
|
||||
|
@ -181,12 +185,12 @@ class AudiopreviewController extends Zend_Controller_Action
|
|||
{
|
||||
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||
|
||||
$elementMap = array( 'element_title' => isset($track['track_title'])?$track['track_title']:"",
|
||||
'element_artist' => isset($track['artist_name'])?$track['artist_name']:"",
|
||||
'element_id' => isset($track['id'])?$track['id']:"",
|
||||
'element_position' => isset($track['position'])?$track['position']:"",
|
||||
'mime' => isset($track['mime'])?$track['mime']:""
|
||||
);
|
||||
$elementMap = ['element_title' => isset($track['track_title']) ? $track['track_title'] : '',
|
||||
'element_artist' => isset($track['artist_name']) ? $track['artist_name'] : '',
|
||||
'element_id' => isset($track['id']) ? $track['id'] : '',
|
||||
'element_position' => isset($track['position']) ? $track['position'] : '',
|
||||
'mime' => isset($track['mime']) ? $track['mime'] : '',
|
||||
];
|
||||
|
||||
/* If the track type is static we know it must be
|
||||
* a track because static blocks can only contain
|
||||
|
@ -199,13 +203,14 @@ class AudiopreviewController extends Zend_Controller_Action
|
|||
|
||||
if ($track['type'] == 0) {
|
||||
$mime = trim(strtolower($track['mime']));
|
||||
|
||||
try {
|
||||
$elementMap['element_' . FileDataHelper::getAudioMimeTypeArray()[$mime]] = $track['item_id'];
|
||||
} catch (Exception $e) {
|
||||
throw new Exception("Unknown file type: $mime");
|
||||
throw new Exception("Unknown file type: {$mime}");
|
||||
}
|
||||
|
||||
$elementMap['uri'] = $baseUrl."api/get-media/file/".$track['item_id'];
|
||||
$elementMap['uri'] = $baseUrl . 'api/get-media/file/' . $track['item_id'];
|
||||
} else {
|
||||
$elementMap['uri'] = $track['path'];
|
||||
}
|
||||
|
@ -226,16 +231,16 @@ class AudiopreviewController extends Zend_Controller_Action
|
|||
|
||||
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||
|
||||
$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->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";
|
||||
$this->view->logo = "data:image/png;base64,{$logo}";
|
||||
} else {
|
||||
$this->view->logo = $baseUrl."css/images/airtime_logo_jp.png";
|
||||
$this->view->logo = $baseUrl . 'css/images/airtime_logo_jp.png';
|
||||
}
|
||||
|
||||
$this->view->showID = $showID;
|
||||
|
@ -261,28 +266,28 @@ class AudiopreviewController extends Zend_Controller_Action
|
|||
}
|
||||
|
||||
$showInstance = new Application_Model_ShowInstance($showID);
|
||||
$result = array();
|
||||
$result = [];
|
||||
$position = 0;
|
||||
foreach ($showInstance->getShowListContent() as $track) {
|
||||
|
||||
$elementMap = array(
|
||||
'element_title' => isset($track['track_title']) ? $track['track_title'] : "",
|
||||
'element_artist' => isset($track['creator']) ? $track['creator'] : "",
|
||||
$elementMap = [
|
||||
'element_title' => isset($track['track_title']) ? $track['track_title'] : '',
|
||||
'element_artist' => isset($track['creator']) ? $track['creator'] : '',
|
||||
'element_position' => $position,
|
||||
'element_id' => ++$position,
|
||||
'mime' => isset($track['mime'])?$track['mime']:""
|
||||
);
|
||||
'mime' => isset($track['mime']) ? $track['mime'] : '',
|
||||
];
|
||||
|
||||
$elementMap['type'] = $track['type'];
|
||||
if ($track['type'] == 0) {
|
||||
$mime = trim(strtolower($track['mime']));
|
||||
|
||||
try {
|
||||
$elementMap['element_' . FileDataHelper::getAudioMimeTypeArray()[$mime]] = $track['item_id'];
|
||||
} catch (Exception $e) {
|
||||
throw new Exception("Unknown file type: $mime");
|
||||
throw new Exception("Unknown file type: {$mime}");
|
||||
}
|
||||
|
||||
$elementMap['uri'] = $baseUrl."api/get-media/file/".$track['item_id'];
|
||||
$elementMap['uri'] = $baseUrl . 'api/get-media/file/' . $track['item_id'];
|
||||
} else {
|
||||
$elementMap['uri'] = $track['filepath'];
|
||||
}
|
||||
|
@ -290,6 +295,5 @@ class AudiopreviewController extends Zend_Controller_Action
|
|||
}
|
||||
|
||||
$this->_helper->json($result);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,13 +2,13 @@
|
|||
|
||||
class DashboardController extends Zend_Controller_Action
|
||||
{
|
||||
|
||||
public function init()
|
||||
{
|
||||
$ajaxContext = $this->_helper->getHelper('AjaxContext');
|
||||
$ajaxContext->addActionContext('switch-source', 'json')
|
||||
->addActionContext('disconnect-source', 'json')
|
||||
->initContext();
|
||||
->addActionContext('disconnect-source', 'json')
|
||||
->initContext()
|
||||
;
|
||||
}
|
||||
|
||||
public function indexAction()
|
||||
|
@ -24,17 +24,17 @@ class DashboardController extends Zend_Controller_Action
|
|||
$user = new Application_Model_User($userInfo->id);
|
||||
|
||||
$show = Application_Model_Show::getCurrentShow();
|
||||
$show_id = isset($show[0]['id'])?$show[0]['id']:0;
|
||||
$show_id = isset($show[0]['id']) ? $show[0]['id'] : 0;
|
||||
$source_connected = Application_Model_Preference::GetSourceStatus($sourcename);
|
||||
|
||||
if ($user->canSchedule($show_id) && $source_connected) {
|
||||
$data = array("sourcename"=>$sourcename);
|
||||
Application_Model_RabbitMq::SendMessageToPypo("disconnect_source", $data);
|
||||
$data = ['sourcename' => $sourcename];
|
||||
Application_Model_RabbitMq::SendMessageToPypo('disconnect_source', $data);
|
||||
} else {
|
||||
if ($source_connected) {
|
||||
$this->view->error = _("You don't have permission to disconnect source.");
|
||||
} else {
|
||||
$this->view->error = _("There is no source connected to this input.");
|
||||
$this->view->error = _('There is no source connected to this input.');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -48,33 +48,36 @@ class DashboardController extends Zend_Controller_Action
|
|||
$user = new Application_Model_User($userInfo->id);
|
||||
|
||||
$show = Application_Model_Show::getCurrentShow();
|
||||
$show_id = isset($show[0]['id'])?$show[0]['id']:0;
|
||||
$show_id = isset($show[0]['id']) ? $show[0]['id'] : 0;
|
||||
|
||||
$source_connected = Application_Model_Preference::GetSourceStatus($sourcename);
|
||||
if ($user->canSchedule($show_id) && ($source_connected || $sourcename == 'scheduled_play' || $current_status == "on")) {
|
||||
if ($user->canSchedule($show_id) && ($source_connected || $sourcename == 'scheduled_play' || $current_status == 'on')) {
|
||||
$change_status_to = 'on';
|
||||
|
||||
$change_status_to = "on";
|
||||
|
||||
if (strtolower($current_status) == "on") {
|
||||
$change_status_to = "off";
|
||||
if (strtolower($current_status) == 'on') {
|
||||
$change_status_to = 'off';
|
||||
}
|
||||
|
||||
$data = array("sourcename"=>$sourcename, "status"=>$change_status_to);
|
||||
Application_Model_RabbitMq::SendMessageToPypo("switch_source", $data);
|
||||
if (strtolower($current_status) == "on") {
|
||||
Application_Model_Preference::SetSourceSwitchStatus($sourcename, "off");
|
||||
$this->view->status = "OFF";
|
||||
$data = ['sourcename' => $sourcename, 'status' => $change_status_to];
|
||||
Application_Model_RabbitMq::SendMessageToPypo('switch_source', $data);
|
||||
if (strtolower($current_status) == 'on') {
|
||||
Application_Model_Preference::SetSourceSwitchStatus($sourcename, 'off');
|
||||
$this->view->status = 'OFF';
|
||||
|
||||
//Log table updates
|
||||
Application_Model_LiveLog::SetEndTime($sourcename == 'scheduled_play'?'S':'L',
|
||||
new DateTime("now", new DateTimeZone('UTC')));
|
||||
Application_Model_LiveLog::SetEndTime(
|
||||
$sourcename == 'scheduled_play' ? 'S' : 'L',
|
||||
new DateTime('now', new DateTimeZone('UTC'))
|
||||
);
|
||||
} else {
|
||||
Application_Model_Preference::SetSourceSwitchStatus($sourcename, "on");
|
||||
$this->view->status = "ON";
|
||||
Application_Model_Preference::SetSourceSwitchStatus($sourcename, 'on');
|
||||
$this->view->status = 'ON';
|
||||
|
||||
//Log table updates
|
||||
Application_Model_LiveLog::SetNewLogTime($sourcename == 'scheduled_play'?'S':'L',
|
||||
new DateTime("now", new DateTimeZone('UTC')));
|
||||
Application_Model_LiveLog::SetNewLogTime(
|
||||
$sourcename == 'scheduled_play' ? 'S' : 'L',
|
||||
new DateTime('now', new DateTimeZone('UTC'))
|
||||
);
|
||||
}
|
||||
} else {
|
||||
if ($source_connected) {
|
||||
|
@ -83,7 +86,7 @@ class DashboardController extends Zend_Controller_Action
|
|||
if ($sourcename == 'scheduled_play') {
|
||||
$this->view->error = _("You don't have permission to disconnect source.");
|
||||
} else {
|
||||
$this->view->error = _("There is no source connected to this input.");
|
||||
$this->view->error = _('There is no source connected to this input.');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -95,11 +98,11 @@ class DashboardController extends Zend_Controller_Action
|
|||
|
||||
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||
|
||||
$this->view->headLink()->appendStylesheet($baseUrl.'js/jplayer/skin/jplayer.blue.monday.css?'.$CC_CONFIG['airtime_version']);
|
||||
$this->view->headLink()->appendStylesheet($baseUrl . 'js/jplayer/skin/jplayer.blue.monday.css?' . $CC_CONFIG['airtime_version']);
|
||||
$this->_helper->layout->setLayout('livestream');
|
||||
|
||||
$logo = Application_Model_Preference::GetStationLogo();
|
||||
$this->view->logo = "data:image/png;base64,".$logo;
|
||||
$this->view->logo = 'data:image/png;base64,' . $logo;
|
||||
}
|
||||
|
||||
public function helpAction()
|
||||
|
@ -124,7 +127,6 @@ class DashboardController extends Zend_Controller_Action
|
|||
|
||||
$headScript = $this->view->headScript();
|
||||
AirtimeTableView::injectTableJavaScriptDependencies($headScript, $baseUrl, $CC_CONFIG['airtime_version']);
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/airtime/widgets/table-example.js?'.$CC_CONFIG['airtime_version']);
|
||||
|
||||
$this->view->headScript()->appendFile($baseUrl . 'js/airtime/widgets/table-example.js?' . $CC_CONFIG['airtime_version']);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,13 +2,15 @@
|
|||
|
||||
class EmbedController extends Zend_Controller_Action
|
||||
{
|
||||
public function init() {
|
||||
public function init()
|
||||
{
|
||||
// translate widgets to station default language
|
||||
$locale = Application_Model_Preference::GetDefaultLocale();
|
||||
if ($locale) {
|
||||
Application_Model_Locale::configureLocalization($locale);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This is the action that is called to insert the player onto a web page.
|
||||
* It passes all the js and css files to the view, as well as all the
|
||||
|
@ -25,45 +27,45 @@ class EmbedController extends Zend_Controller_Action
|
|||
|
||||
$request = $this->getRequest();
|
||||
|
||||
$this->view->playerhtml5_js = "/js/airtime/player/playerhtml5.js?".$CC_CONFIG['airtime_version'];
|
||||
$this->view->jquery = "/js/libs/jquery-1.10.2.min.js";
|
||||
$this->view->metadata_api_url = "/api/live-info";
|
||||
$this->view->playerhtml5_js = '/js/airtime/player/playerhtml5.js?' . $CC_CONFIG['airtime_version'];
|
||||
$this->view->jquery = '/js/libs/jquery-1.10.2.min.js';
|
||||
$this->view->metadata_api_url = '/api/live-info';
|
||||
$this->view->player_title = json_encode($this->view->escape($request->getParam('title')));
|
||||
$this->view->jquery_i18n = "/js/i18n/jquery.i18n.js?";
|
||||
$this->view->jquery_i18n = '/js/i18n/jquery.i18n.js?';
|
||||
|
||||
$styleParam = $request->getParam('style');
|
||||
$player_style = isset($styleParam) ? $styleParam : "basic";
|
||||
if ($player_style == "premium") {
|
||||
$this->view->css = "/css/radio-page/premium_player.css?".$CC_CONFIG['airtime_version'];
|
||||
$player_style = isset($styleParam) ? $styleParam : 'basic';
|
||||
if ($player_style == 'premium') {
|
||||
$this->view->css = '/css/radio-page/premium_player.css?' . $CC_CONFIG['airtime_version'];
|
||||
} else {
|
||||
$this->view->css = "/css/player.css?".$CC_CONFIG['airtime_version'];
|
||||
$this->view->css = '/css/player.css?' . $CC_CONFIG['airtime_version'];
|
||||
}
|
||||
$this->view->player_style = $player_style;
|
||||
|
||||
$stream = $request->getParam('stream');
|
||||
$streamData = Application_Model_StreamSetting::getEnabledStreamData();
|
||||
$availableMobileStreams = array();
|
||||
$availableDesktopStreams = array();
|
||||
$availableMobileStreams = [];
|
||||
$availableDesktopStreams = [];
|
||||
|
||||
if ($stream == "auto") {
|
||||
$this->view->playerMode = "auto";
|
||||
$this->view->streamURL = json_encode("");
|
||||
if ($stream == 'auto') {
|
||||
$this->view->playerMode = 'auto';
|
||||
$this->view->streamURL = json_encode('');
|
||||
foreach ($streamData as $s) {
|
||||
if ($s["mobile"]) {
|
||||
if ($s['mobile']) {
|
||||
array_push($availableMobileStreams, $s);
|
||||
} else if (!$s["mobile"]) {
|
||||
} elseif (!$s['mobile']) {
|
||||
array_push($availableDesktopStreams, $s);
|
||||
}
|
||||
}
|
||||
} else if ($stream == "file") {
|
||||
$this->view->playerMode = "file";
|
||||
$this->view->streamURL = json_encode($request->getParam("file_url"));
|
||||
$this->view->codec = $request->getParam("file_codec");
|
||||
} elseif ($stream == 'file') {
|
||||
$this->view->playerMode = 'file';
|
||||
$this->view->streamURL = json_encode($request->getParam('file_url'));
|
||||
$this->view->codec = $request->getParam('file_codec');
|
||||
} elseif (!empty($stream)) {
|
||||
$this->view->playerMode = "manual";
|
||||
$this->view->playerMode = 'manual';
|
||||
$selectedStreamData = $streamData[$stream];
|
||||
$this->view->streamURL = json_encode($selectedStreamData["url"]);
|
||||
$this->view->codec = $selectedStreamData["codec"];
|
||||
$this->view->streamURL = json_encode($selectedStreamData['url']);
|
||||
$this->view->codec = $selectedStreamData['codec'];
|
||||
}
|
||||
$this->view->availableMobileStreams = json_encode($availableMobileStreams);
|
||||
$this->view->availableDesktopStreams = json_encode($availableDesktopStreams);
|
||||
|
@ -77,23 +79,23 @@ class EmbedController extends Zend_Controller_Action
|
|||
|
||||
$request = $this->getRequest();
|
||||
|
||||
$this->view->angular = Application_Common_HTTPHelper::getStationUrl() . 'js/libs/angular.min.js?'.$CC_CONFIG['airtime_version'];
|
||||
$this->view->angular = Application_Common_HTTPHelper::getStationUrl() . 'js/libs/angular.min.js?' . $CC_CONFIG['airtime_version'];
|
||||
$widgetStyle = $request->getParam('style');
|
||||
if ($widgetStyle == "premium") {
|
||||
$this->view->widgetStyle = "premium";
|
||||
$this->view->css = "/css/embed/weekly-schedule-widget.css?" . $CC_CONFIG['airtime_version'];
|
||||
if ($widgetStyle == 'premium') {
|
||||
$this->view->widgetStyle = 'premium';
|
||||
$this->view->css = '/css/embed/weekly-schedule-widget.css?' . $CC_CONFIG['airtime_version'];
|
||||
} else {
|
||||
$this->view->widgetStyle = "basic";
|
||||
$this->view->css = "/css/embed/weekly-schedule-widget-basic.css?" . $CC_CONFIG['airtime_version'];
|
||||
$this->view->widgetStyle = 'basic';
|
||||
$this->view->css = '/css/embed/weekly-schedule-widget-basic.css?' . $CC_CONFIG['airtime_version'];
|
||||
}
|
||||
$this->view->jquery = "/js/libs/jquery-1.8.3.min.js?".$CC_CONFIG['airtime_version'];
|
||||
$this->view->jquery = '/js/libs/jquery-1.8.3.min.js?' . $CC_CONFIG['airtime_version'];
|
||||
|
||||
$weeklyScheduleData = WidgetHelper::getWeekInfoV2();
|
||||
|
||||
$this->view->schedule_data = json_encode($weeklyScheduleData);
|
||||
|
||||
$currentDay = new DateTime("now", new DateTimeZone(Application_Model_Preference::GetTimezone()));
|
||||
$currentDay = new DateTime('now', new DateTimeZone(Application_Model_Preference::GetTimezone()));
|
||||
//day of the month without leading zeros (1 to 31)
|
||||
$this->view->currentDayOfMonth = $currentDay->format("j");
|
||||
$this->view->currentDayOfMonth = $currentDay->format('j');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,10 +2,8 @@
|
|||
|
||||
class EmbeddableWidgetsController extends Zend_Controller_Action
|
||||
{
|
||||
|
||||
public function init()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function playerAction()
|
||||
|
@ -14,8 +12,8 @@ class EmbeddableWidgetsController extends Zend_Controller_Action
|
|||
|
||||
$CC_CONFIG = Config::getConfig();
|
||||
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||
$this->view->headLink()->appendStylesheet($baseUrl.'css/player-form.css?'.$CC_CONFIG['airtime_version']);
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/airtime/player/player.js?'.$CC_CONFIG['airtime_version']);
|
||||
$this->view->headLink()->appendStylesheet($baseUrl . 'css/player-form.css?' . $CC_CONFIG['airtime_version']);
|
||||
$this->view->headScript()->appendFile($baseUrl . 'js/airtime/player/player.js?' . $CC_CONFIG['airtime_version']);
|
||||
|
||||
$form = new Application_Form_Player();
|
||||
|
||||
|
@ -25,9 +23,9 @@ class EmbeddableWidgetsController extends Zend_Controller_Action
|
|||
if ($numEnabledStreams > 0 && $apiEnabled) {
|
||||
$this->view->player_form = $form;
|
||||
} else {
|
||||
$this->view->player_error_msg = _("To configure and use the embeddable player you must:<br><br>
|
||||
$this->view->player_error_msg = _('To configure and use the embeddable player you must:<br><br>
|
||||
1. Enable at least one MP3, AAC, or OGG stream under Settings -> Streams<br>
|
||||
2. Enable the Public LibreTime API under Settings -> Preferences");
|
||||
2. Enable the Public LibreTime API under Settings -> Preferences');
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -38,8 +36,8 @@ class EmbeddableWidgetsController extends Zend_Controller_Action
|
|||
$apiEnabled = Application_Model_Preference::GetAllow3rdPartyApi();
|
||||
|
||||
if (!$apiEnabled) {
|
||||
$this->view->weekly_schedule_error_msg = _("To use the embeddable weekly schedule widget you must:<br><br>
|
||||
Enable the Public LibreTime API under Settings -> Preferences");
|
||||
$this->view->weekly_schedule_error_msg = _('To use the embeddable weekly schedule widget you must:<br><br>
|
||||
Enable the Public LibreTime API under Settings -> Preferences');
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -51,15 +49,15 @@ class EmbeddableWidgetsController extends Zend_Controller_Action
|
|||
$apiEnabled = Application_Model_Preference::GetAllow3rdPartyApi();
|
||||
|
||||
if (!$apiEnabled) {
|
||||
$this->view->facebook_error_msg = _("To add the Radio Tab to your Facebook Page, you must first:<br><br>
|
||||
Enable the Public LibreTime API under Settings -> Preferences");
|
||||
$this->view->facebook_error_msg = _('To add the Radio Tab to your Facebook Page, you must first:<br><br>
|
||||
Enable the Public LibreTime API under Settings -> Preferences');
|
||||
}
|
||||
|
||||
$CC_CONFIG = Config::getConfig();
|
||||
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||
|
||||
$facebookAppId = $CC_CONFIG['facebook-app-id'];
|
||||
$this->view->headScript()->appendScript("var FACEBOOK_APP_ID = " . json_encode($facebookAppId) . ";");
|
||||
$this->view->headScript()->appendScript('var FACEBOOK_APP_ID = ' . json_encode($facebookAppId) . ';');
|
||||
$this->view->headScript()->appendFile($baseUrl . 'js/airtime/common/facebook.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
}
|
||||
|
||||
|
@ -78,7 +76,7 @@ class EmbeddableWidgetsController extends Zend_Controller_Action
|
|||
}
|
||||
|
||||
$values = $request->getPost();
|
||||
$facebookPageIds = json_decode($values["pages"]);
|
||||
$facebookPageIds = json_decode($values['pages']);
|
||||
|
||||
$CC_CONFIG = Config::getConfig();
|
||||
$facebookMicroserviceUrl = $CC_CONFIG['facebook-app-url'];
|
||||
|
@ -86,14 +84,15 @@ class EmbeddableWidgetsController extends Zend_Controller_Action
|
|||
|
||||
//Post the page tab ID and station subdomain to the social microservice so that mapping can be saved
|
||||
//in a database.
|
||||
foreach ($facebookPageIds as $facebookPageId)
|
||||
{
|
||||
$postfields = array();
|
||||
$postfields["facebookPageId"] = $facebookPageId;
|
||||
$postfields["stationId"] = $CC_CONFIG['stationId'];
|
||||
foreach ($facebookPageIds as $facebookPageId) {
|
||||
$postfields = [];
|
||||
$postfields['facebookPageId'] = $facebookPageId;
|
||||
$postfields['stationId'] = $CC_CONFIG['stationId'];
|
||||
|
||||
$query_string = "";
|
||||
foreach ($postfields as $k => $v) $query_string .= "$k=".urlencode($v)."&";
|
||||
$query_string = '';
|
||||
foreach ($postfields as $k => $v) {
|
||||
$query_string .= "{$k}=" . urlencode($v) . '&';
|
||||
}
|
||||
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch, CURLOPT_URL, $facebookMicroserviceUrl);
|
||||
|
@ -102,21 +101,18 @@ class EmbeddableWidgetsController extends Zend_Controller_Action
|
|||
curl_setopt($ch, CURLOPT_FAILONERROR, 1);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, $query_string);
|
||||
curl_setopt($ch, CURLOPT_USERPWD, ":$facebookMicroserviceApiKey");
|
||||
curl_setopt($ch, CURLOPT_USERPWD, ":{$facebookMicroserviceApiKey}");
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
|
||||
|
||||
$jsondata = curl_exec($ch);
|
||||
if (curl_error($ch)) {
|
||||
throw new Exception("Failed to reach server in " . __FUNCTION__ . ": "
|
||||
throw new Exception('Failed to reach server in ' . __FUNCTION__ . ': '
|
||||
. curl_errno($ch) . ' - ' . curl_error($ch) . ' - ' . curl_getinfo($ch, CURLINFO_EFFECTIVE_URL));
|
||||
}
|
||||
curl_close($ch);
|
||||
|
||||
}
|
||||
|
||||
//$arr = json_decode($jsondata, true); # Decode JSON String
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<?php
|
||||
class ErrorController extends Zend_Controller_Action {
|
||||
|
||||
class ErrorController extends Zend_Controller_Action
|
||||
{
|
||||
public function init()
|
||||
{
|
||||
//The default layout includes the Dashboard header, which may contain private information.
|
||||
|
@ -18,7 +19,8 @@ class ErrorController extends Zend_Controller_Action {
|
|||
}
|
||||
}
|
||||
|
||||
public function errorAction() {
|
||||
public function errorAction()
|
||||
{
|
||||
$errors = $this->_getParam('error_handler');
|
||||
|
||||
if ($errors) {
|
||||
|
@ -27,21 +29,27 @@ class ErrorController extends Zend_Controller_Action {
|
|||
Logging::error($errors->exception->getTraceAsString());
|
||||
|
||||
switch ($errors->type) {
|
||||
case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ROUTE :
|
||||
case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_CONTROLLER :
|
||||
case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ROUTE:
|
||||
case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_CONTROLLER:
|
||||
$this->error404Action();
|
||||
|
||||
break;
|
||||
case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ACTION :
|
||||
|
||||
case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ACTION:
|
||||
$this->error400Action();
|
||||
|
||||
break;
|
||||
default :
|
||||
|
||||
default:
|
||||
$this->error500Action();
|
||||
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
//$exceptions = $this->_getAllParams();
|
||||
//Logging::error($exceptions);
|
||||
$this->error404Action();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -51,7 +59,7 @@ class ErrorController extends Zend_Controller_Action {
|
|||
$log->crit($this->view->message, $errors->exception);
|
||||
}*/
|
||||
//Logging that actually works: -- Albert
|
||||
Logging::error($this->view->message . ": " . $errors->exception);
|
||||
Logging::error($this->view->message . ': ' . $errors->exception);
|
||||
|
||||
// conditionally display exceptions
|
||||
if ($this->getInvokeArg('displayExceptions') == true) {
|
||||
|
@ -68,50 +76,51 @@ class ErrorController extends Zend_Controller_Action {
|
|||
$this->view->headLink()->appendStylesheet($staticBaseDir . 'css/styles.css?' . $CC_CONFIG['airtime_version']);
|
||||
}
|
||||
|
||||
public function getLog() {
|
||||
public function getLog()
|
||||
{
|
||||
$bootstrap = $this->getInvokeArg('bootstrap');
|
||||
if (!$bootstrap->hasPluginResource('Log')) {
|
||||
return false;
|
||||
}
|
||||
$log = $bootstrap->getResource('Log');
|
||||
|
||||
return $log;
|
||||
return $bootstrap->getResource('Log');
|
||||
}
|
||||
|
||||
/**
|
||||
* 404 error - route or controller
|
||||
* 404 error - route or controller.
|
||||
*/
|
||||
public function error404Action() {
|
||||
public function error404Action()
|
||||
{
|
||||
$this->_helper->viewRenderer('error');
|
||||
$this->getResponse()->setHttpResponseCode(404);
|
||||
$this->view->message = _('Page not found.');
|
||||
}
|
||||
|
||||
/**
|
||||
* 400 error - no such action
|
||||
* 400 error - no such action.
|
||||
*/
|
||||
public function error400Action() {
|
||||
public function error400Action()
|
||||
{
|
||||
$this->_helper->viewRenderer('error-400');
|
||||
$this->getResponse()->setHttpResponseCode(400);
|
||||
$this->view->message = _('The requested action is not supported.');
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 403 error - permission denied
|
||||
* 403 error - permission denied.
|
||||
*/
|
||||
public function error403Action() {
|
||||
|
||||
public function error403Action()
|
||||
{
|
||||
$this->_helper->viewRenderer('error-403');
|
||||
$this->getResponse()->setHttpResponseCode(403);
|
||||
$this->view->message = _('You do not have permission to access this resource.');
|
||||
}
|
||||
|
||||
/**
|
||||
* 500 error - internal server error
|
||||
* 500 error - internal server error.
|
||||
*/
|
||||
public function error500Action() {
|
||||
|
||||
public function error500Action()
|
||||
{
|
||||
$this->_helper->viewRenderer('error-500');
|
||||
|
||||
$this->getResponse()->setHttpResponseCode(500);
|
||||
|
|
|
@ -11,9 +11,10 @@ class FeedsController extends Zend_Controller_Action
|
|||
$response = $this->getResponse();
|
||||
|
||||
if ((Application_Model_Preference::getStationPodcastPrivacy()
|
||||
&& $request->getParam("sharing_token") != Application_Model_Preference::getStationPodcastDownloadKey())
|
||||
&& $request->getParam('sharing_token') != Application_Model_Preference::getStationPodcastDownloadKey())
|
||||
&& !RestAuth::verifyAuth(true, false, $this)) {
|
||||
$response->setHttpResponseCode(401);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -21,23 +22,23 @@ class FeedsController extends Zend_Controller_Action
|
|||
|
||||
$rssData = Application_Service_PodcastService::createStationRssFeed();
|
||||
|
||||
$mimeType = "text/xml";
|
||||
header("Content-Type: $mimeType; charset=UTF-8");
|
||||
$mimeType = 'text/xml';
|
||||
header("Content-Type: {$mimeType}; charset=UTF-8");
|
||||
|
||||
if (isset($_SERVER['HTTP_RANGE'])) {
|
||||
header('HTTP/1.1 206 Partial Content');
|
||||
} else {
|
||||
header('HTTP/1.1 200 OK');
|
||||
}
|
||||
header("Content-Type: $mimeType");
|
||||
header("Content-Transfer-Encoding: binary");
|
||||
header("Content-Type: {$mimeType}");
|
||||
header('Content-Transfer-Encoding: binary');
|
||||
header('Cache-Control: public, must-revalidate, max-age=0');
|
||||
header('Pragma: no-cache');
|
||||
header('Accept-Ranges: bytes');
|
||||
$size = strlen($rssData);
|
||||
|
||||
$begin = 0;
|
||||
$end = $size - 1;
|
||||
$end = $size - 1;
|
||||
|
||||
//ob_start(); //Must start a buffer here for these header() functions
|
||||
|
||||
|
@ -53,10 +54,10 @@ class FeedsController extends Zend_Controller_Action
|
|||
if ($size > 0) {
|
||||
header('Content-Length:' . (($end - $begin) + 1));
|
||||
if (isset($_SERVER['HTTP_RANGE'])) {
|
||||
header("Content-Range: bytes $begin-$end/$size");
|
||||
header("Content-Range: bytes {$begin}-{$end}/{$size}");
|
||||
}
|
||||
}
|
||||
|
||||
echo $rssData;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,10 +2,8 @@
|
|||
|
||||
class IndexController extends Zend_Controller_Action
|
||||
{
|
||||
|
||||
public function init()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function indexAction()
|
||||
|
@ -17,20 +15,20 @@ class IndexController extends Zend_Controller_Action
|
|||
|
||||
$this->view->headScript()->appendFile($baseUrl . 'js/i18n/jquery.i18n.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl . 'locale/general-translation-table?' . $CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
$this->view->headScript()->appendScript("$.i18n.setDictionary(general_dict)");
|
||||
$this->view->headScript()->appendScript("var baseUrl='$baseUrl'");
|
||||
$this->view->headScript()->appendScript('$.i18n.setDictionary(general_dict)');
|
||||
$this->view->headScript()->appendScript("var baseUrl='{$baseUrl}'");
|
||||
|
||||
//jplayer
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/jplayer/jquery.jplayer.min.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->headScript()->appendFile($baseUrl . 'js/jplayer/jquery.jplayer.min.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()->setStylesheet($baseUrl.'css/radio-page/radio-page.css?'.$CC_CONFIG['airtime_version']);
|
||||
$this->view->headLink()->appendStylesheet($baseUrl.'css/embed/weekly-schedule-widget.css?'.$CC_CONFIG['airtime_version']);
|
||||
$this->view->headLink()->appendStylesheet($baseUrl.'css/radio-page/station-podcast.css?'.$CC_CONFIG['airtime_version']);
|
||||
$this->view->headLink()->appendStylesheet($baseUrl.'css/bootstrap.css?'.$CC_CONFIG['airtime_version']);
|
||||
$this->view->headLink()->setStylesheet($baseUrl . 'css/radio-page/radio-page.css?' . $CC_CONFIG['airtime_version']);
|
||||
$this->view->headLink()->appendStylesheet($baseUrl . 'css/embed/weekly-schedule-widget.css?' . $CC_CONFIG['airtime_version']);
|
||||
$this->view->headLink()->appendStylesheet($baseUrl . 'css/radio-page/station-podcast.css?' . $CC_CONFIG['airtime_version']);
|
||||
$this->view->headLink()->appendStylesheet($baseUrl . 'css/bootstrap.css?' . $CC_CONFIG['airtime_version']);
|
||||
|
||||
//jplayer control buttons
|
||||
$this->view->headLink()->appendStylesheet($baseUrl.'css/redmond/jquery-ui-1.8.8.custom.css?'.$CC_CONFIG['airtime_version']);
|
||||
$this->view->headLink()->appendStylesheet($baseUrl . 'css/redmond/jquery-ui-1.8.8.custom.css?' . $CC_CONFIG['airtime_version']);
|
||||
|
||||
$this->_helper->layout->setLayout('radio-page');
|
||||
|
||||
|
@ -51,7 +49,7 @@ class IndexController extends Zend_Controller_Action
|
|||
$this->view->stationUrl = Application_Common_HTTPHelper::getStationUrl();
|
||||
|
||||
$displayRadioPageLoginButtonValue = Application_Model_Preference::getRadioPageDisplayLoginButton();
|
||||
if ($displayRadioPageLoginButtonValue == "") {
|
||||
if ($displayRadioPageLoginButtonValue == '') {
|
||||
$displayRadioPageLoginButtonValue = true;
|
||||
}
|
||||
$this->view->displayLoginButton = $displayRadioPageLoginButtonValue;
|
||||
|
@ -59,21 +57,21 @@ class IndexController extends Zend_Controller_Action
|
|||
//station feed episodes
|
||||
$stationPodcastId = Application_Model_Preference::getStationPodcastId();
|
||||
$podcastEpisodesService = new Application_Service_PodcastEpisodeService();
|
||||
$episodes = $podcastEpisodesService->getPodcastEpisodes($stationPodcastId, 0, 0, PodcastEpisodesPeer::PUBLICATION_DATE, "DESC");
|
||||
$episodes = $podcastEpisodesService->getPodcastEpisodes($stationPodcastId, 0, 0, PodcastEpisodesPeer::PUBLICATION_DATE, 'DESC');
|
||||
foreach ($episodes as $e => $v) {
|
||||
$episodes[$e]["CcFiles"]["track_title"] = htmlspecialchars($v["CcFiles"]["track_title"], ENT_QUOTES);
|
||||
$episodes[$e]["CcFiles"]["artist_name"] = htmlspecialchars($v["CcFiles"]["artist_name"], ENT_QUOTES);
|
||||
$episodes[$e]['CcFiles']['track_title'] = htmlspecialchars($v['CcFiles']['track_title'], ENT_QUOTES);
|
||||
$episodes[$e]['CcFiles']['artist_name'] = htmlspecialchars($v['CcFiles']['artist_name'], ENT_QUOTES);
|
||||
|
||||
$pubDate = explode(" ", $v["publication_date"]);
|
||||
$episodes[$e]["publication_date"] = $pubDate[0];
|
||||
$pubDate = explode(' ', $v['publication_date']);
|
||||
$episodes[$e]['publication_date'] = $pubDate[0];
|
||||
|
||||
$length = explode(".", $v["CcFiles"]["length"]);
|
||||
$episodes[$e]["CcFiles"]["length"] = $length[0];
|
||||
$length = explode('.', $v['CcFiles']['length']);
|
||||
$episodes[$e]['CcFiles']['length'] = $length[0];
|
||||
|
||||
$episodes[$e]["mime"] = FileDataHelper::getAudioMimeTypeArray()[$v["CcFiles"]["mime"]];
|
||||
$episodes[$e]['mime'] = FileDataHelper::getAudioMimeTypeArray()[$v['CcFiles']['mime']];
|
||||
|
||||
if (is_null($v["CcFiles"]["description"])) {
|
||||
$episodes[$e]["CcFiles"]["description"] = "";
|
||||
if (is_null($v['CcFiles']['description'])) {
|
||||
$episodes[$e]['CcFiles']['description'] = '';
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -87,9 +85,8 @@ class IndexController extends Zend_Controller_Action
|
|||
$this->view->stationPodcastRssUrl = $url;
|
||||
|
||||
$stationName = Application_Model_Preference::GetStationName();
|
||||
$this->view->podcastTitle = sprintf(_("%s Podcast"), !empty($stationName) ? $stationName : $CC_CONFIG["stationId"]);
|
||||
$this->view->emptyPodcastMessage = _("No tracks have been published yet.");
|
||||
|
||||
$this->view->podcastTitle = sprintf(_('%s Podcast'), !empty($stationName) ? $stationName : $CC_CONFIG['stationId']);
|
||||
$this->view->emptyPodcastMessage = _('No tracks have been published yet.');
|
||||
}
|
||||
|
||||
public function mainAction()
|
||||
|
@ -101,5 +98,4 @@ class IndexController extends Zend_Controller_Action
|
|||
{
|
||||
$this->getResponse()->setHttpResponseCode(503);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -2,40 +2,40 @@
|
|||
|
||||
class LibraryController extends Zend_Controller_Action
|
||||
{
|
||||
|
||||
public function init()
|
||||
{
|
||||
$ajaxContext = $this->_helper->getHelper('AjaxContext');
|
||||
$ajaxContext->addActionContext('contents-feed', 'json')
|
||||
->addActionContext('delete', 'json')
|
||||
->addActionContext('duplicate', 'json')
|
||||
->addActionContext('duplicate-block', 'json')
|
||||
->addActionContext('delete-group', 'json')
|
||||
->addActionContext('context-menu', 'json')
|
||||
->addActionContext('get-file-metadata', 'html')
|
||||
->addActionContext('set-num-entries', 'json')
|
||||
->addActionContext('edit-file-md', 'json')
|
||||
->addActionContext('publish-dialog', 'html')
|
||||
->initContext();
|
||||
->addActionContext('delete', 'json')
|
||||
->addActionContext('duplicate', 'json')
|
||||
->addActionContext('duplicate-block', 'json')
|
||||
->addActionContext('delete-group', 'json')
|
||||
->addActionContext('context-menu', 'json')
|
||||
->addActionContext('get-file-metadata', 'html')
|
||||
->addActionContext('set-num-entries', 'json')
|
||||
->addActionContext('edit-file-md', 'json')
|
||||
->addActionContext('publish-dialog', 'html')
|
||||
->initContext()
|
||||
;
|
||||
}
|
||||
|
||||
public function indexAction()
|
||||
{
|
||||
$this->_redirect("showbuilder");
|
||||
$this->_redirect('showbuilder');
|
||||
}
|
||||
|
||||
protected function playlistNotFound($p_type)
|
||||
{
|
||||
$this->view->error = sprintf(_("%s not found"), $p_type);
|
||||
$this->view->error = sprintf(_('%s not found'), $p_type);
|
||||
|
||||
Logging::info("$p_type not found");
|
||||
Logging::info("{$p_type} not found");
|
||||
Application_Model_Library::changePlaylist(null, $p_type);
|
||||
$this->createFullResponse(null);
|
||||
}
|
||||
|
||||
protected function playlistUnknownError($e)
|
||||
{
|
||||
$this->view->error = _("Something went wrong.");
|
||||
$this->view->error = _('Something went wrong.');
|
||||
Logging::info($e->getMessage());
|
||||
}
|
||||
|
||||
|
@ -62,9 +62,8 @@ class LibraryController extends Zend_Controller_Action
|
|||
$this->view->id = $obj->getId();
|
||||
if ($isJson) {
|
||||
return $this->view->render($viewPath);
|
||||
} else {
|
||||
$this->view->html = $this->view->render($viewPath);
|
||||
}
|
||||
$this->view->html = $this->view->render($viewPath);
|
||||
} else {
|
||||
$this->view->obj = $obj;
|
||||
$this->view->id = $obj->getId();
|
||||
|
@ -84,24 +83,24 @@ class LibraryController extends Zend_Controller_Action
|
|||
//playlist||timeline
|
||||
$screen = $this->_getParam('screen');
|
||||
|
||||
$menu = array();
|
||||
$menu = [];
|
||||
|
||||
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
|
||||
$user = new Application_Model_User($userInfo->id);
|
||||
|
||||
//Open a jPlayer window and play the audio clip.
|
||||
$menu["play"] = array("name"=> _("Preview"), "icon" => "play", "disabled" => false);
|
||||
$menu['play'] = ['name' => _('Preview'), 'icon' => 'play', 'disabled' => false];
|
||||
|
||||
$isAdminOrPM = $user->isUserType(array(UTYPE_SUPERADMIN, UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER));
|
||||
$isAdminOrPM = $user->isUserType([UTYPE_SUPERADMIN, UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER]);
|
||||
|
||||
$obj_sess = new Zend_Session_Namespace(UI_PLAYLISTCONTROLLER_OBJ_SESSNAME);
|
||||
|
||||
if ($type === "audioclip") {
|
||||
if ($type === 'audioclip') {
|
||||
$file = Application_Model_StoredFile::RecallById($id);
|
||||
|
||||
$menu["play"]["mime"] = $file->getPropelOrm()->getDbMime();
|
||||
$menu['play']['mime'] = $file->getPropelOrm()->getDbMime();
|
||||
|
||||
if (isset($obj_sess->id) && $screen == "playlist") {
|
||||
if (isset($obj_sess->id) && $screen == 'playlist') {
|
||||
// if the user is not admin or pm, check the creator and see if this person owns the playlist or Block
|
||||
if ($obj_sess->type == 'playlist') {
|
||||
$obj = new Application_Model_Playlist($obj_sess->id);
|
||||
|
@ -109,16 +108,16 @@ class LibraryController extends Zend_Controller_Action
|
|||
$obj = new Application_Model_Block($obj_sess->id);
|
||||
}
|
||||
if ($isAdminOrPM || $obj->getCreatorId() == $user->getId()) {
|
||||
if ($obj_sess->type === "playlist") {
|
||||
$menu["pl_add"] = array("name"=> _("Add to Playlist"), "icon" => "add-playlist", "icon" => "copy");
|
||||
} elseif ($obj_sess->type === "block" && $obj->isStatic()) {
|
||||
$menu["pl_add"] = array("name"=> _("Add to Smart Block"), "icon" => "add-playlist", "icon" => "copy");
|
||||
if ($obj_sess->type === 'playlist') {
|
||||
$menu['pl_add'] = ['name' => _('Add to Playlist'), 'icon' => 'add-playlist', 'icon' => 'copy'];
|
||||
} elseif ($obj_sess->type === 'block' && $obj->isStatic()) {
|
||||
$menu['pl_add'] = ['name' => _('Add to Smart Block'), 'icon' => 'add-playlist', 'icon' => 'copy'];
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($isAdminOrPM || $file->getFileOwnerId() == $user->getId()) {
|
||||
$menu["del"] = array("name"=> _("Delete"), "icon" => "delete", "url" => $baseUrl."library/delete");
|
||||
$menu["edit"] = array("name"=> _("Edit..."), "icon" => "edit", "url" => $baseUrl."library/edit-file-md/id/{$id}");
|
||||
$menu['del'] = ['name' => _('Delete'), 'icon' => 'delete', 'url' => $baseUrl . 'library/delete'];
|
||||
$menu['edit'] = ['name' => _('Edit...'), 'icon' => 'edit', 'url' => $baseUrl . "library/edit-file-md/id/{$id}"];
|
||||
// Disable My podcasts
|
||||
// See https://github.com/LibreTime/libretime/issues/1320
|
||||
// $menu["publish"] = array("name"=> _("Publish..."), "url" => $baseUrl."library/publish/id/{$id}");
|
||||
|
@ -128,58 +127,57 @@ class LibraryController extends Zend_Controller_Action
|
|||
// and not the cloud_file id (if applicable) for track download.
|
||||
// Our application logic (StoredFile.php) will determine if the track
|
||||
// is a cloud_file and handle it appropriately.
|
||||
$url = $baseUrl."api/get-media/file/$id/download/true";
|
||||
$menu["download"] = array("name" => _("Download"), "icon" => "download", "url" => $url);
|
||||
|
||||
} elseif ($type === "playlist" || $type === "block") {
|
||||
$url = $baseUrl . "api/get-media/file/{$id}/download/true";
|
||||
$menu['download'] = ['name' => _('Download'), 'icon' => 'download', 'url' => $url];
|
||||
} elseif ($type === 'playlist' || $type === 'block') {
|
||||
if ($type === 'playlist') {
|
||||
$obj = new Application_Model_Playlist($id);
|
||||
$menu["duplicate"] = array("name" => _("Duplicate Playlist"), "icon" => "edit", "url" => $baseUrl."library/duplicate");
|
||||
$menu['duplicate'] = ['name' => _('Duplicate Playlist'), 'icon' => 'edit', 'url' => $baseUrl . 'library/duplicate'];
|
||||
} elseif ($type === 'block') {
|
||||
$obj = new Application_Model_Block($id);
|
||||
$menu["duplicate"] = array("name" => _("Duplicate Smartblock"), "icon" => "edit", "url" => $baseUrl."library/duplicate-block");
|
||||
$menu['duplicate'] = ['name' => _('Duplicate Smartblock'), 'icon' => 'edit', 'url' => $baseUrl . 'library/duplicate-block'];
|
||||
if (!$obj->isStatic()) {
|
||||
unset($menu["play"]);
|
||||
unset($menu['play']);
|
||||
}
|
||||
if (($isAdminOrPM || $obj->getCreatorId() == $user->getId()) && $screen == "playlist") {
|
||||
if ($obj_sess->type === "playlist") {
|
||||
$menu["pl_add"] = array("name"=> _("Add to Playlist"), "icon" => "add-playlist", "icon" => "copy");
|
||||
if (($isAdminOrPM || $obj->getCreatorId() == $user->getId()) && $screen == 'playlist') {
|
||||
if ($obj_sess->type === 'playlist') {
|
||||
$menu['pl_add'] = ['name' => _('Add to Playlist'), 'icon' => 'add-playlist', 'icon' => 'copy'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($obj_sess->id !== $id && $screen == "playlist") {
|
||||
if ($obj_sess->id !== $id && $screen == 'playlist') {
|
||||
if ($isAdminOrPM || $obj->getCreatorId() == $user->getId()) {
|
||||
$menu["edit"] = array("name"=> _("Edit..."), "icon" => "edit");
|
||||
$menu['edit'] = ['name' => _('Edit...'), 'icon' => 'edit'];
|
||||
}
|
||||
}
|
||||
|
||||
if ($isAdminOrPM || $obj->getCreatorId() == $user->getId()) {
|
||||
$menu["del"] = array("name"=> _("Delete"), "icon" => "delete", "url" => $baseUrl."library/delete");
|
||||
$menu['del'] = ['name' => _('Delete'), 'icon' => 'delete', 'url' => $baseUrl . 'library/delete'];
|
||||
}
|
||||
} elseif ($type == "stream") {
|
||||
} elseif ($type == 'stream') {
|
||||
$webstream = CcWebstreamQuery::create()->findPK($id);
|
||||
$obj = new Application_Model_Webstream($webstream);
|
||||
|
||||
$menu["play"]["mime"] = $webstream->getDbMime();
|
||||
$menu['play']['mime'] = $webstream->getDbMime();
|
||||
|
||||
if (isset($obj_sess->id) && $screen == "playlist") {
|
||||
if (isset($obj_sess->id) && $screen == 'playlist') {
|
||||
if ($isAdminOrPM || $obj->getCreatorId() == $user->getId()) {
|
||||
if ($obj_sess->type === "playlist") {
|
||||
$menu["pl_add"] = array("name"=> _("Add to Playlist"), "icon" => "add-playlist", "icon" => "copy");
|
||||
if ($obj_sess->type === 'playlist') {
|
||||
$menu['pl_add'] = ['name' => _('Add to Playlist'), 'icon' => 'add-playlist', 'icon' => 'copy'];
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($isAdminOrPM || $obj->getCreatorId() == $user->getId()) {
|
||||
if ($screen == "playlist") {
|
||||
$menu["edit"] = array("name"=> _("Edit..."), "icon" => "edit", "url" => $baseUrl."library/edit-file-md/id/{$id}");
|
||||
if ($screen == 'playlist') {
|
||||
$menu['edit'] = ['name' => _('Edit...'), 'icon' => 'edit', 'url' => $baseUrl . "library/edit-file-md/id/{$id}"];
|
||||
}
|
||||
$menu["del"] = array("name"=> _("Delete"), "icon" => "delete", "url" => $baseUrl."library/delete");
|
||||
$menu['del'] = ['name' => _('Delete'), 'icon' => 'delete', 'url' => $baseUrl . 'library/delete'];
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($menu)) {
|
||||
$menu["noaction"] = array("name"=>_("No action available"));
|
||||
$menu['noaction'] = ['name' => _('No action available')];
|
||||
}
|
||||
|
||||
$this->view->items = $menu;
|
||||
|
@ -193,24 +191,23 @@ class LibraryController extends Zend_Controller_Action
|
|||
$user = Application_Model_User::getCurrentUser();
|
||||
//$isAdminOrPM = $user->isUserType(array(UTYPE_SUPERADMIN, UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER));
|
||||
|
||||
$files = array();
|
||||
$playlists = array();
|
||||
$blocks = array();
|
||||
$streams = array();
|
||||
$files = [];
|
||||
$playlists = [];
|
||||
$blocks = [];
|
||||
$streams = [];
|
||||
|
||||
$message = null;
|
||||
$noPermissionMsg = _("You don't have permission to delete selected items.");
|
||||
|
||||
foreach ($mediaItems as $media) {
|
||||
|
||||
if ($media["type"] === "audioclip") {
|
||||
$files[] = intval($media["id"]);
|
||||
} elseif ($media["type"] === "playlist") {
|
||||
$playlists[] = intval($media["id"]);
|
||||
} elseif ($media["type"] === "block") {
|
||||
$blocks[] = intval($media["id"]);
|
||||
} elseif ($media["type"] === "stream") {
|
||||
$streams[] = intval($media["id"]);
|
||||
if ($media['type'] === 'audioclip') {
|
||||
$files[] = intval($media['id']);
|
||||
} elseif ($media['type'] === 'playlist') {
|
||||
$playlists[] = intval($media['id']);
|
||||
} elseif ($media['type'] === 'block') {
|
||||
$blocks[] = intval($media['id']);
|
||||
} elseif ($media['type'] === 'stream') {
|
||||
$streams[] = intval($media['id']);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -245,11 +242,11 @@ class LibraryController extends Zend_Controller_Action
|
|||
} catch (FileNoPermissionException $e) {
|
||||
$message = $noPermissionMsg;
|
||||
} catch (DeleteScheduledFileException $e) {
|
||||
$message = _("Could not delete file because it is scheduled in the future.");
|
||||
$message = _('Could not delete file because it is scheduled in the future.');
|
||||
} catch (Exception $e) {
|
||||
//could throw a scheduled in future exception.
|
||||
$message = _("Could not delete file(s).");
|
||||
Logging::info($message.": ".$e->getMessage());
|
||||
$message = _('Could not delete file(s).');
|
||||
Logging::info($message . ': ' . $e->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -260,7 +257,8 @@ class LibraryController extends Zend_Controller_Action
|
|||
}
|
||||
|
||||
// duplicate playlist
|
||||
public function duplicateAction(){
|
||||
public function duplicateAction()
|
||||
{
|
||||
$params = $this->getRequest()->getParams();
|
||||
$id = $params['id'];
|
||||
Logging::info($params);
|
||||
|
@ -272,9 +270,9 @@ class LibraryController extends Zend_Controller_Action
|
|||
foreach ($contents as &$c) {
|
||||
if ($c['type'] == '0') {
|
||||
$c[1] = 'audioclip';
|
||||
} else if ($c['type'] == '2') {
|
||||
} elseif ($c['type'] == '2') {
|
||||
$c[1] = 'block';
|
||||
} else if ($c['type'] == '1') {
|
||||
} elseif ($c['type'] == '1') {
|
||||
$c[1] = 'stream';
|
||||
}
|
||||
$c[0] = $c['item_id'];
|
||||
|
@ -285,16 +283,17 @@ class LibraryController extends Zend_Controller_Action
|
|||
$newPl->setCreator(Application_Model_User::getCurrentUser()->getId());
|
||||
$newPl->setDescription($originalPl->getDescription());
|
||||
|
||||
list($plFadeIn, ) = $originalPl->getFadeInfo(0);
|
||||
list(, $plFadeOut) = $originalPl->getFadeInfo($originalPl->getSize()-1);
|
||||
list($plFadeIn) = $originalPl->getFadeInfo(0);
|
||||
list(, $plFadeOut) = $originalPl->getFadeInfo($originalPl->getSize() - 1);
|
||||
|
||||
$newPl->setfades($plFadeIn, $plFadeOut);
|
||||
$newPl->setName(sprintf(_("Copy of %s"), $originalPl->getName()));
|
||||
$newPl->setName(sprintf(_('Copy of %s'), $originalPl->getName()));
|
||||
}
|
||||
|
||||
// duplicate smartblock
|
||||
public function duplicateBlockAction(){
|
||||
Logging::info("duplicate smartblock functionality not yet implemented");
|
||||
public function duplicateBlockAction()
|
||||
{
|
||||
Logging::info('duplicate smartblock functionality not yet implemented');
|
||||
$params = $this->getRequest()->getParams();
|
||||
$id = $params['id'];
|
||||
Logging::info($params);
|
||||
|
@ -305,8 +304,7 @@ class LibraryController extends Zend_Controller_Action
|
|||
$newBl->setDescription($originalBl->getDescription());
|
||||
if ($originalBl->isStatic()) {
|
||||
$newBl->saveType('static');
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$newBl->saveType('dynamic');
|
||||
}
|
||||
// the issue here is that the format that getCriteria provides is different from the format the saveCriteria
|
||||
|
@ -324,28 +322,27 @@ class LibraryController extends Zend_Controller_Action
|
|||
$row->setDbBlockId($newBl->getId());
|
||||
$row->save();
|
||||
}
|
||||
$newBl->setName(sprintf(_("Copy of %s"), $originalBl->getName()));
|
||||
$newBl->setName(sprintf(_('Copy of %s'), $originalBl->getName()));
|
||||
}
|
||||
|
||||
|
||||
public function contentsFeedAction()
|
||||
{
|
||||
$params = $this->getRequest()->getParams();
|
||||
|
||||
# terrible name for the method below. it does not only search files.
|
||||
// terrible name for the method below. it does not only search files.
|
||||
$r = Application_Model_StoredFile::searchLibraryFiles($params);
|
||||
|
||||
$this->view->sEcho = $r["sEcho"];
|
||||
$this->view->iTotalDisplayRecords = $r["iTotalDisplayRecords"];
|
||||
$this->view->iTotalRecords = $r["iTotalRecords"];
|
||||
$this->view->files = SecurityHelper::htmlescape_recursive($r["aaData"]);
|
||||
$this->view->sEcho = $r['sEcho'];
|
||||
$this->view->iTotalDisplayRecords = $r['iTotalDisplayRecords'];
|
||||
$this->view->iTotalRecords = $r['iTotalRecords'];
|
||||
$this->view->files = SecurityHelper::htmlescape_recursive($r['aaData']);
|
||||
}
|
||||
|
||||
public function editFileMdAction()
|
||||
{
|
||||
$user = Application_Model_User::getCurrentUser();
|
||||
$isAdminOrPM = $user->isUserType(array(UTYPE_SUPERADMIN, UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER));
|
||||
$isAdmin = $user->isUserType(array(UTYPE_SUPERADMIN, UTYPE_ADMIN));
|
||||
$isAdminOrPM = $user->isUserType([UTYPE_SUPERADMIN, UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER]);
|
||||
$isAdmin = $user->isUserType([UTYPE_SUPERADMIN, UTYPE_ADMIN]);
|
||||
|
||||
$request = $this->getRequest();
|
||||
|
||||
|
@ -368,27 +365,26 @@ class LibraryController extends Zend_Controller_Action
|
|||
}
|
||||
|
||||
if ($request->isPost()) {
|
||||
|
||||
$js = $this->_getParam('data');
|
||||
$serialized = array();
|
||||
$serialized = [];
|
||||
//need to convert from serialized jQuery array.
|
||||
foreach ($js as $j) {
|
||||
//on edit, if no artwork is set and audiofile has image, automatically add it
|
||||
if ($j["name"] == "artwork") {
|
||||
if ($j["value"] == null || $j["value"] == ''){
|
||||
$serialized["artwork"] = FileDataHelper::resetArtwork($file_id);
|
||||
if ($j['name'] == 'artwork') {
|
||||
if ($j['value'] == null || $j['value'] == '') {
|
||||
$serialized['artwork'] = FileDataHelper::resetArtwork($file_id);
|
||||
}
|
||||
} elseif ($j["name"] == "set_artwork") {
|
||||
if ($j["value"] != null || $j["value"] != ''){
|
||||
$serialized["artwork"] = FileDataHelper::setArtwork($file_id, $j["value"] );
|
||||
} elseif ($j['name'] == 'set_artwork') {
|
||||
if ($j['value'] != null || $j['value'] != '') {
|
||||
$serialized['artwork'] = FileDataHelper::setArtwork($file_id, $j['value']);
|
||||
}
|
||||
} elseif ($j["name"] == "remove_artwork") {
|
||||
if ($j["value"] == 1){
|
||||
} elseif ($j['name'] == 'remove_artwork') {
|
||||
if ($j['value'] == 1) {
|
||||
$remove_artwork = true;
|
||||
$serialized["artwork"] = FileDataHelper::removeArtwork($file_id);
|
||||
$serialized['artwork'] = FileDataHelper::removeArtwork($file_id);
|
||||
}
|
||||
} else {
|
||||
$serialized[$j["name"]] = $j["value"];
|
||||
$serialized[$j['name']] = $j['value'];
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -418,7 +414,7 @@ class LibraryController extends Zend_Controller_Action
|
|||
$type = $this->_getParam('type');
|
||||
|
||||
try {
|
||||
if ($type == "audioclip") {
|
||||
if ($type == 'audioclip') {
|
||||
$file = Application_Model_StoredFile::RecallById($id);
|
||||
$this->view->type = $type;
|
||||
$md = $file->getMetadata();
|
||||
|
@ -430,35 +426,33 @@ class LibraryController extends Zend_Controller_Action
|
|||
}
|
||||
}
|
||||
|
||||
$formatter = new SamplerateFormatter($md["MDATA_KEY_SAMPLERATE"]);
|
||||
$md["MDATA_KEY_SAMPLERATE"] = $formatter->format();
|
||||
$formatter = new SamplerateFormatter($md['MDATA_KEY_SAMPLERATE']);
|
||||
$md['MDATA_KEY_SAMPLERATE'] = $formatter->format();
|
||||
|
||||
$formatter = new BitrateFormatter($md["MDATA_KEY_BITRATE"]);
|
||||
$md["MDATA_KEY_BITRATE"] = $formatter->format();
|
||||
$formatter = new BitrateFormatter($md['MDATA_KEY_BITRATE']);
|
||||
$md['MDATA_KEY_BITRATE'] = $formatter->format();
|
||||
|
||||
$formatter = new LengthFormatter($md["MDATA_KEY_DURATION"]);
|
||||
$md["MDATA_KEY_DURATION"] = $formatter->format();
|
||||
$formatter = new LengthFormatter($md['MDATA_KEY_DURATION']);
|
||||
$md['MDATA_KEY_DURATION'] = $formatter->format();
|
||||
|
||||
$this->view->md = $md;
|
||||
|
||||
} elseif ($type == "playlist") {
|
||||
|
||||
} elseif ($type == 'playlist') {
|
||||
$file = new Application_Model_Playlist($id);
|
||||
$this->view->type = $type;
|
||||
$md = $file->getAllPLMetaData();
|
||||
|
||||
$formatter = new LengthFormatter($md["dcterms:extent"]);
|
||||
$md["dcterms:extent"] = $formatter->format();
|
||||
$formatter = new LengthFormatter($md['dcterms:extent']);
|
||||
$md['dcterms:extent'] = $formatter->format();
|
||||
|
||||
$this->view->md = $md;
|
||||
$this->view->contents = $file->getContents();
|
||||
} elseif ($type == "block") {
|
||||
} elseif ($type == 'block') {
|
||||
$block = new Application_Model_Block($id);
|
||||
$this->view->type = $type;
|
||||
$md = $block->getAllPLMetaData();
|
||||
|
||||
$formatter = new LengthFormatter($md["dcterms:extent"]);
|
||||
$md["dcterms:extent"] = $formatter->format();
|
||||
$formatter = new LengthFormatter($md['dcterms:extent']);
|
||||
$md['dcterms:extent'] = $formatter->format();
|
||||
|
||||
$this->view->md = $md;
|
||||
if ($block->isStatic()) {
|
||||
|
@ -469,7 +463,7 @@ class LibraryController extends Zend_Controller_Action
|
|||
$this->view->contents = $block->getCriteria();
|
||||
}
|
||||
$this->view->block = $block;
|
||||
} elseif ($type == "stream") {
|
||||
} elseif ($type == 'stream') {
|
||||
$webstream = CcWebstreamQuery::create()->findPK($id);
|
||||
$ws = new Application_Model_Webstream($webstream);
|
||||
|
||||
|
@ -483,7 +477,8 @@ class LibraryController extends Zend_Controller_Action
|
|||
}
|
||||
}
|
||||
|
||||
public function publishDialogAction() {
|
||||
public function publishDialogAction()
|
||||
{
|
||||
$this->_helper->layout->disableLayout();
|
||||
//This just spits out publish-dialog.phtml!
|
||||
}
|
||||
|
|
|
@ -6,10 +6,11 @@ class ListenerstatController extends Zend_Controller_Action
|
|||
{
|
||||
$ajaxContext = $this->_helper->getHelper('AjaxContext');
|
||||
$ajaxContext
|
||||
->addActionContext('get-data', 'json')
|
||||
->initContext();
|
||||
->addActionContext('get-data', 'json')
|
||||
->initContext()
|
||||
;
|
||||
}
|
||||
|
||||
|
||||
public function indexAction()
|
||||
{
|
||||
$CC_CONFIG = Config::getConfig();
|
||||
|
@ -19,14 +20,14 @@ class ListenerstatController extends Zend_Controller_Action
|
|||
|
||||
Zend_Layout::getMvcInstance()->assign('parent_page', 'Analytics');
|
||||
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/flot/jquery.flot.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/flot/jquery.flot.crosshair.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/flot/jquery.flot.resize.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/airtime/listenerstat/listenerstat.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/timepicker/jquery.ui.timepicker.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/airtime/buttons/buttons.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/airtime/utilities/utilities.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headLink()->appendStylesheet($baseUrl.'css/jquery.ui.timepicker.css?'.$CC_CONFIG['airtime_version']);
|
||||
$this->view->headScript()->appendFile($baseUrl . 'js/flot/jquery.flot.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl . 'js/flot/jquery.flot.crosshair.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl . 'js/flot/jquery.flot.resize.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl . 'js/airtime/listenerstat/listenerstat.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl . 'js/timepicker/jquery.ui.timepicker.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl . 'js/airtime/buttons/buttons.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl . 'js/airtime/utilities/utilities.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
$this->view->headLink()->appendStylesheet($baseUrl . 'css/jquery.ui.timepicker.css?' . $CC_CONFIG['airtime_version']);
|
||||
|
||||
list($startsDT, $endsDT) = Application_Common_HTTPHelper::getStartEndFromRequest($request);
|
||||
$userTimezone = new DateTimeZone(Application_Model_Preference::GetUserTimezone());
|
||||
|
@ -34,20 +35,20 @@ class ListenerstatController extends Zend_Controller_Action
|
|||
$endsDT->setTimezone($userTimezone);
|
||||
|
||||
$form = new Application_Form_DateRange();
|
||||
$form->populate(array(
|
||||
'his_date_start' => $startsDT->format("Y-m-d"),
|
||||
'his_time_start' => $startsDT->format("H:i"),
|
||||
'his_date_end' => $endsDT->format("Y-m-d"),
|
||||
'his_time_end' => $endsDT->format("H:i")
|
||||
));
|
||||
$form->populate([
|
||||
'his_date_start' => $startsDT->format('Y-m-d'),
|
||||
'his_time_start' => $startsDT->format('H:i'),
|
||||
'his_date_end' => $endsDT->format('Y-m-d'),
|
||||
'his_time_end' => $endsDT->format('H:i'),
|
||||
]);
|
||||
|
||||
$errorStatus = Application_Model_StreamSetting::GetAllListenerStatErrors();
|
||||
Logging::info($errorStatus);
|
||||
$out = array();
|
||||
$out = [];
|
||||
foreach ($errorStatus as $v) {
|
||||
$key = explode('_listener_stat_error', $v['keyname']);
|
||||
if ($v['value'] != 'OK') {
|
||||
$v['value'] = _("Please make sure admin user/password is correct on Settings->Streams page.");
|
||||
$v['value'] = _('Please make sure admin user/password is correct on Settings->Streams page.');
|
||||
}
|
||||
$out[$key[0]] = $v['value'];
|
||||
}
|
||||
|
@ -55,7 +56,9 @@ class ListenerstatController extends Zend_Controller_Action
|
|||
$this->view->errorStatus = $out;
|
||||
$this->view->date_form = $form;
|
||||
}
|
||||
public function showAction() {
|
||||
|
||||
public function showAction()
|
||||
{
|
||||
$CC_CONFIG = Config::getConfig();
|
||||
|
||||
$request = $this->getRequest();
|
||||
|
@ -63,20 +66,18 @@ class ListenerstatController extends Zend_Controller_Action
|
|||
$headScript = $this->view->headScript();
|
||||
AirtimeTableView::injectTableJavaScriptDependencies($headScript, $baseUrl, $CC_CONFIG['airtime_version']);
|
||||
Zend_Layout::getMvcInstance()->assign('parent_page', 'Analytics');
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/timepicker/jquery.ui.timepicker.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/airtime/buttons/buttons.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/airtime/utilities/utilities.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/airtime/listenerstat/showlistenerstat.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl . 'js/timepicker/jquery.ui.timepicker.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl . 'js/airtime/buttons/buttons.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl . 'js/airtime/utilities/utilities.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl . 'js/airtime/listenerstat/showlistenerstat.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
|
||||
|
||||
|
||||
$this->view->headLink()->appendStylesheet($baseUrl.'css/datatables/css/ColVis.css?'.$CC_CONFIG['airtime_version']);
|
||||
$this->view->headLink()->appendStylesheet($baseUrl.'css/datatables/css/dataTables.colReorder.min.css?'.$CC_CONFIG['airtime_version']);
|
||||
$this->view->headLink()->appendStylesheet($baseUrl.'css/jquery.ui.timepicker.css?'.$CC_CONFIG['airtime_version']);
|
||||
$this->view->headLink()->appendStylesheet($baseUrl.'css/show_analytics.css'.$CC_CONFIG['airtime_version']);
|
||||
$this->view->headLink()->appendStylesheet($baseUrl . 'css/datatables/css/ColVis.css?' . $CC_CONFIG['airtime_version']);
|
||||
$this->view->headLink()->appendStylesheet($baseUrl . 'css/datatables/css/dataTables.colReorder.min.css?' . $CC_CONFIG['airtime_version']);
|
||||
$this->view->headLink()->appendStylesheet($baseUrl . 'css/jquery.ui.timepicker.css?' . $CC_CONFIG['airtime_version']);
|
||||
$this->view->headLink()->appendStylesheet($baseUrl . 'css/show_analytics.css' . $CC_CONFIG['airtime_version']);
|
||||
|
||||
$user = Application_Model_User::getCurrentUser();
|
||||
if ($user->isUserType(array(UTYPE_SUPERADMIN, UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER))) {
|
||||
if ($user->isUserType([UTYPE_SUPERADMIN, UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER])) {
|
||||
$this->view->showAllShows = true;
|
||||
}
|
||||
$data = [];
|
||||
|
@ -88,42 +89,56 @@ class ListenerstatController extends Zend_Controller_Action
|
|||
$userTimezone = new DateTimeZone(Application_Model_Preference::GetUserTimezone());
|
||||
$startsDT->setTimezone($userTimezone);
|
||||
$endsDT->setTimezone($userTimezone);
|
||||
$form->populate(array(
|
||||
'his_date_start' => $startsDT->format("Y-m-d"),
|
||||
'his_time_start' => $startsDT->format("H:i"),
|
||||
'his_date_end' => $endsDT->format("Y-m-d"),
|
||||
'his_time_end' => $endsDT->format("H:i")
|
||||
));
|
||||
$form->populate([
|
||||
'his_date_start' => $startsDT->format('Y-m-d'),
|
||||
'his_time_start' => $startsDT->format('H:i'),
|
||||
'his_date_end' => $endsDT->format('Y-m-d'),
|
||||
'his_time_end' => $endsDT->format('H:i'),
|
||||
]);
|
||||
|
||||
$this->view->date_form = $form;
|
||||
}
|
||||
|
||||
public function getDataAction(){
|
||||
public function getDataAction()
|
||||
{
|
||||
list($startsDT, $endsDT) = Application_Common_HTTPHelper::getStartEndFromRequest($this->getRequest());
|
||||
$data = Application_Model_ListenerStat::getDataPointsWithinRange($startsDT->format(DEFAULT_TIMESTAMP_FORMAT),
|
||||
$endsDT->format(DEFAULT_TIMESTAMP_FORMAT));
|
||||
$data = Application_Model_ListenerStat::getDataPointsWithinRange(
|
||||
$startsDT->format(DEFAULT_TIMESTAMP_FORMAT),
|
||||
$endsDT->format(DEFAULT_TIMESTAMP_FORMAT)
|
||||
);
|
||||
$this->_helper->json->sendJson($data);
|
||||
}
|
||||
|
||||
public function getShowDataAction(){
|
||||
public function getShowDataAction()
|
||||
{
|
||||
list($startsDT, $endsDT) = Application_Common_HTTPHelper::getStartEndFromRequest($this->getRequest());
|
||||
$show_id = $this->getRequest()->getParam("show_id", null);
|
||||
$data = Application_Model_ListenerStat::getShowDataPointsWithinRange($startsDT->format(DEFAULT_TIMESTAMP_FORMAT),
|
||||
$endsDT->format(DEFAULT_TIMESTAMP_FORMAT),$show_id);
|
||||
$show_id = $this->getRequest()->getParam('show_id', null);
|
||||
$data = Application_Model_ListenerStat::getShowDataPointsWithinRange(
|
||||
$startsDT->format(DEFAULT_TIMESTAMP_FORMAT),
|
||||
$endsDT->format(DEFAULT_TIMESTAMP_FORMAT),
|
||||
$show_id
|
||||
);
|
||||
$this->_helper->json->sendJson($data);
|
||||
}
|
||||
public function getAllShowData(){
|
||||
list($startsDT, $endsDT) = Application_Common_HTTPHelper::getStartEndFromRequest($this->getRequest());
|
||||
$data = Application_Model_ListenerStat::getAllShowDataPointsWithinRange($startsDT->format(DEFAULT_TIMESTAMP_FORMAT),
|
||||
$endsDT->format(DEFAULT_TIMESTAMP_FORMAT));
|
||||
return $data;
|
||||
|
||||
public function getAllShowData()
|
||||
{
|
||||
list($startsDT, $endsDT) = Application_Common_HTTPHelper::getStartEndFromRequest($this->getRequest());
|
||||
|
||||
return Application_Model_ListenerStat::getAllShowDataPointsWithinRange(
|
||||
$startsDT->format(DEFAULT_TIMESTAMP_FORMAT),
|
||||
$endsDT->format(DEFAULT_TIMESTAMP_FORMAT)
|
||||
);
|
||||
}
|
||||
|
||||
public function getAllShowDataAction(){
|
||||
public function getAllShowDataAction()
|
||||
{
|
||||
list($startsDT, $endsDT) = Application_Common_HTTPHelper::getStartEndFromRequest($this->getRequest());
|
||||
$show_id = $this->getRequest()->getParam("show_id", null);
|
||||
$data = Application_Model_ListenerStat::getAllShowDataPointsWithinRange($startsDT->format(DEFAULT_TIMESTAMP_FORMAT),
|
||||
$endsDT->format(DEFAULT_TIMESTAMP_FORMAT));
|
||||
$show_id = $this->getRequest()->getParam('show_id', null);
|
||||
$data = Application_Model_ListenerStat::getAllShowDataPointsWithinRange(
|
||||
$startsDT->format(DEFAULT_TIMESTAMP_FORMAT),
|
||||
$endsDT->format(DEFAULT_TIMESTAMP_FORMAT)
|
||||
);
|
||||
$this->_helper->json->sendJson($data);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,499 +6,493 @@ final class LocaleController extends Zend_Controller_Action
|
|||
{
|
||||
$this->view->layout()->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender(true);
|
||||
header("Content-type: text/javascript");
|
||||
header('Content-type: text/javascript');
|
||||
|
||||
$locale = Application_Model_Preference::GetLocale();
|
||||
echo "var datatables_dict =" .
|
||||
file_get_contents(Application_Common_OsPath::join(
|
||||
echo 'var datatables_dict =' .
|
||||
file_get_contents(
|
||||
Application_Common_OsPath::join(
|
||||
//$_SERVER["DOCUMENT_ROOT"],
|
||||
dirname(__FILE__) . "/../../public/", // Fixing this... -- Albert
|
||||
"js/datatables/i18n/",
|
||||
$locale.".txt")
|
||||
dirname(__FILE__) . '/../../public/', // Fixing this... -- Albert
|
||||
'js/datatables/i18n/',
|
||||
$locale . '.txt'
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
public function generalTranslationTableAction()
|
||||
{
|
||||
$translations = array (
|
||||
$translations = [
|
||||
//common/common.js
|
||||
"Audio Player" => _("Audio Player"),
|
||||
"Something went wrong!" => _("Something went wrong!"),
|
||||
'Audio Player' => _('Audio Player'),
|
||||
'Something went wrong!' => _('Something went wrong!'),
|
||||
//dashboard/dashboard.js
|
||||
"Recording:" => _("Recording:"),
|
||||
"Master Stream" => _("Master Stream"),
|
||||
"Live Stream" => _("Live Stream"),
|
||||
"Nothing Scheduled" => _("Nothing Scheduled"),
|
||||
"Current Show:" => _("Current Show:"),
|
||||
"Current" => _("Current"),
|
||||
'Recording:' => _('Recording:'),
|
||||
'Master Stream' => _('Master Stream'),
|
||||
'Live Stream' => _('Live Stream'),
|
||||
'Nothing Scheduled' => _('Nothing Scheduled'),
|
||||
'Current Show:' => _('Current Show:'),
|
||||
'Current' => _('Current'),
|
||||
//dashboard/versiontooltip.js
|
||||
"You are running the latest version" => _("You are running the latest version"),
|
||||
"New version available: " => _("New version available: "),
|
||||
"You have a pre-release version of LibreTime intalled." => _("You have a pre-release version of LibreTime intalled."),
|
||||
"A patch update for your LibreTime installation is available." => _("A patch update for your LibreTime installation is available."),
|
||||
"A feature update for your LibreTime installation is available." => _("A feature update for your LibreTime installation is available."),
|
||||
"A major update for your LibreTime installation is available." => _("A major update for your LibreTime installation is available."),
|
||||
"Multiple major updates for LibreTime installation are available. Please upgrade as soon as possible." => _("Multiple major updates for LibreTime installation are available. Please upgrade as soon as possible."),
|
||||
'You are running the latest version' => _('You are running the latest version'),
|
||||
'New version available: ' => _('New version available: '),
|
||||
'You have a pre-release version of LibreTime intalled.' => _('You have a pre-release version of LibreTime intalled.'),
|
||||
'A patch update for your LibreTime installation is available.' => _('A patch update for your LibreTime installation is available.'),
|
||||
'A feature update for your LibreTime installation is available.' => _('A feature update for your LibreTime installation is available.'),
|
||||
'A major update for your LibreTime installation is available.' => _('A major update for your LibreTime installation is available.'),
|
||||
'Multiple major updates for LibreTime installation are available. Please upgrade as soon as possible.' => _('Multiple major updates for LibreTime installation are available. Please upgrade as soon as possible.'),
|
||||
//library/events/library_playlistbuilder.js
|
||||
"Add to current playlist" => _("Add to current playlist"),
|
||||
"Add to current smart block" => _("Add to current smart block"),
|
||||
"Adding 1 Item" => _("Adding 1 Item"),
|
||||
"Adding %s Items" => _("Adding %s Items"),
|
||||
"You can only add tracks to smart blocks." => _("You can only add tracks to smart blocks."),
|
||||
"You can only add tracks, smart blocks, and webstreams to playlists." => _("You can only add tracks, smart blocks, and webstreams to playlists."),
|
||||
'Add to current playlist' => _('Add to current playlist'),
|
||||
'Add to current smart block' => _('Add to current smart block'),
|
||||
'Adding 1 Item' => _('Adding 1 Item'),
|
||||
'Adding %s Items' => _('Adding %s Items'),
|
||||
'You can only add tracks to smart blocks.' => _('You can only add tracks to smart blocks.'),
|
||||
'You can only add tracks, smart blocks, and webstreams to playlists.' => _('You can only add tracks, smart blocks, and webstreams to playlists.'),
|
||||
//library/events/library_showbuilder.js
|
||||
//already in library/events/library_playlistbuilder.js
|
||||
"Please select a cursor position on timeline." => _("Please select a cursor position on timeline."),
|
||||
'Please select a cursor position on timeline.' => _('Please select a cursor position on timeline.'),
|
||||
"You haven't added any tracks" => _("You haven't added any tracks"),
|
||||
"You haven't added any playlists" => _("You haven't added any playlists"),
|
||||
"You haven't added any podcasts" => _("You haven't added any podcasts"),
|
||||
"You haven't added any smart blocks" => _("You haven't added any smart blocks"),
|
||||
"You haven't added any webstreams" => _("You haven't added any webstreams"),
|
||||
"Learn about tracks" => _("Learn about tracks"),
|
||||
"Learn about playlists" => _("Learn about playlists"),
|
||||
"Learn about podcasts" => _("Learn about podcasts"),
|
||||
"Learn about smart blocks" => _("Learn about smart blocks"),
|
||||
"Learn about webstreams" => _("Learn about webstreams"),
|
||||
'Learn about tracks' => _('Learn about tracks'),
|
||||
'Learn about playlists' => _('Learn about playlists'),
|
||||
'Learn about podcasts' => _('Learn about podcasts'),
|
||||
'Learn about smart blocks' => _('Learn about smart blocks'),
|
||||
'Learn about webstreams' => _('Learn about webstreams'),
|
||||
"Click 'New' to create one." => _("Click 'New' to create one."),
|
||||
//"Adding 1 Item" => _("Adding 1 Item"),
|
||||
//"Adding %s Items" => _("Adding %s Items"),
|
||||
//library/library.js
|
||||
"Add" => _("Add"),
|
||||
"New" => _("New"),
|
||||
"Edit" => _("Edit"),
|
||||
"Add to Schedule" => _("Add to Schedule"),
|
||||
"Add to next show" => _("Add to next show"),
|
||||
"Add to current show" => _("Add to current show"),
|
||||
"Add after selected items" => _("Add after selected items"),
|
||||
"Delete" => _("Delete"),
|
||||
"Publish" => _("Publish"),
|
||||
"Remove" => _("Remove"),
|
||||
"Edit Metadata" => _("Edit Metadata"),
|
||||
"Add to selected show" => _("Add to selected show"),
|
||||
"Select" => _("Select"),
|
||||
"Select this page" => _("Select this page"),
|
||||
"Deselect this page" => _("Deselect this page"),
|
||||
"Deselect all" => _("Deselect all"),
|
||||
"Are you sure you want to delete the selected item(s)?" => _("Are you sure you want to delete the selected item(s)?"),
|
||||
"Scheduled" => _("Scheduled"),
|
||||
"Tracks" => _("Tracks"),
|
||||
"Playlist" => _("Playlist"),
|
||||
"Title" => _("Title"),
|
||||
"Creator" => _("Creator"),
|
||||
"Album" => _("Album"),
|
||||
"Bit Rate" => _("Bit Rate"),
|
||||
"BPM" => _("BPM"),
|
||||
"Composer" => _("Composer"),
|
||||
"Conductor" => _("Conductor"),
|
||||
"Copyright" => _("Copyright"),
|
||||
"Encoded By" => _("Encoded By"),
|
||||
"Genre" => _("Genre"),
|
||||
"ISRC" => _("ISRC"),
|
||||
"Label" => _("Label"),
|
||||
"Language" => _("Language"),
|
||||
"Last Modified" => _("Last Modified"),
|
||||
"Last Played" => _("Last Played"),
|
||||
"Length" => _("Length"),
|
||||
"Mime" => _("Mime"),
|
||||
"Mood" => _("Mood"),
|
||||
"Owner" => _("Owner"),
|
||||
"Replay Gain" => _("Replay Gain"),
|
||||
"Sample Rate" => _("Sample Rate"),
|
||||
"Track Number" => _("Track Number"),
|
||||
"Uploaded" => _("Uploaded"),
|
||||
"Website" => _("Website"),
|
||||
"Year" => _("Year"),
|
||||
"Loading..." => _("Loading..."),
|
||||
"All" => _("All"),
|
||||
"Files" => _("Files"),
|
||||
"Playlists" => _("Playlists"),
|
||||
"Smart Blocks" => _("Smart Blocks"),
|
||||
"Web Streams" => _("Web Streams"),
|
||||
"Unknown type: " => _("Unknown type: "),
|
||||
"Are you sure you want to delete the selected item?" => _("Are you sure you want to delete the selected item?"),
|
||||
"Uploading in progress..." => _("Uploading in progress..."),
|
||||
"Retrieving data from the server..." => _("Retrieving data from the server..."),
|
||||
'Add' => _('Add'),
|
||||
'New' => _('New'),
|
||||
'Edit' => _('Edit'),
|
||||
'Add to Schedule' => _('Add to Schedule'),
|
||||
'Add to next show' => _('Add to next show'),
|
||||
'Add to current show' => _('Add to current show'),
|
||||
'Add after selected items' => _('Add after selected items'),
|
||||
'Delete' => _('Delete'),
|
||||
'Publish' => _('Publish'),
|
||||
'Remove' => _('Remove'),
|
||||
'Edit Metadata' => _('Edit Metadata'),
|
||||
'Add to selected show' => _('Add to selected show'),
|
||||
'Select' => _('Select'),
|
||||
'Select this page' => _('Select this page'),
|
||||
'Deselect this page' => _('Deselect this page'),
|
||||
'Deselect all' => _('Deselect all'),
|
||||
'Are you sure you want to delete the selected item(s)?' => _('Are you sure you want to delete the selected item(s)?'),
|
||||
'Scheduled' => _('Scheduled'),
|
||||
'Tracks' => _('Tracks'),
|
||||
'Playlist' => _('Playlist'),
|
||||
'Title' => _('Title'),
|
||||
'Creator' => _('Creator'),
|
||||
'Album' => _('Album'),
|
||||
'Bit Rate' => _('Bit Rate'),
|
||||
'BPM' => _('BPM'),
|
||||
'Composer' => _('Composer'),
|
||||
'Conductor' => _('Conductor'),
|
||||
'Copyright' => _('Copyright'),
|
||||
'Encoded By' => _('Encoded By'),
|
||||
'Genre' => _('Genre'),
|
||||
'ISRC' => _('ISRC'),
|
||||
'Label' => _('Label'),
|
||||
'Language' => _('Language'),
|
||||
'Last Modified' => _('Last Modified'),
|
||||
'Last Played' => _('Last Played'),
|
||||
'Length' => _('Length'),
|
||||
'Mime' => _('Mime'),
|
||||
'Mood' => _('Mood'),
|
||||
'Owner' => _('Owner'),
|
||||
'Replay Gain' => _('Replay Gain'),
|
||||
'Sample Rate' => _('Sample Rate'),
|
||||
'Track Number' => _('Track Number'),
|
||||
'Uploaded' => _('Uploaded'),
|
||||
'Website' => _('Website'),
|
||||
'Year' => _('Year'),
|
||||
'Loading...' => _('Loading...'),
|
||||
'All' => _('All'),
|
||||
'Files' => _('Files'),
|
||||
'Playlists' => _('Playlists'),
|
||||
'Smart Blocks' => _('Smart Blocks'),
|
||||
'Web Streams' => _('Web Streams'),
|
||||
'Unknown type: ' => _('Unknown type: '),
|
||||
'Are you sure you want to delete the selected item?' => _('Are you sure you want to delete the selected item?'),
|
||||
'Uploading in progress...' => _('Uploading in progress...'),
|
||||
'Retrieving data from the server...' => _('Retrieving data from the server...'),
|
||||
//library/podcast.js
|
||||
"Import" => _("Import"),
|
||||
"Imported?" => _("Imported?"),
|
||||
"View" => _("View"),
|
||||
"Error code: " => _("Error code: "),
|
||||
"Error msg: " => _("Error msg: "),
|
||||
"Input must be a positive number" => _("Input must be a positive number"),
|
||||
"Input must be a number" => _("Input must be a number"),
|
||||
"Input must be in the format: yyyy-mm-dd" => _("Input must be in the format: yyyy-mm-dd"),
|
||||
"Input must be in the format: hh:mm:ss.t" => _("Input must be in the format: hh:mm:ss.t"),
|
||||
"My Podcast" => _("My Podcast"),
|
||||
'Import' => _('Import'),
|
||||
'Imported?' => _('Imported?'),
|
||||
'View' => _('View'),
|
||||
'Error code: ' => _('Error code: '),
|
||||
'Error msg: ' => _('Error msg: '),
|
||||
'Input must be a positive number' => _('Input must be a positive number'),
|
||||
'Input must be a number' => _('Input must be a number'),
|
||||
'Input must be in the format: yyyy-mm-dd' => _('Input must be in the format: yyyy-mm-dd'),
|
||||
'Input must be in the format: hh:mm:ss.t' => _('Input must be in the format: hh:mm:ss.t'),
|
||||
'My Podcast' => _('My Podcast'),
|
||||
//library/plupload.js
|
||||
"You are currently uploading files. %sGoing to another screen will cancel the upload process. %sAre you sure you want to leave the page?"
|
||||
=> _("You are currently uploading files. %sGoing to another screen will cancel the upload process. %sAre you sure you want to leave the page?"),
|
||||
'You are currently uploading files. %sGoing to another screen will cancel the upload process. %sAre you sure you want to leave the page?' => _('You are currently uploading files. %sGoing to another screen will cancel the upload process. %sAre you sure you want to leave the page?'),
|
||||
//library/spl.js
|
||||
"Open Media Builder" => _("Open Media Builder"),
|
||||
'Open Media Builder' => _('Open Media Builder'),
|
||||
"please put in a time '00:00:00 (.0)'" => _("please put in a time '00:00:00 (.0)'"),
|
||||
"Please enter a valid time in seconds. Eg. 0.5'" => _("Please enter a valid time in seconds. Eg. 0.5"),
|
||||
"Your browser does not support playing this file type: " => _("Your browser does not support playing this file type: "),
|
||||
"Dynamic block is not previewable" => _("Dynamic block is not previewable"),
|
||||
"Limit to: " => _("Limit to: "),
|
||||
"Playlist saved" => _("Playlist saved"),
|
||||
"Playlist shuffled" => _("Playlist shuffled"),
|
||||
"Airtime is unsure about the status of this file. This can happen when the file is on a remote drive that is unaccessible or the file is in a directory that isn't 'watched' anymore."
|
||||
=> _("Airtime is unsure about the status of this file. This can happen when the file is on a remote drive that is unaccessible or the file is in a directory that isn't 'watched' anymore."),
|
||||
"Please enter a valid time in seconds. Eg. 0.5'" => _('Please enter a valid time in seconds. Eg. 0.5'),
|
||||
'Your browser does not support playing this file type: ' => _('Your browser does not support playing this file type: '),
|
||||
'Dynamic block is not previewable' => _('Dynamic block is not previewable'),
|
||||
'Limit to: ' => _('Limit to: '),
|
||||
'Playlist saved' => _('Playlist saved'),
|
||||
'Playlist shuffled' => _('Playlist shuffled'),
|
||||
"Airtime is unsure about the status of this file. This can happen when the file is on a remote drive that is unaccessible or the file is in a directory that isn't 'watched' anymore." => _("Airtime is unsure about the status of this file. This can happen when the file is on a remote drive that is unaccessible or the file is in a directory that isn't 'watched' anymore."),
|
||||
//listenerstat/listenerstat.js
|
||||
"Listener Count on %s: %s" => _("Listener Count on %s: %s"),
|
||||
'Listener Count on %s: %s' => _('Listener Count on %s: %s'),
|
||||
//nowplaying/register.js
|
||||
"Remind me in 1 week" => _("Remind me in 1 week"),
|
||||
"Remind me never" => _("Remind me never"),
|
||||
"Yes, help Airtime" => _("Yes, help Airtime"),
|
||||
"Image must be one of jpg, jpeg, png, or gif" => _("Image must be one of jpg, jpeg, png, or gif"),
|
||||
'Remind me in 1 week' => _('Remind me in 1 week'),
|
||||
'Remind me never' => _('Remind me never'),
|
||||
'Yes, help Airtime' => _('Yes, help Airtime'),
|
||||
'Image must be one of jpg, jpeg, png, or gif' => _('Image must be one of jpg, jpeg, png, or gif'),
|
||||
//playlist/smart_blockbuilder.js
|
||||
"A static smart block will save the criteria and generate the block content immediately. This allows you to edit and view it in the Library before adding it to a show."
|
||||
=> _("A static smart block will save the criteria and generate the block content immediately. This allows you to edit and view it in the Library before adding it to a show."),
|
||||
"A dynamic smart block will only save the criteria. The block content will get generated upon adding it to a show. You will not be able to view and edit the content in the Library."
|
||||
=> _("A dynamic smart block will only save the criteria. The block content will get generated upon adding it to a show. You will not be able to view and edit the content in the Library."),
|
||||
"The desired block length will not be reached if %s cannot find enough unique tracks to match your criteria. Enable this option if you wish to allow tracks to be added multiple times to the smart block."
|
||||
=> _("The desired block length will not be reached if %s cannot find enough unique tracks to match your criteria. Enable this option if you wish to allow tracks to be added multiple times to the smart block."),
|
||||
"Smart block shuffled" => _("Smart block shuffled"),
|
||||
"Smart block generated and criteria saved" => _("Smart block generated and criteria saved"),
|
||||
"Smart block saved" => _("Smart block saved"),
|
||||
"Processing..." => _("Processing..."),
|
||||
"Select modifier" => _("Select modifier"),
|
||||
"contains" => _("contains"),
|
||||
"does not contain" => _("does not contain"),
|
||||
"is" => _("is"),
|
||||
"is not" => _("is not"),
|
||||
"starts with" => _("starts with"),
|
||||
"ends with" => _("ends with"),
|
||||
"is greater than" => _("is greater than"),
|
||||
"is less than" => _("is less than"),
|
||||
"is in the range" => _("is in the range"),
|
||||
"Preview" => _("Preview"),
|
||||
"Generate" => _("Generate"),
|
||||
//preferences/musicdirs.js
|
||||
"Choose Storage Folder" => _("Choose Storage Folder"),
|
||||
"Choose Folder to Watch" => _("Choose Folder to Watch"),
|
||||
"Are you sure you want to change the storage folder?\nThis will remove the files from your Airtime library!"
|
||||
=> _("Are you sure you want to change the storage folder?\nThis will remove the files from your Airtime library!"),
|
||||
"Manage Media Folders" => _("Manage Media Folders"),
|
||||
"Are you sure you want to remove the watched folder?" => _("Are you sure you want to remove the watched folder?"),
|
||||
"This path is currently not accessible." => _("This path is currently not accessible."),
|
||||
'A static smart block will save the criteria and generate the block content immediately. This allows you to edit and view it in the Library before adding it to a show.' => _('A static smart block will save the criteria and generate the block content immediately. This allows you to edit and view it in the Library before adding it to a show.'),
|
||||
'A dynamic smart block will only save the criteria. The block content will get generated upon adding it to a show. You will not be able to view and edit the content in the Library.' => _('A dynamic smart block will only save the criteria. The block content will get generated upon adding it to a show. You will not be able to view and edit the content in the Library.'),
|
||||
'The desired block length will not be reached if %s cannot find enough unique tracks to match your criteria. Enable this option if you wish to allow tracks to be added multiple times to the smart block.' => _('The desired block length will not be reached if %s cannot find enough unique tracks to match your criteria. Enable this option if you wish to allow tracks to be added multiple times to the smart block.'),
|
||||
'Smart block shuffled' => _('Smart block shuffled'),
|
||||
'Smart block generated and criteria saved' => _('Smart block generated and criteria saved'),
|
||||
'Smart block saved' => _('Smart block saved'),
|
||||
'Processing...' => _('Processing...'),
|
||||
'Select modifier' => _('Select modifier'),
|
||||
'contains' => _('contains'),
|
||||
'does not contain' => _('does not contain'),
|
||||
'is' => _('is'),
|
||||
'is not' => _('is not'),
|
||||
'starts with' => _('starts with'),
|
||||
'ends with' => _('ends with'),
|
||||
'is greater than' => _('is greater than'),
|
||||
'is less than' => _('is less than'),
|
||||
'is in the range' => _('is in the range'),
|
||||
'Preview' => _('Preview'),
|
||||
'Generate' => _('Generate'),
|
||||
//preferences/musicdirs.js
|
||||
'Choose Storage Folder' => _('Choose Storage Folder'),
|
||||
'Choose Folder to Watch' => _('Choose Folder to Watch'),
|
||||
"Are you sure you want to change the storage folder?\nThis will remove the files from your Airtime library!" => _("Are you sure you want to change the storage folder?\nThis will remove the files from your Airtime library!"),
|
||||
'Manage Media Folders' => _('Manage Media Folders'),
|
||||
'Are you sure you want to remove the watched folder?' => _('Are you sure you want to remove the watched folder?'),
|
||||
'This path is currently not accessible.' => _('This path is currently not accessible.'),
|
||||
//preferences/streamsetting.js
|
||||
"Some stream types require extra configuration. Details about enabling %sAAC+ Support%s or %sOpus Support%s are provided." => _("Some stream types require extra configuration. Details about enabling %sAAC+ Support%s or %sOpus Support%s are provided."),
|
||||
"Connected to the streaming server" => _("Connected to the streaming server"),
|
||||
"The stream is disabled" => _("The stream is disabled"),
|
||||
"Getting information from the server..." => _("Getting information from the server..."),
|
||||
"Can not connect to the streaming server" => _("Can not connect to the streaming server"),
|
||||
"If %s is behind a router or firewall, you may need to configure port forwarding and this field information will be incorrect. In this case you will need to manually update this field so it shows the correct host/port/mount that your DJ's need to connect to. The allowed range is between 1024 and 49151."
|
||||
=> _("If %s is behind a router or firewall, you may need to configure port forwarding and this field information will be incorrect. In this case you will need to manually update this field so it shows the correct host/port/mount that your DJ's need to connect to. The allowed range is between 1024 and 49151."),
|
||||
"For more details, please read the %s%s Manual%s" => _("For more details, please read the %s%s Manual%s"),
|
||||
"Check this option to enable metadata for OGG streams (stream metadata is the track title, artist, and show name that is displayed in an audio player). VLC and mplayer have a serious bug when playing an OGG/VORBIS stream that has metadata information enabled: they will disconnect from the stream after every song. If you are using an OGG stream and your listeners do not require support for these audio players, then feel free to enable this option."
|
||||
=> _("Check this option to enable metadata for OGG streams (stream metadata is the track title, artist, and show name that is displayed in an audio player). VLC and mplayer have a serious bug when playing an OGG/VORBIS stream that has metadata information enabled: they will disconnect from the stream after every song. If you are using an OGG stream and your listeners do not require support for these audio players, then feel free to enable this option."),
|
||||
"Check this box to automatically switch off Master/Show source upon source disconnection." => _("Check this box to automatically switch off Master/Show source upon source disconnection."),
|
||||
"Check this box to automatically switch on Master/Show source upon source connection." => _("Check this box to automatically switch on Master/Show source upon source connection."),
|
||||
'Some stream types require extra configuration. Details about enabling %sAAC+ Support%s or %sOpus Support%s are provided.' => _('Some stream types require extra configuration. Details about enabling %sAAC+ Support%s or %sOpus Support%s are provided.'),
|
||||
'Connected to the streaming server' => _('Connected to the streaming server'),
|
||||
'The stream is disabled' => _('The stream is disabled'),
|
||||
'Getting information from the server...' => _('Getting information from the server...'),
|
||||
'Can not connect to the streaming server' => _('Can not connect to the streaming server'),
|
||||
"If %s is behind a router or firewall, you may need to configure port forwarding and this field information will be incorrect. In this case you will need to manually update this field so it shows the correct host/port/mount that your DJ's need to connect to. The allowed range is between 1024 and 49151." => _("If %s is behind a router or firewall, you may need to configure port forwarding and this field information will be incorrect. In this case you will need to manually update this field so it shows the correct host/port/mount that your DJ's need to connect to. The allowed range is between 1024 and 49151."),
|
||||
'For more details, please read the %s%s Manual%s' => _('For more details, please read the %s%s Manual%s'),
|
||||
'Check this option to enable metadata for OGG streams (stream metadata is the track title, artist, and show name that is displayed in an audio player). VLC and mplayer have a serious bug when playing an OGG/VORBIS stream that has metadata information enabled: they will disconnect from the stream after every song. If you are using an OGG stream and your listeners do not require support for these audio players, then feel free to enable this option.' => _('Check this option to enable metadata for OGG streams (stream metadata is the track title, artist, and show name that is displayed in an audio player). VLC and mplayer have a serious bug when playing an OGG/VORBIS stream that has metadata information enabled: they will disconnect from the stream after every song. If you are using an OGG stream and your listeners do not require support for these audio players, then feel free to enable this option.'),
|
||||
'Check this box to automatically switch off Master/Show source upon source disconnection.' => _('Check this box to automatically switch off Master/Show source upon source disconnection.'),
|
||||
'Check this box to automatically switch on Master/Show source upon source connection.' => _('Check this box to automatically switch on Master/Show source upon source connection.'),
|
||||
"If your Icecast server expects a username of 'source', this field can be left blank." => _("If your Icecast server expects a username of 'source', this field can be left blank."),
|
||||
"If your live streaming client does not ask for a username, this field should be 'source'." => _("If your live streaming client does not ask for a username, this field should be 'source'."),
|
||||
"WARNING: This will restart your stream and may cause a short dropout for your listeners!" => _("WARNING: This will restart your stream and may cause a short dropout for your listeners!"),
|
||||
"This is the admin username and password for Icecast/SHOUTcast to get listener statistics." => _("This is the admin username and password for Icecast/SHOUTcast to get listener statistics."),
|
||||
'WARNING: This will restart your stream and may cause a short dropout for your listeners!' => _('WARNING: This will restart your stream and may cause a short dropout for your listeners!'),
|
||||
'This is the admin username and password for Icecast/SHOUTcast to get listener statistics.' => _('This is the admin username and password for Icecast/SHOUTcast to get listener statistics.'),
|
||||
//preferences/support-setting.js
|
||||
"Image must be one of jpg, jpeg, png, or gif" => _("Image must be one of jpg, jpeg, png, or gif"),
|
||||
'Image must be one of jpg, jpeg, png, or gif' => _('Image must be one of jpg, jpeg, png, or gif'),
|
||||
//schedule/add-show.js
|
||||
"Warning: You cannot change this field while the show is currently playing" => _("Warning: You cannot change this field while the show is currently playing"),
|
||||
"No result found" => _("No result found"),
|
||||
"This follows the same security pattern for the shows: only users assigned to the show can connect." => _("This follows the same security pattern for the shows: only users assigned to the show can connect."),
|
||||
"Specify custom authentication which will work only for this show." => _("Specify custom authentication which will work only for this show."),
|
||||
'Warning: You cannot change this field while the show is currently playing' => _('Warning: You cannot change this field while the show is currently playing'),
|
||||
'No result found' => _('No result found'),
|
||||
'This follows the same security pattern for the shows: only users assigned to the show can connect.' => _('This follows the same security pattern for the shows: only users assigned to the show can connect.'),
|
||||
'Specify custom authentication which will work only for this show.' => _('Specify custom authentication which will work only for this show.'),
|
||||
"If your live streaming client does not ask for a username, this field should be 'source'." => _("If your live streaming client does not ask for a username, this field should be 'source'."),
|
||||
"The show instance doesn't exist anymore!" => _("The show instance doesn't exist anymore!"),
|
||||
"Warning: Shows cannot be re-linked" => _("Warning: Shows cannot be re-linked"),
|
||||
"By linking your repeating shows any media items scheduled in any repeat show will also get scheduled in the other repeat shows" => _("By linking your repeating shows any media items scheduled in any repeat show will also get scheduled in the other repeat shows"),
|
||||
"Timezone is set to the station timezone by default. Shows in the calendar will be displayed in your local time defined by the Interface Timezone in your user settings." => _("Timezone is set to the station timezone by default. Shows in the calendar will be displayed in your local time defined by the Interface Timezone in your user settings."),
|
||||
'Warning: Shows cannot be re-linked' => _('Warning: Shows cannot be re-linked'),
|
||||
'By linking your repeating shows any media items scheduled in any repeat show will also get scheduled in the other repeat shows' => _('By linking your repeating shows any media items scheduled in any repeat show will also get scheduled in the other repeat shows'),
|
||||
'Timezone is set to the station timezone by default. Shows in the calendar will be displayed in your local time defined by the Interface Timezone in your user settings.' => _('Timezone is set to the station timezone by default. Shows in the calendar will be displayed in your local time defined by the Interface Timezone in your user settings.'),
|
||||
//schedule/full-calendar-functions
|
||||
//already in schedule/add-show.js
|
||||
//"The show instance doesn't exist anymore!" => _("The show instance doesn't exist anymore!"),
|
||||
"Show" => _("Show"),
|
||||
"Show is empty" => _("Show is empty"),
|
||||
"1m" => _("1m"),
|
||||
"5m" => _("5m"),
|
||||
"10m" => _("10m"),
|
||||
"15m" => _("15m"),
|
||||
"30m" => _("30m"),
|
||||
"60m" => _("60m"),
|
||||
"Uploading in progress..." => _("Uploading in progress..."),
|
||||
"Retreiving data from the server..." => _("Retreiving data from the server..."),
|
||||
"This show has no scheduled content." => _("This show has no scheduled content."),
|
||||
"This show is not completely filled with content." => _("This show is not completely filled with content."),
|
||||
'Show' => _('Show'),
|
||||
'Show is empty' => _('Show is empty'),
|
||||
'1m' => _('1m'),
|
||||
'5m' => _('5m'),
|
||||
'10m' => _('10m'),
|
||||
'15m' => _('15m'),
|
||||
'30m' => _('30m'),
|
||||
'60m' => _('60m'),
|
||||
'Uploading in progress...' => _('Uploading in progress...'),
|
||||
'Retreiving data from the server...' => _('Retreiving data from the server...'),
|
||||
'This show has no scheduled content.' => _('This show has no scheduled content.'),
|
||||
'This show is not completely filled with content.' => _('This show is not completely filled with content.'),
|
||||
//already in schedule/add-show.js
|
||||
//"The show instance doesn"t exist anymore!" => _("The show instance doesn"t exist anymore!"),
|
||||
//schedule/schedule.js
|
||||
"January" => _("January"),
|
||||
"February" => _("February"),
|
||||
"March" => _("March"),
|
||||
"April" => _("April"),
|
||||
"May" => _("May"),
|
||||
"June" => _("June"),
|
||||
"July" => _("July"),
|
||||
"August" => _("August"),
|
||||
"September" => _("September"),
|
||||
"October" => _("October"),
|
||||
"November" => _("November"),
|
||||
"December" => _("December"),
|
||||
"Jan" => _("Jan"),
|
||||
"Feb" => _("Feb"),
|
||||
"Mar" => _("Mar"),
|
||||
"Apr" => _("Apr"),
|
||||
"May" => _("May"),
|
||||
"Jun" => _("Jun"),
|
||||
"Jul" => _("Jul"),
|
||||
"Aug" => _("Aug"),
|
||||
"Sep" => _("Sep"),
|
||||
"Oct" => _("Oct"),
|
||||
"Nov" => _("Nov"),
|
||||
"Dec" => _("Dec"),
|
||||
"Today" => _("Today"),
|
||||
"Day" => _("Day"),
|
||||
"Week" => _("Week"),
|
||||
"Month" => _("Month"),
|
||||
"Sunday" => _("Sunday"),
|
||||
"Monday" => _("Monday"),
|
||||
"Tuesday" => _("Tuesday"),
|
||||
"Wednesday" => _("Wednesday"),
|
||||
"Thursday" => _("Thursday"),
|
||||
"Friday" => _("Friday"),
|
||||
"Saturday" => _("Saturday"),
|
||||
"Sun" => _("Sun"),
|
||||
"Mon" => _("Mon"),
|
||||
"Tue" => _("Tue"),
|
||||
"Wed" => _("Wed"),
|
||||
"Thu" => _("Thu"),
|
||||
"Fri" => _("Fri"),
|
||||
"Sat" => _("Sat"),
|
||||
"Shows longer than their scheduled time will be cut off by a following show." => _("Shows longer than their scheduled time will be cut off by a following show."),
|
||||
"Cancel Current Show?" => _("Cancel Current Show?"),
|
||||
"Stop recording current show?" => _("Stop recording current show?"),
|
||||
"Ok" => _("Ok"),
|
||||
"Contents of Show" => _("Contents of Show"),
|
||||
'January' => _('January'),
|
||||
'February' => _('February'),
|
||||
'March' => _('March'),
|
||||
'April' => _('April'),
|
||||
'May' => _('May'),
|
||||
'June' => _('June'),
|
||||
'July' => _('July'),
|
||||
'August' => _('August'),
|
||||
'September' => _('September'),
|
||||
'October' => _('October'),
|
||||
'November' => _('November'),
|
||||
'December' => _('December'),
|
||||
'Jan' => _('Jan'),
|
||||
'Feb' => _('Feb'),
|
||||
'Mar' => _('Mar'),
|
||||
'Apr' => _('Apr'),
|
||||
'May' => _('May'),
|
||||
'Jun' => _('Jun'),
|
||||
'Jul' => _('Jul'),
|
||||
'Aug' => _('Aug'),
|
||||
'Sep' => _('Sep'),
|
||||
'Oct' => _('Oct'),
|
||||
'Nov' => _('Nov'),
|
||||
'Dec' => _('Dec'),
|
||||
'Today' => _('Today'),
|
||||
'Day' => _('Day'),
|
||||
'Week' => _('Week'),
|
||||
'Month' => _('Month'),
|
||||
'Sunday' => _('Sunday'),
|
||||
'Monday' => _('Monday'),
|
||||
'Tuesday' => _('Tuesday'),
|
||||
'Wednesday' => _('Wednesday'),
|
||||
'Thursday' => _('Thursday'),
|
||||
'Friday' => _('Friday'),
|
||||
'Saturday' => _('Saturday'),
|
||||
'Sun' => _('Sun'),
|
||||
'Mon' => _('Mon'),
|
||||
'Tue' => _('Tue'),
|
||||
'Wed' => _('Wed'),
|
||||
'Thu' => _('Thu'),
|
||||
'Fri' => _('Fri'),
|
||||
'Sat' => _('Sat'),
|
||||
'Shows longer than their scheduled time will be cut off by a following show.' => _('Shows longer than their scheduled time will be cut off by a following show.'),
|
||||
'Cancel Current Show?' => _('Cancel Current Show?'),
|
||||
'Stop recording current show?' => _('Stop recording current show?'),
|
||||
'Ok' => _('Ok'),
|
||||
'Contents of Show' => _('Contents of Show'),
|
||||
//already in schedule/add-show.js
|
||||
//"The show instance doesn"t exist anymore!" => _("The show instance doesn"t exist anymore!"),
|
||||
"Remove all content?" => _("Remove all content?"),
|
||||
'Remove all content?' => _('Remove all content?'),
|
||||
//showbuilder/builder.js
|
||||
"Delete selected item(s)?" => _("Delete selected item(s)?"),
|
||||
"Start" => _("Start"),
|
||||
"End" => _("End"),
|
||||
"Duration" => _("Duration"),
|
||||
"Filtering out " => _("Filtering out "),
|
||||
" of " => _(" of "),
|
||||
" records" => _(" records"),
|
||||
"There are no shows scheduled during the specified time period." => _("There are no shows scheduled during the specified time period."),
|
||||
'Delete selected item(s)?' => _('Delete selected item(s)?'),
|
||||
'Start' => _('Start'),
|
||||
'End' => _('End'),
|
||||
'Duration' => _('Duration'),
|
||||
'Filtering out ' => _('Filtering out '),
|
||||
' of ' => _(' of '),
|
||||
' records' => _(' records'),
|
||||
'There are no shows scheduled during the specified time period.' => _('There are no shows scheduled during the specified time period.'),
|
||||
//already in library/library.js
|
||||
//"Title" => _("Title"),
|
||||
//"Creator" => _("Creator"),
|
||||
//"Album" => _("Album"),
|
||||
//"Mime" => _("Mime"),
|
||||
"Cue In" => _("Cue In"),
|
||||
"Cue Out" => _("Cue Out"),
|
||||
"Fade In" => _("Fade In"),
|
||||
"Fade Out" => _("Fade Out"),
|
||||
"Show Empty" => _("Show Empty"),
|
||||
"Recording From Line In" => _("Recording From Line In"),
|
||||
"Track preview" => _("Track preview"),
|
||||
'Cue In' => _('Cue In'),
|
||||
'Cue Out' => _('Cue Out'),
|
||||
'Fade In' => _('Fade In'),
|
||||
'Fade Out' => _('Fade Out'),
|
||||
'Show Empty' => _('Show Empty'),
|
||||
'Recording From Line In' => _('Recording From Line In'),
|
||||
'Track preview' => _('Track preview'),
|
||||
//already in library/spl.js
|
||||
//"Airtime is unsure about the status of this file. This can happen when the file is on a remote drive that is unaccessible or the file is in a directory that isn"t "watched" anymore."
|
||||
//=> _("Airtime is unsure about the status of this file. This can happen when the file is on a remote drive that is unaccessible or the file is in a directory that isn"t "watched" anymore."),
|
||||
"Cannot schedule outside a show." => _("Cannot schedule outside a show."),
|
||||
"Moving 1 Item" => _("Moving 1 Item"),
|
||||
"Moving %s Items" => _("Moving %s Items"),
|
||||
"Save" => _("Save"),
|
||||
"Cancel" => _("Cancel"),
|
||||
"Fade Editor" => _("Fade Editor"),
|
||||
"Cue Editor" => _("Cue Editor"),
|
||||
"Waveform features are available in a browser supporting the Web Audio API" => _("Waveform features are available in a browser supporting the Web Audio API"),
|
||||
//=> _("Airtime is unsure about the status of this file. This can happen when the file is on a remote drive that is unaccessible or the file is in a directory that isn"t "watched" anymore."),
|
||||
'Cannot schedule outside a show.' => _('Cannot schedule outside a show.'),
|
||||
'Moving 1 Item' => _('Moving 1 Item'),
|
||||
'Moving %s Items' => _('Moving %s Items'),
|
||||
'Save' => _('Save'),
|
||||
'Cancel' => _('Cancel'),
|
||||
'Fade Editor' => _('Fade Editor'),
|
||||
'Cue Editor' => _('Cue Editor'),
|
||||
'Waveform features are available in a browser supporting the Web Audio API' => _('Waveform features are available in a browser supporting the Web Audio API'),
|
||||
//already in library/library.js
|
||||
//"Select" => _("Select"),
|
||||
"Select all" => _("Select all"),
|
||||
"Select none" => _("Select none"),
|
||||
"Trim overbooked shows" => _("Trim overbooked shows"),
|
||||
"Remove selected scheduled items" => _("Remove selected scheduled items"),
|
||||
"Jump to the current playing track" => _("Jump to the current playing track"),
|
||||
"Jump to Current" => _("Jump to Current"),
|
||||
"Cancel current show" => _("Cancel current show"),
|
||||
'Select all' => _('Select all'),
|
||||
'Select none' => _('Select none'),
|
||||
'Trim overbooked shows' => _('Trim overbooked shows'),
|
||||
'Remove selected scheduled items' => _('Remove selected scheduled items'),
|
||||
'Jump to the current playing track' => _('Jump to the current playing track'),
|
||||
'Jump to Current' => _('Jump to Current'),
|
||||
'Cancel current show' => _('Cancel current show'),
|
||||
//already in schedule/schedule.js
|
||||
//"Cancel Current Show?" => _("Cancel Current Show?"),
|
||||
"Stop recording current show?" => _("Stop recording current show?"),
|
||||
'Stop recording current show?' => _('Stop recording current show?'),
|
||||
//showbuilder/main_builder.js
|
||||
"Open library to add or remove content" => _("Open library to add or remove content"),
|
||||
"Add / Remove Content" => _("Add / Remove Content"),
|
||||
'Open library to add or remove content' => _('Open library to add or remove content'),
|
||||
'Add / Remove Content' => _('Add / Remove Content'),
|
||||
//status/status.js
|
||||
"in use" => _("in use"),
|
||||
"Disk" => _("Disk"),
|
||||
'in use' => _('in use'),
|
||||
'Disk' => _('Disk'),
|
||||
//serverbrowse/serverbrowse.js
|
||||
"Look in" => _("Look in"),
|
||||
"Cancel" => _("Cancel"),
|
||||
"Open" => _("Open"),
|
||||
'Look in' => _('Look in'),
|
||||
'Cancel' => _('Cancel'),
|
||||
'Open' => _('Open'),
|
||||
//user/user.js
|
||||
"Admin" => _("Admin"),
|
||||
"DJ" => _("DJ"),
|
||||
"Program Manager" => _("Program Manager"),
|
||||
"Guest" => _("Guest"),
|
||||
"Guests can do the following:" => _("Guests can do the following:"),
|
||||
"View schedule" => _("View schedule"),
|
||||
"View show content" => _("View show content"),
|
||||
"DJs can do the following:" => _("DJs can do the following:"),
|
||||
"Manage assigned show content" => _("Manage assigned show content"),
|
||||
"Import media files" => _("Import media files"),
|
||||
"Create playlists, smart blocks, and webstreams" => _("Create playlists, smart blocks, and webstreams"),
|
||||
"Manage their own library content" => _("Manage their own library content"),
|
||||
"Program Managers can do the following:" => _("Program Managers can do the following:"),
|
||||
"View and manage show content" => _("View and manage show content"),
|
||||
"Schedule shows" => _("Schedule shows"),
|
||||
"Manage all library content" => _("Manage all library content"),
|
||||
"Admins can do the following:" => _("Admins can do the following:"),
|
||||
"Manage preferences" => _("Manage preferences"),
|
||||
"Manage users" => _("Manage users"),
|
||||
"Manage watched folders" => _("Manage watched folders"),
|
||||
"Send support feedback" => _("Send support feedback"),
|
||||
"View system status" => _("View system status"),
|
||||
"Access playout history" => _("Access playout history"),
|
||||
"View listener stats" => _("View listener stats"),
|
||||
'Admin' => _('Admin'),
|
||||
'DJ' => _('DJ'),
|
||||
'Program Manager' => _('Program Manager'),
|
||||
'Guest' => _('Guest'),
|
||||
'Guests can do the following:' => _('Guests can do the following:'),
|
||||
'View schedule' => _('View schedule'),
|
||||
'View show content' => _('View show content'),
|
||||
'DJs can do the following:' => _('DJs can do the following:'),
|
||||
'Manage assigned show content' => _('Manage assigned show content'),
|
||||
'Import media files' => _('Import media files'),
|
||||
'Create playlists, smart blocks, and webstreams' => _('Create playlists, smart blocks, and webstreams'),
|
||||
'Manage their own library content' => _('Manage their own library content'),
|
||||
'Program Managers can do the following:' => _('Program Managers can do the following:'),
|
||||
'View and manage show content' => _('View and manage show content'),
|
||||
'Schedule shows' => _('Schedule shows'),
|
||||
'Manage all library content' => _('Manage all library content'),
|
||||
'Admins can do the following:' => _('Admins can do the following:'),
|
||||
'Manage preferences' => _('Manage preferences'),
|
||||
'Manage users' => _('Manage users'),
|
||||
'Manage watched folders' => _('Manage watched folders'),
|
||||
'Send support feedback' => _('Send support feedback'),
|
||||
'View system status' => _('View system status'),
|
||||
'Access playout history' => _('Access playout history'),
|
||||
'View listener stats' => _('View listener stats'),
|
||||
//dataTables/ColVis.js
|
||||
"Show / hide columns" => _("Show / hide columns"),
|
||||
"Columns" => _("Columns"),
|
||||
'Show / hide columns' => _('Show / hide columns'),
|
||||
'Columns' => _('Columns'),
|
||||
//datatables.columnFilter.js
|
||||
"From {from} to {to}" => _("From {from} to {to}"),
|
||||
"kbps" => _("kbps"),
|
||||
"yyyy-mm-dd" => _("yyyy-mm-dd"),
|
||||
"hh:mm:ss.t" => _("hh:mm:ss.t"),
|
||||
"kHz" => _("kHz"),
|
||||
'From {from} to {to}' => _('From {from} to {to}'),
|
||||
'kbps' => _('kbps'),
|
||||
'yyyy-mm-dd' => _('yyyy-mm-dd'),
|
||||
'hh:mm:ss.t' => _('hh:mm:ss.t'),
|
||||
'kHz' => _('kHz'),
|
||||
//datepicker
|
||||
//months are already in schedule/schedule.js
|
||||
"Su" => _("Su"),
|
||||
"Mo" => _("Mo"),
|
||||
"Tu" => _("Tu"),
|
||||
"We" => _("We"),
|
||||
"Th" => _("Th"),
|
||||
"Fr" => _("Fr"),
|
||||
"Sa" => _("Sa"),
|
||||
"Close" => _("Close"),
|
||||
'Su' => _('Su'),
|
||||
'Mo' => _('Mo'),
|
||||
'Tu' => _('Tu'),
|
||||
'We' => _('We'),
|
||||
'Th' => _('Th'),
|
||||
'Fr' => _('Fr'),
|
||||
'Sa' => _('Sa'),
|
||||
'Close' => _('Close'),
|
||||
//timepicker
|
||||
"Hour" => _("Hour"),
|
||||
"Minute" => _("Minute"),
|
||||
"Done" => _("Done"),
|
||||
'Hour' => _('Hour'),
|
||||
'Minute' => _('Minute'),
|
||||
'Done' => _('Done'),
|
||||
//plupload ships with translation files but a lot are incomplete
|
||||
//so we will keep them here to prevent incomplete translations
|
||||
"Select files" => _("Select files"),
|
||||
"Add files to the upload queue and click the start button." => _("Add files to the upload queue and click the start button."),
|
||||
"Filename" => _("Add files to the upload queue and click the start button."),
|
||||
"Status" => _("Status"),
|
||||
"Size" => _("Status"),
|
||||
"Add Files" => _("Add Files"),
|
||||
"Stop Upload" => _("Stop Upload"),
|
||||
"Start upload" => _("Start upload"),
|
||||
"Add files" => _("Add files"),
|
||||
"Uploaded %d/%d files"=> _("Uploaded %d/%d files"),
|
||||
"N/A" => _("N/A"),
|
||||
"Drag files here." => _("Drag files here."),
|
||||
"File extension error." => _("File extension error."),
|
||||
"File size error." => _("File size error."),
|
||||
"File count error." => _("File count error."),
|
||||
"Init error." => _("Init error."),
|
||||
"HTTP Error." => _("HTTP Error."),
|
||||
"Security error." => _("Security error."),
|
||||
"Generic error." => _("Generic error."),
|
||||
"IO error." => _("IO error."),
|
||||
"File: %s" => _("File: %s"),
|
||||
"Close" => _("Close"),
|
||||
"%d files queued" => _("%d files queued"),
|
||||
"File: %f, size: %s, max file size: %m" => _("File: %f, size: %s, max file size: %m"),
|
||||
'Select files' => _('Select files'),
|
||||
'Add files to the upload queue and click the start button.' => _('Add files to the upload queue and click the start button.'),
|
||||
'Filename' => _('Add files to the upload queue and click the start button.'),
|
||||
'Status' => _('Status'),
|
||||
'Size' => _('Status'),
|
||||
'Add Files' => _('Add Files'),
|
||||
'Stop Upload' => _('Stop Upload'),
|
||||
'Start upload' => _('Start upload'),
|
||||
'Add files' => _('Add files'),
|
||||
'Uploaded %d/%d files' => _('Uploaded %d/%d files'),
|
||||
'N/A' => _('N/A'),
|
||||
'Drag files here.' => _('Drag files here.'),
|
||||
'File extension error.' => _('File extension error.'),
|
||||
'File size error.' => _('File size error.'),
|
||||
'File count error.' => _('File count error.'),
|
||||
'Init error.' => _('Init error.'),
|
||||
'HTTP Error.' => _('HTTP Error.'),
|
||||
'Security error.' => _('Security error.'),
|
||||
'Generic error.' => _('Generic error.'),
|
||||
'IO error.' => _('IO error.'),
|
||||
'File: %s' => _('File: %s'),
|
||||
'Close' => _('Close'),
|
||||
'%d files queued' => _('%d files queued'),
|
||||
'File: %f, size: %s, max file size: %m' => _('File: %f, size: %s, max file size: %m'),
|
||||
"Upload URL might be wrong or doesn't exist" => _("Upload URL might be wrong or doesn't exist"),
|
||||
"Error: File too large: " => _("Error: File too large: "),
|
||||
"Error: Invalid file extension: " => _("Error: Invalid file extension: "),
|
||||
'Error: File too large: ' => _('Error: File too large: '),
|
||||
'Error: Invalid file extension: ' => _('Error: Invalid file extension: '),
|
||||
//history translations
|
||||
"Set Default" => _("Set Default"),
|
||||
"Create Entry" => _("Create Entry"),
|
||||
"Edit History Record" => _("Edit History Record"),
|
||||
"No Show" => _("No Show"),
|
||||
"All" => _("All"),
|
||||
"Copied %s row%s to the clipboard" => _("Copied %s row%s to the clipboard"),
|
||||
'Set Default' => _('Set Default'),
|
||||
'Create Entry' => _('Create Entry'),
|
||||
'Edit History Record' => _('Edit History Record'),
|
||||
'No Show' => _('No Show'),
|
||||
'All' => _('All'),
|
||||
'Copied %s row%s to the clipboard' => _('Copied %s row%s to the clipboard'),
|
||||
"%sPrint view%sPlease use your browser's print function to print this table. Press escape when finished." => _("%sPrint view%sPlease use your browser's print function to print this table. Press escape when finished."),
|
||||
"New Show" => _("New Show"),
|
||||
"New Log Entry" => _("New Log Entry"),
|
||||
'New Show' => _('New Show'),
|
||||
'New Log Entry' => _('New Log Entry'),
|
||||
//Datatables:
|
||||
"No data available in table" => _("No data available in table"),
|
||||
"(filtered from _MAX_ total entries)" => _("(filtered from _MAX_ total entries)"),
|
||||
": activate to sort column ascending",
|
||||
": activate to sort column descending",
|
||||
'No data available in table' => _('No data available in table'),
|
||||
'(filtered from _MAX_ total entries)' => _('(filtered from _MAX_ total entries)'),
|
||||
': activate to sort column ascending',
|
||||
': activate to sort column descending',
|
||||
//End of datatables
|
||||
|
||||
//New entries from .js "" => _(""),
|
||||
"First" => _("First"),
|
||||
"Last" => _("Last"),
|
||||
"Next" => _("Next"),
|
||||
"Previous" => _("Previous"),
|
||||
"Search:" => _("Search:"),
|
||||
"No matching records found" => _("No matching records found"),
|
||||
"Drag tracks here from the library" => _("Drag tracks here from the library"),
|
||||
"No tracks were played during the selected time period." => _("No tracks were played during the selected time period."),
|
||||
"Unpublish" => _("Unpublish"),
|
||||
"No matching results found." => _("No matching results found."),
|
||||
"Author" => _("Author"),
|
||||
"Description" => _("Description"),
|
||||
"Link" => _("Link"),
|
||||
"Publication Date" => _("Publication Date"),
|
||||
"Import Status" => _("Import Status"),
|
||||
"Actions" => _("Actions"),
|
||||
"Delete from Library" => _("Delete from Library"),
|
||||
"Successfully imported" => _("Successfully imported"),
|
||||
"No matching records found" => _("No matching records found"),
|
||||
"Show _MENU_" => _("Show _MENU_"),
|
||||
"Show _MENU_ entries" => _("Show _MENU_ entries"),
|
||||
"Showing _START_ to _END_ of _TOTAL_ entries" => _("Showing _START_ to _END_ of _TOTAL_ entries"),
|
||||
"Showing _START_ to _END_ of _TOTAL_ tracks" => _("Showing _START_ to _END_ of _TOTAL_ tracks"),
|
||||
"Showing _START_ to _END_ of _TOTAL_ track types" => _("Showing _START_ to _END_ of _TOTAL_ track types"),
|
||||
"Showing _START_ to _END_ of _TOTAL_ users" => _("Showing _START_ to _END_ of _TOTAL_ users"),
|
||||
"Showing 0 to 0 of 0 entries" => _("Showing 0 to 0 of 0 entries"),
|
||||
"Showing 0 to 0 of 0 tracks" => _("Showing 0 to 0 of 0 tracks"),
|
||||
"Showing 0 to 0 of 0 track types" => _("Showing 0 to 0 of 0 track types"),
|
||||
"(filtered from _MAX_ total track types)" => _("(filtered from _MAX_ total track types)"),
|
||||
//"This is used for tracks containing music." => _("This is used for tracks containing music."),
|
||||
"Are you sure you want to delete this tracktype?" => _("Are you sure you want to delete this tracktype?"),
|
||||
"No track types were found." => _("No track types were found."),
|
||||
"No track types found" => _("No track types found"),
|
||||
"No matching track types found" => _("No matching track types found"),
|
||||
"Enabled" => _("Enabled"),
|
||||
"Disabled" => _("Disabled"),
|
||||
"Cancel upload" => _("Cancel upload"),
|
||||
"Type" => _("Type"),
|
||||
"Autoloading playlists' contents are added to shows one hour before the show airs. <a target='_blank' href='http://libretime.org/docs/playlists'>More information</a>" => _("Autoloading playlists' contents are added to shows one hour before the show airs. <a target='_blank' href='http://libretime.org/docs/playlists'>More information</a>"),
|
||||
"Podcast settings saved" => _("Podcast settings saved"),
|
||||
"Are you sure you want to delete this user?" => _("Are you sure you want to delete this user?"),
|
||||
"Can't delete yourself!" => _("Can't delete yourself!"),
|
||||
"You haven't published any episodes!" => _("You haven't published any episodes!"),
|
||||
"You can publish your uploaded content from the 'Tracks' view." => _("You can publish your uploaded content from the 'Tracks' view."),
|
||||
"Try it now" => _("Try it now"),
|
||||
"<p>If this option is unchecked, the smartblock will schedule as many tracks as can be played out <strong>in their entirety</strong> within the specified duration. This will usually result in audio playback that is slightly less than the specified duration.</p><p>If this option is checked, the smartblock will also schedule one final track which will overflow the specified duration. This final track may be cut off mid-way if the show into which the smartblock is added finishes.</p>" => _("<p>If this option is unchecked, the smartblock will schedule as many tracks as can be played out <strong>in their entirety</strong> within the specified duration. This will usually result in audio playback that is slightly less than the specified duration.</p><p>If this option is checked, the smartblock will also schedule one final track which will overflow the specified duration. This final track may be cut off mid-way if the show into which the smartblock is added finishes.</p>"),
|
||||
"Playlist preview" => _("Playlist preview"),
|
||||
"Smart Block" => _("Smart Block"),
|
||||
"Webstream preview" => _("Webstream preview"),
|
||||
"You don't have permission to view the library." => _("You don't have permission to view the library."),
|
||||
"Now" => _("Now"),
|
||||
"Click 'New' to create one now." => _("Click 'New' to create one now."),
|
||||
"Click 'Upload' to add some now." => _("Click 'Upload' to add some now."),
|
||||
"Feed URL" => _("Feed URL"),
|
||||
"Import Date" => _("Import Date"),
|
||||
"Add New Podcast" => _("Add New Podcast"),
|
||||
"Cannot schedule outside a show.\nTry creating a show first." => _("Cannot schedule outside a show.\nTry creating a show first."),
|
||||
"No files have been uploaded yet." => _("No files have been uploaded yet."),
|
||||
//"Value is required and can't be empty" => _("Value is required and can't be empty"),
|
||||
//"mute" => _("mute"),
|
||||
//"max volume" => _("max volume"),
|
||||
|
||||
//New entries from .js "" => _(""),
|
||||
'First' => _('First'),
|
||||
'Last' => _('Last'),
|
||||
'Next' => _('Next'),
|
||||
'Previous' => _('Previous'),
|
||||
'Search:' => _('Search:'),
|
||||
'No matching records found' => _('No matching records found'),
|
||||
'Drag tracks here from the library' => _('Drag tracks here from the library'),
|
||||
'No tracks were played during the selected time period.' => _('No tracks were played during the selected time period.'),
|
||||
'Unpublish' => _('Unpublish'),
|
||||
'No matching results found.' => _('No matching results found.'),
|
||||
'Author' => _('Author'),
|
||||
'Description' => _('Description'),
|
||||
'Link' => _('Link'),
|
||||
'Publication Date' => _('Publication Date'),
|
||||
'Import Status' => _('Import Status'),
|
||||
'Actions' => _('Actions'),
|
||||
'Delete from Library' => _('Delete from Library'),
|
||||
'Successfully imported' => _('Successfully imported'),
|
||||
'No matching records found' => _('No matching records found'),
|
||||
'Show _MENU_' => _('Show _MENU_'),
|
||||
'Show _MENU_ entries' => _('Show _MENU_ entries'),
|
||||
'Showing _START_ to _END_ of _TOTAL_ entries' => _('Showing _START_ to _END_ of _TOTAL_ entries'),
|
||||
'Showing _START_ to _END_ of _TOTAL_ tracks' => _('Showing _START_ to _END_ of _TOTAL_ tracks'),
|
||||
'Showing _START_ to _END_ of _TOTAL_ track types' => _('Showing _START_ to _END_ of _TOTAL_ track types'),
|
||||
'Showing _START_ to _END_ of _TOTAL_ users' => _('Showing _START_ to _END_ of _TOTAL_ users'),
|
||||
'Showing 0 to 0 of 0 entries' => _('Showing 0 to 0 of 0 entries'),
|
||||
'Showing 0 to 0 of 0 tracks' => _('Showing 0 to 0 of 0 tracks'),
|
||||
'Showing 0 to 0 of 0 track types' => _('Showing 0 to 0 of 0 track types'),
|
||||
'(filtered from _MAX_ total track types)' => _('(filtered from _MAX_ total track types)'),
|
||||
//"This is used for tracks containing music." => _("This is used for tracks containing music."),
|
||||
'Are you sure you want to delete this tracktype?' => _('Are you sure you want to delete this tracktype?'),
|
||||
'No track types were found.' => _('No track types were found.'),
|
||||
'No track types found' => _('No track types found'),
|
||||
'No matching track types found' => _('No matching track types found'),
|
||||
'Enabled' => _('Enabled'),
|
||||
'Disabled' => _('Disabled'),
|
||||
'Cancel upload' => _('Cancel upload'),
|
||||
'Type' => _('Type'),
|
||||
"Autoloading playlists' contents are added to shows one hour before the show airs. <a target='_blank' href='http://libretime.org/docs/playlists'>More information</a>" => _("Autoloading playlists' contents are added to shows one hour before the show airs. <a target='_blank' href='http://libretime.org/docs/playlists'>More information</a>"),
|
||||
'Podcast settings saved' => _('Podcast settings saved'),
|
||||
'Are you sure you want to delete this user?' => _('Are you sure you want to delete this user?'),
|
||||
"Can't delete yourself!" => _("Can't delete yourself!"),
|
||||
"You haven't published any episodes!" => _("You haven't published any episodes!"),
|
||||
"You can publish your uploaded content from the 'Tracks' view." => _("You can publish your uploaded content from the 'Tracks' view."),
|
||||
'Try it now' => _('Try it now'),
|
||||
'<p>If this option is unchecked, the smartblock will schedule as many tracks as can be played out <strong>in their entirety</strong> within the specified duration. This will usually result in audio playback that is slightly less than the specified duration.</p><p>If this option is checked, the smartblock will also schedule one final track which will overflow the specified duration. This final track may be cut off mid-way if the show into which the smartblock is added finishes.</p>' => _('<p>If this option is unchecked, the smartblock will schedule as many tracks as can be played out <strong>in their entirety</strong> within the specified duration. This will usually result in audio playback that is slightly less than the specified duration.</p><p>If this option is checked, the smartblock will also schedule one final track which will overflow the specified duration. This final track may be cut off mid-way if the show into which the smartblock is added finishes.</p>'),
|
||||
'Playlist preview' => _('Playlist preview'),
|
||||
'Smart Block' => _('Smart Block'),
|
||||
'Webstream preview' => _('Webstream preview'),
|
||||
"You don't have permission to view the library." => _("You don't have permission to view the library."),
|
||||
'Now' => _('Now'),
|
||||
"Click 'New' to create one now." => _("Click 'New' to create one now."),
|
||||
"Click 'Upload' to add some now." => _("Click 'Upload' to add some now."),
|
||||
'Feed URL' => _('Feed URL'),
|
||||
'Import Date' => _('Import Date'),
|
||||
'Add New Podcast' => _('Add New Podcast'),
|
||||
"Cannot schedule outside a show.\nTry creating a show first." => _("Cannot schedule outside a show.\nTry creating a show first."),
|
||||
'No files have been uploaded yet.' => _('No files have been uploaded yet.'),
|
||||
//"Value is required and can't be empty" => _("Value is required and can't be empty"),
|
||||
//"mute" => _("mute"),
|
||||
//"max volume" => _("max volume"),
|
||||
|
||||
//embed player
|
||||
"On Air" => _("On Air"),
|
||||
"Off Air" => _("Off Air"),
|
||||
"Offline" => _("Offline"),
|
||||
"Nothing scheduled" => _("Nothing scheduled"),
|
||||
"Click 'Add' to create one now." => _("Click 'Add' to create one now.")
|
||||
);
|
||||
'On Air' => _('On Air'),
|
||||
'Off Air' => _('Off Air'),
|
||||
'Offline' => _('Offline'),
|
||||
'Nothing scheduled' => _('Nothing scheduled'),
|
||||
"Click 'Add' to create one now." => _("Click 'Add' to create one now."),
|
||||
];
|
||||
$this->view->layout()->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender(true);
|
||||
header("Content-Type: text/javascript");
|
||||
echo "var general_dict=" . json_encode($translations);
|
||||
header('Content-Type: text/javascript');
|
||||
echo 'var general_dict=' . json_encode($translations);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,35 +2,32 @@
|
|||
|
||||
class LoginController extends Zend_Controller_Action
|
||||
{
|
||||
|
||||
public function init()
|
||||
{
|
||||
$CC_CONFIG = Config::getConfig();
|
||||
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||
|
||||
$this->view->headLink(array('rel' => 'icon', 'href' => $baseUrl . 'favicon.ico?' . $CC_CONFIG['airtime_version'], 'type' => 'image/x-icon'), 'PREPEND')
|
||||
$this->view->headLink(['rel' => 'icon', 'href' => $baseUrl . 'favicon.ico?' . $CC_CONFIG['airtime_version'], 'type' => 'image/x-icon'], 'PREPEND')
|
||||
->appendStylesheet($baseUrl . 'css/bootstrap.css?' . $CC_CONFIG['airtime_version'])
|
||||
->appendStylesheet($baseUrl . 'css/redmond/jquery-ui-1.8.8.custom.css?' . $CC_CONFIG['airtime_version'])
|
||||
->appendStylesheet($baseUrl . 'css/styles.css?' . $CC_CONFIG['airtime_version']);
|
||||
|
||||
->appendStylesheet($baseUrl . 'css/styles.css?' . $CC_CONFIG['airtime_version'])
|
||||
;
|
||||
}
|
||||
|
||||
public function indexAction()
|
||||
{
|
||||
$CC_CONFIG = Config::getConfig();
|
||||
|
||||
|
||||
$request = $this->getRequest();
|
||||
$response = $this->getResponse();
|
||||
$stationLocale = Application_Model_Preference::GetDefaultLocale();
|
||||
|
||||
|
||||
//Enable AJAX requests from www.airtime.pro for the sign-in process.
|
||||
CORSHelper::enableCrossOriginRequests($request, $response);
|
||||
|
||||
|
||||
Application_Model_Locale::configureLocalization($request->getcookie('airtime_locale', $stationLocale));
|
||||
|
||||
if (Zend_Session::isStarted()) {
|
||||
|
||||
//Open the session for writing, because we close it for writing by default in Bootstrap.php as an optimization.
|
||||
SessionHelper::reopenSessionForWriting();
|
||||
|
||||
|
@ -46,19 +43,17 @@ class LoginController extends Zend_Controller_Action
|
|||
$this->_helper->layout->setLayout('login');
|
||||
|
||||
$this->view->error = false;
|
||||
|
||||
|
||||
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||
|
||||
$form = new Application_Form_Login();
|
||||
|
||||
$message = _("Please enter your username and password.");
|
||||
$message = _('Please enter your username and password.');
|
||||
|
||||
if ($request->isPost()) {
|
||||
|
||||
//Open the session for writing, because we close it for writing by default in Bootstrap.php as an optimization.
|
||||
//session_start();
|
||||
|
||||
|
||||
if ($form->isValid($request->getPost())) {
|
||||
//get the username and password from the form
|
||||
$username = $form->getValue('username');
|
||||
|
@ -69,8 +64,9 @@ class LoginController extends Zend_Controller_Action
|
|||
|
||||
//pass to the adapter the submitted username and password
|
||||
$authAdapter->setIdentity($username)
|
||||
->setCredential($password);
|
||||
|
||||
->setCredential($password)
|
||||
;
|
||||
|
||||
$result = $auth->authenticate($authAdapter);
|
||||
if ($result->isValid()) {
|
||||
Zend_Session::regenerateId();
|
||||
|
@ -142,11 +138,12 @@ class LoginController extends Zend_Controller_Action
|
|||
|
||||
if (empty($username)) {
|
||||
$query->filterByDbEmail($email);
|
||||
} else if (empty($email)) {
|
||||
} elseif (empty($email)) {
|
||||
$query->filterByDbLogin($username);
|
||||
} else {
|
||||
$query->filterByDbEmail($email)
|
||||
->filterByDbLogin($username);
|
||||
->filterByDbLogin($username)
|
||||
;
|
||||
}
|
||||
$user = $query->findOne();
|
||||
|
||||
|
@ -157,13 +154,13 @@ class LoginController extends Zend_Controller_Action
|
|||
if ($success) {
|
||||
$this->_helper->redirector('password-restore-after', 'login');
|
||||
} else {
|
||||
$form->email->addError($this->view->translate(_("Email could not be sent. Check your mail server settings and ensure it has been configured properly.")));
|
||||
$form->email->addError($this->view->translate(_('Email could not be sent. Check your mail server settings and ensure it has been configured properly.')));
|
||||
}
|
||||
} else {
|
||||
$form->email->addError($this->view->translate(_("That username or email address could not be found.")));
|
||||
$form->email->addError($this->view->translate(_('That username or email address could not be found.')));
|
||||
}
|
||||
} else { //Form is not valid
|
||||
$form->email->addError($this->view->translate(_("There was a problem with the username or email address you entered.")));
|
||||
$form->email->addError($this->view->translate(_('There was a problem with the username or email address you entered.')));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -174,7 +171,7 @@ class LoginController extends Zend_Controller_Action
|
|||
{
|
||||
$request = $this->getRequest();
|
||||
$stationLocale = Application_Model_Preference::GetDefaultLocale();
|
||||
|
||||
|
||||
Application_Model_Locale::configureLocalization($request->getcookie('airtime_locale', $stationLocale));
|
||||
|
||||
//uses separate layout without a navigation.
|
||||
|
@ -187,25 +184,24 @@ class LoginController extends Zend_Controller_Action
|
|||
$this->_helper->layout->setLayout('login');
|
||||
|
||||
$request = $this->getRequest();
|
||||
$token = $request->getParam("token", false);
|
||||
$user_id = $request->getParam("user_id", 0);
|
||||
$token = $request->getParam('token', false);
|
||||
$user_id = $request->getParam('user_id', 0);
|
||||
|
||||
$form = new Application_Form_PasswordChange();
|
||||
$auth = new Application_Model_Auth();
|
||||
$user = CcSubjsQuery::create()->findPK($user_id);
|
||||
|
||||
|
||||
$stationLocale = Application_Model_Preference::GetDefaultLocale();
|
||||
|
||||
Application_Model_Locale::configureLocalization($request->getcookie('airtime_locale', $stationLocale));
|
||||
|
||||
//check validity of token
|
||||
if (!$auth->checkToken($user_id, $token, 'password.restore')) {
|
||||
Logging::debug("token not valid");
|
||||
Logging::debug('token not valid');
|
||||
$this->_helper->redirector('index', 'login');
|
||||
}
|
||||
|
||||
if ($request->isPost() && $form->isValid($request->getPost())) {
|
||||
|
||||
$user->setDbPass(md5($form->password->getValue()));
|
||||
$user->save();
|
||||
|
||||
|
@ -216,7 +212,8 @@ class LoginController extends Zend_Controller_Action
|
|||
|
||||
$authAdapter = Application_Model_Auth::getAuthAdapter();
|
||||
$authAdapter->setIdentity($user->getDbLogin())
|
||||
->setCredential($form->password->getValue());
|
||||
->setCredential($form->password->getValue())
|
||||
;
|
||||
|
||||
$zend_auth->authenticate($authAdapter);
|
||||
|
||||
|
@ -234,18 +231,20 @@ class LoginController extends Zend_Controller_Action
|
|||
}
|
||||
|
||||
/**
|
||||
* populates view with results from a login error and adds a new form
|
||||
* populates view with results from a login error and adds a new form.
|
||||
*
|
||||
* @param string $username user that failed to login
|
||||
*
|
||||
* @param String $username user that failed to login
|
||||
* @return new form
|
||||
*/
|
||||
private function loginError($username)
|
||||
{
|
||||
$this->view->message = _("Wrong username or password provided. Please try again.");
|
||||
$this->view->message = _('Wrong username or password provided. Please try again.');
|
||||
Application_Model_Subjects::increaseLoginAttempts($username);
|
||||
Application_Model_LoginAttempts::increaseAttempts($_SERVER['REMOTE_ADDR']);
|
||||
$form = new Application_Form_Login();
|
||||
$form = new Application_Form_Login();
|
||||
$this->view->error = true;
|
||||
|
||||
return $form;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,37 +1,36 @@
|
|||
<?php
|
||||
|
||||
|
||||
class PlaylistController extends Zend_Controller_Action
|
||||
{
|
||||
|
||||
public function init()
|
||||
{
|
||||
$ajaxContext = $this->_helper->getHelper('AjaxContext');
|
||||
$ajaxContext->addActionContext('add-items', 'json')
|
||||
->addActionContext('move-items', 'json')
|
||||
->addActionContext('delete-items', 'json')
|
||||
->addActionContext('set-fade', 'json')
|
||||
->addActionContext('set-crossfade', 'json')
|
||||
->addActionContext('set-cue', 'json')
|
||||
->addActionContext('new', 'json')
|
||||
->addActionContext('edit', 'json')
|
||||
->addActionContext('delete', 'json')
|
||||
->addActionContext('close-playlist', 'json')
|
||||
->addActionContext('play', 'json')
|
||||
->addActionContext('set-playlist-fades', 'json')
|
||||
->addActionContext('get-playlist-fades', 'json')
|
||||
->addActionContext('set-playlist-name', 'json')
|
||||
->addActionContext('set-playlist-description', 'json')
|
||||
->addActionContext('playlist-preview', 'json')
|
||||
->addActionContext('get-playlist', 'json')
|
||||
->addActionContext('save', 'json')
|
||||
->addActionContext('smart-block-generate', 'json')
|
||||
->addActionContext('smart-block-shuffle', 'json')
|
||||
->addActionContext('get-block-info', 'json')
|
||||
->addActionContext('shuffle', 'json')
|
||||
->addActionContext('empty-content', 'json')
|
||||
->addActionContext('change-playlist', 'json')
|
||||
->initContext();
|
||||
->addActionContext('move-items', 'json')
|
||||
->addActionContext('delete-items', 'json')
|
||||
->addActionContext('set-fade', 'json')
|
||||
->addActionContext('set-crossfade', 'json')
|
||||
->addActionContext('set-cue', 'json')
|
||||
->addActionContext('new', 'json')
|
||||
->addActionContext('edit', 'json')
|
||||
->addActionContext('delete', 'json')
|
||||
->addActionContext('close-playlist', 'json')
|
||||
->addActionContext('play', 'json')
|
||||
->addActionContext('set-playlist-fades', 'json')
|
||||
->addActionContext('get-playlist-fades', 'json')
|
||||
->addActionContext('set-playlist-name', 'json')
|
||||
->addActionContext('set-playlist-description', 'json')
|
||||
->addActionContext('playlist-preview', 'json')
|
||||
->addActionContext('get-playlist', 'json')
|
||||
->addActionContext('save', 'json')
|
||||
->addActionContext('smart-block-generate', 'json')
|
||||
->addActionContext('smart-block-shuffle', 'json')
|
||||
->addActionContext('get-block-info', 'json')
|
||||
->addActionContext('shuffle', 'json')
|
||||
->addActionContext('empty-content', 'json')
|
||||
->addActionContext('change-playlist', 'json')
|
||||
->initContext()
|
||||
;
|
||||
|
||||
//This controller writes to the session all over the place, so we're going to reopen it for writing here.
|
||||
SessionHelper::reopenSessionForWriting();
|
||||
|
@ -48,9 +47,10 @@ class PlaylistController extends Zend_Controller_Action
|
|||
$obj = new $objInfo['className']($obj_sess->id);
|
||||
|
||||
$modified = $this->_getParam('modified', null);
|
||||
if ($obj->getLastModified("U") !== $modified) {
|
||||
if ($obj->getLastModified('U') !== $modified) {
|
||||
$this->createFullResponse($obj);
|
||||
throw new PlaylistOutDatedException(sprintf(_("You are viewing an older version of %s"), $obj->getName()));
|
||||
|
||||
throw new PlaylistOutDatedException(sprintf(_('You are viewing an older version of %s'), $obj->getName()));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -71,20 +71,23 @@ class PlaylistController extends Zend_Controller_Action
|
|||
$this->view->html = $this->view->render('playlist/update.phtml');
|
||||
$this->view->name = $obj->getName();
|
||||
$this->view->description = $obj->getDescription();
|
||||
$this->view->modified = $obj->getLastModified("U");
|
||||
$this->view->modified = $obj->getLastModified('U');
|
||||
unset($this->view->obj);
|
||||
}
|
||||
|
||||
private function createFullResponse($obj = null, $isJson = false,
|
||||
$formIsValid = false)
|
||||
{
|
||||
private function createFullResponse(
|
||||
$obj = null,
|
||||
$isJson = false,
|
||||
$formIsValid = false
|
||||
) {
|
||||
$user = Application_Model_User::getCurrentUser();
|
||||
$isAdminOrPM = $user->isUserType(array(UTYPE_SUPERADMIN, UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER));
|
||||
$isAdminOrPM = $user->isUserType([UTYPE_SUPERADMIN, UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER]);
|
||||
|
||||
if (!$isAdminOrPM && $obj->getCreatorId() != $user->getId()) {
|
||||
$this->view->objType = $obj instanceof Application_Model_Block ? "block" : "playlist";
|
||||
$this->view->objType = $obj instanceof Application_Model_Block ? 'block' : 'playlist';
|
||||
$this->view->obj = $obj;
|
||||
$this->view->html = $this->view->render('playlist/permission-denied.phtml');
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -109,26 +112,24 @@ class PlaylistController extends Zend_Controller_Action
|
|||
|
||||
if ($isJson) {
|
||||
return $this->view->render($viewPath);
|
||||
} else {
|
||||
$this->view->html = $this->view->render($viewPath);
|
||||
}
|
||||
$this->view->html = $this->view->render($viewPath);
|
||||
} else {
|
||||
$this->view->obj = $obj;
|
||||
//$this->view->type = "pl";
|
||||
$this->view->id = $obj->getId();
|
||||
if ($isJson) {
|
||||
return $this->view->html = $this->view->render($viewPath);
|
||||
} else {
|
||||
$this->view->html = $this->view->render($viewPath);
|
||||
}
|
||||
$this->view->html = $this->view->render($viewPath);
|
||||
|
||||
unset($this->view->obj);
|
||||
}
|
||||
} else {
|
||||
if ($isJson) {
|
||||
return $this->view->render($viewPath);
|
||||
} else {
|
||||
$this->view->html = $this->view->render($viewPath);
|
||||
}
|
||||
$this->view->html = $this->view->render($viewPath);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -139,22 +140,22 @@ class PlaylistController extends Zend_Controller_Action
|
|||
|
||||
private function blockDynamic($obj)
|
||||
{
|
||||
$this->view->error = _("You cannot add tracks to dynamic blocks.");
|
||||
$this->view->error = _('You cannot add tracks to dynamic blocks.');
|
||||
$this->createFullResponse($obj);
|
||||
}
|
||||
|
||||
private function playlistNotFound($p_type, $p_isJson = false)
|
||||
{
|
||||
$p_type = ucfirst($p_type);
|
||||
$this->view->error = sprintf(_("%s not found"), $p_type);
|
||||
$this->view->error = sprintf(_('%s not found'), $p_type);
|
||||
|
||||
Logging::info("{$p_type} not found");
|
||||
Application_Model_Library::changePlaylist(null, $p_type);
|
||||
|
||||
|
||||
if (!$p_isJson) {
|
||||
$this->createFullResponse(null);
|
||||
} else {
|
||||
$this->_helper->json->sendJson(array("error"=>$this->view->error, "result"=>1, "html"=>$this->createFullResponse(null, $p_isJson)));
|
||||
$this->_helper->json->sendJson(['error' => $this->view->error, 'result' => 1, 'html' => $this->createFullResponse(null, $p_isJson)]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -167,19 +168,19 @@ class PlaylistController extends Zend_Controller_Action
|
|||
|
||||
private function playlistUnknownError($e)
|
||||
{
|
||||
$this->view->error = _("Something went wrong.");
|
||||
$this->view->error = _('Something went wrong.');
|
||||
Logging::info($e->getMessage());
|
||||
}
|
||||
|
||||
private function wrongTypeToBlock($obj)
|
||||
{
|
||||
$this->view->error = _("You can only add tracks to smart block.");
|
||||
$this->view->error = _('You can only add tracks to smart block.');
|
||||
$this->createFullResponse($obj);
|
||||
}
|
||||
|
||||
private function wrongTypeToPlaylist($obj)
|
||||
{
|
||||
$this->view->error = _("You can only add tracks, smart blocks, and webstreams to playlists.");
|
||||
$this->view->error = _('You can only add tracks, smart blocks, and webstreams to playlists.');
|
||||
$this->createFullResponse($obj);
|
||||
}
|
||||
|
||||
|
@ -204,7 +205,8 @@ class PlaylistController extends Zend_Controller_Action
|
|||
$this->createFullResponse($obj);
|
||||
}
|
||||
|
||||
public function changePlaylistAction() {
|
||||
public function changePlaylistAction()
|
||||
{
|
||||
$this->view->layout()->disableLayout(); // Don't inject the standard Now Playing header.
|
||||
$this->_helper->viewRenderer->setNoRender(true); // Don't use (phtml) templates
|
||||
|
||||
|
@ -236,30 +238,31 @@ class PlaylistController extends Zend_Controller_Action
|
|||
|
||||
public function deleteAction()
|
||||
{
|
||||
$ids = $this->_getParam('ids');
|
||||
$ids = (!is_array($ids)) ? array($ids) : $ids;
|
||||
$ids = $this->_getParam('ids');
|
||||
$ids = (!is_array($ids)) ? [$ids] : $ids;
|
||||
$type = $this->_getParam('type');
|
||||
|
||||
$obj = null;
|
||||
$obj = null;
|
||||
|
||||
$objInfo = Application_Model_Library::getObjInfo($type);
|
||||
$objInfo = Application_Model_Library::getObjInfo($type);
|
||||
|
||||
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
|
||||
|
||||
$obj_sess = new Zend_Session_Namespace(
|
||||
UI_PLAYLISTCONTROLLER_OBJ_SESSNAME);
|
||||
UI_PLAYLISTCONTROLLER_OBJ_SESSNAME
|
||||
);
|
||||
|
||||
try {
|
||||
Logging::info("Currently active {$type} {$obj_sess->id}");
|
||||
if (in_array($obj_sess->id, $ids)) {
|
||||
Logging::info("Deleting currently active {$type}");
|
||||
// Application_Model_Library::changePlaylist(null, $type);
|
||||
// Application_Model_Library::changePlaylist(null, $type);
|
||||
} else {
|
||||
Logging::info("Not deleting currently active {$type}");
|
||||
$obj = new $objInfo['className']($obj_sess->id);
|
||||
}
|
||||
|
||||
if (strcmp($objInfo['className'], 'Application_Model_Playlist')==0) {
|
||||
if (strcmp($objInfo['className'], 'Application_Model_Playlist') == 0) {
|
||||
Application_Model_Playlist::deletePlaylists($ids, $userInfo->id);
|
||||
} else {
|
||||
Application_Model_Block::deleteBlocks($ids, $userInfo->id);
|
||||
|
@ -276,7 +279,8 @@ class PlaylistController extends Zend_Controller_Action
|
|||
}
|
||||
}
|
||||
|
||||
public function closePlaylistAction() {
|
||||
public function closePlaylistAction()
|
||||
{
|
||||
$type = $this->_getParam('type');
|
||||
$obj = null;
|
||||
Application_Model_Library::changePlaylist($obj, $type);
|
||||
|
@ -285,8 +289,8 @@ class PlaylistController extends Zend_Controller_Action
|
|||
|
||||
public function addItemsAction()
|
||||
{
|
||||
$ids = $this->_getParam('aItems', array());
|
||||
$ids = (!is_array($ids)) ? array($ids) : $ids;
|
||||
$ids = $this->_getParam('aItems', []);
|
||||
$ids = (!is_array($ids)) ? [$ids] : $ids;
|
||||
$afterItem = $this->_getParam('afterItem', null);
|
||||
$addType = $this->_getParam('type', 'after');
|
||||
// this is the obj type of destination
|
||||
|
@ -298,7 +302,7 @@ class PlaylistController extends Zend_Controller_Action
|
|||
foreach ($ids as $id) {
|
||||
if (is_array($id) && isset($id[1])) {
|
||||
if ($id[1] == 'playlist') {
|
||||
throw new WrongTypeToPlaylistException;
|
||||
throw new WrongTypeToPlaylistException();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -309,13 +313,13 @@ class PlaylistController extends Zend_Controller_Action
|
|||
foreach ($ids as $id) {
|
||||
if (is_array($id) && isset($id[1])) {
|
||||
if ($id[1] != 'audioclip') {
|
||||
throw new WrongTypeToBlockException;
|
||||
throw new WrongTypeToBlockException();
|
||||
}
|
||||
}
|
||||
}
|
||||
$obj->addAudioClips($ids, $afterItem, $addType);
|
||||
} else {
|
||||
throw new BlockDynamicException;
|
||||
throw new BlockDynamicException();
|
||||
}
|
||||
$this->createUpdateResponse($obj);
|
||||
} catch (PlaylistOutDatedException $e) {
|
||||
|
@ -338,7 +342,7 @@ class PlaylistController extends Zend_Controller_Action
|
|||
public function moveItemsAction()
|
||||
{
|
||||
$ids = $this->_getParam('ids');
|
||||
$ids = (!is_array($ids)) ? array($ids) : $ids;
|
||||
$ids = (!is_array($ids)) ? [$ids] : $ids;
|
||||
$afterItem = $this->_getParam('afterItem', null);
|
||||
$type = $this->_getParam('obj_type');
|
||||
|
||||
|
@ -358,7 +362,7 @@ class PlaylistController extends Zend_Controller_Action
|
|||
public function deleteItemsAction()
|
||||
{
|
||||
$ids = $this->_getParam('ids');
|
||||
$ids = (!is_array($ids)) ? array($ids) : $ids;
|
||||
$ids = (!is_array($ids)) ? [$ids] : $ids;
|
||||
$modified = $this->_getParam('modified');
|
||||
$type = $this->_getParam('obj_type');
|
||||
|
||||
|
@ -374,10 +378,11 @@ class PlaylistController extends Zend_Controller_Action
|
|||
$this->playlistUnknownError($e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function emptyContentAction()
|
||||
{
|
||||
$type = $this->_getParam('obj_type');
|
||||
|
||||
try {
|
||||
$obj = $this->getPlaylist($type);
|
||||
if ($type == 'playlist') {
|
||||
|
@ -406,12 +411,12 @@ class PlaylistController extends Zend_Controller_Action
|
|||
$obj = $this->getPlaylist($type);
|
||||
$response = $obj->changeClipLength($id, $cueIn, $cueOut);
|
||||
|
||||
if (!isset($response["error"])) {
|
||||
if (!isset($response['error'])) {
|
||||
$this->view->response = $response;
|
||||
$this->createUpdateResponse($obj);
|
||||
} else {
|
||||
$this->view->cue_error = $response["error"];
|
||||
$this->view->code = $response["type"];
|
||||
$this->view->cue_error = $response['error'];
|
||||
$this->view->code = $response['type'];
|
||||
}
|
||||
} catch (PlaylistOutDatedException $e) {
|
||||
$this->playlistOutdated($e);
|
||||
|
@ -433,11 +438,11 @@ class PlaylistController extends Zend_Controller_Action
|
|||
$obj = $this->getPlaylist($type);
|
||||
$response = $obj->changeFadeInfo($id, $fadeIn, $fadeOut);
|
||||
|
||||
if (!isset($response["error"])) {
|
||||
if (!isset($response['error'])) {
|
||||
$this->createUpdateResponse($obj);
|
||||
$this->view->response = $response;
|
||||
} else {
|
||||
$this->view->fade_error = $response["error"];
|
||||
$this->view->fade_error = $response['error'];
|
||||
}
|
||||
} catch (PlaylistOutDatedException $e) {
|
||||
$this->playlistOutdated($e);
|
||||
|
@ -447,7 +452,7 @@ class PlaylistController extends Zend_Controller_Action
|
|||
$this->playlistUnknownError($e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function setCrossfadeAction()
|
||||
{
|
||||
$id1 = $this->_getParam('id1', null);
|
||||
|
@ -456,15 +461,15 @@ class PlaylistController extends Zend_Controller_Action
|
|||
$fadeIn = $this->_getParam('fadeIn', 0);
|
||||
$fadeOut = $this->_getParam('fadeOut', 0);
|
||||
$offset = $this->_getParam('offset', 0);
|
||||
|
||||
|
||||
try {
|
||||
$obj = $this->getPlaylist($type);
|
||||
$response = $obj->createCrossfade($id1, $fadeOut, $id2, $fadeIn, $offset);
|
||||
|
||||
if (!isset($response["error"])) {
|
||||
|
||||
if (!isset($response['error'])) {
|
||||
$this->createUpdateResponse($obj);
|
||||
} else {
|
||||
$this->view->error = $response["error"];
|
||||
$this->view->error = $response['error'];
|
||||
}
|
||||
} catch (PlaylistOutDatedException $e) {
|
||||
$this->playlistOutdated($e);
|
||||
|
@ -478,12 +483,13 @@ class PlaylistController extends Zend_Controller_Action
|
|||
public function getPlaylistFadesAction()
|
||||
{
|
||||
$type = $this->_getParam('type');
|
||||
|
||||
try {
|
||||
$obj = $this->getPlaylist($type);
|
||||
$fades = $obj->getFadeInfo(0);
|
||||
$this->view->fadeIn = $fades[0];
|
||||
|
||||
$fades = $obj->getFadeInfo($obj->getSize()-1);
|
||||
$fades = $obj->getFadeInfo($obj->getSize() - 1);
|
||||
$this->view->fadeOut = $fades[1];
|
||||
} catch (PlaylistOutDatedException $e) {
|
||||
$this->playlistOutdated($e);
|
||||
|
@ -498,7 +504,7 @@ class PlaylistController extends Zend_Controller_Action
|
|||
* The playlist fades are stored in the elements themselves.
|
||||
* The fade in is set to the first elements fade in and
|
||||
* the fade out is set to the last elements fade out.
|
||||
**/
|
||||
*/
|
||||
public function setPlaylistFadesAction()
|
||||
{
|
||||
$fadeIn = $this->_getParam('fadeIn', null);
|
||||
|
@ -508,7 +514,7 @@ class PlaylistController extends Zend_Controller_Action
|
|||
try {
|
||||
$obj = $this->getPlaylist($type);
|
||||
$obj->setfades($fadeIn, $fadeOut);
|
||||
$this->view->modified = $obj->getLastModified("U");
|
||||
$this->view->modified = $obj->getLastModified('U');
|
||||
} catch (PlaylistOutDatedException $e) {
|
||||
$this->playlistOutdated($e);
|
||||
} catch (PlaylistNotFoundException $e) {
|
||||
|
@ -521,7 +527,7 @@ class PlaylistController extends Zend_Controller_Action
|
|||
public function setPlaylistNameDescAction()
|
||||
{
|
||||
$name = $this->_getParam('name', _('Unknown Playlist'));
|
||||
$description = $this->_getParam('description', "");
|
||||
$description = $this->_getParam('description', '');
|
||||
$type = $this->_getParam('type');
|
||||
|
||||
try {
|
||||
|
@ -530,7 +536,7 @@ class PlaylistController extends Zend_Controller_Action
|
|||
$obj->setDescription($description);
|
||||
$this->view->description = $description;
|
||||
$this->view->playlistName = $name;
|
||||
$this->view->modified = $obj->getLastModified("U");
|
||||
$this->view->modified = $obj->getLastModified('U');
|
||||
} catch (PlaylistOutDatedException $e) {
|
||||
$this->playlistOutdated($e);
|
||||
} catch (PlaylistNotFoundException $e) {
|
||||
|
@ -544,7 +550,7 @@ class PlaylistController extends Zend_Controller_Action
|
|||
{
|
||||
$request = $this->getRequest();
|
||||
$params = $request->getPost();
|
||||
$result = array();
|
||||
$result = [];
|
||||
|
||||
if ($params['type'] == 'block') {
|
||||
try {
|
||||
|
@ -559,9 +565,7 @@ class PlaylistController extends Zend_Controller_Action
|
|||
$bl->saveSmartBlockCriteria($params['data']);
|
||||
$this->createUpdateResponse($bl, true);
|
||||
$this->view->result = 0;
|
||||
/*
|
||||
$result['html'] = $this->createFullResponse($bl, true, true);
|
||||
*/
|
||||
// $result['html'] = $this->createFullResponse($bl, true, true);
|
||||
} else {
|
||||
$this->view->form = $form;
|
||||
$this->view->unsavedName = $params['name'];
|
||||
|
@ -575,14 +579,13 @@ class PlaylistController extends Zend_Controller_Action
|
|||
$this->view->name = $bl->getName();
|
||||
//$this->view->type = "sb";
|
||||
$this->view->id = $bl->getId();
|
||||
$this->view->modified = $bl->getLastModified("U");
|
||||
} else if ($params['type'] == 'playlist') {
|
||||
$this->view->modified = $bl->getLastModified('U');
|
||||
} elseif ($params['type'] == 'playlist') {
|
||||
$this->setPlaylistNameDescAction();
|
||||
$this->view->modified = $this->view->modified;
|
||||
$this->view->name = $params['name'];
|
||||
}
|
||||
|
||||
|
||||
//$this->_helper->json->sendJson($result);
|
||||
}
|
||||
|
||||
|
@ -590,18 +593,18 @@ class PlaylistController extends Zend_Controller_Action
|
|||
{
|
||||
$request = $this->getRequest();
|
||||
$params = $request->getPost();
|
||||
|
||||
|
||||
//make sure block exists
|
||||
try {
|
||||
$bl = new Application_Model_Block($params['obj_id']);
|
||||
|
||||
|
||||
$form = new Application_Form_SmartBlockCriteria();
|
||||
$form->startForm($params['obj_id']);
|
||||
if ($form->isValid($params)) {
|
||||
$result = $bl->generateSmartBlock($params['data']);
|
||||
$this->view->result = $result['result'];
|
||||
$this->createUpdateResponse($bl, true);
|
||||
#$this->_helper->json->sendJson(array("result"=>0, "html"=>$this->createFullResponse($bl, true, true)));
|
||||
//$this->_helper->json->sendJson(array("result"=>0, "html"=>$this->createFullResponse($bl, true, true)));
|
||||
} else {
|
||||
$this->view->obj = $bl;
|
||||
$this->view->id = $bl->getId();
|
||||
|
@ -620,12 +623,13 @@ class PlaylistController extends Zend_Controller_Action
|
|||
{
|
||||
$request = $this->getRequest();
|
||||
$params = $request->getPost();
|
||||
|
||||
try {
|
||||
$bl = new Application_Model_Block($params['obj_id']);
|
||||
$result = $bl->shuffleSmartBlock();
|
||||
|
||||
$this->view->result = $result["result"];
|
||||
$this->createUpdateResponse($bl,true);
|
||||
$this->view->result = $result['result'];
|
||||
$this->createUpdateResponse($bl, true);
|
||||
|
||||
/*
|
||||
if ($result['result'] == 0) {
|
||||
|
@ -643,17 +647,18 @@ class PlaylistController extends Zend_Controller_Action
|
|||
$this->playlistUnknownError($e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function shuffleAction()
|
||||
{
|
||||
$request = $this->getRequest();
|
||||
$params = $request->getPost();
|
||||
|
||||
try {
|
||||
$pl = new Application_Model_Playlist($params['obj_id']);
|
||||
$result = $pl->shuffle();
|
||||
|
||||
$this->view->result = $result["result"];
|
||||
$this->createUpdateResponse($pl,true);
|
||||
$this->view->result = $result['result'];
|
||||
$this->createUpdateResponse($pl, true);
|
||||
/*
|
||||
if ($result['result'] == 0) {
|
||||
$this->_helper->json->sendJson(array(
|
||||
|
@ -685,6 +690,12 @@ class PlaylistController extends Zend_Controller_Action
|
|||
$this->_helper->json->sendJson($out);
|
||||
}
|
||||
}
|
||||
class WrongTypeToBlockException extends Exception {}
|
||||
class WrongTypeToPlaylistException extends Exception {}
|
||||
class BlockDynamicException extends Exception {}
|
||||
class WrongTypeToBlockException extends Exception
|
||||
{
|
||||
}
|
||||
class WrongTypeToPlaylistException extends Exception
|
||||
{
|
||||
}
|
||||
class BlockDynamicException extends Exception
|
||||
{
|
||||
}
|
||||
|
|
|
@ -16,9 +16,10 @@ class PlayouthistoryController extends Zend_Controller_Action
|
|||
->addActionContext('delete-list-items', 'json')
|
||||
->addActionContext('update-list-item', 'json')
|
||||
->addActionContext('update-file-item', 'json')
|
||||
->initContext();
|
||||
->initContext()
|
||||
;
|
||||
}
|
||||
|
||||
|
||||
public function indexAction()
|
||||
{
|
||||
$CC_CONFIG = Config::getConfig();
|
||||
|
@ -27,48 +28,48 @@ class PlayouthistoryController extends Zend_Controller_Action
|
|||
Zend_Layout::getMvcInstance()->assign('parent_page', 'Analytics');
|
||||
|
||||
list($startsDT, $endsDT) = Application_Common_HTTPHelper::getStartEndFromRequest($this->getRequest());
|
||||
|
||||
|
||||
$userTimezone = new DateTimeZone(Application_Model_Preference::GetUserTimezone());
|
||||
$startsDT->setTimezone($userTimezone);
|
||||
$endsDT->setTimezone($userTimezone);
|
||||
|
||||
$form = new Application_Form_DateRange();
|
||||
$form->populate(array(
|
||||
'his_date_start' => $startsDT->format("Y-m-d"),
|
||||
'his_time_start' => $startsDT->format("H:i"),
|
||||
'his_date_end' => $endsDT->format("Y-m-d"),
|
||||
'his_time_end' => $endsDT->format("H:i")
|
||||
));
|
||||
$form->populate([
|
||||
'his_date_start' => $startsDT->format('Y-m-d'),
|
||||
'his_time_start' => $startsDT->format('H:i'),
|
||||
'his_date_end' => $endsDT->format('Y-m-d'),
|
||||
'his_time_end' => $endsDT->format('H:i'),
|
||||
]);
|
||||
|
||||
$this->view->date_form = $form;
|
||||
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/contextmenu/jquery.contextMenu.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/datatables/js/jquery.dataTables.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/datatables/plugin/dataTables.pluginAPI.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/datatables/plugin/dataTables.fnSetFilteringDelay.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl . 'js/contextmenu/jquery.contextMenu.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl . 'js/datatables/js/jquery.dataTables.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl . 'js/datatables/plugin/dataTables.pluginAPI.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl . 'js/datatables/plugin/dataTables.fnSetFilteringDelay.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/timepicker/jquery.ui.timepicker.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/bootstrap-datetime/bootstrap-datetimepicker.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/airtime/buttons/buttons.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/airtime/utilities/utilities.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/libs/CSVexport.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/libs/pdfmake.min.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/libs/vfs_fonts.min.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/airtime/playouthistory/historytable.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl . 'js/timepicker/jquery.ui.timepicker.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl . 'js/bootstrap-datetime/bootstrap-datetimepicker.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl . 'js/airtime/buttons/buttons.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl . 'js/airtime/utilities/utilities.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl . 'js/libs/CSVexport.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl . 'js/libs/pdfmake.min.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl . 'js/libs/vfs_fonts.min.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl . 'js/airtime/playouthistory/historytable.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
|
||||
$this->view->headLink()->appendStylesheet($baseUrl.'css/bootstrap-datetimepicker.min.css?'.$CC_CONFIG['airtime_version']);
|
||||
$this->view->headLink()->appendStylesheet($baseUrl.'css/jquery.ui.timepicker.css?'.$CC_CONFIG['airtime_version']);
|
||||
$this->view->headLink()->appendStylesheet($baseUrl.'css/playouthistory.css?'.$CC_CONFIG['airtime_version']);
|
||||
$this->view->headLink()->appendStylesheet($baseUrl.'css/history_styles.css?'.$CC_CONFIG['airtime_version']);
|
||||
$this->view->headLink()->appendStylesheet($baseUrl.'css/jquery.contextMenu.css?'.$CC_CONFIG['airtime_version']);
|
||||
$this->view->headLink()->appendStylesheet($baseUrl . 'css/bootstrap-datetimepicker.min.css?' . $CC_CONFIG['airtime_version']);
|
||||
$this->view->headLink()->appendStylesheet($baseUrl . 'css/jquery.ui.timepicker.css?' . $CC_CONFIG['airtime_version']);
|
||||
$this->view->headLink()->appendStylesheet($baseUrl . 'css/playouthistory.css?' . $CC_CONFIG['airtime_version']);
|
||||
$this->view->headLink()->appendStylesheet($baseUrl . 'css/history_styles.css?' . $CC_CONFIG['airtime_version']);
|
||||
$this->view->headLink()->appendStylesheet($baseUrl . 'css/jquery.contextMenu.css?' . $CC_CONFIG['airtime_version']);
|
||||
|
||||
//set datatables columns for display of data.
|
||||
$historyService = new Application_Service_HistoryService();
|
||||
$columns = json_encode($historyService->getDatatablesLogSheetColumns());
|
||||
$script = "localStorage.setItem( 'datatables-historyitem-aoColumns', JSON.stringify($columns) ); ";
|
||||
$script = "localStorage.setItem( 'datatables-historyitem-aoColumns', JSON.stringify({$columns}) ); ";
|
||||
|
||||
$columns = json_encode($historyService->getDatatablesFileSummaryColumns());
|
||||
$script.= "localStorage.setItem( 'datatables-historyfile-aoColumns', JSON.stringify($columns) );";
|
||||
$script .= "localStorage.setItem( 'datatables-historyfile-aoColumns', JSON.stringify({$columns}) );";
|
||||
$this->view->headScript()->appendScript($script);
|
||||
|
||||
$user = Application_Model_User::getCurrentUser();
|
||||
|
@ -77,109 +78,104 @@ class PlayouthistoryController extends Zend_Controller_Action
|
|||
|
||||
public function fileHistoryFeedAction()
|
||||
{
|
||||
try {
|
||||
$request = $this->getRequest();
|
||||
$params = $request->getParams();
|
||||
$instance = $request->getParam("instance_id", null);
|
||||
|
||||
try {
|
||||
$request = $this->getRequest();
|
||||
$params = $request->getParams();
|
||||
$instance = $request->getParam('instance_id', null);
|
||||
|
||||
list($startsDT, $endsDT) = Application_Common_HTTPHelper::getStartEndFromRequest($request);
|
||||
|
||||
$historyService = new Application_Service_HistoryService();
|
||||
$r = $historyService->getFileSummaryData($startsDT, $endsDT, $params);
|
||||
$historyService = new Application_Service_HistoryService();
|
||||
$r = $historyService->getFileSummaryData($startsDT, $endsDT, $params);
|
||||
|
||||
$this->view->sEcho = $r["sEcho"];
|
||||
$this->view->iTotalDisplayRecords = $r["iTotalDisplayRecords"];
|
||||
$this->view->iTotalRecords = $r["iTotalRecords"];
|
||||
$this->view->history = $r["history"];
|
||||
$this->view->sEcho = $r['sEcho'];
|
||||
$this->view->iTotalDisplayRecords = $r['iTotalDisplayRecords'];
|
||||
$this->view->iTotalRecords = $r['iTotalRecords'];
|
||||
$this->view->history = $r['history'];
|
||||
$this->view->history = SecurityHelper::htmlescape_recursive($this->view->history);
|
||||
}
|
||||
catch (Exception $e) {
|
||||
Logging::info($e);
|
||||
Logging::info($e->getMessage());
|
||||
} catch (Exception $e) {
|
||||
Logging::info($e);
|
||||
Logging::info($e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public function itemHistoryFeedAction()
|
||||
{
|
||||
try {
|
||||
$request = $this->getRequest();
|
||||
$params = $request->getParams();
|
||||
$instance = $request->getParam("instance_id", null);
|
||||
|
||||
try {
|
||||
$request = $this->getRequest();
|
||||
$params = $request->getParams();
|
||||
$instance = $request->getParam('instance_id', null);
|
||||
|
||||
list($startsDT, $endsDT) = Application_Common_HTTPHelper::getStartEndFromRequest($request);
|
||||
|
||||
$historyService = new Application_Service_HistoryService();
|
||||
$r = $historyService->getPlayedItemData($startsDT, $endsDT, $params, $instance);
|
||||
|
||||
$this->view->sEcho = $r["sEcho"];
|
||||
$this->view->iTotalDisplayRecords = $r["iTotalDisplayRecords"];
|
||||
$this->view->iTotalRecords = $r["iTotalRecords"];
|
||||
$this->view->history = $r["history"];
|
||||
$historyService = new Application_Service_HistoryService();
|
||||
$r = $historyService->getPlayedItemData($startsDT, $endsDT, $params, $instance);
|
||||
|
||||
$this->view->sEcho = $r['sEcho'];
|
||||
$this->view->iTotalDisplayRecords = $r['iTotalDisplayRecords'];
|
||||
$this->view->iTotalRecords = $r['iTotalRecords'];
|
||||
$this->view->history = $r['history'];
|
||||
$this->view->history = SecurityHelper::htmlescape_recursive($this->view->history);
|
||||
|
||||
} catch (Exception $e) {
|
||||
Logging::info($e);
|
||||
Logging::info($e->getMessage());
|
||||
}
|
||||
catch (Exception $e) {
|
||||
Logging::info($e);
|
||||
Logging::info($e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public function showHistoryFeedAction()
|
||||
{
|
||||
try {
|
||||
$request = $this->getRequest();
|
||||
$params = $request->getParams();
|
||||
$instance = $request->getParam("instance_id", null);
|
||||
|
||||
try {
|
||||
$request = $this->getRequest();
|
||||
$params = $request->getParams();
|
||||
$instance = $request->getParam('instance_id', null);
|
||||
|
||||
list($startsDT, $endsDT) = Application_Common_HTTPHelper::getStartEndFromRequest($request);
|
||||
|
||||
$historyService = new Application_Service_HistoryService();
|
||||
$shows = $historyService->getShowList($startsDT, $endsDT);
|
||||
$historyService = new Application_Service_HistoryService();
|
||||
$shows = $historyService->getShowList($startsDT, $endsDT);
|
||||
$shows = SecurityHelper::htmlescape_recursive($shows);
|
||||
|
||||
$this->_helper->json->sendJson($shows);
|
||||
}
|
||||
catch (Exception $e) {
|
||||
Logging::info($e);
|
||||
Logging::info($e->getMessage());
|
||||
}
|
||||
$this->_helper->json->sendJson($shows);
|
||||
} catch (Exception $e) {
|
||||
Logging::info($e);
|
||||
Logging::info($e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public function editFileItemAction()
|
||||
{
|
||||
$file_id = $this->_getParam('id');
|
||||
$file_id = $this->_getParam('id');
|
||||
|
||||
$historyService = new Application_Service_HistoryService();
|
||||
$form = $historyService->makeHistoryFileForm($file_id);
|
||||
$historyService = new Application_Service_HistoryService();
|
||||
$form = $historyService->makeHistoryFileForm($file_id);
|
||||
|
||||
$this->view->form = $form;
|
||||
$this->view->dialog = $this->view->render('playouthistory/dialog.phtml');
|
||||
$this->view->form = $form;
|
||||
$this->view->dialog = $this->view->render('playouthistory/dialog.phtml');
|
||||
|
||||
unset($this->view->form);
|
||||
unset($this->view->form);
|
||||
}
|
||||
|
||||
public function createListItemAction()
|
||||
{
|
||||
try {
|
||||
$request = $this->getRequest();
|
||||
$params = $request->getPost();
|
||||
Logging::info($params);
|
||||
try {
|
||||
$request = $this->getRequest();
|
||||
$params = $request->getPost();
|
||||
Logging::info($params);
|
||||
|
||||
$historyService = new Application_Service_HistoryService();
|
||||
$json = $historyService->createPlayedItem($params);
|
||||
$historyService = new Application_Service_HistoryService();
|
||||
$json = $historyService->createPlayedItem($params);
|
||||
|
||||
if (isset($json["form"])) {
|
||||
$this->view->form = $json["form"];
|
||||
$json["form"] = $this->view->render('playouthistory/dialog.phtml');
|
||||
if (isset($json['form'])) {
|
||||
$this->view->form = $json['form'];
|
||||
$json['form'] = $this->view->render('playouthistory/dialog.phtml');
|
||||
|
||||
unset($this->view->form);
|
||||
}
|
||||
unset($this->view->form);
|
||||
}
|
||||
|
||||
$this->_helper->json->sendJson($json);
|
||||
}
|
||||
catch (Exception $e) {
|
||||
Logging::info($e);
|
||||
Logging::info($e->getMessage());
|
||||
$this->_helper->json->sendJson($json);
|
||||
} catch (Exception $e) {
|
||||
Logging::info($e);
|
||||
Logging::info($e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -200,43 +196,42 @@ class PlayouthistoryController extends Zend_Controller_Action
|
|||
|
||||
public function deleteListItemAction()
|
||||
{
|
||||
$history_id = $this->_getParam('id');
|
||||
$history_id = $this->_getParam('id');
|
||||
|
||||
$historyService = new Application_Service_HistoryService();
|
||||
$historyService->deletePlayedItem($history_id);
|
||||
$historyService = new Application_Service_HistoryService();
|
||||
$historyService->deletePlayedItem($history_id);
|
||||
}
|
||||
|
||||
public function deleteListItemsAction()
|
||||
{
|
||||
$history_ids = $this->_getParam('ids');
|
||||
$history_ids = $this->_getParam('ids');
|
||||
|
||||
$historyService = new Application_Service_HistoryService();
|
||||
$historyService->deletePlayedItems($history_ids);
|
||||
$historyService = new Application_Service_HistoryService();
|
||||
$historyService->deletePlayedItems($history_ids);
|
||||
}
|
||||
|
||||
public function updateListItemAction()
|
||||
{
|
||||
try {
|
||||
$request = $this->getRequest();
|
||||
$params = $request->getPost();
|
||||
Logging::info($params);
|
||||
try {
|
||||
$request = $this->getRequest();
|
||||
$params = $request->getPost();
|
||||
Logging::info($params);
|
||||
|
||||
$historyService = new Application_Service_HistoryService();
|
||||
$json = $historyService->editPlayedItem($params);
|
||||
$historyService = new Application_Service_HistoryService();
|
||||
$json = $historyService->editPlayedItem($params);
|
||||
|
||||
if (isset($json["form"])) {
|
||||
$this->view->form = $json["form"];
|
||||
$json["form"] = $this->view->render('playouthistory/dialog.phtml');
|
||||
if (isset($json['form'])) {
|
||||
$this->view->form = $json['form'];
|
||||
$json['form'] = $this->view->render('playouthistory/dialog.phtml');
|
||||
|
||||
unset($this->view->form);
|
||||
}
|
||||
unset($this->view->form);
|
||||
}
|
||||
|
||||
$this->_helper->json->sendJson($json);
|
||||
}
|
||||
catch (Exception $e) {
|
||||
Logging::info($e);
|
||||
Logging::info($e->getMessage());
|
||||
}
|
||||
$this->_helper->json->sendJson($json);
|
||||
} catch (Exception $e) {
|
||||
Logging::info($e);
|
||||
Logging::info($e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public function updateFileItemAction()
|
||||
|
@ -245,9 +240,9 @@ class PlayouthistoryController extends Zend_Controller_Action
|
|||
$params = $request->getPost();
|
||||
Logging::info($params);
|
||||
|
||||
$historyService = new Application_Service_HistoryService();
|
||||
$json = $historyService->editPlayedFile($params);
|
||||
$historyService = new Application_Service_HistoryService();
|
||||
$json = $historyService->editPlayedFile($params);
|
||||
|
||||
$this->_helper->json->sendJson($json);
|
||||
$this->_helper->json->sendJson($json);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,138 +10,133 @@ class PlayouthistorytemplateController extends Zend_Controller_Action
|
|||
->addActionContext('update-template', 'json')
|
||||
->addActionContext('delete-template', 'json')
|
||||
->addActionContext('set-template-default', 'json')
|
||||
->initContext();
|
||||
}
|
||||
|
||||
public function indexAction()
|
||||
{
|
||||
$CC_CONFIG = Config::getConfig();
|
||||
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||
->initContext()
|
||||
;
|
||||
}
|
||||
|
||||
Zend_Layout::getMvcInstance()->assign('parent_page', 'Analytics');
|
||||
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/airtime/playouthistory/template.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headLink()->appendStylesheet($baseUrl.'css/history_styles.css?'.$CC_CONFIG['airtime_version']);
|
||||
|
||||
$historyService = new Application_Service_HistoryService();
|
||||
$this->view->template_list = $historyService->getListItemTemplates();
|
||||
$this->view->template_file = $historyService->getFileTemplates();
|
||||
$this->view->configured = $historyService->getConfiguredTemplateIds();
|
||||
}
|
||||
|
||||
public function configureTemplateAction() {
|
||||
|
||||
$CC_CONFIG = Config::getConfig();
|
||||
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||
public function indexAction()
|
||||
{
|
||||
$CC_CONFIG = Config::getConfig();
|
||||
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||
|
||||
Zend_Layout::getMvcInstance()->assign('parent_page', 'Analytics');
|
||||
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/airtime/playouthistory/configuretemplate.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headLink()->appendStylesheet($baseUrl.'css/history_styles.css?'.$CC_CONFIG['airtime_version']);
|
||||
|
||||
try {
|
||||
|
||||
$templateId = $this->_getParam('id');
|
||||
|
||||
$historyService = new Application_Service_HistoryService();
|
||||
$template = $historyService->loadTemplate($templateId);
|
||||
|
||||
$templateType = $template["type"];
|
||||
$supportedTypes = $historyService->getSupportedTemplateTypes();
|
||||
|
||||
if (!in_array($templateType, $supportedTypes)) {
|
||||
throw new Exception("Error: $templateType is not supported.");
|
||||
}
|
||||
|
||||
$getMandatoryFields = "mandatory".ucfirst($templateType)."Fields";
|
||||
$mandatoryFields = $historyService->$getMandatoryFields();
|
||||
|
||||
$this->view->template_id = $templateId;
|
||||
$this->view->template_name = $template["name"];
|
||||
$this->view->template_fields = $template["fields"];
|
||||
$this->view->template_type = $templateType;
|
||||
$this->view->fileMD = $historyService->getFileMetadataTypes();
|
||||
$this->view->fields = $historyService->getFieldTypes();
|
||||
$this->view->required_fields = $mandatoryFields;
|
||||
$this->view->configured = $historyService->getConfiguredTemplateIds();
|
||||
}
|
||||
catch (Exception $e) {
|
||||
Logging::info("Error?");
|
||||
Logging::info($e);
|
||||
Logging::info($e->getMessage());
|
||||
|
||||
$this->_forward('index', 'playouthistorytemplate');
|
||||
}
|
||||
}
|
||||
|
||||
public function createTemplateAction()
|
||||
{
|
||||
$templateType = $this->_getParam('type', null);
|
||||
|
||||
$request = $this->getRequest();
|
||||
$params = $request->getPost();
|
||||
|
||||
try {
|
||||
$historyService = new Application_Service_HistoryService();
|
||||
$supportedTypes = $historyService->getSupportedTemplateTypes();
|
||||
|
||||
if (!in_array($templateType, $supportedTypes)) {
|
||||
throw new Exception("Error: $templateType is not supported.");
|
||||
}
|
||||
|
||||
$id = $historyService->createTemplate($params);
|
||||
|
||||
$this->view->url = $this->view->baseUrl("Playouthistorytemplate/configure-template/id/{$id}");
|
||||
}
|
||||
catch (Exception $e) {
|
||||
Logging::info($e);
|
||||
Logging::info($e->getMessage());
|
||||
|
||||
$this->view->error = $e->getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
public function setTemplateDefaultAction()
|
||||
{
|
||||
$templateId = $this->_getParam('id', null);
|
||||
|
||||
try {
|
||||
$historyService = new Application_Service_HistoryService();
|
||||
$historyService->setConfiguredTemplate($templateId);
|
||||
}
|
||||
catch (Exception $e) {
|
||||
Logging::info($e);
|
||||
Logging::info($e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public function updateTemplateAction()
|
||||
{
|
||||
$templateId = $this->_getParam('id', null);
|
||||
$name = $this->_getParam('name', null);
|
||||
$fields = $this->_getParam('fields', array());
|
||||
|
||||
try {
|
||||
$historyService = new Application_Service_HistoryService();
|
||||
$historyService->updateItemTemplate($templateId, $name, $fields);
|
||||
}
|
||||
catch (Exception $e) {
|
||||
Logging::info($e);
|
||||
Logging::info($e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public function deleteTemplateAction()
|
||||
{
|
||||
$templateId = $this->_getParam('id');
|
||||
|
||||
try {
|
||||
$historyService = new Application_Service_HistoryService();
|
||||
$historyService->deleteTemplate($templateId);
|
||||
}
|
||||
catch (Exception $e) {
|
||||
Logging::info($e);
|
||||
Logging::info($e->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
Zend_Layout::getMvcInstance()->assign('parent_page', 'Analytics');
|
||||
|
||||
$this->view->headScript()->appendFile($baseUrl . 'js/airtime/playouthistory/template.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
$this->view->headLink()->appendStylesheet($baseUrl . 'css/history_styles.css?' . $CC_CONFIG['airtime_version']);
|
||||
|
||||
$historyService = new Application_Service_HistoryService();
|
||||
$this->view->template_list = $historyService->getListItemTemplates();
|
||||
$this->view->template_file = $historyService->getFileTemplates();
|
||||
$this->view->configured = $historyService->getConfiguredTemplateIds();
|
||||
}
|
||||
|
||||
public function configureTemplateAction()
|
||||
{
|
||||
$CC_CONFIG = Config::getConfig();
|
||||
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||
|
||||
Zend_Layout::getMvcInstance()->assign('parent_page', 'Analytics');
|
||||
|
||||
$this->view->headScript()->appendFile($baseUrl . 'js/airtime/playouthistory/configuretemplate.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
$this->view->headLink()->appendStylesheet($baseUrl . 'css/history_styles.css?' . $CC_CONFIG['airtime_version']);
|
||||
|
||||
try {
|
||||
$templateId = $this->_getParam('id');
|
||||
|
||||
$historyService = new Application_Service_HistoryService();
|
||||
$template = $historyService->loadTemplate($templateId);
|
||||
|
||||
$templateType = $template['type'];
|
||||
$supportedTypes = $historyService->getSupportedTemplateTypes();
|
||||
|
||||
if (!in_array($templateType, $supportedTypes)) {
|
||||
throw new Exception("Error: {$templateType} is not supported.");
|
||||
}
|
||||
|
||||
$getMandatoryFields = 'mandatory' . ucfirst($templateType) . 'Fields';
|
||||
$mandatoryFields = $historyService->{$getMandatoryFields}();
|
||||
|
||||
$this->view->template_id = $templateId;
|
||||
$this->view->template_name = $template['name'];
|
||||
$this->view->template_fields = $template['fields'];
|
||||
$this->view->template_type = $templateType;
|
||||
$this->view->fileMD = $historyService->getFileMetadataTypes();
|
||||
$this->view->fields = $historyService->getFieldTypes();
|
||||
$this->view->required_fields = $mandatoryFields;
|
||||
$this->view->configured = $historyService->getConfiguredTemplateIds();
|
||||
} catch (Exception $e) {
|
||||
Logging::info('Error?');
|
||||
Logging::info($e);
|
||||
Logging::info($e->getMessage());
|
||||
|
||||
$this->_forward('index', 'playouthistorytemplate');
|
||||
}
|
||||
}
|
||||
|
||||
public function createTemplateAction()
|
||||
{
|
||||
$templateType = $this->_getParam('type', null);
|
||||
|
||||
$request = $this->getRequest();
|
||||
$params = $request->getPost();
|
||||
|
||||
try {
|
||||
$historyService = new Application_Service_HistoryService();
|
||||
$supportedTypes = $historyService->getSupportedTemplateTypes();
|
||||
|
||||
if (!in_array($templateType, $supportedTypes)) {
|
||||
throw new Exception("Error: {$templateType} is not supported.");
|
||||
}
|
||||
|
||||
$id = $historyService->createTemplate($params);
|
||||
|
||||
$this->view->url = $this->view->baseUrl("Playouthistorytemplate/configure-template/id/{$id}");
|
||||
} catch (Exception $e) {
|
||||
Logging::info($e);
|
||||
Logging::info($e->getMessage());
|
||||
|
||||
$this->view->error = $e->getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
public function setTemplateDefaultAction()
|
||||
{
|
||||
$templateId = $this->_getParam('id', null);
|
||||
|
||||
try {
|
||||
$historyService = new Application_Service_HistoryService();
|
||||
$historyService->setConfiguredTemplate($templateId);
|
||||
} catch (Exception $e) {
|
||||
Logging::info($e);
|
||||
Logging::info($e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public function updateTemplateAction()
|
||||
{
|
||||
$templateId = $this->_getParam('id', null);
|
||||
$name = $this->_getParam('name', null);
|
||||
$fields = $this->_getParam('fields', []);
|
||||
|
||||
try {
|
||||
$historyService = new Application_Service_HistoryService();
|
||||
$historyService->updateItemTemplate($templateId, $name, $fields);
|
||||
} catch (Exception $e) {
|
||||
Logging::info($e);
|
||||
Logging::info($e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public function deleteTemplateAction()
|
||||
{
|
||||
$templateId = $this->_getParam('id');
|
||||
|
||||
try {
|
||||
$historyService = new Application_Service_HistoryService();
|
||||
$historyService->deleteTemplate($templateId);
|
||||
} catch (Exception $e) {
|
||||
Logging::info($e);
|
||||
Logging::info($e->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,9 +5,10 @@ class PluploadController extends Zend_Controller_Action
|
|||
public function init()
|
||||
{
|
||||
$ajaxContext = $this->_helper->getHelper('AjaxContext');
|
||||
$ajaxContext->addActionContext('upload', 'json')
|
||||
->addActionContext('recent-uploads', 'json')
|
||||
->initContext();
|
||||
$ajaxContext->addActionContext('upload', 'json')
|
||||
->addActionContext('recent-uploads', 'json')
|
||||
->initContext()
|
||||
;
|
||||
}
|
||||
|
||||
public function indexAction()
|
||||
|
@ -17,16 +18,16 @@ class PluploadController extends Zend_Controller_Action
|
|||
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||
$locale = Application_Model_Preference::GetLocale();
|
||||
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/datatables/js/jquery.dataTables.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/plupload/plupload.full.min.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/plupload/jquery.plupload.queue.min.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/airtime/library/plupload.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/plupload/i18n/'.$locale.'.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/libs/dropzone.min.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl . 'js/datatables/js/jquery.dataTables.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl . 'js/plupload/plupload.full.min.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl . 'js/plupload/jquery.plupload.queue.min.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl . 'js/airtime/library/plupload.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl . 'js/plupload/i18n/' . $locale . '.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl . 'js/libs/dropzone.min.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
|
||||
$this->view->headLink()->appendStylesheet($baseUrl.'css/plupload.queue.css?'.$CC_CONFIG['airtime_version']);
|
||||
$this->view->headLink()->appendStylesheet($baseUrl.'css/addmedia.css?'.$CC_CONFIG['airtime_version']);
|
||||
$this->view->headLink()->appendStylesheet($baseUrl.'css/dashboard.css?'.$CC_CONFIG['airtime_version']);
|
||||
$this->view->headLink()->appendStylesheet($baseUrl . 'css/plupload.queue.css?' . $CC_CONFIG['airtime_version']);
|
||||
$this->view->headLink()->appendStylesheet($baseUrl . 'css/addmedia.css?' . $CC_CONFIG['airtime_version']);
|
||||
$this->view->headLink()->appendStylesheet($baseUrl . 'css/dashboard.css?' . $CC_CONFIG['airtime_version']);
|
||||
|
||||
$this->view->quotaLimitReached = false;
|
||||
if (Application_Model_Systemstatus::isDiskOverQuota()) {
|
||||
|
@ -60,56 +61,56 @@ class PluploadController extends Zend_Controller_Action
|
|||
$observed_csrf_token = $this->_getParam('csrf_token');
|
||||
$expected_csrf_token = $current_namespace->authtoken;
|
||||
|
||||
if($observed_csrf_token == $expected_csrf_token){
|
||||
$upload_dir = ini_get("upload_tmp_dir") . DIRECTORY_SEPARATOR . "plupload";
|
||||
if ($observed_csrf_token == $expected_csrf_token) {
|
||||
$upload_dir = ini_get('upload_tmp_dir') . DIRECTORY_SEPARATOR . 'plupload';
|
||||
$tempFilePath = Application_Model_StoredFile::uploadFile($upload_dir);
|
||||
$tempFileName = basename($tempFilePath);
|
||||
|
||||
$this->_helper->json->sendJson(array("jsonrpc" => "2.0", "tempfilepath" => $tempFileName));
|
||||
}else{
|
||||
$this->_helper->json->sendJson(array("jsonrpc" => "2.0", "valid" => false, "error" => "CSRF token did not match."));
|
||||
|
||||
$this->_helper->json->sendJson(['jsonrpc' => '2.0', 'tempfilepath' => $tempFileName]);
|
||||
} else {
|
||||
$this->_helper->json->sendJson(['jsonrpc' => '2.0', 'valid' => false, 'error' => 'CSRF token did not match.']);
|
||||
}
|
||||
}
|
||||
|
||||
public function recentUploadsAction()
|
||||
{
|
||||
$request = $this->getRequest();
|
||||
|
||||
$filter = $request->getParam('uploadFilter', "all");
|
||||
$request = $this->getRequest();
|
||||
|
||||
$filter = $request->getParam('uploadFilter', 'all');
|
||||
$limit = intval($request->getParam('iDisplayLength', 10));
|
||||
$rowStart = intval($request->getParam('iDisplayStart', 0));
|
||||
|
||||
|
||||
$recentUploadsQuery = CcFilesQuery::create();
|
||||
//old propel 1.5 to reuse this query item (for counts/finds)
|
||||
$recentUploadsQuery->keepQuery(true);
|
||||
|
||||
|
||||
//Hide deleted files
|
||||
$recentUploadsQuery->filterByDbFileExists(true);
|
||||
|
||||
|
||||
$numTotalRecentUploads = $recentUploadsQuery->count();
|
||||
$numTotalDisplayUploads = $numTotalRecentUploads;
|
||||
|
||||
if ($filter == "pending") {
|
||||
|
||||
if ($filter == 'pending') {
|
||||
$recentUploadsQuery->filterByDbImportStatus(1);
|
||||
$numTotalDisplayUploads = $recentUploadsQuery->count();
|
||||
} else if ($filter == "failed") {
|
||||
} elseif ($filter == 'failed') {
|
||||
$recentUploadsQuery->filterByDbImportStatus(2);
|
||||
$numTotalDisplayUploads = $recentUploadsQuery->count();
|
||||
//TODO: Consider using array('min' => 200)) or something if we have multiple errors codes for failure.
|
||||
}
|
||||
|
||||
|
||||
$recentUploads = $recentUploadsQuery
|
||||
->orderByDbUtime(Criteria::DESC)
|
||||
->offset($rowStart)
|
||||
->limit($limit)
|
||||
->find();
|
||||
|
||||
$uploadsArray = array();
|
||||
$utcTimezone = new DateTimeZone("UTC");
|
||||
->orderByDbUtime(Criteria::DESC)
|
||||
->offset($rowStart)
|
||||
->limit($limit)
|
||||
->find()
|
||||
;
|
||||
|
||||
$uploadsArray = [];
|
||||
$utcTimezone = new DateTimeZone('UTC');
|
||||
$displayTimezone = new DateTimeZone(Application_Model_Preference::GetUserTimezone());
|
||||
|
||||
foreach ($recentUploads as $upload)
|
||||
{
|
||||
|
||||
foreach ($recentUploads as $upload) {
|
||||
$upload = $upload->toArray(BasePeer::TYPE_FIELDNAME);
|
||||
//TODO: $this->sanitizeResponse($upload));
|
||||
$upload['utime'] = new DateTime($upload['utime'], $utcTimezone);
|
||||
|
@ -119,7 +120,7 @@ class PluploadController extends Zend_Controller_Action
|
|||
//TODO: Invoke sanitization here (MediaController's removeBlacklist stuff)
|
||||
array_push($uploadsArray, $upload);
|
||||
}
|
||||
|
||||
|
||||
$this->view->sEcho = intval($request->getParam('sEcho'));
|
||||
$this->view->iTotalDisplayRecords = $numTotalDisplayUploads;
|
||||
$this->view->iTotalRecords = $numTotalRecentUploads;
|
||||
|
@ -127,7 +128,7 @@ class PluploadController extends Zend_Controller_Action
|
|||
}
|
||||
|
||||
/**
|
||||
* get configured upload max size from php
|
||||
* get configured upload max size from php.
|
||||
*
|
||||
* Pinched from Drupal: https://github.com/drupal/drupal/blob/4204b0b29a7318008f10765cf88114bf3ed21c32/core/includes/file.inc#L1099
|
||||
*
|
||||
|
@ -135,10 +136,10 @@ class PluploadController extends Zend_Controller_Action
|
|||
* way. I'm adding the method here since it's part of their core and I did
|
||||
* not find an easy way to grab that thrrough composer in an isolated way.
|
||||
*/
|
||||
private function file_upload_max_size() {
|
||||
private function file_upload_max_size()
|
||||
{
|
||||
static $max_size = -1;
|
||||
if ($max_size < 0) {
|
||||
|
||||
// Start with post_max_size.
|
||||
$max_size = $this->bytes_to_int(ini_get('post_max_size'));
|
||||
|
||||
|
@ -149,19 +150,23 @@ class PluploadController extends Zend_Controller_Action
|
|||
$max_size = $upload_max;
|
||||
}
|
||||
}
|
||||
|
||||
return $max_size;
|
||||
}
|
||||
|
||||
/**
|
||||
* Pinched from Drupal: https://github.com/drupal/drupal/blob/4204b0b29a7318008f10765cf88114bf3ed21c32/core/lib/Drupal/Component/Utility/Bytes.php#L27
|
||||
* Pinched from Drupal: https://github.com/drupal/drupal/blob/4204b0b29a7318008f10765cf88114bf3ed21c32/core/lib/Drupal/Component/Utility/Bytes.php#L27.
|
||||
*
|
||||
* This is the real point of importing the Drupal solution. They have done
|
||||
* an implementation for figuring out what the user specified in the
|
||||
* post_max_size and upload_max_size configuration. Sadly php does not
|
||||
* support a nice way to get at the results of this config after it is
|
||||
* parsed by the engine, hence the below hack.
|
||||
*
|
||||
* @param mixed $size
|
||||
*/
|
||||
private function bytes_to_int($size) {
|
||||
private function bytes_to_int($size)
|
||||
{
|
||||
// Remove the non-unit characters from the size.
|
||||
$unit = preg_replace('/[^bkmgtpezy]/i', '', $size);
|
||||
// Remove the non-numeric characters from the size.
|
||||
|
@ -170,8 +175,8 @@ class PluploadController extends Zend_Controller_Action
|
|||
// Find the position of the unit in the ordered string which is the power
|
||||
// of magnitude to multiply a kilobyte by.
|
||||
return round($size * pow(1024, stripos('bkmgtpezy', $unit[0])));
|
||||
} else {
|
||||
return round($size);
|
||||
}
|
||||
|
||||
return round($size);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,36 +1,36 @@
|
|||
<?php
|
||||
|
||||
class PodcastController extends Zend_Controller_Action {
|
||||
|
||||
public function init() {
|
||||
class PodcastController extends Zend_Controller_Action
|
||||
{
|
||||
public function init()
|
||||
{
|
||||
$CC_CONFIG = Config::getConfig();
|
||||
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||
|
||||
$headScript = $this->view->headScript();
|
||||
AirtimeTableView::injectTableJavaScriptDependencies($headScript, $baseUrl, $CC_CONFIG['airtime_version']);
|
||||
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/airtime/library/library.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/airtime/library/events/library_showbuilder.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl . 'js/airtime/library/library.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl . 'js/airtime/library/events/library_showbuilder.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/airtime/widgets/table.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/airtime/library/podcast.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl . 'js/airtime/widgets/table.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl . 'js/airtime/library/podcast.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
|
||||
$this->view->headLink()->appendStylesheet($baseUrl.'css/datatables/css/ColVis.css?'.$CC_CONFIG['airtime_version']);
|
||||
$this->view->headLink()->appendStylesheet($baseUrl.'css/datatables/css/dataTables.colReorder.min.css?'.$CC_CONFIG['airtime_version']);
|
||||
$this->view->headLink()->appendStylesheet($baseUrl . 'css/datatables/css/ColVis.css?' . $CC_CONFIG['airtime_version']);
|
||||
$this->view->headLink()->appendStylesheet($baseUrl . 'css/datatables/css/dataTables.colReorder.min.css?' . $CC_CONFIG['airtime_version']);
|
||||
|
||||
$this->view->headLink()->appendStylesheet($baseUrl.'css/station_podcast.css?'.$CC_CONFIG['airtime_version']);
|
||||
$this->view->headLink()->appendStylesheet($baseUrl.'css/dashboard.css?'.$CC_CONFIG['airtime_version']);
|
||||
$this->view->headLink()->appendStylesheet($baseUrl . 'css/station_podcast.css?' . $CC_CONFIG['airtime_version']);
|
||||
$this->view->headLink()->appendStylesheet($baseUrl . 'css/dashboard.css?' . $CC_CONFIG['airtime_version']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Renders the Station podcast view
|
||||
* Renders the Station podcast view.
|
||||
*/
|
||||
public function stationAction() {
|
||||
|
||||
public function stationAction()
|
||||
{
|
||||
$stationPodcastId = Application_Model_Preference::getStationPodcastId();
|
||||
$podcast = Application_Service_PodcastService::getPodcastById($stationPodcastId);
|
||||
$this->view->podcast = json_encode($podcast);
|
||||
$this->view->form = new Application_Form_StationPodcast();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -2,21 +2,21 @@
|
|||
|
||||
class PreferenceController extends Zend_Controller_Action
|
||||
{
|
||||
|
||||
public function init()
|
||||
{
|
||||
/* Initialize action controller here */
|
||||
// Initialize action controller here
|
||||
$ajaxContext = $this->_helper->getHelper('AjaxContext');
|
||||
$ajaxContext->addActionContext('server-browse', 'json')
|
||||
->addActionContext('change-stor-directory', 'json')
|
||||
->addActionContext('reload-watch-directory', 'json')
|
||||
->addActionContext('remove-watch-directory', 'json')
|
||||
->addActionContext('is-import-in-progress', 'json')
|
||||
->addActionContext('change-stream-setting', 'json')
|
||||
->addActionContext('get-liquidsoap-status', 'json')
|
||||
->addActionContext('set-source-connection-url', 'json')
|
||||
->addActionContext('get-admin-password-status', 'json')
|
||||
->initContext();
|
||||
->addActionContext('change-stor-directory', 'json')
|
||||
->addActionContext('reload-watch-directory', 'json')
|
||||
->addActionContext('remove-watch-directory', 'json')
|
||||
->addActionContext('is-import-in-progress', 'json')
|
||||
->addActionContext('change-stream-setting', 'json')
|
||||
->addActionContext('get-liquidsoap-status', 'json')
|
||||
->addActionContext('set-source-connection-url', 'json')
|
||||
->addActionContext('get-admin-password-status', 'json')
|
||||
->initContext()
|
||||
;
|
||||
}
|
||||
|
||||
public function indexAction()
|
||||
|
@ -28,54 +28,53 @@ class PreferenceController extends Zend_Controller_Action
|
|||
|
||||
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/airtime/preferences/preferences.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->statusMsg = "";
|
||||
$this->view->headScript()->appendFile($baseUrl . 'js/airtime/preferences/preferences.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
$this->view->statusMsg = '';
|
||||
|
||||
$form = new Application_Form_Preferences();
|
||||
$values = array();
|
||||
$values = [];
|
||||
|
||||
SessionHelper::reopenSessionForWriting();
|
||||
|
||||
if ($request->isPost()) {
|
||||
$values = $request->getPost();
|
||||
if ($form->isValid($values))
|
||||
{
|
||||
Application_Model_Preference::SetHeadTitle($values["stationName"], $this->view);
|
||||
Application_Model_Preference::SetStationDescription($values["stationDescription"]);
|
||||
Application_Model_Preference::SetTrackTypeDefault($values["tracktypeDefault"]);
|
||||
Application_Model_Preference::SetDefaultCrossfadeDuration($values["stationDefaultCrossfadeDuration"]);
|
||||
Application_Model_Preference::SetDefaultFadeIn($values["stationDefaultFadeIn"]);
|
||||
Application_Model_Preference::SetDefaultFadeOut($values["stationDefaultFadeOut"]);
|
||||
Application_Model_Preference::SetPodcastAlbumOverride($values["podcastAlbumOverride"]);
|
||||
Application_Model_Preference::SetPodcastAutoSmartblock($values["podcastAutoSmartblock"]);
|
||||
Application_Model_Preference::SetIntroPlaylist($values["introPlaylistSelect"]);
|
||||
Application_Model_Preference::SetOutroPlaylist($values["outroPlaylistSelect"]);
|
||||
Application_Model_Preference::SetAllow3rdPartyApi($values["thirdPartyApi"]);
|
||||
Application_Model_Preference::SetAllowedCorsUrls($values["allowedCorsUrls"]);
|
||||
Application_Model_Preference::SetDefaultLocale($values["locale"]);
|
||||
Application_Model_Preference::SetDefaultTimezone($values["timezone"]);
|
||||
Application_Model_Preference::SetWeekStartDay($values["weekStartDay"]);
|
||||
Application_Model_Preference::setRadioPageDisplayLoginButton($values["radioPageLoginButton"]);
|
||||
Application_Model_Preference::SetFeaturePreviewMode($values["featurePreviewMode"]);
|
||||
if ($form->isValid($values)) {
|
||||
Application_Model_Preference::SetHeadTitle($values['stationName'], $this->view);
|
||||
Application_Model_Preference::SetStationDescription($values['stationDescription']);
|
||||
Application_Model_Preference::SetTrackTypeDefault($values['tracktypeDefault']);
|
||||
Application_Model_Preference::SetDefaultCrossfadeDuration($values['stationDefaultCrossfadeDuration']);
|
||||
Application_Model_Preference::SetDefaultFadeIn($values['stationDefaultFadeIn']);
|
||||
Application_Model_Preference::SetDefaultFadeOut($values['stationDefaultFadeOut']);
|
||||
Application_Model_Preference::SetPodcastAlbumOverride($values['podcastAlbumOverride']);
|
||||
Application_Model_Preference::SetPodcastAutoSmartblock($values['podcastAutoSmartblock']);
|
||||
Application_Model_Preference::SetIntroPlaylist($values['introPlaylistSelect']);
|
||||
Application_Model_Preference::SetOutroPlaylist($values['outroPlaylistSelect']);
|
||||
Application_Model_Preference::SetAllow3rdPartyApi($values['thirdPartyApi']);
|
||||
Application_Model_Preference::SetAllowedCorsUrls($values['allowedCorsUrls']);
|
||||
Application_Model_Preference::SetDefaultLocale($values['locale']);
|
||||
Application_Model_Preference::SetDefaultTimezone($values['timezone']);
|
||||
Application_Model_Preference::SetWeekStartDay($values['weekStartDay']);
|
||||
Application_Model_Preference::setRadioPageDisplayLoginButton($values['radioPageLoginButton']);
|
||||
Application_Model_Preference::SetFeaturePreviewMode($values['featurePreviewMode']);
|
||||
|
||||
$logoUploadElement = $form->getSubForm('preferences_general')->getElement('stationLogo');
|
||||
$logoUploadElement->receive();
|
||||
$imagePath = $logoUploadElement->getFileName();
|
||||
|
||||
// Only update the image logo if the new logo is non-empty
|
||||
if (!empty($imagePath) && $imagePath != "") {
|
||||
if (!empty($imagePath) && $imagePath != '') {
|
||||
Application_Model_Preference::SetStationLogo($imagePath);
|
||||
}
|
||||
|
||||
Application_Model_Preference::setTuneinEnabled($values["enable_tunein"]);
|
||||
Application_Model_Preference::setTuneinStationId($values["tunein_station_id"]);
|
||||
Application_Model_Preference::setTuneinPartnerKey($values["tunein_partner_key"]);
|
||||
Application_Model_Preference::setTuneinPartnerId($values["tunein_partner_id"]);
|
||||
Application_Model_Preference::setTuneinEnabled($values['enable_tunein']);
|
||||
Application_Model_Preference::setTuneinStationId($values['tunein_station_id']);
|
||||
Application_Model_Preference::setTuneinPartnerKey($values['tunein_partner_key']);
|
||||
Application_Model_Preference::setTuneinPartnerId($values['tunein_partner_id']);
|
||||
|
||||
$this->view->statusMsg = "<div class='success'>". _("Preferences updated.")."</div>";
|
||||
$this->view->statusMsg = "<div class='success'>" . _('Preferences updated.') . '</div>';
|
||||
$form = new Application_Form_Preferences();
|
||||
$this->view->form = $form;
|
||||
//$this->_helper->json->sendJson(array("valid"=>"true", "html"=>$this->view->render('preference/index.phtml')));
|
||||
//$this->_helper->json->sendJson(array("valid"=>"true", "html"=>$this->view->render('preference/index.phtml')));
|
||||
} else {
|
||||
$this->view->form = $form;
|
||||
//$this->_helper->json->sendJson(array("valid"=>"false", "html"=>$this->view->render('preference/index.phtml')));
|
||||
|
@ -86,7 +85,8 @@ class PreferenceController extends Zend_Controller_Action
|
|||
$this->view->form = $form;
|
||||
}
|
||||
|
||||
public function stationPodcastSettingsAction() {
|
||||
public function stationPodcastSettingsAction()
|
||||
{
|
||||
$this->view->layout()->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender(true);
|
||||
|
||||
|
@ -101,11 +101,11 @@ class PreferenceController extends Zend_Controller_Action
|
|||
$stationPodcast = PodcastQuery::create()->findOneByDbId(Application_Model_Preference::getStationPodcastId());
|
||||
$key = Application_Model_Preference::getStationPodcastDownloadKey();
|
||||
$url = Application_Common_HTTPHelper::getStationUrl() .
|
||||
(((int) $values->stationPodcastPrivacy) ? "feeds/station-rss?sharing_token=$key" : "feeds/station-rss");
|
||||
(((int) $values->stationPodcastPrivacy) ? "feeds/station-rss?sharing_token={$key}" : 'feeds/station-rss');
|
||||
$stationPodcast->setDbUrl($url)->save();
|
||||
Application_Model_Preference::setStationPodcastPrivacy($values->stationPodcastPrivacy);
|
||||
|
||||
$this->_helper->json->sendJson(array("url" => $url));
|
||||
$this->_helper->json->sendJson(['url' => $url]);
|
||||
}
|
||||
|
||||
public function directoryConfigAction()
|
||||
|
@ -122,11 +122,12 @@ class PreferenceController extends Zend_Controller_Action
|
|||
|
||||
if (!SecurityHelper::verifyCSRFToken($this->_getParam('csrf_token'))) {
|
||||
Logging::error(__FILE__ . ': Invalid CSRF token');
|
||||
$this->_helper->json->sendJson(array("jsonrpc" => "2.0", "valid" => false, "error" => "CSRF token did not match."));
|
||||
$this->_helper->json->sendJson(['jsonrpc' => '2.0', 'valid' => false, 'error' => 'CSRF token did not match.']);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
Application_Model_Preference::SetStationLogo("");
|
||||
Application_Model_Preference::SetStationLogo('');
|
||||
}
|
||||
|
||||
public function streamSettingAction()
|
||||
|
@ -139,17 +140,17 @@ class PreferenceController extends Zend_Controller_Action
|
|||
|
||||
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/airtime/preferences/streamsetting.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl . 'js/airtime/preferences/streamsetting.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
|
||||
SessionHelper::reopenSessionForWriting();
|
||||
|
||||
$name_map = array(
|
||||
'ogg' => 'Ogg Vorbis',
|
||||
'fdkaac' => 'AAC+',
|
||||
'aac' => 'AAC',
|
||||
'opus' => 'Opus',
|
||||
'mp3' => 'MP3',
|
||||
);
|
||||
$name_map = [
|
||||
'ogg' => 'Ogg Vorbis',
|
||||
'fdkaac' => 'AAC+',
|
||||
'aac' => 'AAC',
|
||||
'opus' => 'Opus',
|
||||
'mp3' => 'MP3',
|
||||
];
|
||||
|
||||
$num_of_stream = intval(Application_Model_Preference::GetNumOfStreams());
|
||||
$form = new Application_Form_StreamSetting();
|
||||
|
@ -160,11 +161,11 @@ class PreferenceController extends Zend_Controller_Action
|
|||
$form->addElement($csrf_element);
|
||||
|
||||
$live_stream_subform = new Application_Form_LiveStreamingPreferences();
|
||||
$form->addSubForm($live_stream_subform, "live_stream_subform");
|
||||
$form->addSubForm($live_stream_subform, 'live_stream_subform');
|
||||
|
||||
// get predefined type and bitrate from pref table
|
||||
$temp_types = Application_Model_Preference::GetStreamType();
|
||||
$stream_types = array();
|
||||
$stream_types = [];
|
||||
foreach ($temp_types as $type) {
|
||||
$type = strtolower(trim($type));
|
||||
if (isset($name_map[$type])) {
|
||||
|
@ -177,10 +178,10 @@ class PreferenceController extends Zend_Controller_Action
|
|||
|
||||
$temp_bitrate = Application_Model_Preference::GetStreamBitrate();
|
||||
$max_bitrate = intval(Application_Model_Preference::GetMaxBitrate());
|
||||
$stream_bitrates = array();
|
||||
$stream_bitrates = [];
|
||||
foreach ($temp_bitrate as $type) {
|
||||
if (intval($type) <= $max_bitrate) {
|
||||
$stream_bitrates[trim($type)] = strtoupper(trim($type))." kbit/s";
|
||||
$stream_bitrates[trim($type)] = strtoupper(trim($type)) . ' kbit/s';
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -188,7 +189,7 @@ class PreferenceController extends Zend_Controller_Action
|
|||
$setting = Application_Model_StreamSetting::getStreamSetting();
|
||||
$form->setSetting($setting);
|
||||
|
||||
for ($i=1; $i<=$num_of_stream; $i++) {
|
||||
for ($i = 1; $i <= $num_of_stream; ++$i) {
|
||||
$subform = new Application_Form_StreamSettingSubForm();
|
||||
$subform->setPrefix($i);
|
||||
$subform->setSetting($setting);
|
||||
|
@ -196,7 +197,7 @@ class PreferenceController extends Zend_Controller_Action
|
|||
$subform->setStreamBitrates($stream_bitrates);
|
||||
$subform->startForm();
|
||||
$subform->toggleState();
|
||||
$form->addSubForm($subform, "s".$i."_subform");
|
||||
$form->addSubForm($subform, 's' . $i . '_subform');
|
||||
}
|
||||
|
||||
$live_stream_subform->updateVariables();
|
||||
|
@ -208,36 +209,36 @@ class PreferenceController extends Zend_Controller_Action
|
|||
* $form->isValid() is expecting it in
|
||||
*/
|
||||
$postData = explode('&', $params['data']);
|
||||
$s1_data = array();
|
||||
$s2_data = array();
|
||||
$s3_data = array();
|
||||
$s4_data = array();
|
||||
$values = array();
|
||||
foreach($postData as $k=>$v) {
|
||||
$s1_data = [];
|
||||
$s2_data = [];
|
||||
$s3_data = [];
|
||||
$s4_data = [];
|
||||
$values = [];
|
||||
foreach ($postData as $k => $v) {
|
||||
$v = explode('=', urldecode($v));
|
||||
if (strpos($v[0], "s1_data") !== false) {
|
||||
if (strpos($v[0], 's1_data') !== false) {
|
||||
/* In this case $v[0] may be 's1_data[enable]' , for example.
|
||||
* We only want the 'enable' part
|
||||
*/
|
||||
preg_match('/\[(.*)\]/', $v[0], $matches);
|
||||
$s1_data[$matches[1]] = $v[1];
|
||||
} elseif (strpos($v[0], "s2_data") !== false) {
|
||||
} elseif (strpos($v[0], 's2_data') !== false) {
|
||||
preg_match('/\[(.*)\]/', $v[0], $matches);
|
||||
$s2_data[$matches[1]] = $v[1];
|
||||
} elseif (strpos($v[0], "s3_data") !== false) {
|
||||
preg_match('/\[(.*)\]/', $v[0], $matches);
|
||||
} elseif (strpos($v[0], 's3_data') !== false) {
|
||||
preg_match('/\[(.*)\]/', $v[0], $matches);
|
||||
$s3_data[$matches[1]] = $v[1];
|
||||
} elseif (strpos($v[0], "s4_data") !== false) {
|
||||
preg_match('/\[(.*)\]/', $v[0], $matches);
|
||||
} elseif (strpos($v[0], 's4_data') !== false) {
|
||||
preg_match('/\[(.*)\]/', $v[0], $matches);
|
||||
$s4_data[$matches[1]] = $v[1];
|
||||
} else {
|
||||
$values[$v[0]] = $v[1];
|
||||
}
|
||||
}
|
||||
$values["s1_data"] = $s1_data;
|
||||
$values["s2_data"] = $s2_data;
|
||||
$values["s3_data"] = $s3_data;
|
||||
$values["s4_data"] = $s4_data;
|
||||
$values['s1_data'] = $s1_data;
|
||||
$values['s2_data'] = $s2_data;
|
||||
$values['s3_data'] = $s3_data;
|
||||
$values['s4_data'] = $s4_data;
|
||||
|
||||
if ($form->isValid($values)) {
|
||||
Application_Model_StreamSetting::setStreamSetting($values);
|
||||
|
@ -245,68 +246,67 @@ class PreferenceController extends Zend_Controller_Action
|
|||
/* If the admin password values are empty then we should not
|
||||
* set the pseudo password ('xxxxxx') on the front-end
|
||||
*/
|
||||
$s1_set_admin_pass = !empty($values["s1_data"]["admin_pass"]);
|
||||
$s2_set_admin_pass = !empty($values["s2_data"]["admin_pass"]);
|
||||
$s3_set_admin_pass = !empty($values["s3_data"]["admin_pass"]);
|
||||
$s4_set_admin_pass = !empty($values["s4_data"]["admin_pass"]);
|
||||
$s1_set_admin_pass = !empty($values['s1_data']['admin_pass']);
|
||||
$s2_set_admin_pass = !empty($values['s2_data']['admin_pass']);
|
||||
$s3_set_admin_pass = !empty($values['s3_data']['admin_pass']);
|
||||
$s4_set_admin_pass = !empty($values['s4_data']['admin_pass']);
|
||||
|
||||
// this goes into cc_pref table
|
||||
$this->setStreamPreferences($values);
|
||||
|
||||
// compare new values with current value
|
||||
$changeRGenabled = Application_Model_Preference::GetEnableReplayGain() != $values["enableReplayGain"];
|
||||
$changeRGmodifier = Application_Model_Preference::getReplayGainModifier() != $values["replayGainModifier"];
|
||||
$changeRGenabled = Application_Model_Preference::GetEnableReplayGain() != $values['enableReplayGain'];
|
||||
$changeRGmodifier = Application_Model_Preference::getReplayGainModifier() != $values['replayGainModifier'];
|
||||
if ($changeRGenabled || $changeRGmodifier) {
|
||||
Application_Model_Preference::SetEnableReplayGain($values["enableReplayGain"]);
|
||||
Application_Model_Preference::setReplayGainModifier($values["replayGainModifier"]);
|
||||
$md = array('schedule' => Application_Model_Schedule::getSchedule());
|
||||
Application_Model_RabbitMq::SendMessageToPypo("update_schedule", $md);
|
||||
Application_Model_Preference::SetEnableReplayGain($values['enableReplayGain']);
|
||||
Application_Model_Preference::setReplayGainModifier($values['replayGainModifier']);
|
||||
$md = ['schedule' => Application_Model_Schedule::getSchedule()];
|
||||
Application_Model_RabbitMq::SendMessageToPypo('update_schedule', $md);
|
||||
//Application_Model_RabbitMq::PushSchedule();
|
||||
}
|
||||
|
||||
// pulling this from the 2.5.x branch
|
||||
if (!Application_Model_Preference::GetMasterDjConnectionUrlOverride()) {
|
||||
$master_connection_url = "http://".$_SERVER['SERVER_NAME'].":".$values["master_source_port"].$values["master_source_mount"];
|
||||
if (empty($values["master_source_port"]) || empty($values["master_source_mount"])) {
|
||||
$master_connection_url = 'http://' . $_SERVER['SERVER_NAME'] . ':' . $values['master_source_port'] . $values['master_source_mount'];
|
||||
if (empty($values['master_source_port']) || empty($values['master_source_mount'])) {
|
||||
Application_Model_Preference::SetMasterDJSourceConnectionURL('N/A');
|
||||
} else {
|
||||
Application_Model_Preference::SetMasterDJSourceConnectionURL($master_connection_url);
|
||||
}
|
||||
} else {
|
||||
Application_Model_Preference::SetMasterDJSourceConnectionURL($values["master_source_host"]);
|
||||
Application_Model_Preference::SetMasterDJSourceConnectionURL($values['master_source_host']);
|
||||
}
|
||||
|
||||
if (!Application_Model_Preference::GetLiveDjConnectionUrlOverride()) {
|
||||
$live_connection_url = "http://".$_SERVER['SERVER_NAME'].":".$values["show_source_port"].$values["show_source_mount"];
|
||||
if (empty($values["show_source_port"]) || empty($values["show_source_mount"])) {
|
||||
$live_connection_url = 'http://' . $_SERVER['SERVER_NAME'] . ':' . $values['show_source_port'] . $values['show_source_mount'];
|
||||
if (empty($values['show_source_port']) || empty($values['show_source_mount'])) {
|
||||
Application_Model_Preference::SetLiveDJSourceConnectionURL('N/A');
|
||||
} else {
|
||||
Application_Model_Preference::SetLiveDJSourceConnectionURL($live_connection_url);
|
||||
}
|
||||
} else {
|
||||
Application_Model_Preference::SetLiveDJSourceConnectionURL($values["show_source_host"]);
|
||||
Application_Model_Preference::SetLiveDJSourceConnectionURL($values['show_source_host']);
|
||||
}
|
||||
|
||||
|
||||
Application_Model_StreamSetting::setMasterLiveStreamPort($values["master_source_port"]);
|
||||
Application_Model_StreamSetting::setMasterLiveStreamMountPoint($values["master_source_mount"]);
|
||||
Application_Model_StreamSetting::setDjLiveStreamPort($values["show_source_port"]);
|
||||
Application_Model_StreamSetting::setDjLiveStreamMountPoint($values["show_source_mount"]);
|
||||
Application_Model_StreamSetting::setMasterLiveStreamPort($values['master_source_port']);
|
||||
Application_Model_StreamSetting::setMasterLiveStreamMountPoint($values['master_source_mount']);
|
||||
Application_Model_StreamSetting::setDjLiveStreamPort($values['show_source_port']);
|
||||
Application_Model_StreamSetting::setDjLiveStreamMountPoint($values['show_source_mount']);
|
||||
|
||||
Application_Model_StreamSetting::setOffAirMeta($values['offAirMeta']);
|
||||
|
||||
// store stream update timestamp
|
||||
Application_Model_Preference::SetStreamUpdateTimestamp();
|
||||
|
||||
$data = array();
|
||||
$data = [];
|
||||
$info = Application_Model_StreamSetting::getStreamSetting();
|
||||
$data['setting'] = $info;
|
||||
for ($i=1; $i<=$num_of_stream; $i++) {
|
||||
Application_Model_StreamSetting::setLiquidsoapError($i, "waiting");
|
||||
for ($i = 1; $i <= $num_of_stream; ++$i) {
|
||||
Application_Model_StreamSetting::setLiquidsoapError($i, 'waiting');
|
||||
}
|
||||
|
||||
Application_Model_RabbitMq::SendMessageToPypo("update_stream_setting", $data);
|
||||
$this->view->statusMsg = "<div class='success'>"._("Stream Setting Updated.")."</div>";
|
||||
Application_Model_RabbitMq::SendMessageToPypo('update_stream_setting', $data);
|
||||
$this->view->statusMsg = "<div class='success'>" . _('Stream Setting Updated.') . '</div>';
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -315,61 +315,61 @@ class PreferenceController extends Zend_Controller_Action
|
|||
$this->view->form = $form;
|
||||
if ($request->isPost()) {
|
||||
if ($form->isValid($values)) {
|
||||
$this->_helper->json->sendJson(array(
|
||||
"valid" => "true",
|
||||
"html" => $this->view->render('preference/stream-setting.phtml'),
|
||||
"s1_set_admin_pass" => $s1_set_admin_pass,
|
||||
"s2_set_admin_pass" => $s2_set_admin_pass,
|
||||
"s3_set_admin_pass" => $s3_set_admin_pass,
|
||||
"s4_set_admin_pass" => $s4_set_admin_pass,
|
||||
));
|
||||
$this->_helper->json->sendJson([
|
||||
'valid' => 'true',
|
||||
'html' => $this->view->render('preference/stream-setting.phtml'),
|
||||
's1_set_admin_pass' => $s1_set_admin_pass,
|
||||
's2_set_admin_pass' => $s2_set_admin_pass,
|
||||
's3_set_admin_pass' => $s3_set_admin_pass,
|
||||
's4_set_admin_pass' => $s4_set_admin_pass,
|
||||
]);
|
||||
} else {
|
||||
$this->_helper->json->sendJson(array("valid" => "false", "html" => $this->view->render('preference/stream-setting.phtml')));
|
||||
$this->_helper->json->sendJson(['valid' => 'false', 'html' => $this->view->render('preference/stream-setting.phtml')]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set stream settings preferences
|
||||
* Set stream settings preferences.
|
||||
*
|
||||
* @param array $values stream setting preference values
|
||||
*/
|
||||
private function setStreamPreferences($values) {
|
||||
private function setStreamPreferences($values)
|
||||
{
|
||||
Application_Model_Preference::setUsingCustomStreamSettings($values['customStreamSettings']);
|
||||
Application_Model_Preference::SetStreamLabelFormat($values['streamFormat']);
|
||||
Application_Model_Preference::SetLiveStreamMasterUsername($values["master_username"]);
|
||||
Application_Model_Preference::SetLiveStreamMasterPassword($values["master_password"]);
|
||||
Application_Model_Preference::SetDefaultTransitionFade($values["transition_fade"]);
|
||||
Application_Model_Preference::SetAutoTransition($values["auto_transition"]);
|
||||
Application_Model_Preference::SetAutoSwitch($values["auto_switch"]);
|
||||
|
||||
Application_Model_Preference::SetLiveStreamMasterUsername($values['master_username']);
|
||||
Application_Model_Preference::SetLiveStreamMasterPassword($values['master_password']);
|
||||
Application_Model_Preference::SetDefaultTransitionFade($values['transition_fade']);
|
||||
Application_Model_Preference::SetAutoTransition($values['auto_transition']);
|
||||
Application_Model_Preference::SetAutoSwitch($values['auto_switch']);
|
||||
}
|
||||
|
||||
public function serverBrowseAction()
|
||||
{
|
||||
$request = $this->getRequest();
|
||||
$path = $request->getParam("path", null);
|
||||
$path = $request->getParam('path', null);
|
||||
|
||||
$result = array();
|
||||
$result = [];
|
||||
|
||||
if (is_null($path)) {
|
||||
$element = array();
|
||||
$element["name"] = _("path should be specified");
|
||||
$element["isFolder"] = false;
|
||||
$element["isError"] = true;
|
||||
$element = [];
|
||||
$element['name'] = _('path should be specified');
|
||||
$element['isFolder'] = false;
|
||||
$element['isError'] = true;
|
||||
$result[$path] = $element;
|
||||
} else {
|
||||
$path = $path.'/';
|
||||
$path = $path . '/';
|
||||
$handle = opendir($path);
|
||||
if ($handle !== false) {
|
||||
while (false !== ($file = readdir($handle))) {
|
||||
if ($file != "." && $file != "..") {
|
||||
if ($file != '.' && $file != '..') {
|
||||
//only show directories that aren't private.
|
||||
if (is_dir($path.$file) && substr($file, 0, 1) != ".") {
|
||||
$element = array();
|
||||
$element["name"] = $file;
|
||||
$element["isFolder"] = true;
|
||||
$element["isError"] = false;
|
||||
if (is_dir($path . $file) && substr($file, 0, 1) != '.') {
|
||||
$element = [];
|
||||
$element['name'] = $file;
|
||||
$element['isFolder'] = true;
|
||||
$element['isError'] = false;
|
||||
$result[$file] = $element;
|
||||
}
|
||||
}
|
||||
|
@ -383,14 +383,14 @@ class PreferenceController extends Zend_Controller_Action
|
|||
|
||||
public function changeStorDirectoryAction()
|
||||
{
|
||||
$chosen = $this->getRequest()->getParam("dir");
|
||||
$element = $this->getRequest()->getParam("element");
|
||||
$chosen = $this->getRequest()->getParam('dir');
|
||||
$element = $this->getRequest()->getParam('element');
|
||||
$watched_dirs_form = new Application_Form_WatchedDirPreferences();
|
||||
|
||||
$res = Application_Model_MusicDir::setStorDir($chosen);
|
||||
if ($res['code'] != 0) {
|
||||
$watched_dirs_form->populate(array('storageFolder' => $chosen));
|
||||
$watched_dirs_form->getElement($element)->setErrors(array($res['error']));
|
||||
$watched_dirs_form->populate(['storageFolder' => $chosen]);
|
||||
$watched_dirs_form->getElement($element)->setErrors([$res['error']]);
|
||||
}
|
||||
|
||||
$this->view->subform = $watched_dirs_form->render();
|
||||
|
@ -398,14 +398,14 @@ class PreferenceController extends Zend_Controller_Action
|
|||
|
||||
public function reloadWatchDirectoryAction()
|
||||
{
|
||||
$chosen = $this->getRequest()->getParam("dir");
|
||||
$element = $this->getRequest()->getParam("element");
|
||||
$chosen = $this->getRequest()->getParam('dir');
|
||||
$element = $this->getRequest()->getParam('element');
|
||||
$watched_dirs_form = new Application_Form_WatchedDirPreferences();
|
||||
|
||||
$res = Application_Model_MusicDir::addWatchedDir($chosen);
|
||||
if ($res['code'] != 0) {
|
||||
$watched_dirs_form->populate(array('watchedFolder' => $chosen));
|
||||
$watched_dirs_form->getElement($element)->setErrors(array($res['error']));
|
||||
$watched_dirs_form->populate(['watchedFolder' => $chosen]);
|
||||
$watched_dirs_form->getElement($element)->setErrors([$res['error']]);
|
||||
}
|
||||
|
||||
$this->view->subform = $watched_dirs_form->render();
|
||||
|
@ -415,17 +415,17 @@ class PreferenceController extends Zend_Controller_Action
|
|||
{
|
||||
$dir_path = $this->getRequest()->getParam('dir');
|
||||
$dir = Application_Model_MusicDir::getDirByPath($dir_path);
|
||||
$data = array( 'directory' => $dir->getDirectory(),
|
||||
'id' => $dir->getId());
|
||||
$data = ['directory' => $dir->getDirectory(),
|
||||
'id' => $dir->getId(), ];
|
||||
Application_Model_RabbitMq::SendMessageToMediaMonitor('rescan_watch', $data);
|
||||
Logging::info("Unhiding all files belonging to:: $dir_path");
|
||||
Logging::info("Unhiding all files belonging to:: {$dir_path}");
|
||||
$dir->unhideFiles();
|
||||
$this->_helper->json->sendJson(null);
|
||||
}
|
||||
|
||||
public function removeWatchDirectoryAction()
|
||||
{
|
||||
$chosen = $this->getRequest()->getParam("dir");
|
||||
$chosen = $this->getRequest()->getParam('dir');
|
||||
|
||||
$dir = Application_Model_MusicDir::removeWatchedDir($chosen);
|
||||
|
||||
|
@ -437,7 +437,7 @@ class PreferenceController extends Zend_Controller_Action
|
|||
{
|
||||
$now = time();
|
||||
$res = false;
|
||||
if (Application_Model_Preference::GetImportTimestamp()+10 > $now) {
|
||||
if (Application_Model_Preference::GetImportTimestamp() + 10 > $now) {
|
||||
$res = true;
|
||||
}
|
||||
$this->_helper->json->sendJson($res);
|
||||
|
@ -445,15 +445,15 @@ class PreferenceController extends Zend_Controller_Action
|
|||
|
||||
public function getLiquidsoapStatusAction()
|
||||
{
|
||||
$out = array();
|
||||
$out = [];
|
||||
$num_of_stream = intval(Application_Model_Preference::GetNumOfStreams());
|
||||
for ($i=1; $i<=$num_of_stream; $i++) {
|
||||
for ($i = 1; $i <= $num_of_stream; ++$i) {
|
||||
$status = Application_Model_StreamSetting::getLiquidsoapError($i);
|
||||
$status = $status == NULL?_("Problem with Liquidsoap..."):$status;
|
||||
$status = $status == null ? _('Problem with Liquidsoap...') : $status;
|
||||
if (!Application_Model_StreamSetting::getStreamEnabled($i)) {
|
||||
$status = "N/A";
|
||||
$status = 'N/A';
|
||||
}
|
||||
$out[] = array("id"=>$i, "status"=>$status);
|
||||
$out[] = ['id' => $i, 'status' => $status];
|
||||
}
|
||||
$this->_helper->json->sendJson($out);
|
||||
}
|
||||
|
@ -463,9 +463,9 @@ class PreferenceController extends Zend_Controller_Action
|
|||
SessionHelper::reopenSessionForWriting();
|
||||
|
||||
$request = $this->getRequest();
|
||||
$type = $request->getParam("type", null);
|
||||
$url = urldecode($request->getParam("url", null));
|
||||
$override = $request->getParam("override", false);
|
||||
$type = $request->getParam('type', null);
|
||||
$url = urldecode($request->getParam('url', null));
|
||||
$override = $request->getParam('override', false);
|
||||
|
||||
if ($type == 'masterdj') {
|
||||
Application_Model_Preference::SetMasterDJSourceConnectionURL($url);
|
||||
|
@ -482,13 +482,13 @@ class PreferenceController extends Zend_Controller_Action
|
|||
{
|
||||
SessionHelper::reopenSessionForWriting();
|
||||
|
||||
$out = array();
|
||||
$out = [];
|
||||
$num_of_stream = intval(Application_Model_Preference::GetNumOfStreams());
|
||||
for ($i=1; $i<=$num_of_stream; $i++) {
|
||||
if (Application_Model_StreamSetting::getAdminPass('s'.$i)=='') {
|
||||
$out["s".$i] = false;
|
||||
for ($i = 1; $i <= $num_of_stream; ++$i) {
|
||||
if (Application_Model_StreamSetting::getAdminPass('s' . $i) == '') {
|
||||
$out['s' . $i] = false;
|
||||
} else {
|
||||
$out["s".$i] = true;
|
||||
$out['s' . $i] = true;
|
||||
}
|
||||
}
|
||||
$this->_helper->json->sendJson($out);
|
||||
|
@ -501,7 +501,8 @@ class PreferenceController extends Zend_Controller_Action
|
|||
|
||||
if (!SecurityHelper::verifyCSRFToken($this->_getParam('csrf_token'))) {
|
||||
Logging::error(__FILE__ . ': Invalid CSRF token');
|
||||
$this->_helper->json->sendJson(array("jsonrpc" => "2.0", "valid" => false, "error" => "CSRF token did not match."));
|
||||
$this->_helper->json->sendJson(['jsonrpc' => '2.0', 'valid' => false, 'error' => 'CSRF token did not match.']);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -510,8 +511,10 @@ class PreferenceController extends Zend_Controller_Action
|
|||
$method = $_SERVER['REQUEST_METHOD'];
|
||||
if (!($method == 'POST')) {
|
||||
$this->getResponse()
|
||||
->setHttpResponseCode(405)
|
||||
->appendBody(_("Request method not accepted") . ": $method");
|
||||
->setHttpResponseCode(405)
|
||||
->appendBody(_('Request method not accepted') . ": {$method}")
|
||||
;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -520,16 +523,19 @@ class PreferenceController extends Zend_Controller_Action
|
|||
$this->deleteStoredFiles();
|
||||
|
||||
$this->getResponse()
|
||||
->setHttpResponseCode(200)
|
||||
->appendBody("OK");
|
||||
->setHttpResponseCode(200)
|
||||
->appendBody('OK')
|
||||
;
|
||||
}
|
||||
|
||||
private function deleteFutureScheduleItems() {
|
||||
$utcTimezone = new DateTimeZone("UTC");
|
||||
$nowDateTime = new DateTime("now", $utcTimezone);
|
||||
private function deleteFutureScheduleItems()
|
||||
{
|
||||
$utcTimezone = new DateTimeZone('UTC');
|
||||
$nowDateTime = new DateTime('now', $utcTimezone);
|
||||
$scheduleItems = CcScheduleQuery::create()
|
||||
->filterByDbEnds($nowDateTime->format(DEFAULT_TIMESTAMP_FORMAT), Criteria::GREATER_THAN)
|
||||
->find();
|
||||
->find()
|
||||
;
|
||||
|
||||
// Delete all the schedule items
|
||||
foreach ($scheduleItems as $i) {
|
||||
|
@ -549,20 +555,22 @@ class PreferenceController extends Zend_Controller_Action
|
|||
}
|
||||
}
|
||||
|
||||
private function deleteCloudFiles() {
|
||||
private function deleteCloudFiles()
|
||||
{
|
||||
try {
|
||||
$CC_CONFIG = Config::getConfig();
|
||||
|
||||
foreach ($CC_CONFIG["supportedStorageBackends"] as $storageBackend) {
|
||||
foreach ($CC_CONFIG['supportedStorageBackends'] as $storageBackend) {
|
||||
$proxyStorageBackend = new ProxyStorageBackend($storageBackend);
|
||||
$proxyStorageBackend->deleteAllCloudFileObjects();
|
||||
}
|
||||
} catch(Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
Logging::info($e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
private function deleteStoredFiles() {
|
||||
private function deleteStoredFiles()
|
||||
{
|
||||
// Delete all files from the database
|
||||
$files = CcFilesQuery::create()->find();
|
||||
foreach ($files as $file) {
|
||||
|
@ -572,5 +580,4 @@ class PreferenceController extends Zend_Controller_Action
|
|||
$storedFile->delete(true);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
<?php
|
||||
|
||||
class RenderController extends Zend_Controller_Action {
|
||||
|
||||
public function init() {
|
||||
class RenderController extends Zend_Controller_Action
|
||||
{
|
||||
public function init()
|
||||
{
|
||||
$this->view->layout()->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender(true);
|
||||
|
||||
|
@ -12,9 +13,9 @@ class RenderController extends Zend_Controller_Action {
|
|||
$this->view->csrf = $csrf_element;
|
||||
}
|
||||
|
||||
public function podcastUrlDialogAction() {
|
||||
public function podcastUrlDialogAction()
|
||||
{
|
||||
$path = 'podcast/podcast_url_dialog.phtml';
|
||||
$this->_helper->json->sendJson(array("html"=>$this->view->render($path)));
|
||||
$this->_helper->json->sendJson(['html' => $this->view->render($path)]);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,43 +2,43 @@
|
|||
|
||||
class ScheduleController extends Zend_Controller_Action
|
||||
{
|
||||
|
||||
protected $sched_sess = null;
|
||||
protected $sched_sess;
|
||||
|
||||
public function init()
|
||||
{
|
||||
$ajaxContext = $this->_helper->getHelper('AjaxContext');
|
||||
$ajaxContext->addActionContext('event-feed', 'json')
|
||||
->addActionContext('event-feed-preload', 'json')
|
||||
->addActionContext('make-context-menu', 'json')
|
||||
->addActionContext('add-show-dialog', 'json')
|
||||
->addActionContext('add-show', 'json')
|
||||
->addActionContext('edit-show', 'json')
|
||||
->addActionContext('move-show', 'json')
|
||||
->addActionContext('resize-show', 'json')
|
||||
->addActionContext('delete-show-instance', 'json')
|
||||
->addActionContext('show-content-dialog', 'json')
|
||||
->addActionContext('clear-show', 'json')
|
||||
->addActionContext('get-current-playlist', 'json')
|
||||
->addActionContext('remove-group', 'json')
|
||||
->addActionContext('populate-show-form', 'json')
|
||||
->addActionContext('populate-repeating-show-instance-form', 'json')
|
||||
->addActionContext('delete-show', 'json')
|
||||
->addActionContext('cancel-current-show', 'json')
|
||||
->addActionContext('get-form', 'json')
|
||||
->addActionContext('upload-to-sound-cloud', 'json')
|
||||
->addActionContext('content-context-menu', 'json')
|
||||
->addActionContext('set-time-scale', 'json')
|
||||
->addActionContext('set-time-interval', 'json')
|
||||
->addActionContext('edit-repeating-show-instance', 'json')
|
||||
->addActionContext('dj-edit-show', 'json')
|
||||
->addActionContext('calculate-duration', 'json')
|
||||
->addActionContext('get-current-show', 'json')
|
||||
->addActionContext('update-future-is-scheduled', 'json')
|
||||
->addActionContext('localize-start-end-time', 'json')
|
||||
->initContext();
|
||||
->addActionContext('event-feed-preload', 'json')
|
||||
->addActionContext('make-context-menu', 'json')
|
||||
->addActionContext('add-show-dialog', 'json')
|
||||
->addActionContext('add-show', 'json')
|
||||
->addActionContext('edit-show', 'json')
|
||||
->addActionContext('move-show', 'json')
|
||||
->addActionContext('resize-show', 'json')
|
||||
->addActionContext('delete-show-instance', 'json')
|
||||
->addActionContext('show-content-dialog', 'json')
|
||||
->addActionContext('clear-show', 'json')
|
||||
->addActionContext('get-current-playlist', 'json')
|
||||
->addActionContext('remove-group', 'json')
|
||||
->addActionContext('populate-show-form', 'json')
|
||||
->addActionContext('populate-repeating-show-instance-form', 'json')
|
||||
->addActionContext('delete-show', 'json')
|
||||
->addActionContext('cancel-current-show', 'json')
|
||||
->addActionContext('get-form', 'json')
|
||||
->addActionContext('upload-to-sound-cloud', 'json')
|
||||
->addActionContext('content-context-menu', 'json')
|
||||
->addActionContext('set-time-scale', 'json')
|
||||
->addActionContext('set-time-interval', 'json')
|
||||
->addActionContext('edit-repeating-show-instance', 'json')
|
||||
->addActionContext('dj-edit-show', 'json')
|
||||
->addActionContext('calculate-duration', 'json')
|
||||
->addActionContext('get-current-show', 'json')
|
||||
->addActionContext('update-future-is-scheduled', 'json')
|
||||
->addActionContext('localize-start-end-time', 'json')
|
||||
->initContext()
|
||||
;
|
||||
|
||||
$this->sched_sess = new Zend_Session_Namespace("schedule");
|
||||
$this->sched_sess = new Zend_Session_Namespace('schedule');
|
||||
}
|
||||
|
||||
public function indexAction()
|
||||
|
@ -53,66 +53,66 @@ class ScheduleController extends Zend_Controller_Action
|
|||
$events = json_encode($scheduleController->view->events);
|
||||
|
||||
$this->view->headScript()->appendScript(
|
||||
"var calendarPref = {};\n".
|
||||
"calendarPref.weekStart = ".Application_Model_Preference::GetWeekStartDay().";\n".
|
||||
"calendarPref.timestamp = ".time().";\n".
|
||||
"calendarPref.timezoneOffset = ".Application_Common_DateHelper::getUserTimezoneOffset().";\n".
|
||||
"calendarPref.timeScale = '".Application_Model_Preference::GetCalendarTimeScale()."';\n".
|
||||
"calendarPref.timeInterval = ".Application_Model_Preference::GetCalendarTimeInterval().";\n".
|
||||
"calendarPref.weekStartDay = ".Application_Model_Preference::GetWeekStartDay().";\n".
|
||||
"var calendarEvents = $events;"
|
||||
"var calendarPref = {};\n" .
|
||||
'calendarPref.weekStart = ' . Application_Model_Preference::GetWeekStartDay() . ";\n" .
|
||||
'calendarPref.timestamp = ' . time() . ";\n" .
|
||||
'calendarPref.timezoneOffset = ' . Application_Common_DateHelper::getUserTimezoneOffset() . ";\n" .
|
||||
"calendarPref.timeScale = '" . Application_Model_Preference::GetCalendarTimeScale() . "';\n" .
|
||||
'calendarPref.timeInterval = ' . Application_Model_Preference::GetCalendarTimeInterval() . ";\n" .
|
||||
'calendarPref.weekStartDay = ' . Application_Model_Preference::GetWeekStartDay() . ";\n" .
|
||||
"var calendarEvents = {$events};"
|
||||
);
|
||||
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/contextmenu/jquery.contextMenu.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl . 'js/contextmenu/jquery.contextMenu.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
|
||||
//full-calendar-functions.js requires this variable, so that datePicker widget can be offset to server time instead of client time
|
||||
//this should be as a default, however with our new drop down timezone changing for shows, we should reset this offset then??
|
||||
$this->view->headScript()->appendScript("var timezoneOffset = ".Application_Common_DateHelper::getStationTimezoneOffset()."; //in seconds");
|
||||
$this->view->headScript()->appendScript('var timezoneOffset = ' . Application_Common_DateHelper::getStationTimezoneOffset() . '; //in seconds');
|
||||
//set offset to ensure it loads last
|
||||
$this->view->headScript()->offsetSetFile(90, $baseUrl.'js/airtime/schedule/full-calendar-functions.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headScript()->offsetSetFile(90, $baseUrl . 'js/airtime/schedule/full-calendar-functions.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/fullcalendar/fullcalendar.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/timepicker/jquery.ui.timepicker.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/colorpicker/js/colorpicker.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl . 'js/fullcalendar/fullcalendar.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl . 'js/timepicker/jquery.ui.timepicker.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl . 'js/colorpicker/js/colorpicker.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
|
||||
// This block needs to be added before the add-show.js script
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/libs/dayjs.min.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/libs/utc.min.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/libs/timezone.min.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl . 'js/libs/dayjs.min.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl . 'js/libs/utc.min.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl . 'js/libs/timezone.min.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/airtime/schedule/add-show.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headScript()->offsetSetFile(100, $baseUrl.'js/airtime/schedule/schedule.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/blockui/jquery.blockUI.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl . 'js/airtime/schedule/add-show.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
$this->view->headScript()->offsetSetFile(100, $baseUrl . 'js/airtime/schedule/schedule.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl . 'js/blockui/jquery.blockUI.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
|
||||
$this->view->headLink()->appendStylesheet($baseUrl.'css/jquery.ui.timepicker.css?'.$CC_CONFIG['airtime_version']);
|
||||
$this->view->headLink()->appendStylesheet($baseUrl.'css/fullcalendar.css?'.$CC_CONFIG['airtime_version']);
|
||||
$this->view->headLink()->appendStylesheet($baseUrl.'css/colorpicker/css/colorpicker.css?'.$CC_CONFIG['airtime_version']);
|
||||
$this->view->headLink()->appendStylesheet($baseUrl.'css/add-show.css?'.$CC_CONFIG['airtime_version']);
|
||||
$this->view->headLink()->appendStylesheet($baseUrl.'css/jquery.contextMenu.css?'.$CC_CONFIG['airtime_version']);
|
||||
$this->view->headLink()->appendStylesheet($baseUrl . 'css/jquery.ui.timepicker.css?' . $CC_CONFIG['airtime_version']);
|
||||
$this->view->headLink()->appendStylesheet($baseUrl . 'css/fullcalendar.css?' . $CC_CONFIG['airtime_version']);
|
||||
$this->view->headLink()->appendStylesheet($baseUrl . 'css/colorpicker/css/colorpicker.css?' . $CC_CONFIG['airtime_version']);
|
||||
$this->view->headLink()->appendStylesheet($baseUrl . 'css/add-show.css?' . $CC_CONFIG['airtime_version']);
|
||||
$this->view->headLink()->appendStylesheet($baseUrl . 'css/jquery.contextMenu.css?' . $CC_CONFIG['airtime_version']);
|
||||
|
||||
//Start Show builder JS/CSS requirements
|
||||
$headScript = $this->view->headScript();
|
||||
AirtimeTableView::injectTableJavaScriptDependencies($headScript, $baseUrl, $CC_CONFIG['airtime_version']);
|
||||
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/airtime/utilities/utilities.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl . 'js/airtime/utilities/utilities.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/airtime/buttons/buttons.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/airtime/library/events/library_showbuilder.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/airtime/library/library.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/airtime/showbuilder/builder.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl . 'js/airtime/buttons/buttons.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl . 'js/airtime/library/events/library_showbuilder.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl . 'js/airtime/library/library.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl . 'js/airtime/showbuilder/builder.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
|
||||
$this->view->headLink()->appendStylesheet($baseUrl.'css/media_library.css?'.$CC_CONFIG['airtime_version']);
|
||||
$this->view->headLink()->appendStylesheet($baseUrl.'css/jquery.contextMenu.css?'.$CC_CONFIG['airtime_version']);
|
||||
$this->view->headLink()->appendStylesheet($baseUrl.'css/datatables/css/ColVis.css?'.$CC_CONFIG['airtime_version']);
|
||||
$this->view->headLink()->appendStylesheet($baseUrl.'css/datatables/css/dataTables.colReorder.min.css?'.$CC_CONFIG['airtime_version']);
|
||||
$this->view->headLink()->appendStylesheet($baseUrl.'css/showbuilder.css?'.$CC_CONFIG['airtime_version']);
|
||||
$this->view->headLink()->appendStylesheet($baseUrl.'css/dashboard.css?'.$CC_CONFIG['airtime_version']);
|
||||
$this->view->headLink()->appendStylesheet($baseUrl . 'css/media_library.css?' . $CC_CONFIG['airtime_version']);
|
||||
$this->view->headLink()->appendStylesheet($baseUrl . 'css/jquery.contextMenu.css?' . $CC_CONFIG['airtime_version']);
|
||||
$this->view->headLink()->appendStylesheet($baseUrl . 'css/datatables/css/ColVis.css?' . $CC_CONFIG['airtime_version']);
|
||||
$this->view->headLink()->appendStylesheet($baseUrl . 'css/datatables/css/dataTables.colReorder.min.css?' . $CC_CONFIG['airtime_version']);
|
||||
$this->view->headLink()->appendStylesheet($baseUrl . 'css/showbuilder.css?' . $CC_CONFIG['airtime_version']);
|
||||
$this->view->headLink()->appendStylesheet($baseUrl . 'css/dashboard.css?' . $CC_CONFIG['airtime_version']);
|
||||
//End Show builder JS/CSS requirements
|
||||
|
||||
$this->createShowFormAction(true);
|
||||
|
||||
$user = Application_Model_User::getCurrentUser();
|
||||
if ($user->isUserType(array(UTYPE_SUPERADMIN, UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER))) {
|
||||
if ($user->isUserType([UTYPE_SUPERADMIN, UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER])) {
|
||||
$this->view->preloadShowForm = true;
|
||||
}
|
||||
|
||||
|
@ -127,12 +127,15 @@ class ScheduleController extends Zend_Controller_Action
|
|||
$userTimezone = new DateTimeZone(Application_Model_Preference::GetUserTimezone());
|
||||
|
||||
$start = new DateTime($this->_getParam('start', null), $userTimezone);
|
||||
$start->setTimezone(new DateTimeZone("UTC"));
|
||||
$start->setTimezone(new DateTimeZone('UTC'));
|
||||
$end = new DateTime($this->_getParam('end', null), $userTimezone);
|
||||
$end->setTimezone(new DateTimeZone("UTC"));
|
||||
$end->setTimezone(new DateTimeZone('UTC'));
|
||||
|
||||
$events = &Application_Model_Show::getFullCalendarEvents($start, $end,
|
||||
$currentUser->isAdminOrPM());
|
||||
$events = &Application_Model_Show::getFullCalendarEvents(
|
||||
$start,
|
||||
$end,
|
||||
$currentUser->isAdminOrPM()
|
||||
);
|
||||
|
||||
$this->view->events = $events;
|
||||
}
|
||||
|
@ -141,17 +144,17 @@ class ScheduleController extends Zend_Controller_Action
|
|||
{
|
||||
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
|
||||
$user = new Application_Model_User($userInfo->id);
|
||||
$editable = $user->isUserType(array(UTYPE_SUPERADMIN, UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER));
|
||||
$editable = $user->isUserType([UTYPE_SUPERADMIN, UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER]);
|
||||
|
||||
$calendar_interval = Application_Model_Preference::GetCalendarTimeScale();
|
||||
if ($calendar_interval == "agendaDay") {
|
||||
if ($calendar_interval == 'agendaDay') {
|
||||
list($start, $end) = Application_Model_Show::getStartEndCurrentDayView();
|
||||
} else if ($calendar_interval == "agendaWeek") {
|
||||
} elseif ($calendar_interval == 'agendaWeek') {
|
||||
list($start, $end) = Application_Model_Show::getStartEndCurrentWeekView();
|
||||
} else if ($calendar_interval == "month") {
|
||||
} elseif ($calendar_interval == 'month') {
|
||||
list($start, $end) = Application_Model_Show::getStartEndCurrentMonthPlusView();
|
||||
} else {
|
||||
Logging::error("Invalid Calendar Interval '$calendar_interval'");
|
||||
Logging::error("Invalid Calendar Interval '{$calendar_interval}'");
|
||||
}
|
||||
|
||||
$events = &Application_Model_Show::getFullCalendarEvents($start, $end, $editable);
|
||||
|
@ -162,7 +165,7 @@ class ScheduleController extends Zend_Controller_Action
|
|||
{
|
||||
$currentShow = Application_Model_Show::getCurrentShow();
|
||||
if (!empty($currentShow)) {
|
||||
$this->view->si_id = $currentShow[0]["instance_id"];
|
||||
$this->view->si_id = $currentShow[0]['instance_id'];
|
||||
$this->view->current_show = true;
|
||||
} else {
|
||||
$this->view->current_show = false;
|
||||
|
@ -174,20 +177,22 @@ class ScheduleController extends Zend_Controller_Action
|
|||
$deltaDay = $this->_getParam('day');
|
||||
$deltaMin = $this->_getParam('min');
|
||||
|
||||
$log_vars = array();
|
||||
$log_vars["url"] = $_SERVER['HTTP_HOST'];
|
||||
$log_vars["action"] = "schedule/move-show";
|
||||
$log_vars["params"] = array();
|
||||
$log_vars["params"]["instance id"] = $this->_getParam('showInstanceId');
|
||||
$log_vars["params"]["delta day"] = $deltaDay;
|
||||
$log_vars["params"]["delta minute"] = $deltaMin;
|
||||
$log_vars = [];
|
||||
$log_vars['url'] = $_SERVER['HTTP_HOST'];
|
||||
$log_vars['action'] = 'schedule/move-show';
|
||||
$log_vars['params'] = [];
|
||||
$log_vars['params']['instance id'] = $this->_getParam('showInstanceId');
|
||||
$log_vars['params']['delta day'] = $deltaDay;
|
||||
$log_vars['params']['delta minute'] = $deltaMin;
|
||||
Logging::info($log_vars);
|
||||
|
||||
try {
|
||||
$service_calendar = new Application_Service_CalendarService(
|
||||
$this->_getParam('showInstanceId'));
|
||||
$this->_getParam('showInstanceId')
|
||||
);
|
||||
} catch (Exception $e) {
|
||||
$this->view->show_error = true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -204,19 +209,19 @@ class ScheduleController extends Zend_Controller_Action
|
|||
$showId = $this->_getParam('showId');
|
||||
$instanceId = $this->_getParam('instanceId');
|
||||
|
||||
$log_vars = array();
|
||||
$log_vars["url"] = $_SERVER['HTTP_HOST'];
|
||||
$log_vars["action"] = "schedule/resize-show";
|
||||
$log_vars["params"] = array();
|
||||
$log_vars["params"]["instance id"] = $instanceId;
|
||||
$log_vars["params"]["delta day"] = $deltaDay;
|
||||
$log_vars["params"]["delta minute"] = $deltaMin;
|
||||
$log_vars = [];
|
||||
$log_vars['url'] = $_SERVER['HTTP_HOST'];
|
||||
$log_vars['action'] = 'schedule/resize-show';
|
||||
$log_vars['params'] = [];
|
||||
$log_vars['params']['instance id'] = $instanceId;
|
||||
$log_vars['params']['delta day'] = $deltaDay;
|
||||
$log_vars['params']['delta minute'] = $deltaMin;
|
||||
Logging::info($log_vars);
|
||||
|
||||
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
|
||||
$user = new Application_Model_User($userInfo->id);
|
||||
|
||||
if ($user->isUserType(array(UTYPE_SUPERADMIN, UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER))) {
|
||||
if ($user->isUserType([UTYPE_SUPERADMIN, UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER])) {
|
||||
try {
|
||||
$show = new Application_Model_Show($showId);
|
||||
} catch (Exception $e) {
|
||||
|
@ -236,11 +241,11 @@ class ScheduleController extends Zend_Controller_Action
|
|||
{
|
||||
$instanceId = $this->_getParam('id');
|
||||
|
||||
$log_vars = array();
|
||||
$log_vars["url"] = $_SERVER['HTTP_HOST'];
|
||||
$log_vars["action"] = "schedule/delete-show-instance";
|
||||
$log_vars["params"] = array();
|
||||
$log_vars["params"]["instance id"] = $instanceId;
|
||||
$log_vars = [];
|
||||
$log_vars['url'] = $_SERVER['HTTP_HOST'];
|
||||
$log_vars['action'] = 'schedule/delete-show-instance';
|
||||
$log_vars['params'] = [];
|
||||
$log_vars['params']['instance id'] = $instanceId;
|
||||
Logging::info($log_vars);
|
||||
|
||||
$service_show = new Application_Service_ShowService();
|
||||
|
@ -265,17 +270,18 @@ class ScheduleController extends Zend_Controller_Action
|
|||
{
|
||||
$instanceId = $this->_getParam('id');
|
||||
|
||||
$log_vars = array();
|
||||
$log_vars["url"] = $_SERVER['HTTP_HOST'];
|
||||
$log_vars["action"] = "schedule/clear-show";
|
||||
$log_vars["params"] = array();
|
||||
$log_vars["params"]["instance id"] = $instanceId;
|
||||
$log_vars = [];
|
||||
$log_vars['url'] = $_SERVER['HTTP_HOST'];
|
||||
$log_vars['action'] = 'schedule/clear-show';
|
||||
$log_vars['params'] = [];
|
||||
$log_vars['params']['instance id'] = $instanceId;
|
||||
Logging::info($log_vars);
|
||||
|
||||
$service_scheduler = new Application_Service_SchedulerService();
|
||||
|
||||
if (!$service_scheduler->emptyShowContent($instanceId)) {
|
||||
$this->view->show_error = true;
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -288,7 +294,7 @@ class ScheduleController extends Zend_Controller_Action
|
|||
$front = Zend_Controller_Front::getInstance();
|
||||
$scheduleController = new ScheduleController($front->getRequest(), $front->getResponse());
|
||||
$scheduleController->getCurrentPlaylistAction();
|
||||
echo(json_encode($scheduleController->view));
|
||||
echo json_encode($scheduleController->view);
|
||||
}
|
||||
|
||||
public function getCurrentPlaylistAction()
|
||||
|
@ -297,49 +303,49 @@ class ScheduleController extends Zend_Controller_Action
|
|||
|
||||
$show = Application_Model_Show::getCurrentShow();
|
||||
|
||||
/* Convert all UTC times to localtime before sending back to user. */
|
||||
$range["schedulerTime"] = Application_Common_DateHelper::UTCStringToUserTimezoneString($range["schedulerTime"]);
|
||||
// Convert all UTC times to localtime before sending back to user.
|
||||
$range['schedulerTime'] = Application_Common_DateHelper::UTCStringToUserTimezoneString($range['schedulerTime']);
|
||||
|
||||
if (isset($range["previous"])) {
|
||||
$range["previous"]["starts"] = Application_Common_DateHelper::UTCStringToUserTimezoneString($range["previous"]["starts"]);
|
||||
$range["previous"]["ends"] = Application_Common_DateHelper::UTCStringToUserTimezoneString($range["previous"]["ends"]);
|
||||
if (isset($range['previous'])) {
|
||||
$range['previous']['starts'] = Application_Common_DateHelper::UTCStringToUserTimezoneString($range['previous']['starts']);
|
||||
$range['previous']['ends'] = Application_Common_DateHelper::UTCStringToUserTimezoneString($range['previous']['ends']);
|
||||
}
|
||||
if (isset($range["current"])) {
|
||||
if (isset($range["current"]["metadata"])) {
|
||||
$get_artwork = FileDataHelper::getArtworkData($range["current"]["metadata"]["artwork"], 256);
|
||||
$range["current"]["metadata"]["artwork_data"] = $get_artwork;
|
||||
if (isset($range['current'])) {
|
||||
if (isset($range['current']['metadata'])) {
|
||||
$get_artwork = FileDataHelper::getArtworkData($range['current']['metadata']['artwork'], 256);
|
||||
$range['current']['metadata']['artwork_data'] = $get_artwork;
|
||||
}
|
||||
$range["current"]["starts"] = Application_Common_DateHelper::UTCStringToUserTimezoneString($range["current"]["starts"]);
|
||||
$range["current"]["ends"] = Application_Common_DateHelper::UTCStringToUserTimezoneString($range["current"]["ends"]);
|
||||
$range['current']['starts'] = Application_Common_DateHelper::UTCStringToUserTimezoneString($range['current']['starts']);
|
||||
$range['current']['ends'] = Application_Common_DateHelper::UTCStringToUserTimezoneString($range['current']['ends']);
|
||||
}
|
||||
if (isset($range["next"])) {
|
||||
$range["next"]["starts"] = Application_Common_DateHelper::UTCStringToUserTimezoneString($range["next"]["starts"]);
|
||||
$range["next"]["ends"] = Application_Common_DateHelper::UTCStringToUserTimezoneString($range["next"]["ends"]);
|
||||
if (isset($range['next'])) {
|
||||
$range['next']['starts'] = Application_Common_DateHelper::UTCStringToUserTimezoneString($range['next']['starts']);
|
||||
$range['next']['ends'] = Application_Common_DateHelper::UTCStringToUserTimezoneString($range['next']['ends']);
|
||||
}
|
||||
|
||||
Application_Common_DateHelper::convertTimestamps(
|
||||
$range["currentShow"],
|
||||
array("starts", "ends", "start_timestamp", "end_timestamp"),
|
||||
"user"
|
||||
$range['currentShow'],
|
||||
['starts', 'ends', 'start_timestamp', 'end_timestamp'],
|
||||
'user'
|
||||
);
|
||||
Application_Common_DateHelper::convertTimestamps(
|
||||
$range["nextShow"],
|
||||
array("starts", "ends", "start_timestamp", "end_timestamp"),
|
||||
"user"
|
||||
$range['nextShow'],
|
||||
['starts', 'ends', 'start_timestamp', 'end_timestamp'],
|
||||
'user'
|
||||
);
|
||||
|
||||
//TODO: Add timezone and timezoneOffset back into the ApiController's results.
|
||||
$range["timezone"] = Application_Common_DateHelper::getUserTimezoneAbbreviation();
|
||||
$range["timezoneOffset"] = Application_Common_DateHelper::getUserTimezoneOffset();
|
||||
$range['timezone'] = Application_Common_DateHelper::getUserTimezoneAbbreviation();
|
||||
$range['timezoneOffset'] = Application_Common_DateHelper::getUserTimezoneOffset();
|
||||
|
||||
$source_status = array();
|
||||
$switch_status = array();
|
||||
$live_dj = Application_Model_Preference::GetSourceStatus("live_dj");
|
||||
$master_dj = Application_Model_Preference::GetSourceStatus("master_dj");
|
||||
$source_status = [];
|
||||
$switch_status = [];
|
||||
$live_dj = Application_Model_Preference::GetSourceStatus('live_dj');
|
||||
$master_dj = Application_Model_Preference::GetSourceStatus('master_dj');
|
||||
|
||||
$scheduled_play_switch = Application_Model_Preference::GetSourceSwitchStatus("scheduled_play");
|
||||
$live_dj_switch = Application_Model_Preference::GetSourceSwitchStatus("live_dj");
|
||||
$master_dj_switch = Application_Model_Preference::GetSourceSwitchStatus("master_dj");
|
||||
$scheduled_play_switch = Application_Model_Preference::GetSourceSwitchStatus('scheduled_play');
|
||||
$live_dj_switch = Application_Model_Preference::GetSourceSwitchStatus('live_dj');
|
||||
$master_dj_switch = Application_Model_Preference::GetSourceSwitchStatus('master_dj');
|
||||
|
||||
//might not be the correct place to implement this but for now let's just do it here
|
||||
$source_status['live_dj_source'] = $live_dj;
|
||||
|
@ -352,12 +358,13 @@ class ScheduleController extends Zend_Controller_Action
|
|||
$this->view->switch_status = $switch_status;
|
||||
|
||||
$this->view->entries = $range;
|
||||
$this->view->show_name = isset($show[0])?$show[0]["name"]:"";
|
||||
$this->view->show_name = isset($show[0]) ? $show[0]['name'] : '';
|
||||
}
|
||||
|
||||
public function showContentDialogAction()
|
||||
{
|
||||
$showInstanceId = $this->_getParam('id');
|
||||
|
||||
try {
|
||||
$show = new Application_Model_ShowInstance($showInstanceId);
|
||||
} catch (Exception $e) {
|
||||
|
@ -380,14 +387,16 @@ class ScheduleController extends Zend_Controller_Action
|
|||
|
||||
//convert from UTC to user's timezone for display.
|
||||
$displayTimeZone = new DateTimeZone(Application_Model_Preference::GetTimezone());
|
||||
$originalDateTime = new DateTime($originalShowStart, new DateTimeZone("UTC"));
|
||||
$originalDateTime = new DateTime($originalShowStart, new DateTimeZone('UTC'));
|
||||
$originalDateTime->setTimezone($displayTimeZone);
|
||||
|
||||
$this->view->additionalShowInfo =
|
||||
sprintf(_("Rebroadcast of show %s from %s at %s"),
|
||||
sprintf(
|
||||
_('Rebroadcast of show %s from %s at %s'),
|
||||
$originalShowName,
|
||||
$originalDateTime->format("l, F jS"),
|
||||
$originalDateTime->format("G:i"));
|
||||
$originalDateTime->format('l, F jS'),
|
||||
$originalDateTime->format('G:i')
|
||||
);
|
||||
}
|
||||
$this->view->showLength = $show->getShowLength();
|
||||
$this->view->timeFilled = $show->getTimeScheduled();
|
||||
|
@ -409,7 +418,7 @@ class ScheduleController extends Zend_Controller_Action
|
|||
$service_showForm->delegateShowInstanceFormPopulation($forms);
|
||||
|
||||
$this->view->addNewShow = false;
|
||||
$this->view->action = "edit-repeating-show-instance";
|
||||
$this->view->action = 'edit-repeating-show-instance';
|
||||
$this->view->newForm = $this->view->render('schedule/add-show-form.phtml');
|
||||
}
|
||||
|
||||
|
@ -434,7 +443,7 @@ class ScheduleController extends Zend_Controller_Action
|
|||
}
|
||||
}
|
||||
|
||||
$this->view->action = "edit-show";
|
||||
$this->view->action = 'edit-show';
|
||||
$this->view->newForm = $this->view->render('schedule/add-show-form.phtml');
|
||||
$this->view->entries = 5;
|
||||
}
|
||||
|
@ -451,26 +460,29 @@ class ScheduleController extends Zend_Controller_Action
|
|||
}
|
||||
}
|
||||
|
||||
public function editRepeatingShowInstanceAction(){
|
||||
public function editRepeatingShowInstanceAction()
|
||||
{
|
||||
$js = $this->_getParam('data');
|
||||
$data = array();
|
||||
$data = [];
|
||||
|
||||
//need to convert from serialized jQuery array.
|
||||
foreach ($js as $j) {
|
||||
$data[$j["name"]] = $j["value"];
|
||||
$data[$j['name']] = $j['value'];
|
||||
}
|
||||
|
||||
$data['add_show_hosts'] = $this->_getParam('hosts');
|
||||
$data['add_show_hosts'] = $this->_getParam('hosts');
|
||||
|
||||
$log_vars = array();
|
||||
$log_vars["url"] = $_SERVER['HTTP_HOST'];
|
||||
$log_vars["action"] = "schedule/edit-repeating-show-instance";
|
||||
$log_vars["params"] = array();
|
||||
$log_vars["params"]["form_data"] = $data;
|
||||
$log_vars = [];
|
||||
$log_vars['url'] = $_SERVER['HTTP_HOST'];
|
||||
$log_vars['action'] = 'schedule/edit-repeating-show-instance';
|
||||
$log_vars['params'] = [];
|
||||
$log_vars['params']['form_data'] = $data;
|
||||
Logging::info($log_vars);
|
||||
|
||||
$service_showForm = new Application_Service_ShowFormService(
|
||||
$data["add_show_id"], $data["add_show_instance_id"]);
|
||||
$data['add_show_id'],
|
||||
$data['add_show_instance_id']
|
||||
);
|
||||
$service_show = new Application_Service_ShowService(null, $data);
|
||||
|
||||
$forms = $this->createShowFormAction();
|
||||
|
@ -478,23 +490,28 @@ class ScheduleController extends Zend_Controller_Action
|
|||
list($data, $validateStartDate, $validateStartTime, $originalShowStartDateTime) =
|
||||
$service_showForm->preEditShowValidationCheck($data);
|
||||
|
||||
if ($service_showForm->validateShowForms($forms, $data, $validateStartDate,
|
||||
$originalShowStartDateTime, true, $data["add_show_instance_id"])) {
|
||||
|
||||
if ($service_showForm->validateShowForms(
|
||||
$forms,
|
||||
$data,
|
||||
$validateStartDate,
|
||||
$originalShowStartDateTime,
|
||||
true,
|
||||
$data['add_show_instance_id']
|
||||
)) {
|
||||
$service_show->editRepeatingShowInstance($data);
|
||||
|
||||
$this->view->addNewShow = true;
|
||||
$this->view->newForm = $this->view->render('schedule/add-show-form.phtml');
|
||||
} else {
|
||||
} else {
|
||||
if (!$validateStartDate) {
|
||||
$this->view->when->getElement('add_show_start_date')->setOptions(array('disabled' => true));
|
||||
$this->view->when->getElement('add_show_start_date')->setOptions(['disabled' => true]);
|
||||
}
|
||||
if (!$validateStartTime) {
|
||||
$this->view->when->getElement('add_show_start_time')->setOptions(array('disabled' => true));
|
||||
$this->view->when->getElement('add_show_start_time')->setOptions(['disabled' => true]);
|
||||
}
|
||||
$this->view->rr->getElement('add_show_record')->setOptions(array('disabled' => true));
|
||||
$this->view->rr->getElement('add_show_record')->setOptions(['disabled' => true]);
|
||||
$this->view->addNewShow = false;
|
||||
$this->view->action = "edit-repeating-show-instance";
|
||||
$this->view->action = 'edit-repeating-show-instance';
|
||||
$this->view->form = $this->view->render('schedule/add-show-form.phtml');
|
||||
}
|
||||
}
|
||||
|
@ -502,30 +519,31 @@ class ScheduleController extends Zend_Controller_Action
|
|||
public function editShowAction()
|
||||
{
|
||||
$js = $this->_getParam('data');
|
||||
$data = array();
|
||||
$data = [];
|
||||
|
||||
//need to convert from serialized jQuery array.
|
||||
foreach ($js as $j) {
|
||||
$data[$j["name"]] = $j["value"];
|
||||
$data[$j['name']] = $j['value'];
|
||||
}
|
||||
|
||||
$service_showForm = new Application_Service_ShowFormService(
|
||||
$data["add_show_id"]);
|
||||
$data['add_show_id']
|
||||
);
|
||||
$service_show = new Application_Service_ShowService(null, $data, true);
|
||||
|
||||
//TODO: move this to js
|
||||
$data['add_show_hosts'] = $this->_getParam('hosts');
|
||||
$data['add_show_day_check'] = $this->_getParam('days');
|
||||
$data['add_show_hosts'] = $this->_getParam('hosts');
|
||||
$data['add_show_day_check'] = $this->_getParam('days');
|
||||
|
||||
if ($data['add_show_day_check'] == "") {
|
||||
if ($data['add_show_day_check'] == '') {
|
||||
$data['add_show_day_check'] = null;
|
||||
}
|
||||
|
||||
$log_vars = array();
|
||||
$log_vars["url"] = $_SERVER['HTTP_HOST'];
|
||||
$log_vars["action"] = "schedule/edit-show";
|
||||
$log_vars["params"] = array();
|
||||
$log_vars["params"]["form_data"] = $data;
|
||||
$log_vars = [];
|
||||
$log_vars['url'] = $_SERVER['HTTP_HOST'];
|
||||
$log_vars['action'] = 'schedule/edit-show';
|
||||
$log_vars['params'] = [];
|
||||
$log_vars['params']['form_data'] = $data;
|
||||
Logging::info($log_vars);
|
||||
|
||||
$forms = $this->createShowFormAction();
|
||||
|
@ -533,24 +551,30 @@ class ScheduleController extends Zend_Controller_Action
|
|||
list($data, $validateStartDate, $validateStartTime, $originalShowStartDateTime) =
|
||||
$service_showForm->preEditShowValidationCheck($data);
|
||||
|
||||
if ($service_showForm->validateShowForms($forms, $data, $validateStartDate,
|
||||
$originalShowStartDateTime, true, $data["add_show_instance_id"])) {
|
||||
if ($service_showForm->validateShowForms(
|
||||
$forms,
|
||||
$data,
|
||||
$validateStartDate,
|
||||
$originalShowStartDateTime,
|
||||
true,
|
||||
$data['add_show_instance_id']
|
||||
)) {
|
||||
// Get the show ID from the show service to pass as a parameter to the RESTful ShowImageController
|
||||
$this->view->showId = $service_show->addUpdateShow($data);
|
||||
|
||||
$this->view->addNewShow = true;
|
||||
$this->view->addNewShow = true;
|
||||
$this->view->newForm = $this->view->render('schedule/add-show-form.phtml');
|
||||
} else {
|
||||
if (!$validateStartDate) {
|
||||
$this->view->when->getElement('add_show_start_date')->setOptions(array('disabled' => true));
|
||||
$this->view->when->getElement('add_show_start_date')->setOptions(['disabled' => true]);
|
||||
}
|
||||
if (!$validateStartTime) {
|
||||
$this->view->when->getElement('add_show_start_time')->setOptions(array('disabled' => true));
|
||||
$this->view->when->getElement('add_show_start_time')->setOptions(['disabled' => true]);
|
||||
}
|
||||
//$this->view->rr->getElement('add_show_record')->setOptions(array('disabled' => true));
|
||||
|
||||
$this->view->addNewShow = false;
|
||||
$this->view->action = "edit-show";
|
||||
$this->view->action = 'edit-show';
|
||||
$this->view->form = $this->view->render('schedule/add-show-form.phtml');
|
||||
}
|
||||
}
|
||||
|
@ -560,63 +584,61 @@ class ScheduleController extends Zend_Controller_Action
|
|||
$service_showForm = new Application_Service_ShowFormService(null);
|
||||
|
||||
$js = $this->_getParam('data');
|
||||
$data = array();
|
||||
$data = [];
|
||||
|
||||
//need to convert from serialized jQuery array.
|
||||
foreach ($js as $j) {
|
||||
$data[$j["name"]] = $j["value"];
|
||||
$data[$j['name']] = $j['value'];
|
||||
}
|
||||
|
||||
$service_show = new Application_Service_ShowService(null, $data);
|
||||
|
||||
// TODO: move this to js
|
||||
$data['add_show_hosts'] = $this->_getParam('hosts');
|
||||
$data['add_show_day_check'] = $this->_getParam('days');
|
||||
$data['add_show_hosts'] = $this->_getParam('hosts');
|
||||
$data['add_show_day_check'] = $this->_getParam('days');
|
||||
|
||||
if ($data['add_show_day_check'] == "") {
|
||||
if ($data['add_show_day_check'] == '') {
|
||||
$data['add_show_day_check'] = null;
|
||||
}
|
||||
|
||||
$log_vars = array();
|
||||
$log_vars["url"] = $_SERVER['HTTP_HOST'];
|
||||
$log_vars["action"] = "schedule/add-show";
|
||||
$log_vars["params"] = array();
|
||||
$log_vars["params"]["form_data"] = $data;
|
||||
$log_vars = [];
|
||||
$log_vars['url'] = $_SERVER['HTTP_HOST'];
|
||||
$log_vars['action'] = 'schedule/add-show';
|
||||
$log_vars['params'] = [];
|
||||
$log_vars['params']['form_data'] = $data;
|
||||
Logging::info($log_vars);
|
||||
|
||||
$forms = $this->createShowFormAction();
|
||||
|
||||
$this->view->addNewShow = true;
|
||||
|
||||
if ($data['add_show_start_now'] == "now") {
|
||||
|
||||
if ($data['add_show_start_now'] == 'now') {
|
||||
//have to use the timezone the user has entered in the form to check past/present
|
||||
$showTimezone = new DateTimeZone($data["add_show_timezone"]);
|
||||
$nowDateTime = new DateTime("now", $showTimezone);
|
||||
$showTimezone = new DateTimeZone($data['add_show_timezone']);
|
||||
$nowDateTime = new DateTime('now', $showTimezone);
|
||||
//$showStartDateTime = new DateTime($start_time, $showTimezone);
|
||||
//$showEndDateTime = new DateTime($end_time, $showTimezone);
|
||||
|
||||
$data['add_show_start_time'] = $nowDateTime->format("H:i");
|
||||
$data['add_show_start_date'] = $nowDateTime->format("Y-m-d");
|
||||
$data['add_show_start_time'] = $nowDateTime->format('H:i');
|
||||
$data['add_show_start_date'] = $nowDateTime->format('Y-m-d');
|
||||
}
|
||||
|
||||
|
||||
if ($service_showForm->validateShowForms($forms, $data)) {
|
||||
// Get the show ID from the show service to pass as a parameter to the RESTful ShowImageController
|
||||
$this->view->showId = $service_show->addUpdateShow($data);
|
||||
// Get the show ID from the show service to pass as a parameter to the RESTful ShowImageController
|
||||
$this->view->showId = $service_show->addUpdateShow($data);
|
||||
|
||||
//send new show forms to the user
|
||||
$this->createShowFormAction(true);
|
||||
$this->view->newForm = $this->view->render('schedule/add-show-form.phtml');
|
||||
|
||||
Logging::debug("Show creation succeeded");
|
||||
Logging::debug('Show creation succeeded');
|
||||
} else {
|
||||
$this->view->form = $this->view->render('schedule/add-show-form.phtml');
|
||||
Logging::debug("Show creation failed");
|
||||
$this->view->form = $this->view->render('schedule/add-show-form.phtml');
|
||||
Logging::debug('Show creation failed');
|
||||
}
|
||||
}
|
||||
|
||||
public function createShowFormAction($populateDefaults=false)
|
||||
public function createShowFormAction($populateDefaults = false)
|
||||
{
|
||||
$service_showForm = new Application_Service_ShowFormService();
|
||||
|
||||
|
@ -625,19 +647,22 @@ class ScheduleController extends Zend_Controller_Action
|
|||
// populate forms with default values
|
||||
if ($populateDefaults) {
|
||||
$service_showForm->populateNewShowForms(
|
||||
$forms["what"], $forms["when"], $forms["repeats"]);
|
||||
$forms['what'],
|
||||
$forms['when'],
|
||||
$forms['repeats']
|
||||
);
|
||||
}
|
||||
|
||||
$this->view->what = $forms["what"];
|
||||
$this->view->autoplaylist = $forms["autoplaylist"];
|
||||
$this->view->when = $forms["when"];
|
||||
$this->view->repeats = $forms["repeats"];
|
||||
$this->view->live = $forms["live"];
|
||||
$this->view->rr = $forms["record"];
|
||||
$this->view->absoluteRebroadcast = $forms["abs_rebroadcast"];
|
||||
$this->view->rebroadcast = $forms["rebroadcast"];
|
||||
$this->view->who = $forms["who"];
|
||||
$this->view->style = $forms["style"];
|
||||
$this->view->what = $forms['what'];
|
||||
$this->view->autoplaylist = $forms['autoplaylist'];
|
||||
$this->view->when = $forms['when'];
|
||||
$this->view->repeats = $forms['repeats'];
|
||||
$this->view->live = $forms['live'];
|
||||
$this->view->rr = $forms['record'];
|
||||
$this->view->absoluteRebroadcast = $forms['abs_rebroadcast'];
|
||||
$this->view->rebroadcast = $forms['rebroadcast'];
|
||||
$this->view->who = $forms['who'];
|
||||
$this->view->style = $forms['style'];
|
||||
|
||||
return $forms;
|
||||
}
|
||||
|
@ -646,11 +671,11 @@ class ScheduleController extends Zend_Controller_Action
|
|||
{
|
||||
$instanceId = $this->_getParam('id');
|
||||
|
||||
$log_vars = array();
|
||||
$log_vars["url"] = $_SERVER['HTTP_HOST'];
|
||||
$log_vars["action"] = "schedule/delete-show";
|
||||
$log_vars["params"] = array();
|
||||
$log_vars["params"]["instance id"] = $instanceId;
|
||||
$log_vars = [];
|
||||
$log_vars['url'] = $_SERVER['HTTP_HOST'];
|
||||
$log_vars['action'] = 'schedule/delete-show';
|
||||
$log_vars['params'] = [];
|
||||
$log_vars['params']['instance id'] = $instanceId;
|
||||
Logging::info($log_vars);
|
||||
|
||||
$service_show = new Application_Service_ShowService();
|
||||
|
@ -664,16 +689,16 @@ class ScheduleController extends Zend_Controller_Action
|
|||
|
||||
public function cancelCurrentShowAction()
|
||||
{
|
||||
$log_vars = array();
|
||||
$log_vars["url"] = $_SERVER['HTTP_HOST'];
|
||||
$log_vars["action"] = "schedule/cancel-current-show";
|
||||
$log_vars["params"] = array();
|
||||
$log_vars["params"]["instance id"] = $this->_getParam('id');
|
||||
$log_vars = [];
|
||||
$log_vars['url'] = $_SERVER['HTTP_HOST'];
|
||||
$log_vars['action'] = 'schedule/cancel-current-show';
|
||||
$log_vars['params'] = [];
|
||||
$log_vars['params']['instance id'] = $this->_getParam('id');
|
||||
Logging::info($log_vars);
|
||||
|
||||
$user = Application_Model_User::getCurrentUser();
|
||||
|
||||
if ($user->isUserType(array(UTYPE_SUPERADMIN, UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER))) {
|
||||
if ($user->isUserType([UTYPE_SUPERADMIN, UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER])) {
|
||||
$id = $this->_getParam('id');
|
||||
|
||||
try {
|
||||
|
@ -681,8 +706,8 @@ class ScheduleController extends Zend_Controller_Action
|
|||
$scheduler->cancelShow($id);
|
||||
Application_Model_StoredFile::updatePastFilesIsScheduled();
|
||||
// send kick out source stream signal to pypo
|
||||
$data = array("sourcename"=>"live_dj");
|
||||
Application_Model_RabbitMq::SendMessageToPypo("disconnect_source", $data);
|
||||
$data = ['sourcename' => 'live_dj'];
|
||||
Application_Model_RabbitMq::SendMessageToPypo('disconnect_source', $data);
|
||||
} catch (Exception $e) {
|
||||
$this->view->error = $e->getMessage();
|
||||
Logging::info($e->getMessage());
|
||||
|
@ -705,10 +730,10 @@ class ScheduleController extends Zend_Controller_Action
|
|||
$file = Application_Model_StoredFile::RecallById($file_id);
|
||||
|
||||
$baseUrl = $this->getRequest()->getBaseUrl();
|
||||
$url = $file->getRelativeFileUrl($baseUrl).'download/true';
|
||||
$menu = array();
|
||||
$menu[] = array('action' => array('type' => 'gourl', 'url' => $url),
|
||||
'title' => _('Download'));
|
||||
$url = $file->getRelativeFileUrl($baseUrl) . 'download/true';
|
||||
$menu = [];
|
||||
$menu[] = ['action' => ['type' => 'gourl', 'url' => $url],
|
||||
'title' => _('Download'), ];
|
||||
|
||||
//returns format jjmenu is looking for.
|
||||
$this->_helper->json->sendJson($menu);
|
||||
|
@ -723,7 +748,7 @@ class ScheduleController extends Zend_Controller_Action
|
|||
Application_Model_Preference::SetCalendarTimeScale($this->_getParam('timeScale'));
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Sets the user specific preference for which time interval to use in Calendar.
|
||||
* This is only being used by schedule.js at the moment.
|
||||
*/
|
||||
|
@ -734,14 +759,15 @@ class ScheduleController extends Zend_Controller_Action
|
|||
|
||||
public function calculateDurationAction()
|
||||
{
|
||||
$start = $this->_getParam('startTime');
|
||||
$end = $this->_getParam('endTime');
|
||||
$timezone = $this->_getParam('timezone');
|
||||
$start = $this->_getParam('startTime');
|
||||
$end = $this->_getParam('endTime');
|
||||
$timezone = $this->_getParam('timezone');
|
||||
|
||||
$service_showForm = new Application_Service_ShowFormService();
|
||||
$result = $service_showForm->calculateDuration($start, $end, $timezone);
|
||||
|
||||
echo Zend_Json::encode($result);
|
||||
|
||||
exit();
|
||||
}
|
||||
|
||||
|
@ -752,22 +778,29 @@ class ScheduleController extends Zend_Controller_Action
|
|||
$scheduleService = new Application_Service_SchedulerService();
|
||||
$redrawLibTable = $scheduleService->updateFutureIsScheduled($schedId, false);
|
||||
|
||||
$this->_helper->json->sendJson(array("redrawLibTable" => $redrawLibTable));
|
||||
$this->_helper->json->sendJson(['redrawLibTable' => $redrawLibTable]);
|
||||
}
|
||||
|
||||
public function localizeStartEndTimeAction()
|
||||
{
|
||||
$newTimezone = $this->_getParam('newTimezone');
|
||||
$oldTimezone = $this->_getParam('oldTimezone');
|
||||
$localTime = array();
|
||||
$localTime = [];
|
||||
|
||||
$localTime["start"] = Application_Service_ShowFormService::localizeDateTime(
|
||||
$this->_getParam('startDate'), $this->_getParam('startTime'), $newTimezone, $oldTimezone);
|
||||
$localTime['start'] = Application_Service_ShowFormService::localizeDateTime(
|
||||
$this->_getParam('startDate'),
|
||||
$this->_getParam('startTime'),
|
||||
$newTimezone,
|
||||
$oldTimezone
|
||||
);
|
||||
|
||||
$localTime["end"] = Application_Service_ShowFormService::localizeDateTime(
|
||||
$this->_getParam('endDate'), $this->_getParam('endTime'), $newTimezone, $oldTimezone);
|
||||
$localTime['end'] = Application_Service_ShowFormService::localizeDateTime(
|
||||
$this->_getParam('endDate'),
|
||||
$this->_getParam('endTime'),
|
||||
$newTimezone,
|
||||
$oldTimezone
|
||||
);
|
||||
|
||||
$this->_helper->json->sendJson($localTime);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
<?php
|
||||
|
||||
/** This class displays the Language and Timezone setup popup dialog that you see on first run. */
|
||||
|
||||
class SetupController extends Zend_Controller_Action
|
||||
{
|
||||
public function init()
|
||||
|
@ -19,18 +18,17 @@ class SetupController extends Zend_Controller_Action
|
|||
$form = new Application_Form_SetupLanguageTimezone();
|
||||
|
||||
if ($request->isPost()) {
|
||||
|
||||
$formData = $request->getPost();
|
||||
if ($form->isValid($formData)) {
|
||||
$userService = new Application_Service_UserService();
|
||||
$currentUser = $userService->getCurrentUser();
|
||||
$currentUserId = $currentUser->getDbId();
|
||||
|
||||
Application_Model_Preference::SetUserTimezone($formData["setup_timezone"], $currentUserId);
|
||||
Application_Model_Preference::SetDefaultTimezone($formData["setup_timezone"]);
|
||||
|
||||
Application_Model_Preference::SetUserLocale($formData["setup_language"], $currentUserId);
|
||||
Application_Model_Preference::SetDefaultLocale($formData["setup_language"]);
|
||||
Application_Model_Preference::SetUserTimezone($formData['setup_timezone'], $currentUserId);
|
||||
Application_Model_Preference::SetDefaultTimezone($formData['setup_timezone']);
|
||||
|
||||
Application_Model_Preference::SetUserLocale($formData['setup_language'], $currentUserId);
|
||||
Application_Model_Preference::SetDefaultLocale($formData['setup_language']);
|
||||
|
||||
Application_Model_Preference::setLangTimezoneSetupComplete(true);
|
||||
|
||||
|
@ -39,5 +37,4 @@ class SetupController extends Zend_Controller_Action
|
|||
}
|
||||
$this->_redirect('/showbuilder');
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,18 +2,18 @@
|
|||
|
||||
class ShowbuilderController extends Zend_Controller_Action
|
||||
{
|
||||
|
||||
public function init()
|
||||
{
|
||||
$ajaxContext = $this->_helper->getHelper('AjaxContext');
|
||||
$ajaxContext->addActionContext('schedule-move', 'json')
|
||||
->addActionContext('schedule-add', 'json')
|
||||
->addActionContext('schedule-remove', 'json')
|
||||
->addActionContext('builder-dialog', 'json')
|
||||
->addActionContext('check-builder-feed', 'json')
|
||||
->addActionContext('builder-feed', 'json')
|
||||
->addActionContext('context-menu', 'json')
|
||||
->initContext();
|
||||
->addActionContext('schedule-add', 'json')
|
||||
->addActionContext('schedule-remove', 'json')
|
||||
->addActionContext('builder-dialog', 'json')
|
||||
->addActionContext('check-builder-feed', 'json')
|
||||
->addActionContext('builder-feed', 'json')
|
||||
->addActionContext('context-menu', 'json')
|
||||
->initContext()
|
||||
;
|
||||
}
|
||||
|
||||
public function indexAction()
|
||||
|
@ -24,46 +24,46 @@ class ShowbuilderController extends Zend_Controller_Action
|
|||
|
||||
//$this->_helper->layout->setLayout("showbuilder");
|
||||
|
||||
$this->view->headScript()->appendScript("localStorage.setItem( 'user-type', '$userType' );");
|
||||
$this->view->headScript()->appendScript("localStorage.setItem( 'user-type', '{$userType}' );");
|
||||
|
||||
$this->view->headLink()->appendStylesheet($baseUrl . 'css/redmond/jquery-ui-1.8.8.custom.css?' . $CC_CONFIG['airtime_version']);
|
||||
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/contextmenu/jquery.contextMenu.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl . 'js/contextmenu/jquery.contextMenu.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/blockui/jquery.blockUI.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/airtime/buttons/buttons.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/airtime/utilities/utilities.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl . 'js/blockui/jquery.blockUI.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl . 'js/airtime/buttons/buttons.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl . 'js/airtime/utilities/utilities.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
|
||||
$this->view->headLink()->appendStylesheet($baseUrl.'css/media_library.css?'.$CC_CONFIG['airtime_version']);
|
||||
$this->view->headLink()->appendStylesheet($baseUrl.'css/jquery.contextMenu.css?'.$CC_CONFIG['airtime_version']);
|
||||
$this->view->headLink()->appendStylesheet($baseUrl.'css/datatables/css/ColVis.css?'.$CC_CONFIG['airtime_version']);
|
||||
$this->view->headLink()->appendStylesheet($baseUrl.'css/datatables/css/dataTables.colReorder.min.css?'.$CC_CONFIG['airtime_version']);
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/airtime/library/library.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/airtime/library/events/library_showbuilder.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headLink()->appendStylesheet($baseUrl . 'css/media_library.css?' . $CC_CONFIG['airtime_version']);
|
||||
$this->view->headLink()->appendStylesheet($baseUrl . 'css/jquery.contextMenu.css?' . $CC_CONFIG['airtime_version']);
|
||||
$this->view->headLink()->appendStylesheet($baseUrl . 'css/datatables/css/ColVis.css?' . $CC_CONFIG['airtime_version']);
|
||||
$this->view->headLink()->appendStylesheet($baseUrl . 'css/datatables/css/dataTables.colReorder.min.css?' . $CC_CONFIG['airtime_version']);
|
||||
$this->view->headScript()->appendFile($baseUrl . 'js/airtime/library/library.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl . 'js/airtime/library/events/library_showbuilder.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
$headScript = $this->view->headScript();
|
||||
AirtimeTableView::injectTableJavaScriptDependencies($headScript, $baseUrl, $CC_CONFIG['airtime_version']);
|
||||
|
||||
// PLUPLOAD
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/libs/dropzone.min.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl . 'js/libs/dropzone.min.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/timepicker/jquery.ui.timepicker.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/airtime/showbuilder/tabs.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/airtime/showbuilder/builder.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/airtime/showbuilder/main_builder.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl . 'js/timepicker/jquery.ui.timepicker.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl . 'js/airtime/showbuilder/tabs.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl . 'js/airtime/showbuilder/builder.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl . 'js/airtime/showbuilder/main_builder.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
|
||||
// MEDIA BUILDER
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/libs/dayjs.min.js','text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/libs/utc.min.js','text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/libs/timezone.min.js','text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/airtime/library/spl.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/airtime/library/podcast.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/airtime/library/publish.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/airtime/playlist/smart_blockbuilder.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
$this->view->headLink()->appendStylesheet($baseUrl.'css/playlist_builder.css?'.$CC_CONFIG['airtime_version']);
|
||||
$this->view->headScript()->appendFile($baseUrl . 'js/libs/dayjs.min.js', 'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl . 'js/libs/utc.min.js', 'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl . 'js/libs/timezone.min.js', 'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl . 'js/airtime/library/spl.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl . 'js/airtime/library/podcast.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl . 'js/airtime/library/publish.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl . 'js/airtime/playlist/smart_blockbuilder.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
$this->view->headLink()->appendStylesheet($baseUrl . 'css/playlist_builder.css?' . $CC_CONFIG['airtime_version']);
|
||||
|
||||
$this->view->headLink()->appendStylesheet($baseUrl.'css/jquery.ui.timepicker.css?'.$CC_CONFIG['airtime_version']);
|
||||
$this->view->headLink()->appendStylesheet($baseUrl.'css/showbuilder.css?'.$CC_CONFIG['airtime_version']);
|
||||
$this->view->headLink()->appendStylesheet($baseUrl.'css/dashboard.css?'.$CC_CONFIG['airtime_version']);
|
||||
$this->view->headLink()->appendStylesheet($baseUrl . 'css/jquery.ui.timepicker.css?' . $CC_CONFIG['airtime_version']);
|
||||
$this->view->headLink()->appendStylesheet($baseUrl . 'css/showbuilder.css?' . $CC_CONFIG['airtime_version']);
|
||||
$this->view->headLink()->appendStylesheet($baseUrl . 'css/dashboard.css?' . $CC_CONFIG['airtime_version']);
|
||||
|
||||
$csrf_namespace = new Zend_Session_Namespace('csrf_namespace');
|
||||
$csrf_element = new Zend_Form_Element_Hidden('csrf');
|
||||
|
@ -72,27 +72,27 @@ class ShowbuilderController extends Zend_Controller_Action
|
|||
|
||||
$request = $this->getRequest();
|
||||
//populate date range form for show builder.
|
||||
$now = time();
|
||||
$from = $request->getParam("from", $now);
|
||||
$to = $request->getParam("to", $now + (3*60*60));
|
||||
$now = time();
|
||||
$from = $request->getParam('from', $now);
|
||||
$to = $request->getParam('to', $now + (3 * 60 * 60));
|
||||
|
||||
$utcTimezone = new DateTimeZone("UTC");
|
||||
$utcTimezone = new DateTimeZone('UTC');
|
||||
$displayTimeZone = new DateTimeZone(Application_Model_Preference::GetTimezone());
|
||||
|
||||
$start = DateTime::createFromFormat("U", $from, $utcTimezone);
|
||||
$start = DateTime::createFromFormat('U', $from, $utcTimezone);
|
||||
$start->setTimezone($displayTimeZone);
|
||||
$end = DateTime::createFromFormat("U", $to, $utcTimezone);
|
||||
$end = DateTime::createFromFormat('U', $to, $utcTimezone);
|
||||
$end->setTimezone($displayTimeZone);
|
||||
|
||||
$this->checkAndShowSetupPopup($request);
|
||||
|
||||
$form = new Application_Form_ShowBuilder();
|
||||
$form->populate(array(
|
||||
'sb_date_start' => $start->format("Y-m-d"),
|
||||
'sb_time_start' => $start->format("H:i"),
|
||||
'sb_date_end' => $end->format("Y-m-d"),
|
||||
'sb_time_end' => $end->format("H:i")
|
||||
));
|
||||
$form->populate([
|
||||
'sb_date_start' => $start->format('Y-m-d'),
|
||||
'sb_time_start' => $start->format('H:i'),
|
||||
'sb_date_end' => $end->format('Y-m-d'),
|
||||
'sb_time_end' => $end->format('H:i'),
|
||||
]);
|
||||
|
||||
$this->view->sb_form = $form;
|
||||
}
|
||||
|
@ -106,15 +106,15 @@ class ShowbuilderController extends Zend_Controller_Action
|
|||
$previousPage = strtolower($request->getHeader('Referer'));
|
||||
$userService = new Application_Service_UserService();
|
||||
$currentUser = $userService->getCurrentUser();
|
||||
$previousPageWasLoginScreen = (strpos($previousPage, 'login') !== false) ||
|
||||
(strpos($previousPage, SAAS_LOGIN_REFERRER) !== false);
|
||||
$previousPageWasLoginScreen = (strpos($previousPage, 'login') !== false)
|
||||
|| (strpos($previousPage, SAAS_LOGIN_REFERRER) !== false);
|
||||
|
||||
// If current user is Super Admin, and they came from the login page,
|
||||
// and they have not seen the setup popup before
|
||||
if ($currentUser->isSuperAdmin() && $previousPageWasLoginScreen && empty($setupComplete)) {
|
||||
$lang_tz_popup_form = new Application_Form_SetupLanguageTimezone();
|
||||
$this->view->lang_tz_popup_form = $lang_tz_popup_form;
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/airtime/nowplaying/lang-timezone-setup.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl . 'js/airtime/nowplaying/lang-timezone-setup.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -126,22 +126,21 @@ class ShowbuilderController extends Zend_Controller_Action
|
|||
$now = floatval(microtime(true));
|
||||
|
||||
$request = $this->getRequest();
|
||||
$menu = array();
|
||||
$menu = [];
|
||||
|
||||
$user = Application_Model_User::getCurrentUser();
|
||||
|
||||
$item = CcScheduleQuery::create()->findPK($id);
|
||||
$instance = $item->getCcShowInstances();
|
||||
|
||||
$menu["preview"] = array("name"=> _("Preview"), "icon" => "play");
|
||||
$menu['preview'] = ['name' => _('Preview'), 'icon' => 'play'];
|
||||
//select the cursor
|
||||
$menu["selCurs"] = array("name"=> _("Select cursor"),"icon" => "select-cursor");
|
||||
$menu["delCurs"] = array("name"=> _("Remove cursor"),"icon" => "select-cursor");
|
||||
|
||||
if ($now < floatval($item->getDbEnds("U.u")) && $user->canSchedule($instance->getDbShowId())) {
|
||||
$menu['selCurs'] = ['name' => _('Select cursor'), 'icon' => 'select-cursor'];
|
||||
$menu['delCurs'] = ['name' => _('Remove cursor'), 'icon' => 'select-cursor'];
|
||||
|
||||
if ($now < floatval($item->getDbEnds('U.u')) && $user->canSchedule($instance->getDbShowId())) {
|
||||
//remove/truncate the item from the schedule
|
||||
$menu["del"] = array("name"=> _("Delete"), "icon" => "delete", "url" => $baseUrl."showbuilder/schedule-remove");
|
||||
$menu['del'] = ['name' => _('Delete'), 'icon' => 'delete', 'url' => $baseUrl . 'showbuilder/schedule-remove'];
|
||||
}
|
||||
|
||||
$this->view->items = $menu;
|
||||
|
@ -150,12 +149,12 @@ class ShowbuilderController extends Zend_Controller_Action
|
|||
public function builderDialogAction()
|
||||
{
|
||||
$request = $this->getRequest();
|
||||
$id = $request->getParam("id");
|
||||
$id = $request->getParam('id');
|
||||
|
||||
$instance = CcShowInstancesQuery::create()->findPK($id);
|
||||
|
||||
if (is_null($instance)) {
|
||||
$this->view->error = _("show does not exist");
|
||||
$this->view->error = _('show does not exist');
|
||||
|
||||
return;
|
||||
}
|
||||
|
@ -176,12 +175,12 @@ class ShowbuilderController extends Zend_Controller_Action
|
|||
$this->view->end = $end_time;
|
||||
|
||||
$form = new Application_Form_ShowBuilder();
|
||||
$form->populate(array(
|
||||
'sb_date_start' => $start->format("Y-m-d"),
|
||||
'sb_time_start' => $start->format("H:i"),
|
||||
'sb_date_end' => $end->format("Y-m-d"),
|
||||
'sb_time_end' => $end->format("H:i")
|
||||
));
|
||||
$form->populate([
|
||||
'sb_date_start' => $start->format('Y-m-d'),
|
||||
'sb_time_start' => $start->format('H:i'),
|
||||
'sb_date_end' => $end->format('Y-m-d'),
|
||||
'sb_time_end' => $end->format('H:i'),
|
||||
]);
|
||||
|
||||
$this->view->sb_form = $form;
|
||||
|
||||
|
@ -191,41 +190,43 @@ class ShowbuilderController extends Zend_Controller_Action
|
|||
public function checkBuilderFeedAction()
|
||||
{
|
||||
$request = $this->getRequest();
|
||||
$show_filter = intval($request->getParam("showFilter", 0));
|
||||
$my_shows = intval($request->getParam("myShows", 0));
|
||||
$timestamp = intval($request->getParam("timestamp", -1));
|
||||
$instances = $request->getParam("instances", array());
|
||||
$show_filter = intval($request->getParam('showFilter', 0));
|
||||
$my_shows = intval($request->getParam('myShows', 0));
|
||||
$timestamp = intval($request->getParam('timestamp', -1));
|
||||
$instances = $request->getParam('instances', []);
|
||||
|
||||
list($startsDT, $endsDT) = Application_Common_HTTPHelper::getStartEndFromRequest($request);
|
||||
|
||||
$opts = array("myShows" => $my_shows, "showFilter" => $show_filter);
|
||||
$opts = ['myShows' => $my_shows, 'showFilter' => $show_filter];
|
||||
$showBuilder = new Application_Model_ShowBuilder($startsDT, $endsDT, $opts);
|
||||
|
||||
//only send the schedule back if updates have been made.
|
||||
// -1 default will always call the schedule to be sent back if no timestamp is defined.
|
||||
$this->view->update = $showBuilder->hasBeenUpdatedSince(
|
||||
$timestamp, $instances);
|
||||
$timestamp,
|
||||
$instances
|
||||
);
|
||||
}
|
||||
|
||||
public function builderFeedAction()
|
||||
{
|
||||
$current_time = time();
|
||||
$current_time = time();
|
||||
|
||||
$request = $this->getRequest();
|
||||
$show_filter = intval($request->getParam("showFilter", 0));
|
||||
$show_instance_filter = intval($request->getParam("showInstanceFilter", 0));
|
||||
$my_shows = intval($request->getParam("myShows", 0));
|
||||
$show_filter = intval($request->getParam('showFilter', 0));
|
||||
$show_instance_filter = intval($request->getParam('showInstanceFilter', 0));
|
||||
$my_shows = intval($request->getParam('myShows', 0));
|
||||
|
||||
list($startsDT, $endsDT) = Application_Common_HTTPHelper::getStartEndFromRequest($request);
|
||||
|
||||
$opts = array("myShows" => $my_shows,
|
||||
"showFilter" => $show_filter,
|
||||
"showInstanceFilter" => $show_instance_filter);
|
||||
$opts = ['myShows' => $my_shows,
|
||||
'showFilter' => $show_filter,
|
||||
'showInstanceFilter' => $show_instance_filter, ];
|
||||
$showBuilder = new Application_Model_ShowBuilder($startsDT, $endsDT, $opts);
|
||||
|
||||
$data = $showBuilder->getItems();
|
||||
$this->view->schedule = $data["schedule"];
|
||||
$this->view->instances = $data["showInstances"];
|
||||
$this->view->schedule = $data['schedule'];
|
||||
$this->view->instances = $data['showInstances'];
|
||||
$this->view->timestamp = $current_time;
|
||||
}
|
||||
|
||||
|
@ -233,15 +234,15 @@ class ShowbuilderController extends Zend_Controller_Action
|
|||
{
|
||||
$request = $this->getRequest();
|
||||
|
||||
$mediaItems = $request->getParam("mediaIds", array());
|
||||
$scheduledItems = $request->getParam("schedIds", array());
|
||||
$mediaItems = $request->getParam('mediaIds', []);
|
||||
$scheduledItems = $request->getParam('schedIds', []);
|
||||
|
||||
$log_vars = array();
|
||||
$log_vars["url"] = $_SERVER['HTTP_HOST'];
|
||||
$log_vars["action"] = "showbuilder/schedule-add";
|
||||
$log_vars["params"] = array();
|
||||
$log_vars["params"]["media_items"] = $mediaItems;
|
||||
$log_vars["params"]["scheduled_items"] = $scheduledItems;
|
||||
$log_vars = [];
|
||||
$log_vars['url'] = $_SERVER['HTTP_HOST'];
|
||||
$log_vars['action'] = 'showbuilder/schedule-add';
|
||||
$log_vars['params'] = [];
|
||||
$log_vars['params']['media_items'] = $mediaItems;
|
||||
$log_vars['params']['scheduled_items'] = $scheduledItems;
|
||||
Logging::info($log_vars);
|
||||
|
||||
try {
|
||||
|
@ -259,13 +260,13 @@ class ShowbuilderController extends Zend_Controller_Action
|
|||
public function scheduleRemoveAction()
|
||||
{
|
||||
$request = $this->getRequest();
|
||||
$items = $request->getParam("items", array());
|
||||
$items = $request->getParam('items', []);
|
||||
|
||||
$log_vars = array();
|
||||
$log_vars["url"] = $_SERVER['HTTP_HOST'];
|
||||
$log_vars["action"] = "showbuilder/schedule-remove";
|
||||
$log_vars["params"] = array();
|
||||
$log_vars["params"]["removed_items"] = $items;
|
||||
$log_vars = [];
|
||||
$log_vars['url'] = $_SERVER['HTTP_HOST'];
|
||||
$log_vars['action'] = 'showbuilder/schedule-remove';
|
||||
$log_vars['params'] = [];
|
||||
$log_vars['params']['removed_items'] = $items;
|
||||
Logging::info($log_vars);
|
||||
|
||||
try {
|
||||
|
@ -283,8 +284,8 @@ class ShowbuilderController extends Zend_Controller_Action
|
|||
public function scheduleMoveAction()
|
||||
{
|
||||
$request = $this->getRequest();
|
||||
$selectedItems = $request->getParam("selectedItem");
|
||||
$afterItem = $request->getParam("afterItem");
|
||||
$selectedItems = $request->getParam('selectedItem');
|
||||
$afterItem = $request->getParam('afterItem');
|
||||
|
||||
/*
|
||||
$log_vars = array();
|
||||
|
@ -310,7 +311,6 @@ class ShowbuilderController extends Zend_Controller_Action
|
|||
|
||||
public function scheduleReorderAction()
|
||||
{
|
||||
throw new Exception("this controller is/was a no-op please fix your code");
|
||||
throw new Exception('this controller is/was a no-op please fix your code');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,12 +1,14 @@
|
|||
<?php
|
||||
|
||||
class SystemstatusController extends Zend_Controller_Action
|
||||
{
|
||||
private $version;
|
||||
|
||||
public function init()
|
||||
{
|
||||
$config = Config::getConfig();
|
||||
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/airtime/status/status.js?'.$config['airtime_version'],'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl . 'js/airtime/status/status.js?' . $config['airtime_version'], 'text/javascript');
|
||||
$this->version = $config['airtime_version'];
|
||||
}
|
||||
|
||||
|
@ -15,7 +17,7 @@ class SystemstatusController extends Zend_Controller_Action
|
|||
Zend_Layout::getMvcInstance()->assign('parent_page', 'Settings');
|
||||
|
||||
$partitions = Application_Model_Systemstatus::GetDiskInfo();
|
||||
$this->view->status = new StdClass;
|
||||
$this->view->status = new StdClass();
|
||||
$this->view->status->partitions = $partitions;
|
||||
$this->view->version = $this->version;
|
||||
}
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Class ThirdPartyController abstract superclass for third-party service authorization
|
||||
* Class ThirdPartyController abstract superclass for third-party service authorization.
|
||||
*/
|
||||
abstract class ThirdPartyController extends Zend_Controller_Action {
|
||||
|
||||
abstract class ThirdPartyController extends Zend_Controller_Action
|
||||
{
|
||||
/**
|
||||
* @var string base url and port for redirection
|
||||
*/
|
||||
|
@ -16,15 +16,13 @@ abstract class ThirdPartyController extends Zend_Controller_Action {
|
|||
protected $_service;
|
||||
|
||||
/**
|
||||
* Disable controller rendering and initialize
|
||||
*
|
||||
* @return void
|
||||
* Disable controller rendering and initialize.
|
||||
*/
|
||||
public function init() {
|
||||
public function init()
|
||||
{
|
||||
$this->_baseUrl = Application_Common_HTTPHelper::getStationUrl();
|
||||
|
||||
$this->view->layout()->disableLayout(); // Don't inject the standard Now Playing header.
|
||||
$this->_helper->viewRenderer->setNoRender(true); // Don't use (phtml) templates
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,14 +2,14 @@
|
|||
|
||||
class TracktypeController extends Zend_Controller_Action
|
||||
{
|
||||
|
||||
public function init()
|
||||
{
|
||||
$ajaxContext = $this->_helper->getHelper('AjaxContext');
|
||||
$ajaxContext->addActionContext('get-tracktype-data-table-info', 'json')
|
||||
->addActionContext('get-tracktype-data', 'json')
|
||||
->addActionContext('remove-tracktype', 'json')
|
||||
->initContext();
|
||||
->addActionContext('get-tracktype-data', 'json')
|
||||
->addActionContext('remove-tracktype', 'json')
|
||||
->initContext()
|
||||
;
|
||||
}
|
||||
|
||||
public function addTracktypeAction()
|
||||
|
@ -25,57 +25,58 @@ class TracktypeController extends Zend_Controller_Action
|
|||
|
||||
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||
|
||||
$js_files = array(
|
||||
$js_files = [
|
||||
'js/datatables/js/jquery.dataTables.js?',
|
||||
'js/datatables/plugin/dataTables.pluginAPI.js?',
|
||||
'js/airtime/tracktype/tracktype.js?'
|
||||
);
|
||||
'js/airtime/tracktype/tracktype.js?',
|
||||
];
|
||||
|
||||
foreach ($js_files as $js) {
|
||||
$this->view->headScript()->appendFile(
|
||||
$baseUrl.$js.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$baseUrl . $js . $CC_CONFIG['airtime_version'],
|
||||
'text/javascript'
|
||||
);
|
||||
}
|
||||
|
||||
$this->view->headLink()->appendStylesheet($baseUrl.'css/tracktypes.css?'.$CC_CONFIG['airtime_version']);
|
||||
$this->view->headLink()->appendStylesheet($baseUrl . 'css/tracktypes.css?' . $CC_CONFIG['airtime_version']);
|
||||
|
||||
$form = new Application_Form_AddTracktype();
|
||||
|
||||
$this->view->successMessage = "";
|
||||
$this->view->successMessage = '';
|
||||
|
||||
if ($request->isPost()) {
|
||||
$params = $request->getPost();
|
||||
$postData = explode('&', $params['data']);
|
||||
$formData = array();
|
||||
foreach($postData as $k=>$v) {
|
||||
$formData = [];
|
||||
foreach ($postData as $k => $v) {
|
||||
$v = explode('=', $v);
|
||||
$formData[$v[0]] = urldecode($v[1]);
|
||||
}
|
||||
|
||||
if ($form->validateCode($formData)) {
|
||||
$tracktype = new Application_Model_Tracktype($formData['tracktype_id']);
|
||||
if (empty($formData['tracktype_id'])) {
|
||||
$tracktype->setCode($formData['code']);
|
||||
}
|
||||
$tracktype->setTypeName($formData['type_name']);
|
||||
$tracktype->setDescription($formData['description']);
|
||||
$tracktype->setVisibility($formData['visibility']);
|
||||
$tracktype->save();
|
||||
if ($form->validateCode($formData)) {
|
||||
$tracktype = new Application_Model_Tracktype($formData['tracktype_id']);
|
||||
if (empty($formData['tracktype_id'])) {
|
||||
$tracktype->setCode($formData['code']);
|
||||
}
|
||||
$tracktype->setTypeName($formData['type_name']);
|
||||
$tracktype->setDescription($formData['description']);
|
||||
$tracktype->setVisibility($formData['visibility']);
|
||||
$tracktype->save();
|
||||
|
||||
$form->reset();
|
||||
$this->view->form = $form;
|
||||
$form->reset();
|
||||
$this->view->form = $form;
|
||||
|
||||
if (strlen($formData['tracktype_id']) == 0) {
|
||||
$this->view->successMessage = "<div class='success'>"._("Track Type added successfully!")."</div>";
|
||||
} else {
|
||||
$this->view->successMessage = "<div class='success'>"._("Track Type updated successfully!")."</div>";
|
||||
}
|
||||
|
||||
$this->_helper->json->sendJson(array("valid"=>"true", "html"=>$this->view->render('tracktype/add-tracktype.phtml')));
|
||||
if (strlen($formData['tracktype_id']) == 0) {
|
||||
$this->view->successMessage = "<div class='success'>" . _('Track Type added successfully!') . '</div>';
|
||||
} else {
|
||||
$this->view->form = $form;
|
||||
$this->_helper->json->sendJson(array("valid"=>"false", "html"=>$this->view->render('tracktype/add-tracktype.phtml')));
|
||||
$this->view->successMessage = "<div class='success'>" . _('Track Type updated successfully!') . '</div>';
|
||||
}
|
||||
|
||||
$this->_helper->json->sendJson(['valid' => 'true', 'html' => $this->view->render('tracktype/add-tracktype.phtml')]);
|
||||
} else {
|
||||
$this->view->form = $form;
|
||||
$this->_helper->json->sendJson(['valid' => 'false', 'html' => $this->view->render('tracktype/add-tracktype.phtml')]);
|
||||
}
|
||||
}
|
||||
|
||||
$this->view->form = $form;
|
||||
|
@ -102,8 +103,7 @@ class TracktypeController extends Zend_Controller_Action
|
|||
|
||||
$tracktype = new Application_Model_Tracktype($delId);
|
||||
|
||||
# Delete the track type
|
||||
// Delete the track type
|
||||
$this->view->entries = $tracktype->delete();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@ class UpgradeController extends Zend_Controller_Action
|
|||
{
|
||||
$this->view->layout()->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender(true);
|
||||
|
||||
|
||||
if (!RestAuth::verifyAuth(true, false, $this)) {
|
||||
return;
|
||||
}
|
||||
|
@ -16,23 +16,25 @@ class UpgradeController extends Zend_Controller_Action
|
|||
|
||||
if (!$didWePerformAnUpgrade) {
|
||||
$this->getResponse()
|
||||
->setHttpResponseCode(200)
|
||||
->appendBody("No upgrade was performed. The current schema version is " . Application_Model_Preference::GetSchemaVersion() . ".<br>");
|
||||
->setHttpResponseCode(200)
|
||||
->appendBody('No upgrade was performed. The current schema version is ' . Application_Model_Preference::GetSchemaVersion() . '.<br>')
|
||||
;
|
||||
} else {
|
||||
$this->getResponse()
|
||||
->setHttpResponseCode(200)
|
||||
->appendBody("Upgrade to Airtime schema version " . Application_Model_Preference::GetSchemaVersion() . " OK<br>");
|
||||
->setHttpResponseCode(200)
|
||||
->appendBody('Upgrade to Airtime schema version ' . Application_Model_Preference::GetSchemaVersion() . ' OK<br>')
|
||||
;
|
||||
}
|
||||
}
|
||||
catch (Exception $e)
|
||||
{
|
||||
} catch (Exception $e) {
|
||||
$this->getResponse()
|
||||
->setHttpResponseCode(400)
|
||||
->appendBody($e->getMessage());
|
||||
->setHttpResponseCode(400)
|
||||
->appendBody($e->getMessage())
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
public function downgradeAction() {
|
||||
public function downgradeAction()
|
||||
{
|
||||
$this->view->layout()->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender(true);
|
||||
|
||||
|
@ -41,7 +43,7 @@ class UpgradeController extends Zend_Controller_Action
|
|||
}
|
||||
|
||||
$request = $this->getRequest();
|
||||
$toVersion = $request->getParam("version");
|
||||
$toVersion = $request->getParam('version');
|
||||
|
||||
try {
|
||||
$downgradePerformed = UpgradeManager::doDowngrade($toVersion);
|
||||
|
@ -49,17 +51,19 @@ class UpgradeController extends Zend_Controller_Action
|
|||
if (!$downgradePerformed) {
|
||||
$this->getResponse()
|
||||
->setHttpResponseCode(200)
|
||||
->appendBody("No downgrade was performed. The current schema version is " . Application_Model_Preference::GetSchemaVersion() . ".<br>");
|
||||
->appendBody('No downgrade was performed. The current schema version is ' . Application_Model_Preference::GetSchemaVersion() . '.<br>')
|
||||
;
|
||||
} else {
|
||||
$this->getResponse()
|
||||
->setHttpResponseCode(200)
|
||||
->appendBody("Downgrade to Airtime schema version " . Application_Model_Preference::GetSchemaVersion() . " OK<br>");
|
||||
->appendBody('Downgrade to Airtime schema version ' . Application_Model_Preference::GetSchemaVersion() . ' OK<br>')
|
||||
;
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
$this->getResponse()
|
||||
->setHttpResponseCode(400)
|
||||
->appendBody($e->getMessage());
|
||||
->appendBody($e->getMessage())
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -2,16 +2,16 @@
|
|||
|
||||
class UserController extends Zend_Controller_Action
|
||||
{
|
||||
|
||||
public function init()
|
||||
{
|
||||
$ajaxContext = $this->_helper->getHelper('AjaxContext');
|
||||
$ajaxContext->addActionContext('get-hosts', 'json')
|
||||
->addActionContext('get-user-data-table-info', 'json')
|
||||
->addActionContext('get-user-data', 'json')
|
||||
->addActionContext('remove-user', 'json')
|
||||
->addActionContext('edit-user', 'json')
|
||||
->initContext();
|
||||
->addActionContext('get-user-data-table-info', 'json')
|
||||
->addActionContext('get-user-data', 'json')
|
||||
->addActionContext('remove-user', 'json')
|
||||
->addActionContext('edit-user', 'json')
|
||||
->initContext()
|
||||
;
|
||||
}
|
||||
|
||||
public function addUserAction()
|
||||
|
@ -27,34 +27,35 @@ class UserController extends Zend_Controller_Action
|
|||
|
||||
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||
|
||||
$js_files = array(
|
||||
$js_files = [
|
||||
'js/datatables/js/jquery.dataTables.js?',
|
||||
'js/datatables/plugin/dataTables.pluginAPI.js?',
|
||||
'js/airtime/user/user.js?'
|
||||
);
|
||||
'js/airtime/user/user.js?',
|
||||
];
|
||||
|
||||
foreach ($js_files as $js) {
|
||||
$this->view->headScript()->appendFile(
|
||||
$baseUrl.$js.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$baseUrl . $js . $CC_CONFIG['airtime_version'],
|
||||
'text/javascript'
|
||||
);
|
||||
}
|
||||
|
||||
$this->view->headLink()->appendStylesheet($baseUrl.'css/users.css?'.$CC_CONFIG['airtime_version']);
|
||||
$this->view->headLink()->appendStylesheet($baseUrl . 'css/users.css?' . $CC_CONFIG['airtime_version']);
|
||||
|
||||
$form = new Application_Form_AddUser();
|
||||
|
||||
$this->view->successMessage = "";
|
||||
$this->view->successMessage = '';
|
||||
|
||||
if ($request->isPost()) {
|
||||
$params = $request->getPost();
|
||||
$postData = explode('&', $params['data']);
|
||||
$formData = array();
|
||||
foreach($postData as $k=>$v) {
|
||||
$formData = [];
|
||||
foreach ($postData as $k => $v) {
|
||||
$v = explode('=', $v);
|
||||
$formData[$v[0]] = urldecode($v[1]);
|
||||
}
|
||||
|
||||
if ($form->isValid($formData)) {
|
||||
|
||||
if ($form->validateLogin($formData)) {
|
||||
$user = new Application_Model_User($formData['user_id']);
|
||||
if (empty($formData['user_id'])) {
|
||||
|
@ -65,7 +66,7 @@ class UserController extends Zend_Controller_Action
|
|||
// We don't allow 6 x's as a password.
|
||||
// The reason is because we that as a password placeholder
|
||||
// on the client side.
|
||||
if ($formData['password'] != "xxxxxx") {
|
||||
if ($formData['password'] != 'xxxxxx') {
|
||||
$user->setPassword($formData['password']);
|
||||
}
|
||||
if (array_key_exists('type', $formData)) {
|
||||
|
@ -83,19 +84,19 @@ class UserController extends Zend_Controller_Action
|
|||
$this->view->form = $form;
|
||||
|
||||
if (strlen($formData['user_id']) == 0) {
|
||||
$this->view->successMessage = "<div class='success'>"._("User added successfully!")."</div>";
|
||||
$this->view->successMessage = "<div class='success'>" . _('User added successfully!') . '</div>';
|
||||
} else {
|
||||
$this->view->successMessage = "<div class='success'>"._("User updated successfully!")."</div>";
|
||||
$this->view->successMessage = "<div class='success'>" . _('User updated successfully!') . '</div>';
|
||||
}
|
||||
|
||||
$this->_helper->json->sendJson(array("valid"=>"true", "html"=>$this->view->render('user/add-user.phtml')));
|
||||
$this->_helper->json->sendJson(['valid' => 'true', 'html' => $this->view->render('user/add-user.phtml')]);
|
||||
} else {
|
||||
$this->view->form = $form;
|
||||
$this->_helper->json->sendJson(array("valid"=>"false", "html"=>$this->view->render('user/add-user.phtml')));
|
||||
$this->_helper->json->sendJson(['valid' => 'false', 'html' => $this->view->render('user/add-user.phtml')]);
|
||||
}
|
||||
} else {
|
||||
$this->view->form = $form;
|
||||
$this->_helper->json->sendJson(array("valid"=>"false", "html"=>$this->view->render('user/add-user.phtml')));
|
||||
$this->_helper->json->sendJson(['valid' => 'false', 'html' => $this->view->render('user/add-user.phtml')]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -104,7 +105,7 @@ class UserController extends Zend_Controller_Action
|
|||
|
||||
public function getHostsAction()
|
||||
{
|
||||
$search = $this->_getParam('term');
|
||||
$search = $this->_getParam('term');
|
||||
$this->view->hosts = Application_Model_User::getHosts($search);
|
||||
}
|
||||
|
||||
|
@ -121,7 +122,7 @@ class UserController extends Zend_Controller_Action
|
|||
$id = $this->_getParam('id');
|
||||
$this->view->entries = Application_Model_User::GetUserData($id);
|
||||
}
|
||||
|
||||
|
||||
public function editUserAction()
|
||||
{
|
||||
Zend_Layout::getMvcInstance()->assign('parent_page', 'Settings');
|
||||
|
@ -132,16 +133,16 @@ class UserController extends Zend_Controller_Action
|
|||
$form = new Application_Form_EditUser();
|
||||
if ($request->isPost()) {
|
||||
$formData = $request->getPost();
|
||||
|
||||
if ($form->isValid($formData) &&
|
||||
$form->validateLogin($formData['cu_login'], $formData['cu_user_id'])) {
|
||||
|
||||
if ($form->isValid($formData)
|
||||
&& $form->validateLogin($formData['cu_login'], $formData['cu_user_id'])) {
|
||||
$user = new Application_Model_User($formData['cu_user_id']);
|
||||
//Stupid hack because our schema enforces non-null first_name
|
||||
//even though by default the admin user has no first name... (....)
|
||||
if (Application_Model_User::getCurrentUser()->isSuperAdmin()) {
|
||||
if (empty($formData['cu_first_name'])) {
|
||||
$formData['cu_first_name'] = "admin";
|
||||
$formData['cu_last_name'] = "admin"; //ditto, avoid non-null DB constraint
|
||||
if (empty($formData['cu_first_name'])) {
|
||||
$formData['cu_first_name'] = 'admin';
|
||||
$formData['cu_last_name'] = 'admin'; //ditto, avoid non-null DB constraint
|
||||
}
|
||||
}
|
||||
if (isset($formData['cu_first_name'])) {
|
||||
|
@ -154,8 +155,8 @@ class UserController extends Zend_Controller_Action
|
|||
// We don't allow 6 x's as a password.
|
||||
// The reason is because we use that as a password placeholder
|
||||
// on the client side.
|
||||
if (array_key_exists('cu_password', $formData) && ($formData['cu_password'] != "xxxxxx") &&
|
||||
(!empty($formData['cu_password']))) {
|
||||
if (array_key_exists('cu_password', $formData) && ($formData['cu_password'] != 'xxxxxx')
|
||||
&& (!empty($formData['cu_password']))) {
|
||||
$user->setPassword($formData['cu_password']);
|
||||
}
|
||||
|
||||
|
@ -185,7 +186,7 @@ class UserController extends Zend_Controller_Action
|
|||
//reinitialize form so language gets translated
|
||||
$form = new Application_Form_EditUser();
|
||||
|
||||
$this->view->successMessage = "<div class='success'>"._("Settings updated successfully!")."</div>";
|
||||
$this->view->successMessage = "<div class='success'>" . _('Settings updated successfully!') . '</div>';
|
||||
}
|
||||
$this->view->form = $form;
|
||||
$this->view->html = $this->view->render('user/edit-user.phtml');
|
||||
|
@ -198,49 +199,48 @@ class UserController extends Zend_Controller_Action
|
|||
{
|
||||
// action body
|
||||
$delId = $this->_getParam('id');
|
||||
$valid_actions = array("delete_cascade", "reassign_to");
|
||||
$valid_actions = ['delete_cascade', 'reassign_to'];
|
||||
$files_action = $this->_getParam('deleted_files');
|
||||
|
||||
# TODO : remove this. we only use default for now not to break the UI.
|
||||
if (!$files_action) { # set default action
|
||||
$files_action = "reassign_to";
|
||||
$new_owner = Application_Model_User::getFirstAdmin($delId);
|
||||
// TODO : remove this. we only use default for now not to break the UI.
|
||||
if (!$files_action) { // set default action
|
||||
$files_action = 'reassign_to';
|
||||
$new_owner = Application_Model_User::getFirstAdmin($delId);
|
||||
}
|
||||
|
||||
# only delete when valid action is selected for the owned files
|
||||
if (! in_array($files_action, $valid_actions) ) {
|
||||
// only delete when valid action is selected for the owned files
|
||||
if (!in_array($files_action, $valid_actions)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
|
||||
$userId = $userInfo->id;
|
||||
|
||||
# Don't let users delete themselves
|
||||
// Don't let users delete themselves
|
||||
if ($delId == $userId) {
|
||||
return;
|
||||
}
|
||||
|
||||
$user = new Application_Model_User($delId);
|
||||
|
||||
|
||||
// Don't allow super admins to be deleted.
|
||||
if ($user->isSuperAdmin())
|
||||
{
|
||||
if ($user->isSuperAdmin()) {
|
||||
return;
|
||||
}
|
||||
|
||||
# Take care of the user's files by either assigning them to somebody
|
||||
# or deleting them all
|
||||
if ($files_action == "delete_cascade") {
|
||||
// Take care of the user's files by either assigning them to somebody
|
||||
// or deleting them all
|
||||
if ($files_action == 'delete_cascade') {
|
||||
$user->deleteAllFiles();
|
||||
} elseif ($files_action == "reassign_to") {
|
||||
} elseif ($files_action == 'reassign_to') {
|
||||
// TODO : fix code to actually use the line below and pick a
|
||||
// real owner instead of defaulting to the first found admin
|
||||
//$new_owner_id = $this->_getParam("new_owner");
|
||||
//$new_owner = new Application_Model_User($new_owner_id);
|
||||
$user->donateFilesTo( $new_owner );
|
||||
$user->donateFilesTo($new_owner);
|
||||
Logging::info("Reassign to user {$new_owner->getDbId()}");
|
||||
}
|
||||
# Finally delete the user
|
||||
// Finally delete the user
|
||||
$this->view->entries = $user->delete();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,28 +1,29 @@
|
|||
<?php
|
||||
|
||||
class UsersettingsController extends Zend_Controller_Action
|
||||
{
|
||||
|
||||
public function init()
|
||||
{
|
||||
/* Initialize action controller here */
|
||||
// Initialize action controller here
|
||||
$ajaxContext = $this->_helper->getHelper('AjaxContext');
|
||||
$ajaxContext->addActionContext('get-now-playing-screen-settings', 'json')
|
||||
->addActionContext('set-now-playing-screen-settings', 'json')
|
||||
->addActionContext('get-library-datatable', 'json')
|
||||
->addActionContext('set-library-datatable', 'json')
|
||||
->addActionContext('get-timeline-datatable', 'json')
|
||||
->addActionContext('set-timeline-datatable', 'json')
|
||||
->addActionContext('remindme', 'json')
|
||||
->addActionContext('remindme-never', 'json')
|
||||
->addActionContext('donotshowregistrationpopup', 'json')
|
||||
->addActionContext('set-library-screen-settings', 'json')
|
||||
->initContext();
|
||||
->addActionContext('set-now-playing-screen-settings', 'json')
|
||||
->addActionContext('get-library-datatable', 'json')
|
||||
->addActionContext('set-library-datatable', 'json')
|
||||
->addActionContext('get-timeline-datatable', 'json')
|
||||
->addActionContext('set-timeline-datatable', 'json')
|
||||
->addActionContext('remindme', 'json')
|
||||
->addActionContext('remindme-never', 'json')
|
||||
->addActionContext('donotshowregistrationpopup', 'json')
|
||||
->addActionContext('set-library-screen-settings', 'json')
|
||||
->initContext()
|
||||
;
|
||||
}
|
||||
|
||||
public function setNowPlayingScreenSettingsAction()
|
||||
{
|
||||
$request = $this->getRequest();
|
||||
$settings = $request->getParam("settings");
|
||||
$settings = $request->getParam('settings');
|
||||
|
||||
Application_Model_Preference::setNowPlayingScreenSettings($settings);
|
||||
}
|
||||
|
@ -38,7 +39,7 @@ class UsersettingsController extends Zend_Controller_Action
|
|||
public function setLibraryDatatableAction()
|
||||
{
|
||||
$request = $this->getRequest();
|
||||
$settings = $request->getParam("settings");
|
||||
$settings = $request->getParam('settings');
|
||||
|
||||
Application_Model_Preference::setCurrentLibraryTableSetting($settings);
|
||||
}
|
||||
|
@ -56,7 +57,7 @@ class UsersettingsController extends Zend_Controller_Action
|
|||
public function setTimelineDatatableAction()
|
||||
{
|
||||
$request = $this->getRequest();
|
||||
$settings = $request->getParam("settings");
|
||||
$settings = $request->getParam('settings');
|
||||
|
||||
Application_Model_Preference::setTimelineDatatableSetting($settings);
|
||||
}
|
||||
|
@ -76,7 +77,7 @@ class UsersettingsController extends Zend_Controller_Action
|
|||
Zend_Session::namespaceUnset('referrer');
|
||||
Application_Model_Preference::SetRemindMeDate();
|
||||
}
|
||||
|
||||
|
||||
public function remindmeNeverAction()
|
||||
{
|
||||
SessionHelper::reopenSessionForWriting();
|
||||
|
@ -95,7 +96,7 @@ class UsersettingsController extends Zend_Controller_Action
|
|||
public function setLibraryScreenSettingsAction()
|
||||
{
|
||||
$request = $this->getRequest();
|
||||
$settings = $request->getParam("settings");
|
||||
$settings = $request->getParam('settings');
|
||||
Application_Model_Preference::setLibraryScreenSettings($settings);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,10 +6,11 @@ class WebstreamController extends Zend_Controller_Action
|
|||
{
|
||||
$ajaxContext = $this->_helper->getHelper('AjaxContext');
|
||||
$ajaxContext->addActionContext('new', 'json')
|
||||
->addActionContext('save', 'json')
|
||||
->addActionContext('edit', 'json')
|
||||
->addActionContext('delete', 'json')
|
||||
->initContext();
|
||||
->addActionContext('save', 'json')
|
||||
->addActionContext('edit', 'json')
|
||||
->addActionContext('delete', 'json')
|
||||
->initContext()
|
||||
;
|
||||
}
|
||||
|
||||
public function newAction()
|
||||
|
@ -17,7 +18,8 @@ class WebstreamController extends Zend_Controller_Action
|
|||
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
|
||||
if (!$this->isAuthorized(-1)) {
|
||||
// TODO: this header call does not actually print any error message
|
||||
header("Status: 401 Not Authorized");
|
||||
header('Status: 401 Not Authorized');
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -25,20 +27,20 @@ class WebstreamController extends Zend_Controller_Action
|
|||
|
||||
//we're not saving this primary key in the DB so it's OK to be -1
|
||||
$webstream->setDbId(-1);
|
||||
$webstream->setDbName(_("Untitled Webstream"));
|
||||
$webstream->setDbDescription("");
|
||||
$webstream->setDbUrl("http://");
|
||||
$webstream->setDbLength("00:30:00");
|
||||
$webstream->setDbName(_("Untitled Webstream"));
|
||||
$webstream->setDbName(_('Untitled Webstream'));
|
||||
$webstream->setDbDescription('');
|
||||
$webstream->setDbUrl('http://');
|
||||
$webstream->setDbLength('00:30:00');
|
||||
$webstream->setDbName(_('Untitled Webstream'));
|
||||
$webstream->setDbCreatorId($userInfo->id);
|
||||
$webstream->setDbUtime(new DateTime("now", new DateTimeZone('UTC')));
|
||||
$webstream->setDbMtime(new DateTime("now", new DateTimeZone('UTC')));
|
||||
$webstream->setDbUtime(new DateTime('now', new DateTimeZone('UTC')));
|
||||
$webstream->setDbMtime(new DateTime('now', new DateTimeZone('UTC')));
|
||||
|
||||
//clear the session in case an old playlist was open: CC-4196
|
||||
Application_Model_Library::changePlaylist(null, null);
|
||||
|
||||
$this->view->obj = new Application_Model_Webstream($webstream);
|
||||
$this->view->action = "new";
|
||||
$this->view->action = 'new';
|
||||
$this->view->html = $this->view->render('webstream/webstream.phtml');
|
||||
}
|
||||
|
||||
|
@ -46,57 +48,57 @@ class WebstreamController extends Zend_Controller_Action
|
|||
{
|
||||
$request = $this->getRequest();
|
||||
|
||||
$id = $request->getParam("id");
|
||||
$id = $request->getParam('id');
|
||||
if (is_null($id)) {
|
||||
throw new Exception("Missing parameter 'id'");
|
||||
}
|
||||
|
||||
$webstream = CcWebstreamQuery::create()->findPK($id);
|
||||
if ($webstream) {
|
||||
Application_Model_Library::changePlaylist($id, "stream");
|
||||
Application_Model_Library::changePlaylist($id, 'stream');
|
||||
}
|
||||
|
||||
$obj = new Application_Model_Webstream($webstream);
|
||||
|
||||
$user = Application_Model_User::getCurrentUser();
|
||||
$isAdminOrPM = $user->isUserType(array(UTYPE_SUPERADMIN, UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER));
|
||||
$isAdminOrPM = $user->isUserType([UTYPE_SUPERADMIN, UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER]);
|
||||
|
||||
if (!$isAdminOrPM && $webstream->getDbCreatorId() != $user->getId()) {
|
||||
$this->view->objType = "webstream";
|
||||
$this->view->type = "webstream";
|
||||
$this->view->objType = 'webstream';
|
||||
$this->view->type = 'webstream';
|
||||
$this->view->obj = $obj;
|
||||
$this->view->id = $id;
|
||||
$this->view->html = $this->view->render('playlist/permission-denied.phtml');
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$this->view->obj = $obj;
|
||||
$this->view->type = "webstream";
|
||||
$this->view->type = 'webstream';
|
||||
$this->view->id = $id;
|
||||
$this->view->action = "edit";
|
||||
$this->view->action = 'edit';
|
||||
$this->view->html = $this->view->render('webstream/webstream.phtml');
|
||||
}
|
||||
|
||||
public function deleteAction()
|
||||
{
|
||||
$request = $this->getRequest();
|
||||
$id = $request->getParam("ids");
|
||||
$id = $request->getParam('ids');
|
||||
|
||||
if (!$this->isAuthorized($id)) {
|
||||
header("Status: 401 Not Authorized");
|
||||
header('Status: 401 Not Authorized');
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$type = "stream";
|
||||
$type = 'stream';
|
||||
Application_Model_Library::changePlaylist(null, $type);
|
||||
|
||||
$webstream = CcWebstreamQuery::create()->findPK($id)->delete();
|
||||
|
||||
$this->view->obj = null;
|
||||
$this->view->action = "delete";
|
||||
$this->view->action = 'delete';
|
||||
$this->view->html = $this->view->render('webstream/webstream.phtml');
|
||||
|
||||
}
|
||||
|
||||
/*TODO : make a user object be passed a parameter into this function so
|
||||
|
@ -104,7 +106,7 @@ class WebstreamController extends Zend_Controller_Action
|
|||
public function isAuthorized($webstream_id)
|
||||
{
|
||||
$user = Application_Model_User::getCurrentUser();
|
||||
if ($user->isUserType(array(UTYPE_SUPERADMIN, UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER))) {
|
||||
if ($user->isUserType([UTYPE_SUPERADMIN, UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER])) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -121,9 +123,9 @@ class WebstreamController extends Zend_Controller_Action
|
|||
/*we are creating a new stream. Don't need to check whether the
|
||||
DJ/Host owns the stream*/
|
||||
return true;
|
||||
} else {
|
||||
Logging::info( $user );
|
||||
}
|
||||
Logging::info($user);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -131,35 +133,36 @@ class WebstreamController extends Zend_Controller_Action
|
|||
{
|
||||
$request = $this->getRequest();
|
||||
|
||||
$id = $request->getParam("id");
|
||||
$id = $request->getParam('id');
|
||||
|
||||
$parameters = array();
|
||||
foreach (array('id','length','name','description','url') as $p) {
|
||||
$parameters = [];
|
||||
foreach (['id', 'length', 'name', 'description', 'url'] as $p) {
|
||||
$parameters[$p] = trim($request->getParam($p));
|
||||
}
|
||||
|
||||
if (!$this->isAuthorized($id)) {
|
||||
header("Status: 401 Not Authorized");
|
||||
header('Status: 401 Not Authorized');
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
list($analysis, $mime, $mediaUrl, $di) = Application_Model_Webstream::analyzeFormData($parameters);
|
||||
|
||||
try {
|
||||
if (Application_Model_Webstream::isValid($analysis)) {
|
||||
$streamId = Application_Model_Webstream::save($parameters, $mime, $mediaUrl, $di);
|
||||
|
||||
Application_Model_Library::changePlaylist($streamId, "stream");
|
||||
Application_Model_Library::changePlaylist($streamId, 'stream');
|
||||
|
||||
$this->view->statusMessage = "<div class='success'>"._("Webstream saved.")."</div>";
|
||||
$this->view->statusMessage = "<div class='success'>" . _('Webstream saved.') . '</div>';
|
||||
$this->view->streamId = $streamId;
|
||||
$this->view->length = $di->format("%Hh %Im");
|
||||
$this->view->length = $di->format('%Hh %Im');
|
||||
} else {
|
||||
throw new Exception("isValid returned false");
|
||||
throw new Exception('isValid returned false');
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
Logging::debug($e->getMessage());
|
||||
$this->view->statusMessage = "<div class='errors'>"._("Invalid form values.")."</div>";
|
||||
$this->view->statusMessage = "<div class='errors'>" . _('Invalid form values.') . '</div>';
|
||||
$this->view->streamId = -1;
|
||||
$this->view->analysis = $analysis;
|
||||
}
|
||||
|
|
|
@ -4,31 +4,30 @@ class Zend_Controller_Plugin_Acl extends Zend_Controller_Plugin_Abstract
|
|||
{
|
||||
/**
|
||||
* @var Zend_Acl
|
||||
**/
|
||||
*/
|
||||
protected $_acl;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
**/
|
||||
*/
|
||||
protected $_roleName;
|
||||
|
||||
/**
|
||||
* @var array
|
||||
**/
|
||||
*/
|
||||
protected $_errorPage;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* Constructor.
|
||||
*
|
||||
* @param mixed $aclData
|
||||
* @param $roleName
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
public function __construct(Zend_Acl $aclData, $roleName = 'G')
|
||||
{
|
||||
$this->_errorPage = array('module' => 'default',
|
||||
'controller' => 'error',
|
||||
'action' => 'error');
|
||||
$this->_errorPage = ['module' => 'default',
|
||||
'controller' => 'error',
|
||||
'action' => 'error', ];
|
||||
|
||||
$this->_roleName = $roleName;
|
||||
|
||||
|
@ -38,32 +37,32 @@ class Zend_Controller_Plugin_Acl extends Zend_Controller_Plugin_Abstract
|
|||
}
|
||||
|
||||
/**
|
||||
* Sets the ACL object
|
||||
* Sets the ACL object.
|
||||
*
|
||||
* @param mixed $aclData
|
||||
* @return void
|
||||
**/
|
||||
* @param mixed $aclData
|
||||
*/
|
||||
public function setAcl(Zend_Acl $aclData)
|
||||
{
|
||||
$this->_acl = $aclData;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the ACL object
|
||||
* Returns the ACL object.
|
||||
*
|
||||
* @return Zend_Acl
|
||||
**/
|
||||
*/
|
||||
public function getAcl()
|
||||
{
|
||||
return $this->_acl;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the ACL role used
|
||||
* Returns the ACL role used.
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* @author
|
||||
**/
|
||||
*/
|
||||
public function getRoleName()
|
||||
{
|
||||
return $this->_roleName;
|
||||
|
@ -75,25 +74,24 @@ class Zend_Controller_Plugin_Acl extends Zend_Controller_Plugin_Abstract
|
|||
}
|
||||
|
||||
/**
|
||||
* Sets the error page
|
||||
* Sets the error page.
|
||||
*
|
||||
* @param string $action
|
||||
* @param string $controller
|
||||
* @param string $module
|
||||
* @return void
|
||||
**/
|
||||
* @param string $action
|
||||
* @param string $controller
|
||||
* @param string $module
|
||||
*/
|
||||
public function setErrorPage($action, $controller = 'error', $module = 'default')
|
||||
{
|
||||
$this->_errorPage = array('module' => $module,
|
||||
'controller' => $controller,
|
||||
'action' => $action);
|
||||
$this->_errorPage = ['module' => $module,
|
||||
'controller' => $controller,
|
||||
'action' => $action, ];
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the error page
|
||||
* Returns the error page.
|
||||
*
|
||||
* @return array
|
||||
**/
|
||||
*/
|
||||
public function getErrorPage()
|
||||
{
|
||||
return $this->_errorPage;
|
||||
|
@ -102,82 +100,73 @@ class Zend_Controller_Plugin_Acl extends Zend_Controller_Plugin_Abstract
|
|||
/**
|
||||
* Predispatch
|
||||
* Checks if the current user identified by roleName has rights to the requested url (module/controller/action)
|
||||
* If not, it will call denyAccess to be redirected to errorPage
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
* If not, it will call denyAccess to be redirected to errorPage.
|
||||
*/
|
||||
public function preDispatch(Zend_Controller_Request_Abstract $request)
|
||||
{
|
||||
$controller = strtolower($request->getControllerName());
|
||||
|
||||
if (in_array($controller, array(
|
||||
"index",
|
||||
"login",
|
||||
"api",
|
||||
"auth",
|
||||
"error",
|
||||
"locale",
|
||||
"upgrade",
|
||||
"embed",
|
||||
"feeds"
|
||||
)))
|
||||
{
|
||||
$this->setRoleName("G");
|
||||
}
|
||||
elseif (Zend_Session::isStarted() && !Zend_Auth::getInstance()->hasIdentity()) {
|
||||
|
||||
if (in_array($controller, [
|
||||
'index',
|
||||
'login',
|
||||
'api',
|
||||
'auth',
|
||||
'error',
|
||||
'locale',
|
||||
'upgrade',
|
||||
'embed',
|
||||
'feeds',
|
||||
])) {
|
||||
$this->setRoleName('G');
|
||||
} elseif (Zend_Session::isStarted() && !Zend_Auth::getInstance()->hasIdentity()) {
|
||||
//The controller uses sessions but we don't have an identity yet.
|
||||
|
||||
// If we don't have an identity and we're making a RESTful request,
|
||||
// we need to do API key verification
|
||||
if ($request->getModuleName() == "rest") {
|
||||
if ($request->getModuleName() == 'rest') {
|
||||
if (!$this->verifyAuth()) {
|
||||
//$this->denyAccess();
|
||||
//$this->getResponse()->sendResponse();
|
||||
//$r->gotoSimpleAndExit('index', 'login', $request->getModuleName());
|
||||
|
||||
//die();
|
||||
throw new Zend_Controller_Exception("Incorrect API key", 401);
|
||||
throw new Zend_Controller_Exception('Incorrect API key', 401);
|
||||
}
|
||||
}
|
||||
else //Non-REST, regular Airtime web app requests
|
||||
{
|
||||
} else { //Non-REST, regular Airtime web app requests
|
||||
// Redirect user to the landing page if they are trying to
|
||||
// access a resource that requires a valid session.
|
||||
// Skip the redirection if they are already on the landing page
|
||||
// or the login page.
|
||||
if ($controller !== 'index' && $controller !== 'login') {
|
||||
|
||||
if ($request->isXmlHttpRequest()) {
|
||||
|
||||
$url = 'http://'.$request->getHttpHost().'/';
|
||||
$json = Zend_Json::encode(array('auth' => false, 'url' => $url));
|
||||
$url = 'http://' . $request->getHttpHost() . '/';
|
||||
$json = Zend_Json::encode(['auth' => false, 'url' => $url]);
|
||||
|
||||
// Prepare response
|
||||
$this->getResponse()
|
||||
->setHttpResponseCode(401)
|
||||
->setBody($json)
|
||||
->sendResponse();
|
||||
->setHttpResponseCode(401)
|
||||
->setBody($json)
|
||||
->sendResponse()
|
||||
;
|
||||
|
||||
//redirectAndExit() cleans up, sends the headers and stops the script
|
||||
Zend_Controller_Action_HelperBroker::getStaticHelper('redirector')->redirectAndExit();
|
||||
} else {
|
||||
$r = Zend_Controller_Action_HelperBroker::getStaticHelper('redirector');
|
||||
$r->gotoSimpleAndExit('index', 'index', $request->getModuleName());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else { //We have a session/identity.
|
||||
|
||||
// If we have an identity and we're making a RESTful request,
|
||||
// we need to check the CSRF token
|
||||
if ($_SERVER['REQUEST_METHOD'] != "GET" && $request->getModuleName() == "rest") {
|
||||
$token = $request->getParam("csrf_token");
|
||||
if ($_SERVER['REQUEST_METHOD'] != 'GET' && $request->getModuleName() == 'rest') {
|
||||
$token = $request->getParam('csrf_token');
|
||||
// PUT requests don't parameterize the data in the body, so we can't
|
||||
// fetch it with getParam or getPost; instead we have to parse the body and
|
||||
// check for the token in the JSON. (Hopefully we can find a better way to do this) -- Duncan
|
||||
if (empty($token)) {
|
||||
$token = json_decode($this->getRequest()->getRawBody(), true)["csrf_token"];
|
||||
$token = json_decode($this->getRequest()->getRawBody(), true)['csrf_token'];
|
||||
}
|
||||
$tokenValid = $this->verifyCSRFToken($token);
|
||||
|
||||
|
@ -185,15 +174,17 @@ class Zend_Controller_Plugin_Acl extends Zend_Controller_Plugin_Abstract
|
|||
$csrf_namespace = new Zend_Session_Namespace('csrf_namespace');
|
||||
$csrf_namespace->authtoken = sha1(openssl_random_pseudo_bytes(128));
|
||||
|
||||
Logging::warn("Invalid CSRF token: $token");
|
||||
Logging::warn("Invalid CSRF token: {$token}");
|
||||
$this->getResponse()
|
||||
->setHttpResponseCode(401)
|
||||
->appendBody("ERROR: CSRF token mismatch.")
|
||||
->sendResponse();
|
||||
die();
|
||||
->setHttpResponseCode(401)
|
||||
->appendBody('ERROR: CSRF token mismatch.')
|
||||
->sendResponse()
|
||||
;
|
||||
|
||||
exit();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
|
||||
$this->setRoleName($userInfo->type);
|
||||
|
||||
|
@ -208,28 +199,32 @@ class Zend_Controller_Plugin_Acl extends Zend_Controller_Plugin_Abstract
|
|||
|
||||
$resourceName .= $controller;
|
||||
|
||||
/** Check if the controller/action can be accessed by the current user */
|
||||
// Check if the controller/action can be accessed by the current user
|
||||
if (!$this->getAcl()->has($resourceName)) {
|
||||
$this->setErrorPage('error404');
|
||||
$this->denyAccess();
|
||||
} else if (!$this->getAcl()->isAllowed($this->_roleName,
|
||||
$resourceName,
|
||||
$request->getActionName())) {
|
||||
/** Redirect to access denied page */
|
||||
} elseif (!$this->getAcl()->isAllowed(
|
||||
$this->_roleName,
|
||||
$resourceName,
|
||||
$request->getActionName()
|
||||
)) {
|
||||
// Redirect to access denied page
|
||||
$this->setErrorPage('error403');
|
||||
$this->denyAccess();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function verifyAuth() {
|
||||
private function verifyAuth()
|
||||
{
|
||||
if ($this->verifyAPIKey() || $this->isVerifiedDownload()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
$this->getResponse()
|
||||
->setHttpResponseCode(401)
|
||||
->appendBody("ERROR: Incorrect API key.");
|
||||
->appendBody('ERROR: Incorrect API key.')
|
||||
;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@ -239,47 +234,50 @@ class Zend_Controller_Plugin_Acl extends Zend_Controller_Plugin_Abstract
|
|||
* It should satisfy the following requirements:
|
||||
* * request path is /rest/media/:id/download
|
||||
* * download key is correct
|
||||
* * requested file belongs to the station podcast
|
||||
* * requested file belongs to the station podcast.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
private function isVerifiedDownload() {
|
||||
private function isVerifiedDownload()
|
||||
{
|
||||
$request = $this->getRequest();
|
||||
$fileId = $request->getParam("id");
|
||||
$key = $request->getParam("download_key");
|
||||
$fileId = $request->getParam('id');
|
||||
$key = $request->getParam('download_key');
|
||||
$module = $request->getModuleName();
|
||||
$controller = $request->getControllerName();
|
||||
$action = $request->getActionName();
|
||||
$stationPodcast = StationPodcastQuery::create()
|
||||
->findOneByDbPodcastId(Application_Model_Preference::getStationPodcastId());
|
||||
return $module == "rest" && $controller == "media" && $action == "download"
|
||||
->findOneByDbPodcastId(Application_Model_Preference::getStationPodcastId())
|
||||
;
|
||||
|
||||
return $module == 'rest' && $controller == 'media' && $action == 'download'
|
||||
&& $key === Application_Model_Preference::getStationPodcastDownloadKey()
|
||||
&& $stationPodcast->hasEpisodeForFile($fileId);
|
||||
}
|
||||
|
||||
private function verifyCSRFToken($token) {
|
||||
private function verifyCSRFToken($token)
|
||||
{
|
||||
return SecurityHelper::verifyCSRFToken($token);
|
||||
}
|
||||
|
||||
private function verifyAPIKey() {
|
||||
|
||||
private function verifyAPIKey()
|
||||
{
|
||||
// The API key is passed in via HTTP "basic authentication":
|
||||
// http://en.wikipedia.org/wiki/Basic_access_authentication
|
||||
$CC_CONFIG = Config::getConfig();
|
||||
|
||||
|
||||
// Decode the API key that was passed to us in the HTTP request.
|
||||
$authHeader = $this->getRequest()->getHeader("Authorization");
|
||||
$encodedRequestApiKey = substr($authHeader, strlen("Basic "));
|
||||
$encodedStoredApiKey = base64_encode($CC_CONFIG["apiKey"][0] . ":");
|
||||
|
||||
return ($encodedRequestApiKey === $encodedStoredApiKey);
|
||||
$authHeader = $this->getRequest()->getHeader('Authorization');
|
||||
$encodedRequestApiKey = substr($authHeader, strlen('Basic '));
|
||||
$encodedStoredApiKey = base64_encode($CC_CONFIG['apiKey'][0] . ':');
|
||||
|
||||
return $encodedRequestApiKey === $encodedStoredApiKey;
|
||||
}
|
||||
|
||||
/**
|
||||
* Deny Access Function
|
||||
* Redirects to errorPage, this can be called from an action using the action helper
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
* Redirects to errorPage, this can be called from an action using the action helper.
|
||||
*/
|
||||
public function denyAccess()
|
||||
{
|
||||
$this->_request->setModuleName($this->_errorPage['module']);
|
||||
|
|
|
@ -2,14 +2,16 @@
|
|||
|
||||
class Zend_Controller_Plugin_Maintenance extends Zend_Controller_Plugin_Abstract
|
||||
{
|
||||
public function preDispatch(Zend_Controller_Request_Abstract $request) {
|
||||
$maintenanceFile = isset($_SERVER['AIRTIME_BASE']) ? $_SERVER['AIRTIME_BASE']."maintenance.txt" : "/tmp/maintenance.txt";
|
||||
public function preDispatch(Zend_Controller_Request_Abstract $request)
|
||||
{
|
||||
$maintenanceFile = isset($_SERVER['AIRTIME_BASE']) ? $_SERVER['AIRTIME_BASE'] . 'maintenance.txt' : '/tmp/maintenance.txt';
|
||||
|
||||
if (file_exists($maintenanceFile)) {
|
||||
$request->setModuleName('default')
|
||||
->setControllerName('index')
|
||||
->setActionName('maintenance')
|
||||
->setDispatched(true);
|
||||
->setControllerName('index')
|
||||
->setActionName('maintenance')
|
||||
->setDispatched(true)
|
||||
;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,9 +7,10 @@
|
|||
*/
|
||||
class PageLayoutInitPlugin extends Zend_Controller_Plugin_Abstract
|
||||
{
|
||||
protected $_bootstrap = null;
|
||||
protected $_bootstrap;
|
||||
|
||||
public function __construct($boostrap) {
|
||||
public function __construct($boostrap)
|
||||
{
|
||||
$this->_bootstrap = $boostrap;
|
||||
}
|
||||
|
||||
|
@ -17,7 +18,7 @@ class PageLayoutInitPlugin extends Zend_Controller_Plugin_Abstract
|
|||
* Start the session depending on which controller your request is going to.
|
||||
* We start the session explicitly here so that we can avoid starting sessions
|
||||
* needlessly for (stateless) requests to the API.
|
||||
* @param Zend_Controller_Request_Abstract $request
|
||||
*
|
||||
* @throws Zend_Session_Exception
|
||||
*/
|
||||
public function routeShutdown(Zend_Controller_Request_Abstract $request)
|
||||
|
@ -27,15 +28,15 @@ class PageLayoutInitPlugin extends Zend_Controller_Plugin_Abstract
|
|||
|
||||
//List of controllers where we don't need a session, and we don't need
|
||||
//all the standard HTML / JS boilerplate.
|
||||
if (!in_array($controller, array(
|
||||
"index", //Radio Page
|
||||
"api",
|
||||
"auth",
|
||||
"error",
|
||||
"upgrade",
|
||||
"embed",
|
||||
"feeds"
|
||||
))
|
||||
if (!in_array($controller, [
|
||||
'index', //Radio Page
|
||||
'api',
|
||||
'auth',
|
||||
'error',
|
||||
'upgrade',
|
||||
'embed',
|
||||
'feeds',
|
||||
])
|
||||
) {
|
||||
//Start the session
|
||||
Zend_Session::start();
|
||||
|
@ -54,7 +55,7 @@ class PageLayoutInitPlugin extends Zend_Controller_Plugin_Abstract
|
|||
}
|
||||
|
||||
// Skip upgrades and task management when running unit tests
|
||||
if (getenv("AIRTIME_UNIT_TEST") != 1) {
|
||||
if (getenv('AIRTIME_UNIT_TEST') != 1) {
|
||||
$taskManager = TaskManager::getInstance();
|
||||
|
||||
// Run the upgrade on each request (if it needs to be run)
|
||||
|
@ -66,7 +67,7 @@ class PageLayoutInitPlugin extends Zend_Controller_Plugin_Abstract
|
|||
// Piggyback the TaskManager onto API calls. This provides guaranteed consistency
|
||||
// (there is at least one API call made from pypo to Airtime every 7 minutes) and
|
||||
// greatly reduces the chances of lock contention on cc_pref while the TaskManager runs
|
||||
if ($controller == "api") {
|
||||
if ($controller == 'api') {
|
||||
$taskManager->runTasks();
|
||||
}
|
||||
}
|
||||
|
@ -81,29 +82,29 @@ class PageLayoutInitPlugin extends Zend_Controller_Plugin_Abstract
|
|||
$view = $this->_bootstrap->getResource('view');
|
||||
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||
|
||||
$view->headScript()->appendScript("var baseUrl = '$baseUrl';");
|
||||
$view->headScript()->appendScript("var baseUrl = '{$baseUrl}';");
|
||||
$this->_initTranslationGlobals($view);
|
||||
|
||||
$user = Application_Model_User::GetCurrentUser();
|
||||
if (!is_null($user)) {
|
||||
$userType = $user->getType();
|
||||
} else {
|
||||
$userType = "";
|
||||
$userType = '';
|
||||
}
|
||||
$view->headScript()->appendScript("var userType = '$userType';");
|
||||
$view->headScript()->appendScript("var userType = '{$userType}';");
|
||||
|
||||
// Dropzone also accept file extensions and doesn't correctly extract certain mimetypes (eg. FLAC - try it),
|
||||
// so we append the file extensions to the list of mimetypes and that makes it work.
|
||||
$mimeTypes = FileDataHelper::getAudioMimeTypeArray();
|
||||
$fileExtensions = array_values($mimeTypes);
|
||||
foreach($fileExtensions as &$extension) {
|
||||
foreach ($fileExtensions as &$extension) {
|
||||
$extension = '.' . $extension;
|
||||
}
|
||||
$view->headScript()->appendScript("var acceptedMimeTypes = " . json_encode(array_merge(array_keys($mimeTypes), $fileExtensions)) . ";");
|
||||
$view->headScript()->appendScript('var acceptedMimeTypes = ' . json_encode(array_merge(array_keys($mimeTypes), $fileExtensions)) . ';');
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a global namespace to hold a session token for CSRF prevention
|
||||
* Create a global namespace to hold a session token for CSRF prevention.
|
||||
*/
|
||||
protected function _initCsrfNamespace()
|
||||
{
|
||||
|
@ -131,7 +132,7 @@ class PageLayoutInitPlugin extends Zend_Controller_Plugin_Abstract
|
|||
/**
|
||||
* Ideally, globals should be written to a single js file once
|
||||
* from a php init function. This will save us from having to
|
||||
* reinitialize them every request
|
||||
* reinitialize them every request.
|
||||
*/
|
||||
private function _initTranslationGlobals()
|
||||
{
|
||||
|
@ -142,18 +143,18 @@ class PageLayoutInitPlugin extends Zend_Controller_Plugin_Abstract
|
|||
//Each page refresh or tab open has uniqID, not to be used for security
|
||||
$view->headScript()->appendScript("var UNIQID = '" . uniqid() . "';");
|
||||
|
||||
$track_type_options = array();
|
||||
$track_type_options = [];
|
||||
$track_types = Application_Model_Tracktype::getTracktypes();
|
||||
|
||||
array_multisort(array_map(function($element) {
|
||||
|
||||
array_multisort(array_map(function ($element) {
|
||||
return $element['type_name'];
|
||||
}, $track_types), SORT_ASC, $track_types);
|
||||
|
||||
|
||||
foreach ($track_types as $key => $tt) {
|
||||
$track_type_options[$tt['code']] = $tt['type_name'];
|
||||
}
|
||||
$ttarr = json_encode($track_type_options, JSON_FORCE_OBJECT);
|
||||
$view->headScript()->appendScript("var TRACKTYPES = " . $ttarr . ";");
|
||||
$view->headScript()->appendScript('var TRACKTYPES = ' . $ttarr . ';');
|
||||
}
|
||||
|
||||
protected function _initHeadLink()
|
||||
|
@ -164,14 +165,15 @@ class PageLayoutInitPlugin extends Zend_Controller_Plugin_Abstract
|
|||
|
||||
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||
|
||||
$view->headLink(array('rel' => 'icon', 'href' => $baseUrl . 'favicon.ico?' . $CC_CONFIG['airtime_version'], 'type' => 'image/x-icon'), 'PREPEND')
|
||||
$view->headLink(['rel' => 'icon', 'href' => $baseUrl . 'favicon.ico?' . $CC_CONFIG['airtime_version'], 'type' => 'image/x-icon'], 'PREPEND')
|
||||
->appendStylesheet($baseUrl . 'css/bootstrap.css?' . $CC_CONFIG['airtime_version'])
|
||||
->appendStylesheet($baseUrl . 'css/redmond/jquery-ui-1.8.8.custom.css?' . $CC_CONFIG['airtime_version'])
|
||||
->appendStylesheet($baseUrl . 'css/pro_dropdown_3.css?' . $CC_CONFIG['airtime_version'])
|
||||
->appendStylesheet($baseUrl . 'css/qtip/jquery.qtip.min.css?' . $CC_CONFIG['airtime_version'])
|
||||
->appendStylesheet($baseUrl . 'css/styles.css?' . $CC_CONFIG['airtime_version'])
|
||||
->appendStylesheet($baseUrl . 'css/masterpanel.css?' . $CC_CONFIG['airtime_version'])
|
||||
->appendStylesheet($baseUrl . 'css/tipsy/jquery.tipsy.css?' . $CC_CONFIG['airtime_version']);
|
||||
->appendStylesheet($baseUrl . 'css/tipsy/jquery.tipsy.css?' . $CC_CONFIG['airtime_version'])
|
||||
;
|
||||
}
|
||||
|
||||
protected function _initHeadScript()
|
||||
|
@ -200,20 +202,21 @@ class PageLayoutInitPlugin extends Zend_Controller_Plugin_Abstract
|
|||
->appendFile($baseUrl . 'locale/general-translation-table?' . $CC_CONFIG['airtime_version'], 'text/javascript')
|
||||
->appendFile($baseUrl . 'locale/datatables-translation-table?' . $CC_CONFIG['airtime_version'], 'text/javascript')
|
||||
|
||||
->appendScript("$.i18n.setDictionary(general_dict)")
|
||||
->appendScript("var baseUrl='$baseUrl'");
|
||||
->appendScript('$.i18n.setDictionary(general_dict)')
|
||||
->appendScript("var baseUrl='{$baseUrl}'")
|
||||
;
|
||||
|
||||
//These timezones are needed to adjust javascript Date objects on the client to make sense to the user's set timezone
|
||||
//or the server's set timezone.
|
||||
$serverTimeZone = new DateTimeZone(Application_Model_Preference::GetDefaultTimezone());
|
||||
$now = new DateTime("now", $serverTimeZone);
|
||||
$offset = $now->format("Z") * -1;
|
||||
$now = new DateTime('now', $serverTimeZone);
|
||||
$offset = $now->format('Z') * -1;
|
||||
$view->headScript()->appendScript("var serverTimezoneOffset = {$offset}; //in seconds");
|
||||
|
||||
if (class_exists("Zend_Auth", false) && Zend_Auth::getInstance()->hasIdentity()) {
|
||||
if (class_exists('Zend_Auth', false) && Zend_Auth::getInstance()->hasIdentity()) {
|
||||
$userTimeZone = new DateTimeZone(Application_Model_Preference::GetUserTimezone());
|
||||
$now = new DateTime("now", $userTimeZone);
|
||||
$offset = $now->format("Z") * -1;
|
||||
$now = new DateTime('now', $userTimeZone);
|
||||
$offset = $now->format('Z') * -1;
|
||||
$view->headScript()->appendScript("var userTimezoneOffset = {$offset}; //in seconds");
|
||||
}
|
||||
|
||||
|
@ -225,16 +228,17 @@ class PageLayoutInitPlugin extends Zend_Controller_Plugin_Abstract
|
|||
->appendFile($baseUrl . 'js/tipsy/jquery.tipsy.js?' . $CC_CONFIG['airtime_version'], 'text/javascript')
|
||||
|
||||
->appendFile($baseUrl . 'js/airtime/common/common.js?' . $CC_CONFIG['airtime_version'], 'text/javascript')
|
||||
->appendFile($baseUrl . 'js/airtime/common/audioplaytest.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
->appendFile($baseUrl . 'js/airtime/common/audioplaytest.js?' . $CC_CONFIG['airtime_version'], 'text/javascript')
|
||||
;
|
||||
|
||||
$user = Application_Model_User::getCurrentUser();
|
||||
if (!is_null($user)) {
|
||||
$userType = $user->getType();
|
||||
} else {
|
||||
$userType = "";
|
||||
$userType = '';
|
||||
}
|
||||
|
||||
$view->headScript()->appendScript("var userType = '$userType';");
|
||||
$view->headScript()->appendScript("var userType = '{$userType}';");
|
||||
}
|
||||
|
||||
protected function _initViewHelpers()
|
||||
|
|
|
@ -5,15 +5,15 @@ class RabbitMqPlugin extends Zend_Controller_Plugin_Abstract
|
|||
public function dispatchLoopShutdown()
|
||||
{
|
||||
if (Application_Model_RabbitMq::$doPush) {
|
||||
$md = array('schedule' => Application_Model_Schedule::getSchedule());
|
||||
Application_Model_RabbitMq::SendMessageToPypo("update_schedule", $md);
|
||||
$md = ['schedule' => Application_Model_Schedule::getSchedule()];
|
||||
Application_Model_RabbitMq::SendMessageToPypo('update_schedule', $md);
|
||||
}
|
||||
|
||||
if (memory_get_peak_usage() > 30*pow(2, 20)) {
|
||||
Logging::debug("Peak memory usage: "
|
||||
.(memory_get_peak_usage()/1000000)
|
||||
." MB while accessing URI ".$_SERVER['REQUEST_URI']);
|
||||
Logging::debug("Should try to keep memory footprint under 25 MB");
|
||||
if (memory_get_peak_usage() > 30 * pow(2, 20)) {
|
||||
Logging::debug('Peak memory usage: '
|
||||
. (memory_get_peak_usage() / 1000000)
|
||||
. ' MB while accessing URI ' . $_SERVER['REQUEST_URI']);
|
||||
Logging::debug('Should try to keep memory footprint under 25 MB');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue