Merge branch 'devel' into 2.3.x-saas

Conflicts:
	airtime_mvc/application/controllers/PreferenceController.php
	airtime_mvc/application/forms/AddShowWhen.php
	airtime_mvc/application/forms/GeneralPreferences.php
	airtime_mvc/application/forms/LiveStreamingPreferences.php
	airtime_mvc/application/forms/SoundcloudPreferences.php
	airtime_mvc/application/forms/SupportSettings.php
	airtime_mvc/application/views/scripts/form/preferences.phtml
	airtime_mvc/application/views/scripts/form/preferences_email_server.phtml
	airtime_mvc/application/views/scripts/form/preferences_general.phtml
	airtime_mvc/application/views/scripts/form/preferences_livestream.phtml
	airtime_mvc/application/views/scripts/form/support-setting.phtml
	airtime_mvc/application/views/scripts/schedule/add-
show-form.phtml
	airtime_mvc/public/js/airtime/preferences/preferences.js
	python_apps/api_clients/api_client.py
	python_apps/pypo/listenerstat.py
This commit is contained in:
Martin Konecny 2013-01-15 13:44:44 -05:00
commit 8cd6bd9aa4
346 changed files with 48955 additions and 11856 deletions

View file

@ -42,18 +42,19 @@ class ApiController extends Zend_Controller_Action
->addActionContext('notify-webstream-data' , 'json')
->addActionContext('get-stream-parameters' , 'json')
->addActionContext('push-stream-stats' , 'json')
->addActionContext('update-stream-setting-table' , 'json')
->initContext();
}
public function checkAuth()
{
global $CC_CONFIG;
$CC_CONFIG = Config::getConfig();
$api_key = $this->_getParam('api_key');
if (!in_array($api_key, $CC_CONFIG["apiKey"]) &&
is_null(Zend_Auth::getInstance()->getStorage()->read())) {
header('HTTP/1.0 401 Unauthorized');
print 'You are not allowed to access this resource.';
print _('You are not allowed to access this resource.');
exit;
}
}
@ -80,7 +81,7 @@ class ApiController extends Zend_Controller_Action
if (is_null(Zend_Auth::getInstance()->getStorage()->read())) {
header('HTTP/1.0 401 Unauthorized');
print 'You are not allowed to access this resource.';
print _('You are not allowed to access this resource.');
return;
}
@ -282,7 +283,7 @@ class ApiController extends Zend_Controller_Action
echo isset($_GET['callback']) ? $_GET['callback'].'('.json_encode($result).')' : json_encode($result);
} else {
header('HTTP/1.0 401 Unauthorized');
print 'You are not allowed to access this resource. ';
print _('You are not allowed to access this resource. ');
exit;
}
}
@ -321,7 +322,7 @@ class ApiController extends Zend_Controller_Action
echo isset($_GET['callback']) ? $_GET['callback'].'('.json_encode($result).')' : json_encode($result);
} else {
header('HTTP/1.0 401 Unauthorized');
print 'You are not allowed to access this resource. ';
print _('You are not allowed to access this resource. ');
exit;
}
}
@ -490,6 +491,7 @@ class ApiController extends Zend_Controller_Action
// If the file already exists we will update and make sure that
// it's marked as 'exists'.
$file->setFileExistsFlag(true);
$file->setFileHiddenFlag(false);
$file->setMetadata($md);
}
if ($md['is_record'] != 0) {
@ -502,7 +504,7 @@ class ApiController extends Zend_Controller_Action
//File is not in database anymore.
if (is_null($file)) {
$return_hash['error'] = "File does not exist in Airtime.";
$return_hash['error'] = _("File does not exist in Airtime.");
return $return_hash;
}
@ -515,7 +517,7 @@ class ApiController extends Zend_Controller_Action
$md['MDATA_KEY_ORIGINAL_PATH']);
if (is_null($file)) {
$return_hash['error'] = 'File does not exist in Airtime';
$return_hash['error'] = _('File does not exist in Airtime');
} else {
$filepath = $md['MDATA_KEY_FILEPATH'];
//$filepath = str_replace("\\", "", $filepath);
@ -527,7 +529,7 @@ class ApiController extends Zend_Controller_Action
$file = Application_Model_StoredFile::RecallByFilepath($filepath);
if (is_null($file)) {
$return_hash['error'] = "File doesn't exist in Airtime.";
$return_hash['error'] = _("File doesn't exist in Airtime.");
Logging::warn("Attempt to delete file that doesn't exist.
Path: '$filepath'");
@ -573,7 +575,7 @@ class ApiController extends Zend_Controller_Action
Logging::info("Received bad request(key=$k), no 'mode' parameter. Bad request is:");
Logging::info( $info_json );
array_push( $responses, array(
'error' => "Bad request. no 'mode' parameter passed.",
'error' => _("Bad request. no 'mode' parameter passed."),
'key' => $k));
continue;
} elseif ( !in_array($info_json['mode'], $valid_modes) ) {
@ -583,7 +585,7 @@ class ApiController extends Zend_Controller_Action
Logging::info("Received bad request(key=$k). 'mode' parameter was invalid with value: '$mode'. Request:");
Logging::info( $info_json );
array_push( $responses, array(
'error' => "Bad request. 'mode' parameter is invalid",
'error' => _("Bad request. 'mode' parameter is invalid"),
'key' => $k,
'mode' => $mode ) );
continue;
@ -953,7 +955,7 @@ class ApiController extends Zend_Controller_Action
$data_arr = json_decode($data);
if (!is_null($media_id)) {
if (isset($data_arr->title) &&
if (isset($data_arr->title) &&
strlen($data_arr->title) < 1024) {
$previous_metadata = CcWebstreamMetadataQuery::create()
@ -989,7 +991,7 @@ class ApiController extends Zend_Controller_Action
$streams = array("s1", "s2", "s3");
$stream_params = array();
foreach ($streams as $s) {
$stream_params[$s] =
$stream_params[$s] =
Application_Model_StreamSetting::getStreamDataNormalized($s);
}
$this->view->stream_params = $stream_params;
@ -1002,5 +1004,14 @@ class ApiController extends Zend_Controller_Action
Application_Model_ListenerStat::insertDataPoints($data);
$this->view->data = $data;
}
public function updateStreamSettingTableAction() {
$request = $this->getRequest();
$data = json_decode($request->getParam("data"), true);
foreach ($data as $k=>$v) {
Application_Model_StreamSetting::SetListenerStatError($k, $v);
}
}
}

View file

@ -19,31 +19,30 @@ class AudiopreviewController extends Zend_Controller_Action
*/
public function audioPreviewAction()
{
global $CC_CONFIG;
$CC_CONFIG = Config::getConfig();
$audioFileID = $this->_getParam('audioFileID');
$audioFileArtist = $this->_getParam('audioFileArtist');
$audioFileTitle = $this->_getParam('audioFileTitle');
$type = $this->_getParam('type');
$request = $this->getRequest();
$baseUrl = $request->getBaseUrl();
$baseUrl = Application_Common_OsPath::getBaseDir();
$this->view->headScript()->appendFile(
$baseUrl.'/js/airtime/audiopreview/preview_jplayer.js?'.$CC_CONFIG['airtime_version'],
$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'],
$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";
} else {
$this->view->logo = "$baseUrl/css/images/airtime_logo_jp.png";
$this->view->logo = $baseUrl."css/images/airtime_logo_jp.png";
}
if ($type == "audioclip") {
@ -74,24 +73,23 @@ class AudiopreviewController extends Zend_Controller_Action
*/
public function playlistPreviewAction()
{
global $CC_CONFIG;
$CC_CONFIG = Config::getConfig();
$playlistIndex = $this->_getParam('playlistIndex');
$playlistID = $this->_getParam('playlistID');
$request = $this->getRequest();
$baseUrl = $request->getBaseUrl();
$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";
} 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->playlistID = $playlistID;
@ -101,24 +99,23 @@ class AudiopreviewController extends Zend_Controller_Action
public function blockPreviewAction()
{
global $CC_CONFIG;
$CC_CONFIG = Config::getConfig();
$blockIndex = $this->_getParam('blockIndex');
$blockId = $this->_getParam('blockId');
$request = $this->getRequest();
$baseUrl = $request->getBaseUrl();
$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";
} 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->blockId = $blockId;
@ -180,6 +177,8 @@ class AudiopreviewController extends Zend_Controller_Action
private function createElementMap($track)
{
$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']:"",
@ -213,7 +212,7 @@ class AudiopreviewController extends Zend_Controller_Action
throw new Exception("Unknown file type: $mime");
}
$elementMap['uri'] = "/api/get-media/file/".$track['item_id'];
$elementMap['uri'] = $baseUrl."api/get-media/file/".$track['item_id'];
} else {
$elementMap['uri'] = $track['path'];
}
@ -227,24 +226,23 @@ class AudiopreviewController extends Zend_Controller_Action
*/
public function showPreviewAction()
{
global $CC_CONFIG;
$CC_CONFIG = Config::getConfig();
$showID = $this->_getParam('showID');
$showIndex = $this->_getParam('showIndex');
$request = $this->getRequest();
$baseUrl = $request->getBaseUrl();
$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";
} 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;
@ -258,6 +256,7 @@ class AudiopreviewController extends Zend_Controller_Action
*/
public function getShowAction()
{
$baseUrl = Application_Common_OsPath::getBaseDir();
// disable the view and the layout
$this->view->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender(true);
@ -298,7 +297,7 @@ class AudiopreviewController extends Zend_Controller_Action
throw new Exception("Unknown file type: $mime");
}
$elementMap['uri'] = "/api/get-media/file/".$track['item_id'];
$elementMap['uri'] = $baseUrl."api/get-media/file/".$track['item_id'];
} else {
$elementMap['uri'] = $track['filepath'];
}

View file

@ -33,9 +33,9 @@ class DashboardController extends Zend_Controller_Action
Application_Model_RabbitMq::SendMessageToPypo("disconnect_source", $data);
} else {
if ($source_connected) {
$this->view->error = "You don't have permission to disconnect source.";
$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.");
}
}
}
@ -79,12 +79,12 @@ class DashboardController extends Zend_Controller_Action
}
} else {
if ($source_connected) {
$this->view->error = "You don't have permission to switch source.";
$this->view->error = _("You don't have permission to switch source.");
} else {
if ($sourcename == 'scheduled_play') {
$this->view->error = "You don't have permission to disconnect source.";
$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.");
}
}
}
@ -96,19 +96,18 @@ class DashboardController extends Zend_Controller_Action
public function streamPlayerAction()
{
global $CC_CONFIG;
$CC_CONFIG = Config::getConfig();
$request = $this->getRequest();
$baseUrl = $request->getBaseUrl();
$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('bare');
$logo = Application_Model_Preference::GetStationLogo();
if ($logo) {
$this->view->logo = "data:image/png;base64,$logo";
} else {
$this->view->logo = "$baseUrl/css/images/airtime_logo_jp.png";
$this->view->logo = $baseUrl."css/images/airtime_logo_jp.png";
}
}

View file

@ -14,12 +14,12 @@ class ErrorController extends Zend_Controller_Action
// 404 error -- controller or action not found
$this->getResponse()->setHttpResponseCode(404);
$this->view->message = 'Page not found';
$this->view->message = _('Page not found');
break;
default:
// application error
$this->getResponse()->setHttpResponseCode(500);
$this->view->message = 'Application error';
$this->view->message = _('Application error');
break;
}

View file

@ -12,45 +12,47 @@ class LibraryController extends Zend_Controller_Action
$ajaxContext = $this->_helper->getHelper('AjaxContext');
$ajaxContext->addActionContext('contents-feed', 'json')
->addActionContext('delete', 'json')
->addActionContext('duplicate', 'json')
->addActionContext('delete-group', 'json')
->addActionContext('context-menu', 'json')
->addActionContext('get-file-metadata', 'html')
->addActionContext('upload-file-soundcloud', 'json')
->addActionContext('get-upload-to-soundcloud-status', 'json')
->addActionContext('set-num-entries', 'json')
->addActionContext('edit-file-md', 'json')
->initContext();
}
public function indexAction()
{
global $CC_CONFIG;
$CC_CONFIG = Config::getConfig();
$request = $this->getRequest();
$baseUrl = $request->getBaseUrl();
$baseUrl = Application_Common_OsPath::getBaseDir();
$this->view->headScript()->appendFile($baseUrl.'/js/blockui/jquery.blockUI.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/datatables/plugin/dataTables.ColVis.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'/js/datatables/plugin/dataTables.ColReorder.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'/js/datatables/plugin/dataTables.FixedColumns.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'/js/datatables/plugin/dataTables.columnFilter.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/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/datatables/plugin/dataTables.ColVis.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/datatables/plugin/dataTables.ColReorder.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/datatables/plugin/dataTables.FixedColumns.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/datatables/plugin/dataTables.columnFilter.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/library/library.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/library/events/library_playlistbuilder.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/library/library.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/airtime/library/events/library_playlistbuilder.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/ColReorder.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/ColReorder.css?'.$CC_CONFIG['airtime_version']);
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/library/spl.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/airtime/library/spl.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']);
try {
@ -90,7 +92,7 @@ class LibraryController extends Zend_Controller_Action
protected function playlistNotFound($p_type)
{
$this->view->error = "$p_type not found";
$this->view->error = sprintf(_("%s not found"), $p_type);
Logging::info("$p_type not found");
Application_Model_Library::changePlaylist(null, $p_type);
@ -99,7 +101,7 @@ class LibraryController extends Zend_Controller_Action
protected function playlistUnknownError($e)
{
$this->view->error = "Something went wrong.";
$this->view->error = _("Something went wrong.");
Logging::info($e->getMessage());
}
@ -142,19 +144,21 @@ class LibraryController extends Zend_Controller_Action
public function contextMenuAction()
{
$baseUrl = Application_Common_OsPath::getBaseDir();
$id = $this->_getParam('id');
$type = $this->_getParam('type');
//playlist||timeline
$screen = $this->_getParam('screen');
$request = $this->getRequest();
$baseUrl = $request->getBaseUrl();
$baseUrl = Application_Common_OsPath::getBaseDir();
$menu = array();
$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"] = array("name"=> _("Preview"), "icon" => "play", "disabled" => false);
$isAdminOrPM = $user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER));
@ -175,23 +179,23 @@ class LibraryController extends Zend_Controller_Action
}
if ($isAdminOrPM || $obj->getCreatorId() == $user->getId()) {
if ($obj_sess->type === "playlist") {
$menu["pl_add"] = array("name"=> "Add to Playlist", "icon" => "add-playlist", "icon" => "copy");
$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");
$menu["pl_add"] = array("name"=> _("Add to Smart Block"), "icon" => "add-playlist", "icon" => "copy");
}
}
}
if ($isAdminOrPM || $file->getFileOwnerId() == $user->getId()) {
$menu["del"] = array("name"=> "Delete", "icon" => "delete", "url" => "/library/delete");
$menu["edit"] = array("name"=> "Edit Metadata", "icon" => "edit", "url" => "/library/edit-file-md/id/{$id}");
$menu["del"] = array("name"=> _("Delete"), "icon" => "delete", "url" => $baseUrl."library/delete");
$menu["edit"] = array("name"=> _("Edit Metadata"), "icon" => "edit", "url" => $baseUrl."library/edit-file-md/id/{$id}");
}
$url = $file->getRelativeFileUrl($baseUrl).'/download/true';
$menu["download"] = array("name" => "Download", "icon" => "download", "url" => $url);
$url = $file->getRelativeFileUrl($baseUrl).'download/true';
$menu["download"] = array("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");
} elseif ($type === 'block') {
$obj = new Application_Model_Block($id);
if (!$obj->isStatic()) {
@ -199,35 +203,38 @@ class LibraryController extends Zend_Controller_Action
}
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");
$menu["pl_add"] = array("name"=> _("Add to Playlist"), "icon" => "add-playlist", "icon" => "copy");
}
}
}
if ($obj_sess->id !== $id && $screen == "playlist") {
if ($isAdminOrPM || $obj->getCreatorId() == $user->getId()) {
$menu["edit"] = array("name"=> "Edit", "icon" => "edit");
$menu["edit"] = array("name"=> _("Edit"), "icon" => "edit");
}
}
if ($isAdminOrPM || $obj->getCreatorId() == $user->getId()) {
$menu["del"] = array("name"=> "Delete", "icon" => "delete", "url" => "/library/delete");
$menu["del"] = array("name"=> _("Delete"), "icon" => "delete", "url" => $baseUrl."library/delete");
}
} elseif ($type == "stream") {
$webstream = CcWebstreamQuery::create()->findPK($id);
$obj = new Application_Model_Webstream($webstream);
$menu["play"]["mime"] = $webstream->getDbMime();
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");
$menu["pl_add"] = array("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" => "/library/edit-file-md/id/{$id}");
}
$menu["del"] = array("name"=> "Delete", "icon" => "delete", "url" => "/library/delete");
$menu["edit"] = array("name"=> _("Edit"), "icon" => "edit", "url" => $baseUrl."library/edit-file-md/id/{$id}");
}
$menu["del"] = array("name"=> _("Delete"), "icon" => "delete", "url" => $baseUrl."library/delete");
}
}
@ -238,26 +245,26 @@ class LibraryController extends Zend_Controller_Action
$menu["sep1"] = "-----------";
//create a sub menu for Soundcloud actions.
$menu["soundcloud"] = array("name" => "Soundcloud", "icon" => "soundcloud", "items" => array());
$menu["soundcloud"] = array("name" => _("Soundcloud"), "icon" => "soundcloud", "items" => array());
$scid = $file->getSoundCloudId();
if ($scid > 0) {
$url = $file->getSoundCloudLinkToFile();
$menu["soundcloud"]["items"]["view"] = array("name" => "View on Soundcloud", "icon" => "soundcloud", "url" => $url);
$menu["soundcloud"]["items"]["view"] = array("name" => _("View on Soundcloud"), "icon" => "soundcloud", "url" => $url);
}
if (!is_null($scid)) {
$text = "Re-upload to SoundCloud";
$text = _("Re-upload to SoundCloud");
} else {
$text = "Upload to SoundCloud";
$text = _("Upload to SoundCloud");
}
$menu["soundcloud"]["items"]["upload"] = array("name" => $text, "icon" => "soundcloud", "url" => "/library/upload-file-soundcloud/id/{$id}");
$menu["soundcloud"]["items"]["upload"] = array("name" => $text, "icon" => "soundcloud", "url" => $baseUrl."library/upload-file-soundcloud/id/{$id}");
}
if (empty($menu)) {
$menu["noaction"] = array("name"=>"No action available");
$menu["noaction"] = array("name"=>_("No action available"));
}
$this->view->items = $menu;
@ -277,7 +284,7 @@ class LibraryController extends Zend_Controller_Action
$streams = array();
$message = null;
$noPermissionMsg = "You don't have permission to delete selected items.";
$noPermissionMsg = _("You don't have permission to delete selected items.");
foreach ($mediaItems as $media) {
@ -326,7 +333,7 @@ class LibraryController extends Zend_Controller_Action
$message = $noPermissionMsg;
} catch (Exception $e) {
//could throw a scheduled in future exception.
$message = "Could not delete some scheduled files.";
$message = _("Could not delete some scheduled files.");
Logging::debug($e->getMessage());
}
}
@ -336,11 +343,43 @@ class LibraryController extends Zend_Controller_Action
$this->view->message = $message;
}
}
// duplicate playlist
public function duplicateAction(){
$params = $this->getRequest()->getParams();
$id = $params['id'];
$originalPl = new Application_Model_Playlist($id);
$newPl = new Application_Model_Playlist();
$contents = $originalPl->getContents();
foreach ($contents as &$c) {
if ($c['type'] == '0') {
$c[1] = 'audioclip';
} else if ($c['type'] == '2') {
$c[1] = 'block';
} else if ($c['type'] == '1') {
$c[1] = 'stream';
}
$c[0] = $c['item_id'];
}
$newPl->addAudioClips($contents, null, 'begining');
$newPl->setCreator(Application_Model_User::getCurrentUser()->getId());
$newPl->setDescription($originalPl->getDescription());
list($plFadeIn, ) = $originalPl->getFadeInfo(0);
list(, $plFadeOut) = $originalPl->getFadeInfo($originalPl->getSize()-1);
$newPl->setfades($plFadeIn, $plFadeOut);
$newPl->setName(sprintf(_("Copy of %s"), $originalPl->getName()));
}
public function contentsFeedAction()
{
$params = $this->getRequest()->getParams();
# terrible name for the method below. it does not only search files.
$r = Application_Model_StoredFile::searchLibraryFiles($params);
//TODO move this to the datatables row callback.
@ -379,14 +418,19 @@ class LibraryController extends Zend_Controller_Action
if (!$isAdminOrPM && $file->getFileOwnerId() != $user->getId()) {
return;
}
$form = new Application_Form_EditAudioMD();
$form->startForm($file_id);
$form->populate($file->getDbColMetadata());
if ($request->isPost()) {
if ($form->isValid($request->getPost())) {
$formdata = $form->getValues();
$formValues = $this->_getParam('data', null);
$formdata = array();
foreach ($formValues as $val) {
$formdata[$val["name"]] = $val["value"];
}
$file->setDbColMetadata($formdata);
$data = $file->getMetadata();
@ -401,6 +445,7 @@ class LibraryController extends Zend_Controller_Action
}
$this->view->form = $form;
$this->view->dialog = $this->view->render('library/edit-file-md.phtml');
}
public function getFileMetadataAction()
@ -453,10 +498,10 @@ class LibraryController extends Zend_Controller_Action
$this->view->md = $md;
if ($block->isStatic()) {
$this->view->blType = 'Static';
$this->view->blType = _('Static');
$this->view->contents = $block->getContents();
} else {
$this->view->blType = 'Dynamic';
$this->view->blType = _('Dynamic');
$this->view->contents = $block->getCriteria();
}
$this->view->block = $block;

View file

@ -12,22 +12,22 @@ class ListenerstatController extends Zend_Controller_Action
public function indexAction()
{
global $CC_CONFIG;
$CC_CONFIG = Config::getConfig();
$request = $this->getRequest();
$baseUrl = $request->getBaseUrl();
$baseUrl = Application_Common_OsPath::getBaseDir();
$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/airtime/listenerstat/listenerstat.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$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/airtime/listenerstat/listenerstat.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$offset = date("Z") * -1;
$this->view->headScript()->appendScript("var serverTimezoneOffset = {$offset}; //in seconds");
$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/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->headLink()->appendStylesheet($baseUrl.'css/jquery.ui.timepicker.css?'.$CC_CONFIG['airtime_version']);
//default time is the last 24 hours.
$now = time();
@ -47,6 +47,18 @@ class ListenerstatController extends Zend_Controller_Action
'his_time_end' => $end->format("H:i")
));
$errorStatus = Application_Model_StreamSetting::GetAllListenerStatErrors();
Logging::info($errorStatus);
$out = array();
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 System->Streams page.");
}
$out[$key[0]] = $v['value'];
}
$this->view->errorStatus = $out;
$this->view->date_form = $form;
}

View file

@ -0,0 +1,396 @@
<?php
class LocaleController extends Zend_Controller_Action
{
public function init()
{
$ajaxContext = $this->_helper->getHelper("AjaxContext");
$ajaxContext->addActionContext("general-translation-table", "json")
->addActionContext("datatables-translation-table", "json")
->initContext();
}
public function datatablesTranslationTableAction()
{
$this->view->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender(true);
header("Content-type: text/javascript");
$baseUrl = Application_Common_OsPath::getBaseDir();
$locale = Application_Model_Preference::GetLocale();
echo "var datatables_dict =" .
file_get_contents(Application_Common_OsPath::join(
$_SERVER["DOCUMENT_ROOT"],
$baseUrl,
"js/datatables/i18n/",
$locale.".txt")
);
}
public function generalTranslationTableAction()
{
$translations = array (
//common/common.js
"Audio Player" => _("Audio Player"),
//dashboard/dashboard.js
"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: "),
"This version will soon be obsolete." => _("This version will soon be obsolete."),
"This version is no longer supported." => _("This version is no longer supported."),
"Please upgrade to " => _("Please upgrade to "),
//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."),
//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."),
//"Adding 1 Item" => _("Adding 1 Item"),
//"Adding %s Items" => _("Adding %s Items"),
//library/library.js
"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)?"),
"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..."),
"The soundcloud id for this file is: " => _("The soundcloud id for this file is: "),
"There was an error while uploading to soundcloud." => _("There was an error while uploading to soundcloud."),
"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"),
//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?"),
//library/spl.js
"please put in a time '00:00:00 (.0)'" => _("please put in a time '00:00:00 (.0)'"),
"please put in a time in seconds '00 (.0)'" => _("please put in a time in seconds '00 (.0)'"),
"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"),
//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"),
//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 Airtime 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 Airtime 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"),
//playouthistory/historytable.js
"Title" => _("Title"),
"Creator" => _("Creator"),
"Played" => _("Played"),
"Length" => _("Length"),
"Composer" => _("Composer"),
"Copyright" => _("Copyright"),
"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."),
//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
"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 Airtime 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 Airtime 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 %sAirtime Manual%s" => _("For more details, please read the %sAirtime 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'."),
"If you change the username or password values for an enabled stream the playout engine will be rebooted and your listeners will hear silence for 5-10 seconds. Changing the following fields will NOT cause a reboot: Stream Label (Global Settings), and Switch Transition Fade(s), Master Username, and Master Password (Input Stream Settings). If Airtime is recording, and if the change causes a playout engine restart, the recording will be interrupted."
=> _("If you change the username or password values for an enabled stream the playout engine will be rebooted and your listeners will hear silence for 5-10 seconds. Changing the following fields will NOT cause a reboot: Stream Label (Global Settings), and Switch Transition Fade(s), Master Username, and Master Password (Input Stream Settings). If Airtime is recording, and if the change causes a playout engine restart, the recording will be interrupted."),
"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"),
//schedule/add-show.js
"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!"),
//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..."),
//already in library/library.js
//"The soundcloud id for this file is: " => _("The soundcloud id for this file is: "),
//"There was error while uploading to soundcloud." => _("There was error while uploading to soundcloud."),
//"Error code: " => _("Error code: "),
//"Error msg: " => _("Error msg: "),
"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"),
//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?"),
//showbuilder/builder.js
"Delete selected item(s)?" => _("Delete selected item(s)?"),
"Start" => _("Start"),
"End" => _("End"),
"Duration" => _("Duration"),
//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"),
//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"),
//already in library/library.js
//"Select" => _("Select"),
"Select all" => _("Select all"),
"Select none" => _("Select none"),
"Remove overbooked tracks" => _("Remove overbooked tracks"),
"Remove selected scheduled items" => _("Remove selected scheduled items"),
"Jump to the current playing track" => _("Jump to the current playing track"),
"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?"),
//showbuilder/main_builder.js
"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"),
//serverbrowse/serverbrowse.js
"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"),
"Progam Managers can do the following:" => _("Progam 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"),
//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"),
//datepicker
//months are already in schedule/schedule.js
"Su" => _("Su"),
"Mo" => _("Mo"),
"Tu" => _("Tu"),
"We" => _("We"),
"Th" => _("Th"),
"Fr" => _("Fr"),
"Sa" => _("Sa"),
"Close" => _("Close"),
//timepicker
"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"),
"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: ")
);
$this->view->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender(true);
header("Content-type: text/javascript");
echo "var general_dict=".json_encode($translations);
}
}

View file

@ -5,14 +5,18 @@ class LoginController extends Zend_Controller_Action
public function init()
{
/* Initialize action controller here */
}
public function indexAction()
{
global $CC_CONFIG;
$CC_CONFIG = Config::getConfig();
$request = $this->getRequest();
Application_Model_Locale::configureLocalization($request->getcookie('airtime_locale', 'en_CA'));
if (Zend_Auth::getInstance()->hasIdentity())
{
if (Zend_Auth::getInstance()->hasIdentity()) {
$this->_redirect('Showbuilder');
}
@ -20,14 +24,14 @@ class LoginController extends Zend_Controller_Action
$this->_helper->layout->setLayout('login');
$error = false;
$request = $this->getRequest();
$baseUrl = $request->getBaseUrl();
$baseUrl = Application_Common_OsPath::getBaseDir();
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/login/login.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/airtime/login/login.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$form = new Application_Form_Login();
$message = "Please enter your user name and password";
$message = _("Please enter your user name and password");
if ($request->isPost()) {
// if the post contains recaptcha field, which means form had recaptcha field.
@ -39,6 +43,7 @@ class LoginController extends Zend_Controller_Action
//get the username and password from the form
$username = $form->getValue('username');
$password = $form->getValue('password');
$locale = $form->getValue('locale');
if (Application_Model_Subjects::getLoginAttempts($username) >= 3 && $form->getElement('captcha') == NULL) {
$form->addRecaptcha();
} else {
@ -63,10 +68,13 @@ class LoginController extends Zend_Controller_Action
$tempSess = new Zend_Session_Namespace("referrer");
$tempSess->referrer = 'login';
//set the user locale in case user changed it in when logging in
Application_Model_Preference::SetUserLocale($auth->getIdentity()->id, $locale);
$this->_redirect('Showbuilder');
} else {
$message = "Wrong username or password provided. Please try again.";
$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();
@ -94,11 +102,11 @@ class LoginController extends Zend_Controller_Action
public function passwordRestoreAction()
{
global $CC_CONFIG;
$CC_CONFIG = Config::getConfig();
$request = $this->getRequest();
$baseUrl = $request->getBaseUrl();
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/login/password-restore.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$baseUrl = Application_Common_OsPath::getBaseDir();
$this->view->headScript()->appendFile($baseUrl.'js/airtime/login/password-restore.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
if (!Application_Model_Preference::GetEnableSystemEmail()) {
$this->_redirect('login');
@ -128,10 +136,10 @@ 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("Given email not found."));
$form->email->addError($this->view->translate(_("Given email not found.")));
}
}

View file

@ -25,6 +25,7 @@ class PlaylistController extends Zend_Controller_Action
->addActionContext('smart-block-generate', 'json')
->addActionContext('smart-block-shuffle', 'json')
->addActionContext('get-block-info', 'json')
->addActionContext('shuffle', 'json')
->initContext();
}
@ -41,7 +42,7 @@ class PlaylistController extends Zend_Controller_Action
$modified = $this->_getParam('modified', null);
if ($obj->getLastModified("U") !== $modified) {
$this->createFullResponse($obj);
throw new PlaylistOutDatedException("You are viewing an older version of {$obj->getName()}");
throw new PlaylistOutDatedException(sprintf(_("You are viewing an older version of %s"), $obj->getName()));
}
}
@ -72,7 +73,6 @@ class PlaylistController extends Zend_Controller_Action
$isBlock = true;
$viewPath = 'playlist/smart-block.phtml';
}
if (isset($obj)) {
$formatter = new LengthFormatter($obj->getLength());
$this->view->length = $formatter->format();
@ -94,7 +94,11 @@ class PlaylistController extends Zend_Controller_Action
} else {
$this->view->obj = $obj;
$this->view->id = $obj->getId();
$this->view->html = $this->view->render($viewPath);
if ($isJson) {
return $this->view->html = $this->view->render($viewPath);
} else {
$this->view->html = $this->view->render($viewPath);
}
unset($this->view->obj);
}
} else {
@ -113,14 +117,14 @@ 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 = "{$p_type} not found";
$this->view->error = sprintf(_("%s not found"), $p_type);
Logging::info("{$p_type} not found");
Application_Model_Library::changePlaylist(null, $p_type);
@ -134,26 +138,26 @@ class PlaylistController extends Zend_Controller_Action
private function playlistNoPermission($p_type)
{
$this->view->error = "You don't have permission to delete selected {$p_type}(s).";
$this->view->error = sprintf(_("You don't have permission to delete selected %s(s)."), $p_type);
$this->changePlaylist(null, $p_type);
$this->createFullResponse(null);
}
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);
}
@ -165,9 +169,9 @@ class PlaylistController extends Zend_Controller_Action
$objInfo = Application_Model_Library::getObjInfo($type);
$name = 'Untitled Playlist';
$name = _('Untitled Playlist');
if ($type == 'block') {
$name = 'Untitled Smart Block';
$name = _('Untitled Smart Block');
}
$obj = new $objInfo['className']();
@ -430,7 +434,7 @@ class PlaylistController extends Zend_Controller_Action
public function setPlaylistNameDescAction()
{
$name = $this->_getParam('name', 'Unknown Playlist');
$name = $this->_getParam('name', _('Unknown Playlist'));
$description = $this->_getParam('description', "");
$type = $this->_getParam('type');
@ -537,6 +541,26 @@ 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();
if ($result['result'] == 0) {
die(json_encode(array("result"=>0, "html"=>$this->createFullResponse($pl, true))));
} else {
die(json_encode($result));
}
} catch (PlaylistNotFoundException $e) {
$this->playlistNotFound('block', true);
} catch (Exception $e) {
$this->playlistUnknownError($e);
}
}
public function getBlockInfoAction()
{

View file

@ -8,14 +8,15 @@ class PlayouthistoryController extends Zend_Controller_Action
$ajaxContext
->addActionContext('playout-history-feed', 'json')
->initContext();
}
}
public function indexAction()
{
global $CC_CONFIG;
$CC_CONFIG = Config::getConfig();
$request = $this->getRequest();
$baseUrl = $request->getBaseUrl();
$baseUrl = Application_Common_OsPath::getBaseDir();
//default time is the last 24 hours.
$now = time();
@ -37,23 +38,23 @@ class PlayouthistoryController extends Zend_Controller_Action
$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/datatables/plugin/TableTools/js/ZeroClipboard.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'/js/datatables/plugin/TableTools/js/TableTools.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/datatables/plugin/TableTools/js/ZeroClipboard.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/datatables/plugin/TableTools/js/TableTools.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$offset = date("Z") * -1;
$this->view->headScript()->appendScript("var serverTimezoneOffset = {$offset}; //in seconds");
$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/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/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/playouthistory/historytable.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headLink()->appendStylesheet($baseUrl.'/js/datatables/plugin/TableTools/css/TableTools.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.'js/datatables/plugin/TableTools/css/TableTools.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']);
}
public function playoutHistoryFeedAction()
@ -81,4 +82,5 @@ class PlayouthistoryController extends Zend_Controller_Action
$this->view->iTotalRecords = $r["iTotalRecords"];
$this->view->history = $r["history"];
}
}

View file

@ -13,16 +13,17 @@ class PluploadController extends Zend_Controller_Action
public function indexAction()
{
global $CC_CONFIG;
$CC_CONFIG = Config::getConfig();
$request = $this->getRequest();
$baseUrl = $request->getBaseUrl();
$baseUrl = Application_Common_OsPath::getBaseDir();
$locale = Application_Model_Preference::GetLocale();
$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/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->headLink()->appendStylesheet($baseUrl.'/css/plupload.queue.css?'.$CC_CONFIG['airtime_version']);
$this->view->headLink()->appendStylesheet($baseUrl.'css/plupload.queue.css?'.$CC_CONFIG['airtime_version']);
}
public function uploadAction()

View file

@ -20,36 +20,50 @@ class PreferenceController extends Zend_Controller_Action
public function indexAction()
{
global $CC_CONFIG;
$CC_CONFIG = Config::getConfig();
$request = $this->getRequest();
$baseUrl = $request->getBaseUrl();
$isSaas = Application_Model_Preference::GetPlanLevel() == 'disabled'?false:true;
$baseUrl = Application_Common_OsPath::getBaseDir();
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/preferences/preferences.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/airtime/preferences/preferences.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->statusMsg = "";
$form = new Application_Form_Preferences();
if ($request->isPost()) {
if ($form->isValid($request->getPost())) {
$values = $form->getValues();
$params = $request->getPost();
$postData = explode('&', $params['data']);
foreach($postData as $k=>$v) {
$v = explode('=', $v);
$values[$v[0]] = urldecode($v[1]);
}
if ($form->isValid($values)) {
Application_Model_Preference::SetHeadTitle($values["preferences_general"]["stationName"], $this->view);
Application_Model_Preference::SetDefaultFade($values["preferences_general"]["stationDefaultFade"]);
Application_Model_Preference::SetAllow3rdPartyApi($values["preferences_general"]["thirdPartyApi"]);
Application_Model_Preference::SetTimezone($values["preferences_general"]["timezone"]);
Application_Model_Preference::SetWeekStartDay($values["preferences_general"]["weekStartDay"]);
Application_Model_Preference::SetHeadTitle($values["stationName"], $this->view);
Application_Model_Preference::SetDefaultFade($values["stationDefaultFade"]);
Application_Model_Preference::SetAllow3rdPartyApi($values["thirdPartyApi"]);
Application_Model_Preference::SetDefaultLocale($values["locale"]);
Application_Model_Preference::SetDefaultTimezone($values["timezone"]);
Application_Model_Preference::SetWeekStartDay($values["weekStartDay"]);
Application_Model_Preference::SetUploadToSoundcloudOption($values["preferences_soundcloud"]["UploadToSoundcloudOption"]);
Application_Model_Preference::SetSoundCloudDownloadbleOption($values["preferences_soundcloud"]["SoundCloudDownloadbleOption"]);
Application_Model_Preference::SetSoundCloudUser($values["preferences_soundcloud"]["SoundCloudUser"]);
Application_Model_Preference::SetSoundCloudPassword($values["preferences_soundcloud"]["SoundCloudPassword"]);
Application_Model_Preference::SetSoundCloudTags($values["preferences_soundcloud"]["SoundCloudTags"]);
Application_Model_Preference::SetSoundCloudGenre($values["preferences_soundcloud"]["SoundCloudGenre"]);
Application_Model_Preference::SetSoundCloudTrackType($values["preferences_soundcloud"]["SoundCloudTrackType"]);
Application_Model_Preference::SetSoundCloudLicense($values["preferences_soundcloud"]["SoundCloudLicense"]);
Application_Model_Preference::SetAutoUploadRecordedShowToSoundcloud($values["UseSoundCloud"]);
Application_Model_Preference::SetUploadToSoundcloudOption($values["UploadToSoundcloudOption"]);
Application_Model_Preference::SetSoundCloudDownloadbleOption($values["SoundCloudDownloadbleOption"]);
Application_Model_Preference::SetSoundCloudUser($values["SoundCloudUser"]);
Application_Model_Preference::SetSoundCloudPassword($values["SoundCloudPassword"]);
Application_Model_Preference::SetSoundCloudTags($values["SoundCloudTags"]);
Application_Model_Preference::SetSoundCloudGenre($values["SoundCloudGenre"]);
Application_Model_Preference::SetSoundCloudTrackType($values["SoundCloudTrackType"]);
Application_Model_Preference::SetSoundCloudLicense($values["SoundCloudLicense"]);
$this->view->statusMsg = "<div class='success'>Preferences updated.</div>";
$this->view->statusMsg = "<div class='success'>". _("Preferences updated.")."</div>";
$this->view->form = $form;
die(json_encode(array("valid"=>"true", "html"=>$this->view->render('preference/index.phtml'))));
} else {
$this->view->form = $form;
die(json_encode(array("valid"=>"false", "html"=>$this->view->render('preference/index.phtml'))));
}
}
$this->view->form = $form;
@ -57,19 +71,25 @@ class PreferenceController extends Zend_Controller_Action
public function supportSettingAction()
{
global $CC_CONFIG;
$CC_CONFIG = Config::getConfig();
$request = $this->getRequest();
$baseUrl = $request->getBaseUrl();
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/preferences/support-setting.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$baseUrl = Application_Common_OsPath::getBaseDir();
$this->view->headScript()->appendFile($baseUrl.'js/airtime/preferences/support-setting.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->statusMsg = "";
$form = new Application_Form_SupportSettings();
if ($request->isPost()) {
$values = $request->getPost();
if ($form->isValid($values)) {
if ($values["Publicise"] != 1) {
Application_Model_Preference::SetSupportFeedback($values["SupportFeedback"]);
Application_Model_Preference::SetPublicise($values["Publicise"]);
if (isset($values["Privacy"])) {
Application_Model_Preference::SetPrivacyPolicyCheck($values["Privacy"]);
}
} else if ($form->isValid($values)) {
Application_Model_Preference::SetHeadTitle($values["stationName"], $this->view);
Application_Model_Preference::SetPhone($values["Phone"]);
Application_Model_Preference::SetEmail($values["Email"]);
@ -85,9 +105,10 @@ class PreferenceController extends Zend_Controller_Action
if (isset($values["Privacy"])) {
Application_Model_Preference::SetPrivacyPolicyCheck($values["Privacy"]);
}
$this->view->statusMsg = "<div class='success'>Support setting updated.</div>";
}
$this->view->statusMsg = "<div class='success'>"._("Support setting updated.")."</div>";
}
$logo = Application_Model_Preference::GetStationLogo();
if ($logo) {
$this->view->logoImg = $logo;
@ -97,21 +118,20 @@ class PreferenceController extends Zend_Controller_Action
$privacyChecked = true;
}
$this->view->privacyChecked = $privacyChecked;
$this->view->section_title = 'Support Feedback';
$this->view->section_title = _('Support Feedback');
$this->view->form = $form;
//$form->render($this->view);
}
public function directoryConfigAction()
{
global $CC_CONFIG;
$CC_CONFIG = Config::getConfig();
if (Application_Model_Preference::GetPlanLevel() == 'disabled') {
$request = $this->getRequest();
$baseUrl = $request->getBaseUrl();
if(Application_Model_Preference::GetPlanLevel() == 'disabled'){
$baseUrl = Application_Common_OsPath::getBaseDir();
$this->view->headScript()->appendFile($baseUrl.'/js/serverbrowse/serverbrowser.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/preferences/musicdirs.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/serverbrowse/serverbrowser.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/airtime/preferences/musicdirs.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$watched_dirs_pref = new Application_Form_WatchedDirPreferences();
@ -121,12 +141,13 @@ class PreferenceController extends Zend_Controller_Action
public function streamSettingAction()
{
global $CC_CONFIG;
$CC_CONFIG = Config::getConfig();
$request = $this->getRequest();
$baseUrl = $request->getBaseUrl();
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/preferences/streamsetting.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$baseUrl = Application_Common_OsPath::getBaseDir();
$this->view->headScript()->appendFile($baseUrl.'js/airtime/preferences/streamsetting.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
// get current settings
$temp = Application_Model_StreamSetting::getStreamSetting();
@ -174,10 +195,37 @@ class PreferenceController extends Zend_Controller_Action
$form->addSubForm($subform, "s".$i."_subform");
}
if ($request->isPost()) {
$values = $request->getPost();
$params = $request->getPost();
/* Parse through post data and put in format
* $form->isValid() is expecting it in
*/
$postData = explode('&', $params['data']);
$s1_data = array();
$s2_data = array();
$s3_data = array();
foreach($postData as $k=>$v) {
$v = explode('=', urldecode($v));
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) {
preg_match('/\[(.*)\]/', $v[0], $matches);
$s2_data[$matches[1]] = $v[1];
} elseif (strpos($v[0], "s3_data") !== false) {
preg_match('/\[(.*)\]/', $v[0], $matches);
$s3_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;
$error = false;
if ($form->isValid($values)) {
$values['icecast_vorbis_metadata'] = $form->getValue('icecast_vorbis_metadata');
@ -192,6 +240,17 @@ class PreferenceController extends Zend_Controller_Action
Application_Model_Preference::SetDefaultTransitionFade($values["transition_fade"]);
Application_Model_Preference::SetAutoTransition($values["auto_transition"]);
Application_Model_Preference::SetAutoSwitch($values["auto_switch"]);
// compare new values with current value
$changeRGenabled = Application_Model_Preference::GetEnableReplayGain() != $values["enableReplayGain"];
$changeRGmodifier = Application_Model_Preference::getReplayGainModifier() != $values["replayGainModifier"];
if ($changeRGenabled || $changeRGmodifier) {
$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"]);
// store stream update timestamp
Application_Model_Preference::SetStreamUpdateTimestamp();
@ -204,12 +263,23 @@ class PreferenceController extends Zend_Controller_Action
}
Application_Model_RabbitMq::SendMessageToPypo("update_stream_setting", $data);
$this->view->statusMsg = "<div class='success'>Stream Setting Updated.</div>";
$live_stream_subform->updateVariables();
$this->view->enable_stream_conf = Application_Model_Preference::GetEnableStreamConf();
$this->view->form = $form;
$this->view->num_stream = $num_of_stream;
$this->view->statusMsg = "<div class='success'>"._("Stream Setting Updated.")."</div>";
die(json_encode(array("valid"=>"true", "html"=>$this->view->render('preference/stream-setting.phtml'))));
} else {
$live_stream_subform->updateVariables();
$this->view->enable_stream_conf = Application_Model_Preference::GetEnableStreamConf();
$this->view->form = $form;
$this->view->num_stream = $num_of_stream;
die(json_encode(array("valid"=>"false", "html"=>$this->view->render('preference/stream-setting.phtml'))));
}
}
$live_stream_subform->updateVariables();
$this->view->confirm_pypo_restart_text = "If you change the username or password values for an enabled stream the playout engine will be rebooted and your listeners will hear silence for 5-10 seconds. Changing the following fields will NOT cause a reboot: Stream Label (Global Settings), and Switch Transition Fade(s), Master Username, and Master Password (Input Stream Settings). If Airtime is recording, and if the change causes a playout engine restart, the recording will be interrupted.";
$this->view->num_stream = $num_of_stream;
$this->view->enable_stream_conf = Application_Model_Preference::GetEnableStreamConf();
@ -225,7 +295,7 @@ class PreferenceController extends Zend_Controller_Action
if (is_null($path)) {
$element = array();
$element["name"] = "path should be specified";
$element["name"] = _("path should be specified");
$element["isFolder"] = false;
$element["isError"] = true;
$result[$path] = $element;
@ -284,13 +354,14 @@ class PreferenceController extends Zend_Controller_Action
public function rescanWatchDirectoryAction()
{
$dir = Application_Model_MusicDir::getDirByPath($this->getRequest()->getParam("dir"));
$id = $dir->getId();
$data = array();
$data['directory'] = $dir->getDirectory();
$data['id'] = $id;
$dir_path = $this->getRequest()->getParam('dir');
$dir = Application_Model_MusicDir::getDirByPath($dir_path);
$data = array( 'directory' => $dir->getDirectory(),
'id' => $dir->getId());
Application_Model_RabbitMq::SendMessageToMediaMonitor('rescan_watch', $data);
die();
Logging::info("Unhiding all files belonging to:: $dir_path");
$dir->unhideFiles();
die(); # Get rid of this ugliness later
}
public function removeWatchDirectoryAction()
@ -319,7 +390,7 @@ class PreferenceController extends Zend_Controller_Action
$num_of_stream = intval(Application_Model_Preference::GetNumOfStreams());
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";
}

View file

@ -40,53 +40,52 @@ class ScheduleController extends Zend_Controller_Action
public function indexAction()
{
global $CC_CONFIG;
$CC_CONFIG = Config::getConfig();
$request = $this->getRequest();
$baseUrl = $request->getBaseUrl();
$baseUrl = Application_Common_OsPath::getBaseDir();
$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->view->headScript()->appendScript("var timezoneOffset = ".date("Z")."; //in seconds");
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/schedule/full-calendar-functions.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headScript()->appendFile($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->view->headScript()->appendFile($baseUrl.'/js/airtime/schedule/add-show.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headScript()->appendFile($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()->appendFile($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
$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/datatables/plugin/dataTables.ColVis.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'/js/datatables/plugin/dataTables.ColReorder.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'/js/datatables/plugin/dataTables.FixedColumns.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'/js/datatables/plugin/dataTables.TableTools.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'/js/datatables/plugin/dataTables.columnFilter.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/datatables/plugin/dataTables.ColVis.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/datatables/plugin/dataTables.ColReorder.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/datatables/plugin/dataTables.FixedColumns.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/datatables/plugin/dataTables.TableTools.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/datatables/plugin/dataTables.columnFilter.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($this->view->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/ColReorder.css?'.$CC_CONFIG['airtime_version']);
$this->view->headLink()->appendStylesheet($baseUrl.'/css/TableTools.css?'.$CC_CONFIG['airtime_version']);
$this->view->headLink()->appendStylesheet($baseUrl.'/css/showbuilder.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/ColReorder.css?'.$CC_CONFIG['airtime_version']);
$this->view->headLink()->appendStylesheet($baseUrl.'css/TableTools.css?'.$CC_CONFIG['airtime_version']);
$this->view->headLink()->appendStylesheet($baseUrl.'css/showbuilder.css?'.$CC_CONFIG['airtime_version']);
//End Show builder JS/CSS requirements
Application_Model_Schedule::createNewFormSections($this->view);
@ -227,6 +226,7 @@ class ScheduleController extends Zend_Controller_Action
$id = $this->_getParam('id');
$menu = array();
$epochNow = time();
$baseUrl = Application_Common_OsPath::getBaseDir();
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
$user = new Application_Model_User($userInfo->id);
@ -249,8 +249,8 @@ class ScheduleController extends Zend_Controller_Action
$file = $instance->getRecordedFile();
$fileId = $file->getId();
$menu["view_recorded"] = array("name" => "View Recorded File Metadata", "icon" => "overview",
"url" => "/library/edit-file-md/id/".$fileId);
$menu["view_recorded"] = array("name" => _("View Recorded File Metadata"), "icon" => "overview",
"url" => $baseUrl."library/edit-file-md/id/".$fileId);
}
if ($epochNow < $showStartLocalDT->getTimestamp()) {
@ -258,17 +258,17 @@ class ScheduleController extends Zend_Controller_Action
&& !$instance->isRecorded()
&& !$instance->isRebroadcast()) {
$menu["schedule"] = array("name"=> "Add / Remove Content", "icon" => "add-remove-content",
"url" => "/showbuilder/builder-dialog/");
$menu["schedule"] = array("name"=> _("Add / Remove Content"), "icon" => "add-remove-content",
"url" => $baseUrl."showbuilder/builder-dialog/");
$menu["clear"] = array("name"=> "Remove All Content", "icon" => "remove-all-content",
"url" => "/schedule/clear-show");
$menu["clear"] = array("name"=> _("Remove All Content"), "icon" => "remove-all-content",
"url" => $baseUrl."schedule/clear-show");
}
}
if (!$instance->isRecorded()) {
$menu["content"] = array("name"=> "Show Content", "icon" => "overview", "url" => "/schedule/show-content-dialog");
$menu["content"] = array("name"=> _("Show Content"), "icon" => "overview", "url" => $baseUrl."schedule/show-content-dialog");
}
if ($showEndLocalDT->getTimestamp() <= $epochNow
@ -281,10 +281,10 @@ class ScheduleController extends Zend_Controller_Action
if ($scid > 0) {
$url = $file->getSoundCloudLinkToFile();
$menu["soundcloud_view"] = array("name" => "View on Soundcloud", "icon" => "soundcloud", "url" => $url);
$menu["soundcloud_view"] = array("name" => _("View on Soundcloud"), "icon" => "soundcloud", "url" => $url);
}
$text = is_null($scid) ? 'Upload to SoundCloud' : 'Re-upload to SoundCloud';
$text = is_null($scid) ? _('Upload to SoundCloud') : _('Re-upload to SoundCloud');
$menu["soundcloud_upload"] = array("name"=> $text, "icon" => "soundcloud");
}
@ -292,34 +292,34 @@ class ScheduleController extends Zend_Controller_Action
$epochNow < $showEndLocalDT->getTimestamp() && $isAdminOrPM) {
if ($instance->isRecorded()) {
$menu["cancel_recorded"] = array("name"=> "Cancel Current Show", "icon" => "delete");
$menu["cancel_recorded"] = array("name"=> _("Cancel Current Show"), "icon" => "delete");
} else {
if (!$instance->isRebroadcast()) {
$menu["edit"] = array("name"=> "Edit Show", "icon" => "edit", "_type"=>"all", "url" => "/Schedule/populate-show-form");
$menu["edit"] = array("name"=> _("Edit Show"), "icon" => "edit", "_type"=>"all", "url" => $baseUrl."Schedule/populate-show-form");
}
$menu["cancel"] = array("name"=> "Cancel Current Show", "icon" => "delete");
$menu["cancel"] = array("name"=> _("Cancel Current Show"), "icon" => "delete");
}
}
if ($epochNow < $showStartLocalDT->getTimestamp()) {
if (!$instance->isRebroadcast() && $isAdminOrPM) {
$menu["edit"] = array("name"=> "Edit Show", "icon" => "edit", "_type"=>"all", "url" => "/Schedule/populate-show-form");
$menu["edit"] = array("name"=> _("Edit Show"), "icon" => "edit", "_type"=>"all", "url" => $baseUrl."Schedule/populate-show-form");
}
if ($instance->getShow()->isRepeating() && $isAdminOrPM) {
//create delete sub menu.
$menu["del"] = array("name"=> "Delete", "icon" => "delete", "items" => array());
$menu["del"] = array("name"=> _("Delete"), "icon" => "delete", "items" => array());
$menu["del"]["items"]["single"] = array("name"=> "Delete This Instance", "icon" => "delete", "url" => "/schedule/delete-show");
$menu["del"]["items"]["single"] = array("name"=> _("Delete This Instance"), "icon" => "delete", "url" => $baseUrl."schedule/delete-show");
$menu["del"]["items"]["following"] = array("name"=> "Delete This Instance and All Following", "icon" => "delete", "url" => "/schedule/cancel-show");
$menu["del"]["items"]["following"] = array("name"=> _("Delete This Instance and All Following"), "icon" => "delete", "url" => $baseUrl."schedule/cancel-show");
} elseif ($isAdminOrPM) {
$menu["del"] = array("name"=> "Delete", "icon" => "delete", "url" => "/schedule/delete-show");
$menu["del"] = array("name"=> _("Delete"), "icon" => "delete", "url" => $baseUrl."schedule/delete-show");
}
}
@ -442,8 +442,10 @@ class ScheduleController extends Zend_Controller_Action
$originalDateTime->setTimezone(new DateTimeZone(date_default_timezone_get()));
//$timestamp = Application_Common_DateHelper::ConvertToLocalDateTimeString($originalDateTime->format("Y-m-d H:i:s"));
$this->view->additionalShowInfo =
"Rebroadcast of show \"$originalShowName\" from "
.$originalDateTime->format("l, F jS")." at ".$originalDateTime->format("G:i");
sprintf(_("Rebroadcast of show %s from %s at %s"),
$originalShowName,
$originalDateTime->format("l, F jS"),
$originalDateTime->format("G:i"));
}
$this->view->showLength = $show->getShowLength();
$this->view->timeFilled = $show->getTimeScheduled();
@ -833,8 +835,6 @@ class ScheduleController extends Zend_Controller_Action
public function contentContextMenuAction()
{
global $CC_CONFIG;
$id = $this->_getParam('id');
$params = '/format/json/id/#id#/';
@ -848,9 +848,9 @@ class ScheduleController extends Zend_Controller_Action
$file = Application_Model_StoredFile::Recall($file_id);
$baseUrl = $this->getRequest()->getBaseUrl();
$url = $file->getRelativeFileUrl($baseUrl).'/download/true';
$url = $file->getRelativeFileUrl($baseUrl).'download/true';
$menu[] = array('action' => array('type' => 'gourl', 'url' => $url),
'title' => 'Download');
'title' => _('Download'));
//returns format jjmenu is looking for.
die(json_encode($menu));
@ -876,8 +876,6 @@ class ScheduleController extends Zend_Controller_Action
public function calculateDurationAction()
{
global $CC_CONFIG;
$startParam = $this->_getParam('startTime');
$endParam = $this->_getParam('endTime');

View file

@ -18,12 +18,14 @@ class ShowbuilderController extends Zend_Controller_Action
public function indexAction()
{
global $CC_CONFIG;
$CC_CONFIG = Config::getConfig();
$request = $this->getRequest();
$baseUrl = $request->getBaseUrl();
$user = Application_Model_User::getCurrentUser();
$baseUrl = Application_Common_OsPath::getBaseDir();
$user = Application_Model_User::GetCurrentUser();
$userType = $user->getType();
$this->view->headScript()->appendScript("localStorage.setItem( 'user-type', '$userType' );");
@ -42,28 +44,27 @@ class ShowbuilderController extends Zend_Controller_Action
} else {
$this->view->headScript()->appendScript("localStorage.setItem( 'datatables-timeline', '' );");
}
$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/datatables/plugin/dataTables.ColVis.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'/js/datatables/plugin/dataTables.ColReorder.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'/js/datatables/plugin/dataTables.FixedColumns.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'/js/datatables/plugin/dataTables.columnFilter.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/airtime/library/library.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/datatables/plugin/dataTables.ColVis.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/datatables/plugin/dataTables.ColReorder.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/datatables/plugin/dataTables.FixedColumns.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/datatables/plugin/dataTables.columnFilter.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/ColReorder.css?'.$CC_CONFIG['airtime_version']);
$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/airtime/library/library.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headScript()->appendFile($this->view->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/ColReorder.css?'.$CC_CONFIG['airtime_version']);
$this->view->headScript()->appendFile($baseUrl.'js/airtime/library/events/library_showbuilder.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$refer_sses = new Zend_Session_Namespace('referrer');
if ($request->isPost()) {
@ -105,7 +106,7 @@ class ShowbuilderController extends Zend_Controller_Action
$this->view->logoImg = $logo;
}
$this->view->dialog = $form;
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/nowplaying/register.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/airtime/nowplaying/register.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
}
}
@ -120,7 +121,7 @@ class ShowbuilderController extends Zend_Controller_Action
$this->view->logoImg = $logo;
}
$this->view->dialog = $form;
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/nowplaying/register.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/airtime/nowplaying/register.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
}
//determine whether to remove/hide/display the library.
@ -163,16 +164,18 @@ class ShowbuilderController extends Zend_Controller_Action
$offset = date("Z") * -1;
$this->view->headScript()->appendScript("var serverTimezoneOffset = {$offset}; //in seconds");
$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/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/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->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/jquery.ui.timepicker.css?'.$CC_CONFIG['airtime_version']);
$this->view->headLink()->appendStylesheet($baseUrl.'css/showbuilder.css?'.$CC_CONFIG['airtime_version']);
}
public function contextMenuAction()
{
$baseUrl = Application_Common_OsPath::getBaseDir();
$id = $this->_getParam('id');
$now = floatval(microtime(true));
@ -184,15 +187,15 @@ class ShowbuilderController extends Zend_Controller_Action
$item = CcScheduleQuery::create()->findPK($id);
$instance = $item->getCcShowInstances();
$menu["preview"] = array("name"=> "Preview", "icon" => "play");
$menu["preview"] = array("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");
$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())) {
//remove/truncate the item from the schedule
$menu["del"] = array("name"=> "Remove from show", "icon" => "delete", "url" => "/showbuilder/schedule-remove");
$menu["del"] = array("name"=> _("Delete"), "icon" => "delete", "url" => $baseUrl."showbuilder/schedule-remove");
}
$this->view->items = $menu;
@ -206,7 +209,7 @@ class ShowbuilderController extends Zend_Controller_Action
$instance = CcShowInstancesQuery::create()->findPK($id);
if (is_null($instance)) {
$this->view->error = "show does not exist";
$this->view->error = _("show does not exist");
return;
}

View file

@ -4,12 +4,11 @@ class SystemstatusController extends Zend_Controller_Action
{
public function init()
{
global $CC_CONFIG;
$CC_CONFIG = Config::getConfig();
$request = $this->getRequest();
$baseUrl = $request->getBaseUrl();
$baseUrl = Application_Common_OsPath::getBaseDir();
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/status/status.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/airtime/status/status.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
}
public function indexAction()

View file

@ -10,20 +10,21 @@ class UserController extends Zend_Controller_Action
->addActionContext('get-user-data-table-info', 'json')
->addActionContext('get-user-data', 'json')
->addActionContext('remove-user', 'json')
->addActionContext('edit-user', 'json')
->initContext();
}
public function addUserAction()
{
global $CC_CONFIG;
$CC_CONFIG = Config::getConfig();
$request = $this->getRequest();
$baseUrl = $request->getBaseUrl();
$baseUrl = Application_Common_OsPath::getBaseDir();
$js_files = array(
'/js/datatables/js/jquery.dataTables.js?',
'/js/datatables/plugin/dataTables.pluginAPI.js?',
'/js/airtime/user/user.js?'
'js/datatables/js/jquery.dataTables.js?',
'js/datatables/plugin/dataTables.pluginAPI.js?',
'js/airtime/user/user.js?'
);
foreach ($js_files as $js) {
@ -31,46 +32,71 @@ class UserController extends Zend_Controller_Action
$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 = "";
if ($request->isPost()) {
if ($form->isValid($request->getPost())) {
$params = $request->getPost();
$postData = explode('&', $params['data']);
foreach($postData as $k=>$v) {
$v = explode('=', $v);
$formData[$v[0]] = urldecode($v[1]);
}
$formdata = $form->getValues();
if (isset($CC_CONFIG['demo']) && $CC_CONFIG['demo'] == 1
&& $formdata['login'] == 'admin'
&& $formdata['user_id'] != 0) {
$this->view->successMessage = "<div class='errors'>Specific action is not allowed in demo version!</div>";
} elseif ($form->validateLogin($formdata)) {
$user = new Application_Model_User($formdata['user_id']);
$user->setFirstName($formdata['first_name']);
$user->setLastName($formdata['last_name']);
$user->setLogin($formdata['login']);
if ($form->isValid($formData)) {
if (isset($CC_CONFIG['demo']) && $CC_CONFIG['demo'] == 1
&& $formData['login'] == 'admin'
&& $formData['user_id'] != 0) {
$this->view->form = $form;
$this->view->successMessage = "<div class='errors'>"._("Specific action is not allowed in demo version!")."</div>";
die(json_encode(array("valid"=>"false", "html"=>$this->view->render('user/add-user.phtml'))));
} elseif ($form->validateLogin($formData)) {
$user = new Application_Model_User($formData['user_id']);
if (empty($formData['user_id'])) {
$user->setLogin($formData['login']);
}
$user->setFirstName($formData['first_name']);
$user->setLastName($formData['last_name']);
// 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") {
$user->setPassword($formdata['password']);
if ($formData['password'] != "xxxxxx") {
$user->setPassword($formData['password']);
}
$user->setType($formdata['type']);
$user->setEmail($formdata['email']);
$user->setCellPhone($formdata['cell_phone']);
$user->setSkype($formdata['skype']);
$user->setJabber($formdata['jabber']);
$user->setType($formData['type']);
$user->setEmail($formData['email']);
$user->setCellPhone($formData['cell_phone']);
$user->setSkype($formData['skype']);
$user->setJabber($formData['jabber']);
$user->save();
$form->reset();
// Language and timezone settings are saved on a per-user basis
// By default, the default language, and timezone setting on
// preferences page is what gets assigned.
Application_Model_Preference::SetUserLocale($user->getId());
Application_Model_Preference::SetUserTimezone($user->getId());
if (strlen($formdata['user_id']) == 0) {
$this->view->successMessage = "<div class='success'>User added successfully!</div>";
$form->reset();
$this->view->form = $form;
if (strlen($formData['user_id']) == 0) {
$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>";
}
die(json_encode(array("valid"=>"true", "html"=>$this->view->render('user/add-user.phtml'))));
} else {
$this->view->form = $form;
die(json_encode(array("valid"=>"false", "html"=>$this->view->render('user/add-user.phtml'))));
}
} else {
$this->view->form = $form;
die(json_encode(array("valid"=>"false", "html"=>$this->view->render('user/add-user.phtml'))));
}
}
@ -97,6 +123,52 @@ class UserController extends Zend_Controller_Action
$id = $this->_getParam('id');
$this->view->entries = Application_Model_User::GetUserData($id);
}
public function editUserAction()
{
$request = $this->getRequest();
$form = new Application_Form_EditUser();
if ($request->isPost()) {
$formData = $request->getPost();
if (isset($CC_CONFIG['demo']) && $CC_CONFIG['demo'] == 1
&& $formData['cu_login'] == 'admin') {
$this->view->form = $form;
$this->view->successMessage = "<div class='errors'>"._("Specific action is not allowed in demo version!")."</div>";
die(json_encode(array("html"=>$this->view->render('user/edit-user.phtml'))));
} else if ($form->isValid($formData) &&
$form->validateLogin($formData['cu_login'], $formData['cu_user_id'])) {
$user = new Application_Model_User($formData['cu_user_id']);
$user->setFirstName($formData['cu_first_name']);
$user->setLastName($formData['cu_last_name']);
// 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 ($formData['cu_password'] != "xxxxxx") {
$user->setPassword($formData['cu_password']);
}
$user->setEmail($formData['cu_email']);
$user->setCellPhone($formData['cu_cell_phone']);
$user->setSkype($formData['cu_skype']);
$user->setJabber($formData['cu_jabber']);
$user->save();
Application_Model_Preference::SetUserLocale($user->getId(), $formData['cu_locale']);
Application_Model_Preference::SetUserTimezone($user->getId(), $formData['cu_timezone']);
//configure localization with new locale setting
Application_Model_Locale::configureLocalization($formData['cu_locale']);
//reinitialize form so language gets translated
$form = new Application_Form_EditUser();
$this->view->successMessage = "<div class='success'>"._("Settings updated successfully!")."</div>";
}
$this->view->form = $form;
$this->view->html = $this->view->render('user/edit-user.phtml');
}
$this->view->form = $form;
$this->view->html = $this->view->render('user/edit-user.phtml');
}
public function removeUserAction()
{
@ -114,7 +186,7 @@ class UserController extends Zend_Controller_Action
# 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;

View file

@ -26,11 +26,11 @@ 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->setDbName(_("Untitled Webstream"));
$webstream->setDbDescription("");
$webstream->setDbUrl("http://");
$webstream->setDbLength("00:30:00");
$webstream->setDbName("Untitled Webstream");
$webstream->setDbName(_("Untitled Webstream"));
$webstream->setDbCreatorId($userInfo->id);
$webstream->setDbUtime(new DateTime("now", new DateTimeZone('UTC')));
$webstream->setDbMtime(new DateTime("now", new DateTimeZone('UTC')));
@ -135,7 +135,7 @@ class WebstreamController extends Zend_Controller_Action
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");
} else {
@ -143,7 +143,7 @@ class WebstreamController extends Zend_Controller_Action
}
} 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;
}

View file

@ -152,7 +152,10 @@ class Zend_Controller_Plugin_Acl extends Zend_Controller_Plugin_Abstract
$resourceName .= $controller;
/** Check if the controller/action can be accessed by the current user */
if (!$this->getAcl()->isAllowed($this->_roleName, $resourceName, $request->getActionName())) {
if (!$this->getAcl()->has($resourceName)
|| !$this->getAcl()->isAllowed($this->_roleName,
$resourceName,
$request->getActionName())) {
/** Redirect to access denied page */
$this->denyAccess();
}