Merge branch 'devel' of dev.sourcefabric.org:airtime into devel

Conflicts:
	install_minimal/include/airtime-upgrade.php
This commit is contained in:
Martin Konecny 2013-01-15 12:32:49 -05:00
commit 93505353e7
86 changed files with 10772 additions and 7287 deletions

View File

@ -1,5 +1,8 @@
<?php <?php
require_once __DIR__."/configs/conf.php"; require_once __DIR__."/configs/conf.php";
Config::loadConfig();
$CC_CONFIG = Config::getConfig();
require_once __DIR__."/configs/ACL.php"; require_once __DIR__."/configs/ACL.php";
require_once 'propel/runtime/lib/Propel.php'; require_once 'propel/runtime/lib/Propel.php';
@ -20,13 +23,10 @@ require_once __DIR__.'/controllers/plugins/RabbitMqPlugin.php';
date_default_timezone_set('UTC'); date_default_timezone_set('UTC');
require_once (APPLICATION_PATH."/logging/Logging.php"); require_once (APPLICATION_PATH."/logging/Logging.php");
Logging::setLogPath('/var/log/airtime/zendphp.log'); Logging::setLogPath('/var/log/airtime/zendphp.log');
date_default_timezone_set(Application_Model_Preference::GetTimezone()); date_default_timezone_set(Application_Model_Preference::GetTimezone());
global $CC_CONFIG; Config::setAirtimeVersion();
$airtime_version = Application_Model_Preference::GetAirtimeVersion(); $CC_CONFIG = Config::getConfig();
$uniqueid = Application_Model_Preference::GetUniqueId();
$CC_CONFIG['airtime_version'] = md5($airtime_version.$uniqueid);
require_once __DIR__."/configs/navigation.php"; require_once __DIR__."/configs/navigation.php";
Zend_Validate::setDefaultNamespaces("Zend"); Zend_Validate::setDefaultNamespaces("Zend");
@ -67,52 +67,52 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
protected function _initHeadLink() protected function _initHeadLink()
{ {
global $CC_CONFIG; $CC_CONFIG = Config::getConfig();
$view = $this->getResource('view'); $view = $this->getResource('view');
$baseUrl = Application_Common_OsPath::getBaseDir(); $baseUrl = Application_Common_OsPath::getBaseDir();
$view->headLink()->appendStylesheet($baseUrl.'/css/redmond/jquery-ui-1.8.8.custom.css?'.$CC_CONFIG['airtime_version']); $view->headLink()->appendStylesheet($baseUrl.'css/redmond/jquery-ui-1.8.8.custom.css?'.$CC_CONFIG['airtime_version']);
$view->headLink()->appendStylesheet($baseUrl.'/css/pro_dropdown_3.css?'.$CC_CONFIG['airtime_version']); $view->headLink()->appendStylesheet($baseUrl.'css/pro_dropdown_3.css?'.$CC_CONFIG['airtime_version']);
$view->headLink()->appendStylesheet($baseUrl.'/css/qtip/jquery.qtip.min.css?'.$CC_CONFIG['airtime_version']); $view->headLink()->appendStylesheet($baseUrl.'css/qtip/jquery.qtip.min.css?'.$CC_CONFIG['airtime_version']);
$view->headLink()->appendStylesheet($baseUrl.'/css/styles.css?'.$CC_CONFIG['airtime_version']); $view->headLink()->appendStylesheet($baseUrl.'css/styles.css?'.$CC_CONFIG['airtime_version']);
$view->headLink()->appendStylesheet($baseUrl.'/css/masterpanel.css?'.$CC_CONFIG['airtime_version']); $view->headLink()->appendStylesheet($baseUrl.'css/masterpanel.css?'.$CC_CONFIG['airtime_version']);
$view->headLink()->appendStylesheet($baseUrl.'/css/bootstrap.css?'.$CC_CONFIG['airtime_version']); $view->headLink()->appendStylesheet($baseUrl.'css/bootstrap.css?'.$CC_CONFIG['airtime_version']);
$view->headLink()->appendStylesheet($baseUrl.'/css/tipsy/jquery.tipsy.css?'.$CC_CONFIG['airtime_version']); $view->headLink()->appendStylesheet($baseUrl.'css/tipsy/jquery.tipsy.css?'.$CC_CONFIG['airtime_version']);
} }
protected function _initHeadScript() protected function _initHeadScript()
{ {
global $CC_CONFIG; $CC_CONFIG = Config::getConfig();
$view = $this->getResource('view'); $view = $this->getResource('view');
$baseUrl = Application_Common_OsPath::getBaseDir(); $baseUrl = Application_Common_OsPath::getBaseDir();
$view->headScript()->appendFile($baseUrl.'/js/libs/jquery-1.7.2.min.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); $view->headScript()->appendFile($baseUrl.'js/libs/jquery-1.7.2.min.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$view->headScript()->appendFile($baseUrl.'/js/libs/jquery-ui-1.8.18.custom.min.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); $view->headScript()->appendFile($baseUrl.'js/libs/jquery-ui-1.8.18.custom.min.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$view->headScript()->appendFile($baseUrl.'/js/libs/jquery.stickyPanel.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); $view->headScript()->appendFile($baseUrl.'js/libs/jquery.stickyPanel.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$view->headScript()->appendFile($baseUrl.'/js/qtip/jquery.qtip.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); $view->headScript()->appendFile($baseUrl.'js/qtip/jquery.qtip.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$view->headScript()->appendFile($baseUrl.'/js/jplayer/jquery.jplayer.min.js?'.$CC_CONFIG['airtime_version'], 'text/javascript'); $view->headScript()->appendFile($baseUrl.'js/jplayer/jquery.jplayer.min.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
$view->headScript()->appendFile($baseUrl.'/js/sprintf/sprintf-0.7-beta1.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); $view->headScript()->appendFile($baseUrl.'js/sprintf/sprintf-0.7-beta1.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$view->headScript()->appendFile($baseUrl.'/js/bootstrap/bootstrap.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); $view->headScript()->appendFile($baseUrl.'js/bootstrap/bootstrap.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$view->headScript()->appendFile($baseUrl.'/js/cookie/jquery.cookie.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); $view->headScript()->appendFile($baseUrl.'js/cookie/jquery.cookie.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$view->headScript()->appendFile($baseUrl.'/js/i18n/jquery.i18n.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); $view->headScript()->appendFile($baseUrl.'js/i18n/jquery.i18n.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$view->headScript()->appendFile($baseUrl.'/locale/general-translation-table?'.$CC_CONFIG['airtime_version'],'text/javascript'); $view->headScript()->appendFile($baseUrl.'locale/general-translation-table?'.$CC_CONFIG['airtime_version'],'text/javascript');
$view->headScript()->appendFile($baseUrl.'/locale/datatables-translation-table?'.$CC_CONFIG['airtime_version'],'text/javascript'); $view->headScript()->appendFile($baseUrl.'locale/datatables-translation-table?'.$CC_CONFIG['airtime_version'],'text/javascript');
$view->headScript()->appendScript("$.i18n.setDictionary(general_dict)"); $view->headScript()->appendScript("$.i18n.setDictionary(general_dict)");
$view->headScript()->appendScript("var baseUrl='$baseUrl'"); $view->headScript()->appendScript("var baseUrl='$baseUrl'");
//scripts for now playing bar //scripts for now playing bar
$view->headScript()->appendFile($baseUrl.'/js/airtime/airtime_bootstrap.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); $view->headScript()->appendFile($baseUrl.'js/airtime/airtime_bootstrap.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$view->headScript()->appendFile($baseUrl.'/js/airtime/dashboard/helperfunctions.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); $view->headScript()->appendFile($baseUrl.'js/airtime/dashboard/helperfunctions.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$view->headScript()->appendFile($baseUrl.'/js/airtime/dashboard/dashboard.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); $view->headScript()->appendFile($baseUrl.'js/airtime/dashboard/dashboard.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$view->headScript()->appendFile($baseUrl.'/js/airtime/dashboard/versiontooltip.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); $view->headScript()->appendFile($baseUrl.'js/airtime/dashboard/versiontooltip.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$view->headScript()->appendFile($baseUrl.'/js/tipsy/jquery.tipsy.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); $view->headScript()->appendFile($baseUrl.'js/tipsy/jquery.tipsy.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$view->headScript()->appendFile($baseUrl.'/js/airtime/common/common.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); $view->headScript()->appendFile($baseUrl.'js/airtime/common/common.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$view->headScript()->appendFile($baseUrl.'/js/airtime/common/audioplaytest.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); $view->headScript()->appendFile($baseUrl.'js/airtime/common/audioplaytest.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$user = Application_Model_User::getCurrentUser(); $user = Application_Model_User::getCurrentUser();
if (!is_null($user)){ if (!is_null($user)){
@ -123,15 +123,16 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
$view->headScript()->appendScript("var userType = '$userType';"); $view->headScript()->appendScript("var userType = '$userType';");
if (isset($CC_CONFIG['demo']) && $CC_CONFIG['demo'] == 1) { if (isset($CC_CONFIG['demo']) && $CC_CONFIG['demo'] == 1) {
$view->headScript()->appendFile($baseUrl.'/js/libs/google-analytics.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); $view->headScript()->appendFile($baseUrl.'js/libs/google-analytics.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
} }
if (Application_Model_Preference::GetPlanLevel() != "disabled" if (Application_Model_Preference::GetPlanLevel() != "disabled"
&& !($_SERVER['REQUEST_URI'] == $baseUrl.'/Dashboard/stream-player' || && !($_SERVER['REQUEST_URI'] == $baseUrl.'Dashboard/stream-player' ||
strncmp($_SERVER['REQUEST_URI'], $baseUrl.'/audiopreview/audio-preview', strlen($baseUrl.'/audiopreview/audio-preview'))==0)) { strncmp($_SERVER['REQUEST_URI'], $baseUrl.'audiopreview/audio-preview', strlen($baseUrl.'audiopreview/audio-preview'))==0)) {
$client_id = Application_Model_Preference::GetClientId(); $client_id = Application_Model_Preference::GetClientId();
$view->headScript()->appendScript("var livechat_client_id = '$client_id';"); $view->headScript()->appendScript("var livechat_client_id = '$client_id';");
$view->headScript()->appendFile($baseUrl . '/js/airtime/common/livechat.js?'.$CC_CONFIG['airtime_version'], 'text/javascript'); $view->headScript()->appendFile($baseUrl . 'js/airtime/common/livechat.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
} }
} }
@ -151,7 +152,7 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
protected function _initZFDebug() protected function _initZFDebug()
{ {
Zend_Controller_Front::getInstance()->throwExceptions(true); Zend_Controller_Front::getInstance()->throwExceptions(true);
/* /*
if (APPLICATION_ENV == "development") { if (APPLICATION_ENV == "development") {

View File

@ -66,8 +66,15 @@ class Application_Common_OsPath{
public static function getBaseDir() { public static function getBaseDir() {
$baseUrl = dirname($_SERVER['SCRIPT_NAME']); $baseUrl = dirname($_SERVER['SCRIPT_NAME']);
if (strcmp($baseUrl, '/') ==0) $baseUrl = "";
if ($baseUrl[0] != "/") {
$baseUrl = "/".$baseUrl;
}
if ($baseUrl[strlen($baseUrl) -1] != "/") {
$baseUrl = $baseUrl."/";
}
return $baseUrl; return $baseUrl;
} }
} }

View File

@ -8,7 +8,7 @@
* that the user can customize these. * that the user can customize these.
*/ */
global $CC_CONFIG; $CC_CONFIG = Config::getConfig();
$dbhost = $CC_CONFIG['dsn']['hostspec']; $dbhost = $CC_CONFIG['dsn']['hostspec'];
$dbname = $CC_CONFIG['dsn']['database']; $dbname = $CC_CONFIG['dsn']['database'];

View File

@ -6,53 +6,20 @@
* /etc/airtime/recorder.cfg * /etc/airtime/recorder.cfg
*/ */
global $CC_CONFIG;
$CC_CONFIG = array(
// prefix for table names in the database
'tblNamePrefix' => 'cc_',
/* ================================================ storage configuration */
'soundcloud-client-id' => '2CLCxcSXYzx7QhhPVHN4A',
'soundcloud-client-secret' => 'pZ7beWmF06epXLHVUP1ufOg2oEnIt9XhE8l8xt0bBs',
"rootDir" => __DIR__."/../.."
);
$configFile = isset($_SERVER['AIRTIME_CONF']) ? $_SERVER['AIRTIME_CONF'] : "/etc/airtime/airtime.conf";
Config::loadConfig($configFile);
// Add database table names
$CC_CONFIG['playListTable'] = $CC_CONFIG['tblNamePrefix'].'playlist';
$CC_CONFIG['playListContentsTable'] = $CC_CONFIG['tblNamePrefix'].'playlistcontents';
$CC_CONFIG['filesTable'] = $CC_CONFIG['tblNamePrefix'].'files';
$CC_CONFIG['accessTable'] = $CC_CONFIG['tblNamePrefix'].'access';
$CC_CONFIG['permTable'] = $CC_CONFIG['tblNamePrefix'].'perms';
$CC_CONFIG['sessTable'] = $CC_CONFIG['tblNamePrefix'].'sess';
$CC_CONFIG['subjTable'] = $CC_CONFIG['tblNamePrefix'].'subjs';
$CC_CONFIG['smembTable'] = $CC_CONFIG['tblNamePrefix'].'smemb';
$CC_CONFIG['prefTable'] = $CC_CONFIG['tblNamePrefix'].'pref';
$CC_CONFIG['scheduleTable'] = $CC_CONFIG['tblNamePrefix'].'schedule';
$CC_CONFIG['playListTimeView'] = $CC_CONFIG['tblNamePrefix'].'playlisttimes';
$CC_CONFIG['showSchedule'] = $CC_CONFIG['tblNamePrefix'].'show_schedule';
$CC_CONFIG['showDays'] = $CC_CONFIG['tblNamePrefix'].'show_days';
$CC_CONFIG['showTable'] = $CC_CONFIG['tblNamePrefix'].'show';
$CC_CONFIG['showInstances'] = $CC_CONFIG['tblNamePrefix'].'show_instances';
$CC_CONFIG['playListSequence'] = $CC_CONFIG['playListTable'].'_id';
$CC_CONFIG['filesSequence'] = $CC_CONFIG['filesTable'].'_id';
$CC_CONFIG['prefSequence'] = $CC_CONFIG['prefTable'].'_id';
$CC_CONFIG['permSequence'] = $CC_CONFIG['permTable'].'_id';
$CC_CONFIG['subjSequence'] = $CC_CONFIG['subjTable'].'_id';
$CC_CONFIG['smembSequence'] = $CC_CONFIG['smembTable'].'_id';
class Config { class Config {
public static function loadConfig($p_path) { private static $CC_CONFIG;
global $CC_CONFIG; public static function loadConfig() {
$CC_CONFIG = array(
/* ================================================ storage configuration */
$filename = $p_path; 'soundcloud-client-id' => '2CLCxcSXYzx7QhhPVHN4A',
'soundcloud-client-secret' => 'pZ7beWmF06epXLHVUP1ufOg2oEnIt9XhE8l8xt0bBs',
"rootDir" => __DIR__."/../.."
);
$filename = isset($_SERVER['AIRTIME_CONF']) ? $_SERVER['AIRTIME_CONF'] : "/etc/airtime/airtime.conf";
$values = parse_ini_file($filename, true); $values = parse_ini_file($filename, true);
// Name of the web server user // Name of the web server user
@ -61,6 +28,7 @@ class Config {
$CC_CONFIG['baseUrl'] = $values['general']['base_url']; $CC_CONFIG['baseUrl'] = $values['general']['base_url'];
$CC_CONFIG['basePort'] = $values['general']['base_port']; $CC_CONFIG['basePort'] = $values['general']['base_port'];
$CC_CONFIG['phpDir'] = $values['general']['airtime_dir'];
$CC_CONFIG['cache_ahead_hours'] = $values['general']['cache_ahead_hours']; $CC_CONFIG['cache_ahead_hours'] = $values['general']['cache_ahead_hours'];
@ -85,6 +53,17 @@ class Config {
if(isset($values['demo']['demo'])){ if(isset($values['demo']['demo'])){
$CC_CONFIG['demo'] = $values['demo']['demo']; $CC_CONFIG['demo'] = $values['demo']['demo'];
} }
self::$CC_CONFIG = $CC_CONFIG;
}
public static function setAirtimeVersion() {
$airtime_version = Application_Model_Preference::GetAirtimeVersion();
$uniqueid = Application_Model_Preference::GetUniqueId();
self::$CC_CONFIG['airtime_version'] = md5($airtime_version.$uniqueid);
}
public static function getConfig() {
return self::$CC_CONFIG;
} }
} }

View File

@ -5,14 +5,6 @@
* yet available because airtime.conf hasn't been updated yet. This situation ends up throwing a lot of errors to stdout. * yet available because airtime.conf hasn't been updated yet. This situation ends up throwing a lot of errors to stdout.
* airtime*/ * airtime*/
global $CC_CONFIG; require_once("conf.php");
$filename = "/etc/airtime/airtime.conf"; $CC_CONFIG = Config::getConfig();
$values = parse_ini_file($filename, true);
// Database config
$CC_CONFIG['dsn']['username'] = $values['database']['dbuser'];
$CC_CONFIG['dsn']['password'] = $values['database']['dbpass'];
$CC_CONFIG['dsn']['hostspec'] = $values['database']['host'];
$CC_CONFIG['dsn']['phptype'] = 'pgsql';
$CC_CONFIG['dsn']['database'] = $values['database']['dbname'];

View File

@ -48,7 +48,7 @@ class ApiController extends Zend_Controller_Action
public function checkAuth() public function checkAuth()
{ {
global $CC_CONFIG; $CC_CONFIG = Config::getConfig();
$api_key = $this->_getParam('api_key'); $api_key = $this->_getParam('api_key');
if (!in_array($api_key, $CC_CONFIG["apiKey"]) && if (!in_array($api_key, $CC_CONFIG["apiKey"]) &&

View File

@ -19,7 +19,7 @@ class AudiopreviewController extends Zend_Controller_Action
*/ */
public function audioPreviewAction() public function audioPreviewAction()
{ {
global $CC_CONFIG; $CC_CONFIG = Config::getConfig();
$audioFileID = $this->_getParam('audioFileID'); $audioFileID = $this->_getParam('audioFileID');
$audioFileArtist = $this->_getParam('audioFileArtist'); $audioFileArtist = $this->_getParam('audioFileArtist');
@ -29,20 +29,20 @@ class AudiopreviewController extends Zend_Controller_Action
$baseUrl = Application_Common_OsPath::getBaseDir(); $baseUrl = Application_Common_OsPath::getBaseDir();
$this->view->headScript()->appendFile( $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'); 'text/javascript');
$this->view->headScript()->appendFile( $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'); 'text/javascript');
$this->view->headLink()->appendStylesheet( $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'); $this->_helper->layout->setLayout('audioPlayer');
$logo = Application_Model_Preference::GetStationLogo(); $logo = Application_Model_Preference::GetStationLogo();
if ($logo) { if ($logo) {
$this->view->logo = "data:image/png;base64,$logo"; $this->view->logo = "data:image/png;base64,$logo";
} else { } else {
$this->view->logo = "$baseUrl/css/images/airtime_logo_jp.png"; $this->view->logo = $baseUrl."css/images/airtime_logo_jp.png";
} }
if ($type == "audioclip") { if ($type == "audioclip") {
@ -73,23 +73,23 @@ class AudiopreviewController extends Zend_Controller_Action
*/ */
public function playlistPreviewAction() public function playlistPreviewAction()
{ {
global $CC_CONFIG; $CC_CONFIG = Config::getConfig();
$playlistIndex = $this->_getParam('playlistIndex'); $playlistIndex = $this->_getParam('playlistIndex');
$playlistID = $this->_getParam('playlistID'); $playlistID = $this->_getParam('playlistID');
$baseUrl = Application_Common_OsPath::getBaseDir(); $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/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->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->headLink()->appendStylesheet($baseUrl.'js/jplayer/skin/jplayer.airtime.audio.preview.css?'.$CC_CONFIG['airtime_version']);
$this->_helper->layout->setLayout('audioPlayer'); $this->_helper->layout->setLayout('audioPlayer');
$logo = Application_Model_Preference::GetStationLogo(); $logo = Application_Model_Preference::GetStationLogo();
if ($logo) { if ($logo) {
$this->view->logo = "data:image/png;base64,$logo"; $this->view->logo = "data:image/png;base64,$logo";
} else { } else {
$this->view->logo = "$baseUrl/css/images/airtime_logo_jp.png"; $this->view->logo = $baseUrl."css/images/airtime_logo_jp.png";
} }
$this->view->playlistIndex= $playlistIndex; $this->view->playlistIndex= $playlistIndex;
$this->view->playlistID = $playlistID; $this->view->playlistID = $playlistID;
@ -99,23 +99,23 @@ class AudiopreviewController extends Zend_Controller_Action
public function blockPreviewAction() public function blockPreviewAction()
{ {
global $CC_CONFIG; $CC_CONFIG = Config::getConfig();
$blockIndex = $this->_getParam('blockIndex'); $blockIndex = $this->_getParam('blockIndex');
$blockId = $this->_getParam('blockId'); $blockId = $this->_getParam('blockId');
$baseUrl = Application_Common_OsPath::getBaseDir(); $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/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->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->headLink()->appendStylesheet($baseUrl.'js/jplayer/skin/jplayer.airtime.audio.preview.css?'.$CC_CONFIG['airtime_version']);
$this->_helper->layout->setLayout('audioPlayer'); $this->_helper->layout->setLayout('audioPlayer');
$logo = Application_Model_Preference::GetStationLogo(); $logo = Application_Model_Preference::GetStationLogo();
if ($logo) { if ($logo) {
$this->view->logo = "data:image/png;base64,$logo"; $this->view->logo = "data:image/png;base64,$logo";
} else { } else {
$this->view->logo = "$baseUrl/css/images/airtime_logo_jp.png"; $this->view->logo = $baseUrl."css/images/airtime_logo_jp.png";
} }
$this->view->blockIndex= $blockIndex; $this->view->blockIndex= $blockIndex;
$this->view->blockId = $blockId; $this->view->blockId = $blockId;
@ -212,7 +212,7 @@ class AudiopreviewController extends Zend_Controller_Action
throw new Exception("Unknown file type: $mime"); throw new Exception("Unknown file type: $mime");
} }
$elementMap['uri'] = $baseUrl."/api/get-media/file/".$track['item_id']; $elementMap['uri'] = $baseUrl."api/get-media/file/".$track['item_id'];
} else { } else {
$elementMap['uri'] = $track['path']; $elementMap['uri'] = $track['path'];
} }
@ -226,24 +226,23 @@ class AudiopreviewController extends Zend_Controller_Action
*/ */
public function showPreviewAction() public function showPreviewAction()
{ {
global $CC_CONFIG; $CC_CONFIG = Config::getConfig();
$showID = $this->_getParam('showID'); $showID = $this->_getParam('showID');
$showIndex = $this->_getParam('showIndex'); $showIndex = $this->_getParam('showIndex');
$baseUrl = dirname($_SERVER['SCRIPT_NAME']); $baseUrl = Application_Common_OsPath::getBaseDir();
if (strcmp($baseUrl, '/') ==0) $baseUrl = "";
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/audiopreview/preview_jplayer.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); $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->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->headLink()->appendStylesheet($baseUrl.'js/jplayer/skin/jplayer.airtime.audio.preview.css?'.$CC_CONFIG['airtime_version']);
$this->_helper->layout->setLayout('audioPlayer'); $this->_helper->layout->setLayout('audioPlayer');
$logo = Application_Model_Preference::GetStationLogo(); $logo = Application_Model_Preference::GetStationLogo();
if ($logo) { if ($logo) {
$this->view->logo = "data:image/png;base64,$logo"; $this->view->logo = "data:image/png;base64,$logo";
} else { } 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; $this->view->showID = $showID;
@ -298,7 +297,7 @@ class AudiopreviewController extends Zend_Controller_Action
throw new Exception("Unknown file type: $mime"); throw new Exception("Unknown file type: $mime");
} }
$elementMap['uri'] = $baseUrl."/api/get-media/file/".$track['item_id']; $elementMap['uri'] = $baseUrl."api/get-media/file/".$track['item_id'];
} else { } else {
$elementMap['uri'] = $track['filepath']; $elementMap['uri'] = $track['filepath'];
} }

View File

@ -96,18 +96,18 @@ class DashboardController extends Zend_Controller_Action
public function streamPlayerAction() public function streamPlayerAction()
{ {
global $CC_CONFIG; $CC_CONFIG = Config::getConfig();
$baseUrl = Application_Common_OsPath::getBaseDir(); $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'); $this->_helper->layout->setLayout('bare');
$logo = Application_Model_Preference::GetStationLogo(); $logo = Application_Model_Preference::GetStationLogo();
if ($logo) { if ($logo) {
$this->view->logo = "data:image/png;base64,$logo"; $this->view->logo = "data:image/png;base64,$logo";
} else { } else {
$this->view->logo = $baseUrl."/css/images/airtime_logo_jp.png"; $this->view->logo = $baseUrl."css/images/airtime_logo_jp.png";
} }
} }

View File

@ -25,34 +25,34 @@ class LibraryController extends Zend_Controller_Action
public function indexAction() public function indexAction()
{ {
global $CC_CONFIG; $CC_CONFIG = Config::getConfig();
$request = $this->getRequest(); $request = $this->getRequest();
$baseUrl = Application_Common_OsPath::getBaseDir(); $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/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/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/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.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.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.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.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.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/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/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/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/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/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/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/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/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/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/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->headScript()->appendFile($baseUrl.'js/airtime/playlist/smart_blockbuilder.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
$this->view->headLink()->appendStylesheet($baseUrl.'/css/playlist_builder.css?'.$CC_CONFIG['airtime_version']); $this->view->headLink()->appendStylesheet($baseUrl.'css/playlist_builder.css?'.$CC_CONFIG['airtime_version']);
try { try {
@ -186,16 +186,16 @@ class LibraryController extends Zend_Controller_Action
} }
} }
if ($isAdminOrPM || $file->getFileOwnerId() == $user->getId()) { if ($isAdminOrPM || $file->getFileOwnerId() == $user->getId()) {
$menu["del"] = array("name"=> _("Delete"), "icon" => "delete", "url" => $baseUrl."/library/delete"); $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}"); $menu["edit"] = array("name"=> _("Edit Metadata"), "icon" => "edit", "url" => $baseUrl."library/edit-file-md/id/{$id}");
} }
$url = $file->getRelativeFileUrl($baseUrl).'/download/true'; $url = $file->getRelativeFileUrl($baseUrl).'download/true';
$menu["download"] = array("name" => _("Download"), "icon" => "download", "url" => $url); $menu["download"] = array("name" => _("Download"), "icon" => "download", "url" => $url);
} elseif ($type === "playlist" || $type === "block") { } elseif ($type === "playlist" || $type === "block") {
if ($type === 'playlist') { if ($type === 'playlist') {
$obj = new Application_Model_Playlist($id); $obj = new Application_Model_Playlist($id);
$menu["duplicate"] = array("name" => _("Duplicate Playlist"), "icon" => "edit", "url" => $baseUrl."/library/duplicate"); $menu["duplicate"] = array("name" => _("Duplicate Playlist"), "icon" => "edit", "url" => $baseUrl."library/duplicate");
} elseif ($type === 'block') { } elseif ($type === 'block') {
$obj = new Application_Model_Block($id); $obj = new Application_Model_Block($id);
if (!$obj->isStatic()) { if (!$obj->isStatic()) {
@ -215,7 +215,7 @@ class LibraryController extends Zend_Controller_Action
} }
if ($isAdminOrPM || $obj->getCreatorId() == $user->getId()) { if ($isAdminOrPM || $obj->getCreatorId() == $user->getId()) {
$menu["del"] = array("name"=> _("Delete"), "icon" => "delete", "url" => $baseUrl."/library/delete"); $menu["del"] = array("name"=> _("Delete"), "icon" => "delete", "url" => $baseUrl."library/delete");
} }
} elseif ($type == "stream") { } elseif ($type == "stream") {
$webstream = CcWebstreamQuery::create()->findPK($id); $webstream = CcWebstreamQuery::create()->findPK($id);
@ -232,9 +232,9 @@ class LibraryController extends Zend_Controller_Action
} }
if ($isAdminOrPM || $obj->getCreatorId() == $user->getId()) { if ($isAdminOrPM || $obj->getCreatorId() == $user->getId()) {
if ($screen == "playlist") { if ($screen == "playlist") {
$menu["edit"] = array("name"=> _("Edit"), "icon" => "edit", "url" => $baseUrl."/library/edit-file-md/id/{$id}"); $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"); $menu["del"] = array("name"=> _("Delete"), "icon" => "delete", "url" => $baseUrl."library/delete");
} }
} }
@ -260,7 +260,7 @@ class LibraryController extends Zend_Controller_Action
$text = _("Upload to SoundCloud"); $text = _("Upload to SoundCloud");
} }
$menu["soundcloud"]["items"]["upload"] = array("name" => $text, "icon" => "soundcloud", "url" => $baseUrl."/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)) { if (empty($menu)) {
@ -372,7 +372,7 @@ class LibraryController extends Zend_Controller_Action
list(, $plFadeOut) = $originalPl->getFadeInfo($originalPl->getSize()-1); list(, $plFadeOut) = $originalPl->getFadeInfo($originalPl->getSize()-1);
$newPl->setfades($plFadeIn, $plFadeOut); $newPl->setfades($plFadeIn, $plFadeOut);
$newPl->setName("Copy of ".$originalPl->getName()); $newPl->setName(sprintf(_("Copy of %s"), $originalPl->getName()));
} }
public function contentsFeedAction() public function contentsFeedAction()

View File

@ -12,22 +12,22 @@ class ListenerstatController extends Zend_Controller_Action
public function indexAction() public function indexAction()
{ {
global $CC_CONFIG; $CC_CONFIG = Config::getConfig();
$request = $this->getRequest(); $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.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'/js/flot/jquery.flot.crosshair.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); $this->view->headScript()->appendFile($baseUrl.'js/flot/jquery.flot.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/airtime/listenerstat/listenerstat.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$offset = date("Z") * -1; $offset = date("Z") * -1;
$this->view->headScript()->appendScript("var serverTimezoneOffset = {$offset}; //in seconds"); $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/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/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/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. //default time is the last 24 hours.
$now = time(); $now = time();
@ -52,6 +52,9 @@ class ListenerstatController extends Zend_Controller_Action
$out = array(); $out = array();
foreach ($errorStatus as $v) { foreach ($errorStatus as $v) {
$key = explode('_listener_stat_error', $v['keyname']); $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']; $out[$key[0]] = $v['value'];
} }

View File

@ -22,7 +22,7 @@ class LocaleController extends Zend_Controller_Action
file_get_contents(Application_Common_OsPath::join( file_get_contents(Application_Common_OsPath::join(
$_SERVER["DOCUMENT_ROOT"], $_SERVER["DOCUMENT_ROOT"],
$baseUrl, $baseUrl,
"/js/datatables/i18n/", "js/datatables/i18n/",
$locale.".txt") $locale.".txt")
); );
} }
@ -54,6 +54,7 @@ class LocaleController extends Zend_Controller_Action
"You can only add tracks, smart blocks, and webstreams to playlists." => _("You can only add tracks, smart blocks, and webstreams to playlists."), "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 //library/events/library_showbuilder.js
//already in library/events/library_playlistbuilder.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 1 Item" => _("Adding 1 Item"),
//"Adding %s Items" => _("Adding %s Items"), //"Adding %s Items" => _("Adding %s Items"),
//library/library.js //library/library.js
@ -157,6 +158,7 @@ class LocaleController extends Zend_Controller_Action
"Copyright" => _("Copyright"), "Copyright" => _("Copyright"),
"All" => _("All"), "All" => _("All"),
"Copied %s row%s to the clipboard" => _("Copied %s row%s to the clipboard"), "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 //preferences/musicdirs.js
"Choose Storage Folder" => _("Choose Storage Folder"), "Choose Storage Folder" => _("Choose Storage Folder"),
"Choose Folder to Watch" => _("Choose Folder to Watch"), "Choose Folder to Watch" => _("Choose Folder to Watch"),
@ -209,6 +211,7 @@ class LocaleController extends Zend_Controller_Action
//"Error code: " => _("Error code: "), //"Error code: " => _("Error code: "),
//"Error msg: " => _("Error msg: "), //"Error msg: " => _("Error msg: "),
"This show has no scheduled content." => _("This show has no scheduled content."), "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 //already in schedule/add-show.js
//"The show instance doesn"t exist anymore!" => _("The show instance doesn"t exist anymore!"), //"The show instance doesn"t exist anymore!" => _("The show instance doesn"t exist anymore!"),
//schedule/schedule.js //schedule/schedule.js
@ -390,4 +393,4 @@ class LocaleController extends Zend_Controller_Action
echo "var general_dict=".json_encode($translations); echo "var general_dict=".json_encode($translations);
} }
} }

View File

@ -9,7 +9,7 @@ class LoginController extends Zend_Controller_Action
public function indexAction() public function indexAction()
{ {
global $CC_CONFIG; $CC_CONFIG = Config::getConfig();
$request = $this->getRequest(); $request = $this->getRequest();
@ -27,7 +27,7 @@ class LoginController extends Zend_Controller_Action
$baseUrl = Application_Common_OsPath::getBaseDir(); $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(); $form = new Application_Form_Login();
@ -102,11 +102,11 @@ class LoginController extends Zend_Controller_Action
public function passwordRestoreAction() public function passwordRestoreAction()
{ {
global $CC_CONFIG; $CC_CONFIG = Config::getConfig();
$baseUrl = Application_Common_OsPath::getBaseDir(); $baseUrl = Application_Common_OsPath::getBaseDir();
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/login/password-restore.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); $this->view->headScript()->appendFile($baseUrl.'js/airtime/login/password-restore.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
if (!Application_Model_Preference::GetEnableSystemEmail()) { if (!Application_Model_Preference::GetEnableSystemEmail()) {
$this->_redirect('login'); $this->_redirect('login');

View File

@ -12,7 +12,7 @@ class PlayouthistoryController extends Zend_Controller_Action
public function indexAction() public function indexAction()
{ {
global $CC_CONFIG; $CC_CONFIG = Config::getConfig();
$request = $this->getRequest(); $request = $this->getRequest();
@ -38,23 +38,23 @@ class PlayouthistoryController extends Zend_Controller_Action
$this->view->date_form = $form; $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/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/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.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.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/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/datatables/plugin/TableTools/js/TableTools.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$offset = date("Z") * -1; $offset = date("Z") * -1;
$this->view->headScript()->appendScript("var serverTimezoneOffset = {$offset}; //in seconds"); $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/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/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/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/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.'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/jquery.ui.timepicker.css?'.$CC_CONFIG['airtime_version']);
$this->view->headLink()->appendStylesheet($baseUrl.'/css/playouthistory.css?'.$CC_CONFIG['airtime_version']); $this->view->headLink()->appendStylesheet($baseUrl.'css/playouthistory.css?'.$CC_CONFIG['airtime_version']);
} }
public function playoutHistoryFeedAction() public function playoutHistoryFeedAction()

View File

@ -13,17 +13,17 @@ class PluploadController extends Zend_Controller_Action
public function indexAction() public function indexAction()
{ {
global $CC_CONFIG; $CC_CONFIG = Config::getConfig();
$baseUrl = Application_Common_OsPath::getBaseDir(); $baseUrl = Application_Common_OsPath::getBaseDir();
$locale = Application_Model_Preference::GetLocale(); $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/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/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/airtime/library/plupload.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'/js/plupload/i18n/'.$locale.'.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); $this->view->headScript()->appendFile($baseUrl.'js/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() public function uploadAction()

View File

@ -20,14 +20,14 @@ class PreferenceController extends Zend_Controller_Action
public function indexAction() public function indexAction()
{ {
global $CC_CONFIG; $CC_CONFIG = Config::getConfig();
$request = $this->getRequest(); $request = $this->getRequest();
$isSaas = Application_Model_Preference::GetPlanLevel() == 'disabled'?false:true; $isSaas = Application_Model_Preference::GetPlanLevel() == 'disabled'?false:true;
$baseUrl = Application_Common_OsPath::getBaseDir(); $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 = ""; $this->view->statusMsg = "";
$form = new Application_Form_Preferences(); $form = new Application_Form_Preferences();
@ -80,13 +80,13 @@ class PreferenceController extends Zend_Controller_Action
public function supportSettingAction() public function supportSettingAction()
{ {
global $CC_CONFIG; $CC_CONFIG = Config::getConfig();
$request = $this->getRequest(); $request = $this->getRequest();
$baseUrl = Application_Common_OsPath::getBaseDir(); $baseUrl = Application_Common_OsPath::getBaseDir();
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/preferences/support-setting.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); $this->view->headScript()->appendFile($baseUrl.'js/airtime/preferences/support-setting.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->statusMsg = ""; $this->view->statusMsg = "";
$form = new Application_Form_SupportSettings(); $form = new Application_Form_SupportSettings();
@ -136,14 +136,14 @@ class PreferenceController extends Zend_Controller_Action
public function directoryConfigAction() public function directoryConfigAction()
{ {
global $CC_CONFIG; $CC_CONFIG = Config::getConfig();
if(Application_Model_Preference::GetPlanLevel() == 'disabled'){ if(Application_Model_Preference::GetPlanLevel() == 'disabled'){
$baseUrl = Application_Common_OsPath::getBaseDir(); $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/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/airtime/preferences/musicdirs.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$watched_dirs_pref = new Application_Form_WatchedDirPreferences(); $watched_dirs_pref = new Application_Form_WatchedDirPreferences();
@ -153,13 +153,13 @@ class PreferenceController extends Zend_Controller_Action
public function streamSettingAction() public function streamSettingAction()
{ {
global $CC_CONFIG; $CC_CONFIG = Config::getConfig();
$request = $this->getRequest(); $request = $this->getRequest();
$baseUrl = Application_Common_OsPath::getBaseDir(); $baseUrl = Application_Common_OsPath::getBaseDir();
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/preferences/streamsetting.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); $this->view->headScript()->appendFile($baseUrl.'js/airtime/preferences/streamsetting.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
// get current settings // get current settings
@ -255,6 +255,15 @@ class PreferenceController extends Zend_Controller_Action
Application_Model_Preference::SetDefaultTransitionFade($values["transition_fade"]); Application_Model_Preference::SetDefaultTransitionFade($values["transition_fade"]);
Application_Model_Preference::SetAutoTransition($values["auto_transition"]); Application_Model_Preference::SetAutoTransition($values["auto_transition"]);
Application_Model_Preference::SetAutoSwitch($values["auto_switch"]); 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::SetEnableReplayGain($values["enableReplayGain"]);
Application_Model_Preference::setReplayGainModifier($values["replayGainModifier"]); Application_Model_Preference::setReplayGainModifier($values["replayGainModifier"]);

View File

@ -40,53 +40,52 @@ class ScheduleController extends Zend_Controller_Action
public function indexAction() public function indexAction()
{ {
global $CC_CONFIG; $CC_CONFIG = Config::getConfig();
$request = $this->getRequest(); $baseUrl = Application_Common_OsPath::getBaseDir();
$baseUrl = $request->getBaseUrl();
$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 //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()->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/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/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/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/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/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/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/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/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/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/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.contextMenu.css?'.$CC_CONFIG['airtime_version']);
//Start Show builder JS/CSS requirements //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/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/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.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.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.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.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.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.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/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/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/events/library_showbuilder.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/library/library.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); $this->view->headScript()->appendFile($baseUrl.'js/airtime/library/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/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/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/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/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/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/TableTools.css?'.$CC_CONFIG['airtime_version']);
$this->view->headLink()->appendStylesheet($baseUrl.'/css/showbuilder.css?'.$CC_CONFIG['airtime_version']); $this->view->headLink()->appendStylesheet($baseUrl.'css/showbuilder.css?'.$CC_CONFIG['airtime_version']);
//End Show builder JS/CSS requirements //End Show builder JS/CSS requirements
Application_Model_Schedule::createNewFormSections($this->view); Application_Model_Schedule::createNewFormSections($this->view);
@ -251,7 +250,7 @@ class ScheduleController extends Zend_Controller_Action
$fileId = $file->getId(); $fileId = $file->getId();
$menu["view_recorded"] = array("name" => _("View Recorded File Metadata"), "icon" => "overview", $menu["view_recorded"] = array("name" => _("View Recorded File Metadata"), "icon" => "overview",
"url" => $baseUrl."/library/edit-file-md/id/".$fileId); "url" => $baseUrl."library/edit-file-md/id/".$fileId);
} }
if ($epochNow < $showStartLocalDT->getTimestamp()) { if ($epochNow < $showStartLocalDT->getTimestamp()) {
@ -260,16 +259,16 @@ class ScheduleController extends Zend_Controller_Action
&& !$instance->isRebroadcast()) { && !$instance->isRebroadcast()) {
$menu["schedule"] = array("name"=> _("Add / Remove Content"), "icon" => "add-remove-content", $menu["schedule"] = array("name"=> _("Add / Remove Content"), "icon" => "add-remove-content",
"url" => $baseUrl."/showbuilder/builder-dialog/"); "url" => $baseUrl."showbuilder/builder-dialog/");
$menu["clear"] = array("name"=> _("Remove All Content"), "icon" => "remove-all-content", $menu["clear"] = array("name"=> _("Remove All Content"), "icon" => "remove-all-content",
"url" => $baseUrl."/schedule/clear-show"); "url" => $baseUrl."schedule/clear-show");
} }
} }
if (!$instance->isRecorded()) { if (!$instance->isRecorded()) {
$menu["content"] = array("name"=> _("Show Content"), "icon" => "overview", "url" => $baseUrl."/schedule/show-content-dialog"); $menu["content"] = array("name"=> _("Show Content"), "icon" => "overview", "url" => $baseUrl."schedule/show-content-dialog");
} }
if ($showEndLocalDT->getTimestamp() <= $epochNow if ($showEndLocalDT->getTimestamp() <= $epochNow
@ -297,7 +296,7 @@ class ScheduleController extends Zend_Controller_Action
} else { } else {
if (!$instance->isRebroadcast()) { if (!$instance->isRebroadcast()) {
$menu["edit"] = array("name"=> _("Edit Show"), "icon" => "edit", "_type"=>"all", "url" => $baseUrl."/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");
@ -307,7 +306,7 @@ class ScheduleController extends Zend_Controller_Action
if ($epochNow < $showStartLocalDT->getTimestamp()) { if ($epochNow < $showStartLocalDT->getTimestamp()) {
if (!$instance->isRebroadcast() && $isAdminOrPM) { if (!$instance->isRebroadcast() && $isAdminOrPM) {
$menu["edit"] = array("name"=> _("Edit Show"), "icon" => "edit", "_type"=>"all", "url" => $baseUrl."/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) { if ($instance->getShow()->isRepeating() && $isAdminOrPM) {
@ -315,12 +314,12 @@ class ScheduleController extends Zend_Controller_Action
//create delete sub menu. //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" => $baseUrl."/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" => $baseUrl."/schedule/cancel-show"); $menu["del"]["items"]["following"] = array("name"=> _("Delete This Instance and All Following"), "icon" => "delete", "url" => $baseUrl."schedule/cancel-show");
} elseif ($isAdminOrPM) { } elseif ($isAdminOrPM) {
$menu["del"] = array("name"=> _("Delete"), "icon" => "delete", "url" => $baseUrl."/schedule/delete-show"); $menu["del"] = array("name"=> _("Delete"), "icon" => "delete", "url" => $baseUrl."schedule/delete-show");
} }
} }
@ -880,8 +879,6 @@ class ScheduleController extends Zend_Controller_Action
public function contentContextMenuAction() public function contentContextMenuAction()
{ {
global $CC_CONFIG;
$id = $this->_getParam('id'); $id = $this->_getParam('id');
$params = '/format/json/id/#id#/'; $params = '/format/json/id/#id#/';
@ -895,7 +892,7 @@ class ScheduleController extends Zend_Controller_Action
$file = Application_Model_StoredFile::Recall($file_id); $file = Application_Model_StoredFile::Recall($file_id);
$baseUrl = $this->getRequest()->getBaseUrl(); $baseUrl = $this->getRequest()->getBaseUrl();
$url = $file->getRelativeFileUrl($baseUrl).'/download/true'; $url = $file->getRelativeFileUrl($baseUrl).'download/true';
$menu[] = array('action' => array('type' => 'gourl', 'url' => $url), $menu[] = array('action' => array('type' => 'gourl', 'url' => $url),
'title' => _('Download')); 'title' => _('Download'));
@ -923,8 +920,6 @@ class ScheduleController extends Zend_Controller_Action
public function calculateDurationAction() public function calculateDurationAction()
{ {
global $CC_CONFIG;
$startParam = $this->_getParam('startTime'); $startParam = $this->_getParam('startTime');
$endParam = $this->_getParam('endTime'); $endParam = $this->_getParam('endTime');

View File

@ -19,7 +19,7 @@ class ShowbuilderController extends Zend_Controller_Action
public function indexAction() public function indexAction()
{ {
global $CC_CONFIG; $CC_CONFIG = Config::getConfig();
$request = $this->getRequest(); $request = $this->getRequest();
@ -45,26 +45,26 @@ class ShowbuilderController extends Zend_Controller_Action
$this->view->headScript()->appendScript("localStorage.setItem( 'datatables-timeline', '' );"); $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/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/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.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.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.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.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.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/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/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/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/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/library.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/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/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/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/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'); $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'); $refer_sses = new Zend_Session_Namespace('referrer');
if ($request->isPost()) { if ($request->isPost()) {
@ -106,7 +106,7 @@ class ShowbuilderController extends Zend_Controller_Action
$this->view->logoImg = $logo; $this->view->logoImg = $logo;
} }
$this->view->dialog = $form; $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');
} }
} }
@ -121,7 +121,7 @@ class ShowbuilderController extends Zend_Controller_Action
$this->view->logoImg = $logo; $this->view->logoImg = $logo;
} }
$this->view->dialog = $form; $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. //determine whether to remove/hide/display the library.
@ -164,12 +164,12 @@ class ShowbuilderController extends Zend_Controller_Action
$offset = date("Z") * -1; $offset = date("Z") * -1;
$this->view->headScript()->appendScript("var serverTimezoneOffset = {$offset}; //in seconds"); $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/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/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/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/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/showbuilder.css?'.$CC_CONFIG['airtime_version']);
} }
public function contextMenuAction() public function contextMenuAction()
@ -195,7 +195,7 @@ class ShowbuilderController extends Zend_Controller_Action
if ($now < floatval($item->getDbEnds("U.u")) && $user->canSchedule($instance->getDbShowId())) { if ($now < floatval($item->getDbEnds("U.u")) && $user->canSchedule($instance->getDbShowId())) {
//remove/truncate the item from the schedule //remove/truncate the item from the schedule
$menu["del"] = array("name"=> _("Delete"), "icon" => "delete", "url" => $baseUrl."/showbuilder/schedule-remove"); $menu["del"] = array("name"=> _("Delete"), "icon" => "delete", "url" => $baseUrl."showbuilder/schedule-remove");
} }
$this->view->items = $menu; $this->view->items = $menu;

View File

@ -4,11 +4,11 @@ class SystemstatusController extends Zend_Controller_Action
{ {
public function init() public function init()
{ {
global $CC_CONFIG; $CC_CONFIG = Config::getConfig();
$baseUrl = Application_Common_OsPath::getBaseDir(); $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() public function indexAction()

View File

@ -16,15 +16,15 @@ class UserController extends Zend_Controller_Action
public function addUserAction() public function addUserAction()
{ {
global $CC_CONFIG; $CC_CONFIG = Config::getConfig();
$request = $this->getRequest(); $request = $this->getRequest();
$baseUrl = Application_Common_OsPath::getBaseDir(); $baseUrl = Application_Common_OsPath::getBaseDir();
$js_files = array( $js_files = array(
'/js/datatables/js/jquery.dataTables.js?', 'js/datatables/js/jquery.dataTables.js?',
'/js/datatables/plugin/dataTables.pluginAPI.js?', 'js/datatables/plugin/dataTables.pluginAPI.js?',
'/js/airtime/user/user.js?' 'js/airtime/user/user.js?'
); );
foreach ($js_files as $js) { foreach ($js_files as $js) {
@ -32,7 +32,7 @@ class UserController extends Zend_Controller_Action
$baseUrl.$js.$CC_CONFIG['airtime_version'],'text/javascript'); $baseUrl.$js.$CC_CONFIG['airtime_version'],'text/javascript');
} }
$this->view->headLink()->appendStylesheet($baseUrl.'/css/users.css?'.$CC_CONFIG['airtime_version']); $this->view->headLink()->appendStylesheet($baseUrl.'css/users.css?'.$CC_CONFIG['airtime_version']);
$form = new Application_Form_AddUser(); $form = new Application_Form_AddUser();
@ -48,8 +48,8 @@ class UserController extends Zend_Controller_Action
if ($form->isValid($formData)) { if ($form->isValid($formData)) {
if (isset($CC_CONFIG['demo']) && $CC_CONFIG['demo'] == 1 if (isset($CC_CONFIG['demo']) && $CC_CONFIG['demo'] == 1
&& $formData['login'] == 'admin' && $formData['login'] == 'admin'
&& $formData['user_id'] != 0) { && $formData['user_id'] != 0) {
$this->view->form = $form; $this->view->form = $form;
$this->view->successMessage = "<div class='errors'>"._("Specific action is not allowed in demo version!")."</div>"; $this->view->successMessage = "<div class='errors'>"._("Specific action is not allowed in demo version!")."</div>";
@ -131,12 +131,12 @@ class UserController extends Zend_Controller_Action
if ($request->isPost()) { if ($request->isPost()) {
$formData = $request->getPost(); $formData = $request->getPost();
if (isset($CC_CONFIG['demo']) && $CC_CONFIG['demo'] == 1 if (isset($CC_CONFIG['demo']) && $CC_CONFIG['demo'] == 1
&& $formData['cu_login'] == 'admin') { && $formData['cu_login'] == 'admin') {
$this->view->form = $form; $this->view->form = $form;
$this->view->successMessage = "<div class='errors'>"._("Specific action is not allowed in demo version!")."</div>"; $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')))); die(json_encode(array("html"=>$this->view->render('user/edit-user.phtml'))));
} else if ($form->isValid($formData) && } else if ($form->isValid($formData) &&
$form->validateLogin($formData['cu_login'], $formData['cu_user_id'])) { $form->validateLogin($formData['cu_login'], $formData['cu_user_id'])) {
$user = new Application_Model_User($formData['cu_user_id']); $user = new Application_Model_User($formData['cu_user_id']);
$user->setFirstName($formData['cu_first_name']); $user->setFirstName($formData['cu_first_name']);
@ -186,7 +186,7 @@ class UserController extends Zend_Controller_Action
# only delete when valid action is selected for the owned files # only delete when valid action is selected for the owned files
if (! in_array($files_action, $valid_actions) ) { if (! in_array($files_action, $valid_actions) ) {
return; return;
} }
$userInfo = Zend_Auth::getInstance()->getStorage()->read(); $userInfo = Zend_Auth::getInstance()->getStorage()->read();
$userId = $userInfo->id; $userId = $userInfo->id;

View File

@ -19,9 +19,9 @@ class Application_Form_AddShowStyle extends Zend_Form_SubForm
'class' => 'big' 'class' => 'big'
)))); ))));
$stringLengthValidator = Application_Form_Helper_ValidationTypes::overrideStringLengthValidator(6, 6);
$bg->setValidators(array( $bg->setValidators(array(
'Hex', 'Hex', $stringLengthValidator
array('stringLength', false, array(6, 6))
)); ));
// Add show color input // Add show color input
@ -39,8 +39,7 @@ class Application_Form_AddShowStyle extends Zend_Form_SubForm
)))); ))));
$c->setValidators(array( $c->setValidators(array(
'Hex', 'Hex', $stringLengthValidator
array('stringLength', false, array(6, 6))
)); ));
} }

View File

@ -36,14 +36,12 @@ class Application_Form_AddUser extends Zend_Form
$password->addValidator($notEmptyValidator); $password->addValidator($notEmptyValidator);
$this->addElement($password); $this->addElement($password);
$passwordIdenticalValidator = Application_Form_Helper_ValidationTypes::overridePasswordIdenticalValidator('password');
$passwordVerify = new Zend_Form_Element_Password('passwordVerify'); $passwordVerify = new Zend_Form_Element_Password('passwordVerify');
$passwordVerify->setLabel(_('Verify Password:')); $passwordVerify->setLabel(_('Verify Password:'));
$passwordVerify->setAttrib('class', 'input_text'); $passwordVerify->setAttrib('class', 'input_text');
$passwordVerify->setRequired(true); $passwordVerify->setRequired(true);
$passwordVerify->addFilter('StringTrim'); $passwordVerify->addFilter('StringTrim');
$passwordVerify->addValidator($notEmptyValidator); $passwordVerify->addValidator($notEmptyValidator);
$passwordVerify->addValidator($passwordIdenticalValidator);
$this->addElement($passwordVerify); $this->addElement($passwordVerify);
$firstName = new Zend_Form_Element_Text('first_name'); $firstName = new Zend_Form_Element_Text('first_name');
@ -120,4 +118,13 @@ class Application_Form_AddUser extends Zend_Form
return true; return true;
} }
// We need to add the password identical validator here in case
// Zend version is less than 1.10.5
public function isValid($data) {
$passwordIdenticalValidator = Application_Form_Helper_ValidationTypes::overridePasswordIdenticalValidator(
$data['password']);
$this->getElement('passwordVerify')->addValidator($passwordIdenticalValidator);
return parent::isValid($data);
}
} }

View File

@ -46,14 +46,12 @@ class Application_Form_EditUser extends Zend_Form
$password->setDecorators(array('viewHelper')); $password->setDecorators(array('viewHelper'));
$this->addElement($password); $this->addElement($password);
$passwordIdenticalValidator = Application_Form_Helper_ValidationTypes::overridePasswordIdenticalValidator('cu_password');
$passwordVerify = new Zend_Form_Element_Password('cu_passwordVerify'); $passwordVerify = new Zend_Form_Element_Password('cu_passwordVerify');
$passwordVerify->setLabel(_('Verify Password:')); $passwordVerify->setLabel(_('Verify Password:'));
$passwordVerify->setAttrib('class', 'input_text'); $passwordVerify->setAttrib('class', 'input_text');
$passwordVerify->setRequired(true); $passwordVerify->setRequired(true);
$passwordVerify->addFilter('StringTrim'); $passwordVerify->addFilter('StringTrim');
$passwordVerify->addValidator($notEmptyValidator); $passwordVerify->addValidator($notEmptyValidator);
$passwordVerify->addValidator($passwordIdenticalValidator);
$passwordVerify->setDecorators(array('viewHelper')); $passwordVerify->setDecorators(array('viewHelper'));
$this->addElement($passwordVerify); $this->addElement($passwordVerify);
@ -137,4 +135,13 @@ class Application_Form_EditUser extends Zend_Form
return true; return true;
} }
} }
// We need to add the password identical validator here in case
// Zend version is less than 1.10.5
public function isValid($data) {
$passwordIdenticalValidator = Application_Form_Helper_ValidationTypes::overridePasswordIdenticalValidator(
$data['cu_password']);
$this->getElement('cu_passwordVerify')->addValidator($passwordIdenticalValidator);
return parent::isValid($data);
}
} }

View File

@ -5,7 +5,7 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm
public function init() public function init()
{ {
global $CC_CONFIG; $CC_CONFIG = Config::getConfig();
$isDemo = isset($CC_CONFIG['demo']) && $CC_CONFIG['demo'] == 1; $isDemo = isset($CC_CONFIG['demo']) && $CC_CONFIG['demo'] == 1;
$isStreamConfigable = Application_Model_Preference::GetEnableStreamConf() == "true"; $isStreamConfigable = Application_Model_Preference::GetEnableStreamConf() == "true";
@ -131,7 +131,7 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm
public function updateVariables() public function updateVariables()
{ {
global $CC_CONFIG; $CC_CONFIG = Config::getConfig();
$isDemo = isset($CC_CONFIG['demo']) && $CC_CONFIG['demo'] == 1; $isDemo = isset($CC_CONFIG['demo']) && $CC_CONFIG['demo'] == 1;
$master_dj_connection_url = Application_Model_Preference::GetMasterDJSourceConnectionURL(); $master_dj_connection_url = Application_Model_Preference::GetMasterDJSourceConnectionURL();

View File

@ -5,7 +5,7 @@ class Application_Form_Login extends Zend_Form
public function init() public function init()
{ {
global $CC_CONFIG; $CC_CONFIG = Config::getConfig();
// Set the method for the display form to POST // Set the method for the display form to POST
$this->setMethod('post'); $this->setMethod('post');

View File

@ -24,7 +24,7 @@
<div class="personal-block solo"> <div class="personal-block solo">
<ul> <ul>
<li> <li>
<a id="current-user" href=<?php echo $baseUrl . "/User/edit-user"?>><span class="name"><?php echo $this->loggedInAs()?></span></a> | <a href=<?php echo $baseUrl . "/Login/logout"?>><?php echo _("Logout")?></a> <a id="current-user" href=<?php echo $baseUrl . "User/edit-user"?>><span class="name"><?php echo $this->loggedInAs()?></span></a> | <a href=<?php echo $baseUrl . "Login/logout"?>><?php echo _("Logout")?></a>
</li> </li>
</ul> </ul>
</div> </div>

View File

@ -940,9 +940,8 @@ SQL;
public static function getBlockCount() public static function getBlockCount()
{ {
global $CC_CONFIG;
$con = Propel::getConnection(); $con = Propel::getConnection();
$sql = 'SELECT count(*) as cnt FROM '.$CC_CONFIG["playListTable"]; $sql = 'SELECT count(*) as cnt FROM cc_playlist';
return $con->query($sql)->fetchColumn(0); return $con->query($sql)->fetchColumn(0);
} }

View File

@ -869,9 +869,8 @@ SQL;
public static function getPlaylistCount() public static function getPlaylistCount()
{ {
global $CC_CONFIG;
$con = Propel::getConnection(); $con = Propel::getConnection();
$sql = 'SELECT count(*) as cnt FROM '.$CC_CONFIG["playListTable"]; $sql = 'SELECT count(*) as cnt FROM cc_playlist';
return $con->query($sql)->fetchColumn(0); return $con->query($sql)->fetchColumn(0);
} }

View File

@ -15,7 +15,7 @@ class Application_Model_RabbitMq
private static function sendMessage($exchange, $data) private static function sendMessage($exchange, $data)
{ {
global $CC_CONFIG; $CC_CONFIG = Config::getConfig();
$conn = new AMQPConnection($CC_CONFIG["rabbitmq"]["host"], $conn = new AMQPConnection($CC_CONFIG["rabbitmq"]["host"],
$CC_CONFIG["rabbitmq"]["port"], $CC_CONFIG["rabbitmq"]["port"],

View File

@ -181,15 +181,14 @@ SQL;
public static function GetLastScheduleItem($p_timeNow) public static function GetLastScheduleItem($p_timeNow)
{ {
global $CC_CONFIG;
$sql = <<<SQL $sql = <<<SQL
SELECT ft.artist_name, SELECT ft.artist_name,
ft.track_title, ft.track_title,
st.starts AS starts, st.starts AS starts,
st.ends AS ends st.ends AS ends
FROM cc_schedule st FROM cc_schedule st
LEFT JOIN $CC_CONFIG[filesTable] ft ON st.file_id = ft.id LEFT JOIN cc_files ft ON st.file_id = ft.id
LEFT JOIN $CC_CONFIG[showInstances] sit ON st.instance_id = sit.id LEFT JOIN cc_show_instances sit ON st.instance_id = sit.id
-- this and the next line are necessary since we can overbook shows. -- this and the next line are necessary since we can overbook shows.
WHERE st.ends < TIMESTAMP :timeNow WHERE st.ends < TIMESTAMP :timeNow
@ -204,7 +203,6 @@ SQL;
public static function GetCurrentScheduleItem($p_timeNow, $p_instanceId) public static function GetCurrentScheduleItem($p_timeNow, $p_instanceId)
{ {
global $CC_CONFIG;
/* Note that usually there will be one result returned. In some /* Note that usually there will be one result returned. In some
* rare cases two songs are returned. This happens when a track * rare cases two songs are returned. This happens when a track
* that was overbooked from a previous show appears as if it * that was overbooked from a previous show appears as if it
@ -213,8 +211,8 @@ SQL;
* this is the *real* track that is currently playing. So this * this is the *real* track that is currently playing. So this
* is why we are ordering by track start time. */ * is why we are ordering by track start time. */
$sql = "SELECT *" $sql = "SELECT *"
." FROM $CC_CONFIG[scheduleTable] st" ." FROM cc_schedule st"
." LEFT JOIN $CC_CONFIG[filesTable] ft" ." LEFT JOIN cc_files ft"
." ON st.file_id = ft.id" ." ON st.file_id = ft.id"
." WHERE st.starts <= TIMESTAMP :timeNow1" ." WHERE st.starts <= TIMESTAMP :timeNow1"
." AND st.instance_id = :instanceId" ." AND st.instance_id = :instanceId"
@ -229,14 +227,13 @@ SQL;
public static function GetNextScheduleItem($p_timeNow) public static function GetNextScheduleItem($p_timeNow)
{ {
global $CC_CONFIG;
$sql = "SELECT" $sql = "SELECT"
." ft.artist_name, ft.track_title," ." ft.artist_name, ft.track_title,"
." st.starts as starts, st.ends as ends" ." st.starts as starts, st.ends as ends"
." FROM $CC_CONFIG[scheduleTable] st" ." FROM cc_schedule st"
." LEFT JOIN $CC_CONFIG[filesTable] ft" ." LEFT JOIN cc_files ft"
." ON st.file_id = ft.id" ." ON st.file_id = ft.id"
." LEFT JOIN $CC_CONFIG[showInstances] sit" ." LEFT JOIN cc_show_instances sit"
." ON st.instance_id = sit.id" ." ON st.instance_id = sit.id"
." WHERE st.starts > TIMESTAMP :timeNow" ." WHERE st.starts > TIMESTAMP :timeNow"
." AND st.starts >= sit.starts" //this and the next line are necessary since we can overbook shows. ." AND st.starts >= sit.starts" //this and the next line are necessary since we can overbook shows.
@ -260,7 +257,6 @@ SQL;
*/ */
public static function GetScheduleDetailItems($p_start, $p_end, $p_shows) public static function GetScheduleDetailItems($p_start, $p_end, $p_shows)
{ {
global $CC_CONFIG;
$con = Propel::getConnection(); $con = Propel::getConnection();
$p_start_str = $p_start->format("Y-m-d H:i:s"); $p_start_str = $p_start->format("Y-m-d H:i:s");
@ -386,9 +382,8 @@ SQL;
public static function UpdateMediaPlayedStatus($p_id) public static function UpdateMediaPlayedStatus($p_id)
{ {
global $CC_CONFIG;
$con = Propel::getConnection(); $con = Propel::getConnection();
$sql = "UPDATE ".$CC_CONFIG['scheduleTable'] $sql = "UPDATE cc_schedule"
." SET media_item_played=TRUE"; ." SET media_item_played=TRUE";
// we need to update 'broadcasted' column as well // we need to update 'broadcasted' column as well
// check the current switch status // check the current switch status
@ -427,9 +422,8 @@ SQL;
public static function getSchduledPlaylistCount() public static function getSchduledPlaylistCount()
{ {
global $CC_CONFIG;
$con = Propel::getConnection(); $con = Propel::getConnection();
$sql = "SELECT count(*) as cnt FROM ".$CC_CONFIG['scheduleTable']; $sql = "SELECT count(*) as cnt FROM cc_schedule";
return $con->query($sql)->fetchColumn(0); return $con->query($sql)->fetchColumn(0);
} }
@ -769,7 +763,7 @@ SQL;
private static function getRangeStartAndEnd($p_fromDateTime, $p_toDateTime) private static function getRangeStartAndEnd($p_fromDateTime, $p_toDateTime)
{ {
global $CC_CONFIG; $CC_CONFIG = Config::getConfig();
/* if $p_fromDateTime and $p_toDateTime function parameters are null, /* if $p_fromDateTime and $p_toDateTime function parameters are null,
then set range * from "now" to "now + 24 hours". */ then set range * from "now" to "now + 24 hours". */
@ -918,15 +912,13 @@ SQL;
public static function deleteAll() public static function deleteAll()
{ {
global $CC_CONFIG;
$con = Propel::getConnection(); $con = Propel::getConnection();
$con->exec("TRUNCATE TABLE ".$CC_CONFIG["scheduleTable"]); $con->exec("TRUNCATE TABLE cc_schedule");
} }
public static function deleteWithFileId($fileId) public static function deleteWithFileId($fileId)
{ {
global $CC_CONFIG; $sql = "DELETE FROM cc_schedule WHERE file_id=:file_id";
$sql = "DELETE FROM ".$CC_CONFIG["scheduleTable"]." WHERE file_id=:file_id";
Application_Common_Database::prepareAndExecute($sql, array(':file_id'=>$fileId), 'execute'); Application_Common_Database::prepareAndExecute($sql, array(':file_id'=>$fileId), 'execute');
} }

View File

@ -189,7 +189,7 @@ SQL;
->find($con); ->find($con);
/* Check two things: /* Check two things:
1. If the show being resized and any of its repeats end in the past 1. If the show being resized and any of its repeats end in the past
2. If the show being resized and any of its repeats overlap 2. If the show being resized and any of its repeats overlap
with other scheduled shows */ with other scheduled shows */
@ -321,7 +321,7 @@ SQL;
} catch (Exception $e) { } catch (Exception $e) {
Logging::info($e->getMessage()); Logging::info($e->getMessage());
} }
} }
Application_Model_RabbitMq::PushSchedule(); Application_Model_RabbitMq::PushSchedule();
} }
@ -467,7 +467,7 @@ SQL;
$startDateTime = new DateTime($show["starts"], $utc); $startDateTime = new DateTime($show["starts"], $utc);
$startDateTime->setTimezone($dtz); $startDateTime->setTimezone($dtz);
$rebroadcastsLocal[$i]["start_date"] = $rebroadcastsLocal[$i]["start_date"] =
$startDateTime->format("Y-m-d"); $startDateTime->format("Y-m-d");
$rebroadcastsLocal[$i]["start_time"] = $rebroadcastsLocal[$i]["start_time"] =
$startDateTime->format("H:i"); $startDateTime->format("H:i");
@ -533,7 +533,7 @@ SQL;
->filterByDbShowId($this->_showId) ->filterByDbShowId($this->_showId)
->findOne(); ->findOne();
if (!is_null($showDaysRow)) if (!is_null($showDaysRow))
return $showDaysRow->getDbRepeatType(); return $showDaysRow->getDbRepeatType();
else else
return -1; return -1;
@ -582,7 +582,7 @@ WHERE starts > :timestamp::TIMESTAMP
AND show_id = :showId AND show_id = :showId
SQL; SQL;
Application_Common_Database::prepareAndExecute( $sql, Application_Common_Database::prepareAndExecute( $sql,
array( ':timestamp' => gmdate("Y-m-d H:i:s"), array( ':timestamp' => gmdate("Y-m-d H:i:s"),
':showId' => $this->getId()), 'execute'); ':showId' => $this->getId()), 'execute');
} }
@ -838,7 +838,7 @@ WHERE show_id = :show_id
AND ends > :timestamp::TIMESTAMP AND ends > :timestamp::TIMESTAMP
SQL; SQL;
Application_Common_Database::prepareAndExecute( $sql, array( Application_Common_Database::prepareAndExecute( $sql, array(
':add_show_duration' => $p_data['add_show_duration'], ':add_show_duration' => $p_data['add_show_duration'],
':show_id' => $p_data['add_show_id'], ':show_id' => $p_data['add_show_id'],
':timestamp' => $timestamp), "execute"); ':timestamp' => $timestamp), "execute");
@ -1222,12 +1222,12 @@ SQL;
SELECT :rebroadcast::date - :start::date SELECT :rebroadcast::date - :start::date
SQL; SQL;
$offset_days = $offset_days =
Application_Common_Database::prepareAndExecute($sql, Application_Common_Database::prepareAndExecute($sql,
array( array(
'rebroadcast' => 'rebroadcast' =>
$data["add_show_rebroadcast_date_absolute_$i"], $data["add_show_rebroadcast_date_absolute_$i"],
'start' => 'start' =>
$data['add_show_start_date']), "column" ); $data['add_show_start_date']), "column" );
//$r = $con->query($sql); //$r = $con->query($sql);
@ -1770,7 +1770,7 @@ SQL;
$parentStartsEpoch = intval($parentStartsDT->format("U")); $parentStartsEpoch = intval($parentStartsDT->format("U"));
} }
$startsDT = DateTime::createFromFormat("Y-m-d G:i:s", $startsDT = DateTime::createFromFormat("Y-m-d G:i:s",
$show["starts"],$utc); $show["starts"],$utc);
$endsDT = DateTime::createFromFormat("Y-m-d G:i:s", $endsDT = DateTime::createFromFormat("Y-m-d G:i:s",
$show["ends"], $utc); $show["ends"], $utc);
@ -1907,7 +1907,7 @@ SQL;
*/ */
public static function getCurrentShow($timeNow=null) public static function getCurrentShow($timeNow=null)
{ {
global $CC_CONFIG; $CC_CONFIG = Config::getConfig();
$con = Propel::getConnection(); $con = Propel::getConnection();
if ($timeNow == null) { if ($timeNow == null) {
$date = new Application_Common_DateHelper; $date = new Application_Common_DateHelper;
@ -1953,7 +1953,7 @@ SQL;
*/ */
public static function getPrevCurrentNext($p_timeNow) public static function getPrevCurrentNext($p_timeNow)
{ {
global $CC_CONFIG; $CC_CONFIG = Config::getConfig();
$con = Propel::getConnection(); $con = Propel::getConnection();
// //
//TODO, returning starts + ends twice (once with an alias). Unify this after the 2.0 release. --Martin //TODO, returning starts + ends twice (once with an alias). Unify this after the 2.0 release. --Martin

View File

@ -7,7 +7,7 @@ class Application_Model_Soundcloud
public function __construct() public function __construct()
{ {
global $CC_CONFIG; $CC_CONFIG = Config::getConfig();
$this->_soundcloud = new Services_Soundcloud( $this->_soundcloud = new Services_Soundcloud(
$CC_CONFIG['soundcloud-client-id'], $CC_CONFIG['soundcloud-client-id'],
$CC_CONFIG['soundcloud-client-secret']); $CC_CONFIG['soundcloud-client-secret']);
@ -25,11 +25,11 @@ class Application_Model_Soundcloud
public function uploadTrack($filepath, $filename, $description, public function uploadTrack($filepath, $filename, $description,
$tags=array(), $release=null, $genre=null) $tags=array(), $release=null, $genre=null)
{ {
if (!$this->getToken()) { if (!$this->getToken()) {
throw new NoSoundCloundToken(); throw new NoSoundCloundToken();
} }
if (count($tags)) { if (count($tags)) {
$tags = join(" ", $tags); $tags = join(" ", $tags);
$tags = $tags." ".Application_Model_Preference::GetSoundCloudTags(); $tags = $tags." ".Application_Model_Preference::GetSoundCloudTags();
@ -88,7 +88,7 @@ class Application_Model_Soundcloud
} }
public static function uploadSoundcloud($id) public static function uploadSoundcloud($id)
{ {
$cmd = "/usr/lib/airtime/utils/soundcloud-uploader $id > /dev/null &"; $cmd = "/usr/lib/airtime/utils/soundcloud-uploader $id > /dev/null &";
Logging::info("Uploading soundcloud with command: $cmd"); Logging::info("Uploading soundcloud with command: $cmd");

View File

@ -504,7 +504,7 @@ SQL;
*/ */
public function getFileUrlUsingConfigAddress() public function getFileUrlUsingConfigAddress()
{ {
global $CC_CONFIG; $CC_CONFIG = Config::getConfig();
if (isset($CC_CONFIG['baseUrl'])) { if (isset($CC_CONFIG['baseUrl'])) {
$serverName = $CC_CONFIG['baseUrl']; $serverName = $CC_CONFIG['baseUrl'];
@ -532,7 +532,7 @@ SQL;
*/ */
public function getRelativeFileUrl($baseUrl) public function getRelativeFileUrl($baseUrl)
{ {
return $baseUrl."/api/get-media/file/".$this->getId().".".$this->getFileExtension(); return $baseUrl."api/get-media/file/".$this->getId().".".$this->getFileExtension();
} }
public static function Insert($md) public static function Insert($md)
@ -807,14 +807,14 @@ SQL;
// ugly // ugly
if ($type == "au") { if ($type == "au") {
$row['audioFile'] = $row['id'].".".pathinfo($row['filepath'], PATHINFO_EXTENSION); $row['audioFile'] = $row['id'].".".pathinfo($row['filepath'], PATHINFO_EXTENSION);
$row['image'] = '<img title="'._("Track preview").'" src="'.$baseUrl.'/css/images/icon_audioclip.png">'; $row['image'] = '<img title="'._("Track preview").'" src="'.$baseUrl.'css/images/icon_audioclip.png">';
} elseif ($type == "pl") { } elseif ($type == "pl") {
$row['image'] = '<img title="'._("Playlist preview").'" src="'.$baseUrl.'/css/images/icon_playlist.png">'; $row['image'] = '<img title="'._("Playlist preview").'" src="'.$baseUrl.'css/images/icon_playlist.png">';
} elseif ($type == "st") { } elseif ($type == "st") {
$row['audioFile'] = $row['id']; $row['audioFile'] = $row['id'];
$row['image'] = '<img title="'._("Webstream preview").'" src="'.$baseUrl.'/css/images/icon_webstream.png">'; $row['image'] = '<img title="'._("Webstream preview").'" src="'.$baseUrl.'css/images/icon_webstream.png">';
} elseif ($type == "bl") { } elseif ($type == "bl") {
$row['image'] = '<img title="'._("Smart Block").'" src="'.$baseUrl.'/css/images/icon_smart-block.png">'; $row['image'] = '<img title="'._("Smart Block").'" src="'.$baseUrl.'css/images/icon_smart-block.png">';
} }
} }
@ -1218,7 +1218,7 @@ SQL;
// note: never call this method from controllers because it does a sleep // note: never call this method from controllers because it does a sleep
public function uploadToSoundCloud() public function uploadToSoundCloud()
{ {
global $CC_CONFIG; $CC_CONFIG = Config::getConfig();
$file = $this->_file; $file = $this->_file;
if (is_null($file)) { if (is_null($file)) {

View File

@ -20,9 +20,8 @@ class Application_Model_Subjects
public static function increaseLoginAttempts($login) public static function increaseLoginAttempts($login)
{ {
global $CC_CONFIG;
$con = Propel::getConnection(); $con = Propel::getConnection();
$sql = "UPDATE ".$CC_CONFIG['subjTable']." SET login_attempts = login_attempts+1" $sql = "UPDATE cc_subjs SET login_attempts = login_attempts+1"
." WHERE login='$login'"; ." WHERE login='$login'";
$res = $con->exec($sql); $res = $con->exec($sql);
@ -31,9 +30,8 @@ class Application_Model_Subjects
public static function resetLoginAttempts($login) public static function resetLoginAttempts($login)
{ {
global $CC_CONFIG;
$con = Propel::getConnection(); $con = Propel::getConnection();
$sql = "UPDATE ".$CC_CONFIG['subjTable']." SET login_attempts = '0'" $sql = "UPDATE cc_subjs SET login_attempts = '0'"
." WHERE login='$login'"; ." WHERE login='$login'";
$res = $con->exec($sql); $res = $con->exec($sql);
@ -42,9 +40,8 @@ class Application_Model_Subjects
public static function getLoginAttempts($login) public static function getLoginAttempts($login)
{ {
global $CC_CONFIG;
$con = Propel::getConnection(); $con = Propel::getConnection();
$sql = "SELECT login_attempts FROM ".$CC_CONFIG['subjTable']." WHERE login='$login'"; $sql = "SELECT login_attempts FROM cc_subjs WHERE login='$login'";
$res = $con->query($sql)->fetchColumn(0); $res = $con->query($sql)->fetchColumn(0);
return ($res !== false) ? $res : 0; return ($res !== false) ? $res : 0;

View File

@ -5,7 +5,7 @@ class Application_Model_Systemstatus
public static function GetMonitStatus($p_ip) public static function GetMonitStatus($p_ip)
{ {
global $CC_CONFIG; $CC_CONFIG = Config::getConfig();
$monit_user = $CC_CONFIG['monit_user']; $monit_user = $CC_CONFIG['monit_user'];
$monit_password = $CC_CONFIG['monit_password']; $monit_password = $CC_CONFIG['monit_password'];

View File

@ -1,5 +1,5 @@
<?php $baseUrl = Application_Common_OsPath::getBaseDir(); ?> <?php $baseUrl = Application_Common_OsPath::getBaseDir(); ?>
<div id="import_status" class="library_import" style="display:none"><? echo _("File import in progress..."); ?><img src=<?php echo $baseUrl . "/css/images/file_import_loader.gif"?>></img></div> <div id="import_status" class="library_import" style="display:none"><? echo _("File import in progress..."); ?><img src=<?php echo $baseUrl . "css/images/file_import_loader.gif"?>></img></div>
<fieldset class="toggle closed" id="filter_options"> <fieldset class="toggle closed" id="filter_options">
<legend style="cursor: pointer;"><span class="ui-icon ui-icon-triangle-2-n-s"></span><? echo _("Advanced Search Options") ?></legend> <legend style="cursor: pointer;"><span class="ui-icon ui-icon-triangle-2-n-s"></span><? echo _("Advanced Search Options") ?></legend>

View File

@ -85,7 +85,7 @@
<span id="rg_modifier_value" style="border: 0; color: #f6931f; font-weight: bold;"> <span id="rg_modifier_value" style="border: 0; color: #f6931f; font-weight: bold;">
<?php echo $this->form->getElement('replayGainModifier')->getValue() ?> <?php echo $this->form->getElement('replayGainModifier')->getValue() ?>
</span> </span>
dB <?php echo _("dB")?>
</dt> </dt>
<dd id="replayGainModifier-element" class="block-display"> <dd id="replayGainModifier-element" class="block-display">
<?php echo $this->form->getElement('replayGainModifier') ?> <?php echo $this->form->getElement('replayGainModifier') ?>

View File

@ -1,7 +1,7 @@
<div class="ui-widget ui-widget-content block-shadow simple-formblock clearfix padded-strong preferences" id="support-feedback-view"> <div class="ui-widget ui-widget-content block-shadow simple-formblock clearfix padded-strong preferences" id="support-feedback-view">
<h2><?php echo $this->section_title?></h2> <h2><?php echo $this->section_title?></h2>
<?php $baseUrl = Application_Common_OsPath::getBaseDir(); ?> <?php $baseUrl = Application_Common_OsPath::getBaseDir(); ?>
<form method="post" action=<?php echo $baseUrl."/Preference/support-setting"?> enctype="multipart/form-data" id="support-feedback-form"> <form method="post" action=<?php echo $baseUrl."Preference/support-setting"?> enctype="multipart/form-data" id="support-feedback-form">
<div id="support-settings"> <div id="support-settings">
<?php echo $this->statusMsg ?> <?php echo $this->statusMsg ?>
<?php echo $this->form ?> <?php echo $this->form ?>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -2992,7 +2992,7 @@ dd .stream-status {
.edit-user-errors { .edit-user-errors {
margin-left: 33% !important; margin-left: 33% !important;
width: 208px; width: 208px;
}
.jp-container a#popup-link { .jp-container a#popup-link {
width: 104px; width: 104px;
border: 1px solid black; border: 1px solid black;

View File

@ -76,7 +76,7 @@ function playAllPlaylist(p_playlistID, p_playlistIndex) {
if ( _idToPostionLookUp !== undefined && viewsPlaylistID == p_playlistID ) { if ( _idToPostionLookUp !== undefined && viewsPlaylistID == p_playlistID ) {
play(p_playlistIndex); play(p_playlistIndex);
}else { }else {
buildplaylist(baseUrl+"/audiopreview/get-playlist/playlistID/"+p_playlistID, p_playlistIndex); buildplaylist(baseUrl+"audiopreview/get-playlist/playlistID/"+p_playlistID, p_playlistIndex);
} }
} }
@ -87,7 +87,7 @@ function playBlock(p_blockId, p_blockIndex)
if ( _idToPostionLookUp !== undefined && viewsBlockId == p_blockId ) { if ( _idToPostionLookUp !== undefined && viewsBlockId == p_blockId ) {
play(p_blockIndex); play(p_blockIndex);
} else { } else {
buildplaylist(baseUrl+"/audiopreview/get-block/blockId/"+p_blockId, p_blockIndex); buildplaylist(baseUrl+"audiopreview/get-block/blockId/"+p_blockId, p_blockIndex);
} }
} }
@ -105,7 +105,7 @@ function playAllShow(p_showID, p_index) {
if ( _idToPostionLookUp !== undefined && viewsShowID == p_showID ) { if ( _idToPostionLookUp !== undefined && viewsShowID == p_showID ) {
play(p_index); play(p_index);
}else { }else {
buildplaylist(baseUrl+"/audiopreview/get-show/showID/"+p_showID, p_index); buildplaylist(baseUrl+"audiopreview/get-show/showID/"+p_showID, p_index);
} }
} }

View File

@ -103,7 +103,7 @@ function open_playlist_preview(p_playlistID, p_playlistIndex) {
if (_preview_window != null && !_preview_window.closed) if (_preview_window != null && !_preview_window.closed)
_preview_window.playAllPlaylist(p_playlistID, p_playlistIndex); _preview_window.playAllPlaylist(p_playlistID, p_playlistIndex);
else else
openPreviewWindow(baseUrl+'/audiopreview/playlist-preview/playlistIndex/'+p_playlistIndex+'/playlistID/'+p_playlistID); openPreviewWindow(baseUrl+'audiopreview/playlist-preview/playlistIndex/'+p_playlistIndex+'/playlistID/'+p_playlistID);
_preview_window.focus(); _preview_window.focus();
} }
@ -114,7 +114,7 @@ function open_block_preview(p_blockId, p_blockIndex) {
if (_preview_window != null && !_preview_window.closed) if (_preview_window != null && !_preview_window.closed)
_preview_window.playBlock(p_blockId, p_blockIndex); _preview_window.playBlock(p_blockId, p_blockIndex);
else else
openPreviewWindow(baseUrl+'/audiopreview/block-preview/blockIndex/'+p_blockIndex+'/blockId/'+p_blockId); openPreviewWindow(baseUrl+'audiopreview/block-preview/blockIndex/'+p_blockIndex+'/blockId/'+p_blockId);
_preview_window.focus(); _preview_window.focus();
} }
@ -128,7 +128,7 @@ function open_show_preview(p_showID, p_showIndex) {
if (_preview_window != null && !_preview_window.closed) if (_preview_window != null && !_preview_window.closed)
_preview_window.playAllShow(p_showID, p_showIndex); _preview_window.playAllShow(p_showID, p_showIndex);
else else
openPreviewWindow(baseUrl+'/audiopreview/show-preview/showID/'+p_showID+'/showIndex/'+p_showIndex); openPreviewWindow(baseUrl+'audiopreview/show-preview/showID/'+p_showID+'/showIndex/'+p_showIndex);
_preview_window.focus(); _preview_window.focus();
} }

View File

@ -360,7 +360,7 @@ function controlSwitchLight(){
} }
function getScheduleFromServer(){ function getScheduleFromServer(){
$.ajax({ url: baseUrl+"/Schedule/get-current-playlist/format/json", dataType:"json", success:function(data){ $.ajax({ url: baseUrl+"Schedule/get-current-playlist/format/json", dataType:"json", success:function(data){
parseItems(data.entries); parseItems(data.entries);
parseSourceStatus(data.source_status); parseSourceStatus(data.source_status);
parseSwitchStatus(data.switch_status); parseSwitchStatus(data.switch_status);
@ -398,7 +398,7 @@ function setSwitchListener(ele){
var sourcename = $(ele).attr('id'); var sourcename = $(ele).attr('id');
var status_span = $(ele).find("span"); var status_span = $(ele).find("span");
var status = status_span.html(); var status = status_span.html();
$.get(baseUrl+"/Dashboard/switch-source/format/json/sourcename/"+sourcename+"/status/"+status, function(data){ $.get(baseUrl+"Dashboard/switch-source/format/json/sourcename/"+sourcename+"/status/"+status, function(data){
if(data.error){ if(data.error){
alert(data.error); alert(data.error);
}else{ }else{
@ -415,7 +415,7 @@ function setSwitchListener(ele){
function kickSource(ele){ function kickSource(ele){
var sourcename = $(ele).attr('id'); var sourcename = $(ele).attr('id');
$.get(baseUrl+"/Dashboard/disconnect-source/format/json/sourcename/"+sourcename, function(data){ $.get(baseUrl+"Dashboard/disconnect-source/format/json/sourcename/"+sourcename, function(data){
if(data.error){ if(data.error){
alert(data.error); alert(data.error);
} }
@ -435,7 +435,7 @@ function init() {
$('.listen-control-button').click(function() { $('.listen-control-button').click(function() {
if (stream_window == null || stream_window.closed) if (stream_window == null || stream_window.closed)
stream_window=window.open(baseUrl+"/Dashboard/stream-player", 'name', 'width=400,height=158'); stream_window=window.open(baseUrl+"Dashboard/stream-player", 'name', 'width=400,height=158');
stream_window.focus(); stream_window.focus();
return false; return false;
}); });
@ -460,7 +460,7 @@ $(document).ready(function() {
$('#current-user').live('click', function() { $('#current-user').live('click', function() {
$.ajax({ $.ajax({
url: baseUrl+'/user/edit-user/format/json' url: baseUrl+'user/edit-user/format/json'
}); });
}); });

View File

@ -113,7 +113,7 @@ var AIRTIME = (function(AIRTIME) {
} }
if (aSchedIds.length == 0) { if (aSchedIds.length == 0) {
alert("Please select a cursor position on timeline."); alert($.i18n._("Please select a cursor position on timeline."));
return false; return false;
} }
console.log(aMediaIds); console.log(aMediaIds);

View File

@ -310,7 +310,7 @@ var AIRTIME = (function(AIRTIME) {
mod.fnDeleteItems = function(aMedia) { mod.fnDeleteItems = function(aMedia) {
$.post(baseUrl+"/library/delete", $.post(baseUrl+"library/delete",
{"format": "json", "media": aMedia}, {"format": "json", "media": aMedia},
function(json){ function(json){
if (json.message !== undefined) { if (json.message !== undefined) {
@ -481,7 +481,7 @@ var AIRTIME = (function(AIRTIME) {
"fnStateSave": function (oSettings, oData) { "fnStateSave": function (oSettings, oData) {
localStorage.setItem('datatables-library', JSON.stringify(oData)); localStorage.setItem('datatables-library', JSON.stringify(oData));
$.ajax({ $.ajax({
url: baseUrl+"/usersettings/set-library-datatable", url: baseUrl+"usersettings/set-library-datatable",
type: "POST", type: "POST",
data: {settings : oData, format: "json"}, data: {settings : oData, format: "json"},
dataType: "json" dataType: "json"
@ -522,7 +522,7 @@ var AIRTIME = (function(AIRTIME) {
oData.iCreate = parseInt(oData.iCreate, 10); oData.iCreate = parseInt(oData.iCreate, 10);
}, },
"sAjaxSource": baseUrl+"/Library/contents-feed", "sAjaxSource": baseUrl+"Library/contents-feed",
"sAjaxDataProp": "files", "sAjaxDataProp": "files",
"fnServerData": function ( sSource, aoData, fnCallback ) { "fnServerData": function ( sSource, aoData, fnCallback ) {
@ -615,7 +615,7 @@ var AIRTIME = (function(AIRTIME) {
text: aData.track_title text: aData.track_title
}, },
ajax: { ajax: {
url: baseUrl+"/Library/get-file-metadata", url: baseUrl+"Library/get-file-metadata",
type: "get", type: "get",
data: ({format: "html", id : aData.id, type: aData.ftype}), data: ({format: "html", id : aData.id, type: aData.ftype}),
success: function(data, status) { success: function(data, status) {
@ -800,13 +800,13 @@ var AIRTIME = (function(AIRTIME) {
}; };
} else if (data.ftype === "playlist" || data.ftype === "block") { } else if (data.ftype === "playlist" || data.ftype === "block") {
callback = function() { callback = function() {
var url = baseUrl+'/Playlist/edit'; var url = baseUrl+'Playlist/edit';
AIRTIME.playlist.fnEdit(data.id, data.ftype, url); AIRTIME.playlist.fnEdit(data.id, data.ftype, url);
AIRTIME.playlist.validatePlaylistElements(); AIRTIME.playlist.validatePlaylistElements();
}; };
} else if (data.ftype === "stream") { } else if (data.ftype === "stream") {
callback = function() { callback = function() {
var url = baseUrl+'/Webstream/edit'; var url = baseUrl+'Webstream/edit';
AIRTIME.playlist.fnEdit(data.id, data.ftype, url); AIRTIME.playlist.fnEdit(data.id, data.ftype, url);
} }
} else { } else {
@ -932,7 +932,7 @@ var AIRTIME = (function(AIRTIME) {
} }
request = $.ajax({ request = $.ajax({
url: baseUrl+"/library/context-menu", url: baseUrl+"library/context-menu",
type: "GET", type: "GET",
data: {id : data.id, type: data.ftype, format: "json", "screen": screen}, data: {id : data.id, type: data.ftype, format: "json", "screen": screen},
dataType: "json", dataType: "json",
@ -974,7 +974,7 @@ function closeDialog(event, ui) {
} }
function checkImportStatus() { function checkImportStatus() {
$.getJSON(baseUrl+'/Preference/is-import-in-progress', function(data){ $.getJSON(baseUrl+'Preference/is-import-in-progress', function(data){
var div = $('#import_status'); var div = $('#import_status');
var table = $('#library_display').dataTable(); var table = $('#library_display').dataTable();
if (data == true){ if (data == true){
@ -1006,7 +1006,7 @@ function addProgressIcon(id) {
} }
function checkLibrarySCUploadStatus(){ function checkLibrarySCUploadStatus(){
var url = baseUrl+'/Library/get-upload-to-soundcloud-status', var url = baseUrl+'Library/get-upload-to-soundcloud-status',
span, span,
id; id;
@ -1066,7 +1066,7 @@ function addQtipToSCIcons(){
content: { content: {
text: $.i18n._("Retrieving data from the server..."), text: $.i18n._("Retrieving data from the server..."),
ajax: { ajax: {
url: baseUrl+"/Library/get-upload-to-soundcloud-status", url: baseUrl+"Library/get-upload-to-soundcloud-status",
type: "post", type: "post",
data: ({format: "json", id : id, type: "file"}), data: ({format: "json", id : id, type: "file"}),
success: function(json, status){ success: function(json, status){
@ -1096,7 +1096,7 @@ function addQtipToSCIcons(){
content: { content: {
text: $.i18n._("Retreiving data from the server..."), text: $.i18n._("Retreiving data from the server..."),
ajax: { ajax: {
url: baseUrl+"/Library/get-upload-to-soundcloud-status", url: baseUrl+"Library/get-upload-to-soundcloud-status",
type: "post", type: "post",
data: ({format: "json", id : id, type: "file"}), data: ({format: "json", id : id, type: "file"}),
success: function(json, status){ success: function(json, status){
@ -1281,7 +1281,7 @@ $(document).ready(function() {
$('#editmdsave').live("click", function() { $('#editmdsave').live("click", function() {
var file_id = $('#file_id').val(), var file_id = $('#file_id').val(),
data = $("#edit-md-dialog form").serializeArray(); data = $("#edit-md-dialog form").serializeArray();
$.post(baseUrl+'/library/edit-file-md', {format: "json", id: file_id, data: data}, function() { $.post(baseUrl+'library/edit-file-md', {format: "json", id: file_id, data: data}, function() {
$("#edit-md-dialog").dialog().remove(); $("#edit-md-dialog").dialog().remove();
}); });
}); });

View File

@ -5,7 +5,7 @@ $(document).ready(function() {
$("#plupload_files").pluploadQueue({ $("#plupload_files").pluploadQueue({
// General settings // General settings
runtimes : 'gears, html5, html4', runtimes : 'gears, html5, html4',
url : baseUrl+'/Plupload/upload/format/json', url : baseUrl+'Plupload/upload/format/json',
chunk_size : '5mb', chunk_size : '5mb',
unique_names : 'true', unique_names : 'true',
multiple_queues : 'true', multiple_queues : 'true',
@ -28,7 +28,7 @@ $(document).ready(function() {
$("#plupload_error table").css("display", "inline-table"); $("#plupload_error table").css("display", "inline-table");
}else{ }else{
var tempFileName = j.tempfilepath; var tempFileName = j.tempfilepath;
$.get(baseUrl+'/Plupload/copyfile/format/json/name/'+ $.get(baseUrl+'Plupload/copyfile/format/json/name/'+
encodeURIComponent(file.name)+'/tempname/' + encodeURIComponent(file.name)+'/tempname/' +
encodeURIComponent(tempFileName), function(json){ encodeURIComponent(tempFileName), function(json){
var jr = jQuery.parseJSON(json); var jr = jQuery.parseJSON(json);

View File

@ -66,7 +66,7 @@ var AIRTIME = (function(AIRTIME){
event.stopPropagation(); event.stopPropagation();
var span = $(this), var span = $(this),
id = span.parent().attr("id").split("_").pop(), id = span.parent().attr("id").split("_").pop(),
url = baseUrl+"/Playlist/set-cue", url = baseUrl+"Playlist/set-cue",
cueIn = $.trim(span.text()), cueIn = $.trim(span.text()),
li = span.parents("li"), li = span.parents("li"),
unqid = li.attr("unqid"), unqid = li.attr("unqid"),
@ -74,7 +74,7 @@ var AIRTIME = (function(AIRTIME){
type = $('#obj_type').val(); type = $('#obj_type').val();
if (!isTimeValid(cueIn)){ if (!isTimeValid(cueIn)){
showError(span, $.i18n("please put in a time '00:00:00 (.0)'")); showError(span, $.i18n._("please put in a time '00:00:00 (.0)'"));
return; return;
} }
$.post(url, $.post(url,
@ -103,7 +103,7 @@ var AIRTIME = (function(AIRTIME){
event.stopPropagation(); event.stopPropagation();
var span = $(this), var span = $(this),
id = span.parent().attr("id").split("_").pop(), id = span.parent().attr("id").split("_").pop(),
url = baseUrl+"/Playlist/set-cue", url = baseUrl+"Playlist/set-cue",
cueOut = $.trim(span.text()), cueOut = $.trim(span.text()),
li = span.parents("li"), li = span.parents("li"),
unqid = li.attr("unqid"), unqid = li.attr("unqid"),
@ -111,7 +111,7 @@ var AIRTIME = (function(AIRTIME){
type = $('#obj_type').val(); type = $('#obj_type').val();
if (!isTimeValid(cueOut)){ if (!isTimeValid(cueOut)){
showError(span, $.i18n("please put in a time '00:00:00 (.0)'")); showError(span, $.i18n._("please put in a time '00:00:00 (.0)'"));
return; return;
} }
@ -142,7 +142,7 @@ var AIRTIME = (function(AIRTIME){
var span = $(this), var span = $(this),
id = span.parent().attr("id").split("_").pop(), id = span.parent().attr("id").split("_").pop(),
url = baseUrl+"/Playlist/set-fade", url = baseUrl+"Playlist/set-fade",
fadeIn = $.trim(span.text()), fadeIn = $.trim(span.text()),
li = span.parents("li"), li = span.parents("li"),
unqid = li.attr("unqid"), unqid = li.attr("unqid"),
@ -180,7 +180,7 @@ var AIRTIME = (function(AIRTIME){
var span = $(this), var span = $(this),
id = span.parent().attr("id").split("_").pop(), id = span.parent().attr("id").split("_").pop(),
url = baseUrl+"/Playlist/set-fade", url = baseUrl+"Playlist/set-fade",
fadeOut = $.trim(span.text()), fadeOut = $.trim(span.text()),
li = span.parents("li"), li = span.parents("li"),
unqid = li.attr("unqid"), unqid = li.attr("unqid"),
@ -265,7 +265,7 @@ var AIRTIME = (function(AIRTIME){
/* --until we decide whether Playlist name should autosave or not /* --until we decide whether Playlist name should autosave or not
url = baseUrl+'/Playlist/set-playlist-name'; url = baseUrl+'Playlist/set-playlist-name';
$.post(url, $.post(url,
{format: "json", name: nameElement.text(), modified: lastMod, type: type}, {format: "json", name: nameElement.text(), modified: lastMod, type: type},
@ -448,7 +448,7 @@ var AIRTIME = (function(AIRTIME){
var id = parseInt($(this).attr("id").split("_").pop(), 10); var id = parseInt($(this).attr("id").split("_").pop(), 10);
var blockId = parseInt($(this).attr("blockId"), 10); var blockId = parseInt($(this).attr("blockId"), 10);
if ($(this).hasClass('close')) { if ($(this).hasClass('close')) {
var sUrl = baseUrl+"/playlist/get-block-info"; var sUrl = baseUrl+"playlist/get-block-info";
mod.disableUI(); mod.disableUI();
$.post(sUrl, {format:"json", id:blockId}, function(json){ $.post(sUrl, {format:"json", id:blockId}, function(json){
$html = ""; $html = "";
@ -531,7 +531,7 @@ var AIRTIME = (function(AIRTIME){
else { else {
$(this).addClass("ui-state-active"); $(this).addClass("ui-state-active");
var url = baseUrl+'/Playlist/get-playlist-fades'; var url = baseUrl+'Playlist/get-playlist-fades';
$.post(url, $.post(url,
{format: "json", modified: lastMod, type: type}, {format: "json", modified: lastMod, type: type},
function(json){ function(json){
@ -568,7 +568,7 @@ var AIRTIME = (function(AIRTIME){
$pl.on("blur", "span.spl_main_fade_in", function(event){ $pl.on("blur", "span.spl_main_fade_in", function(event){
event.stopPropagation(); event.stopPropagation();
var url = baseUrl+"/Playlist/set-playlist-fades", var url = baseUrl+"Playlist/set-playlist-fades",
span = $(this), span = $(this),
fadeIn = $.trim(span.text()), fadeIn = $.trim(span.text()),
lastMod = getModified(), lastMod = getModified(),
@ -592,7 +592,7 @@ var AIRTIME = (function(AIRTIME){
$pl.on("blur", "span.spl_main_fade_out", function(event){ $pl.on("blur", "span.spl_main_fade_out", function(event){
event.stopPropagation(); event.stopPropagation();
var url = baseUrl+"/Playlist/set-playlist-fades", var url = baseUrl+"Playlist/set-playlist-fades",
span = $(this), span = $(this),
fadeOut = $.trim(span.text()), fadeOut = $.trim(span.text()),
lastMod = getModified(), lastMod = getModified(),
@ -641,7 +641,7 @@ var AIRTIME = (function(AIRTIME){
$pl.on("click", 'button[id="playlist_shuffle_button"]', function(){ $pl.on("click", 'button[id="playlist_shuffle_button"]', function(){
obj_id = $('input[id="obj_id"]').val(); obj_id = $('input[id="obj_id"]').val();
url = baseUrl+"/Playlist/shuffle"; url = baseUrl+"Playlist/shuffle";
enableLoadingIcon(); enableLoadingIcon();
$.post(url, {format: "json", obj_id: obj_id}, function(data){ $.post(url, {format: "json", obj_id: obj_id}, function(data){
var json = $.parseJSON(data) var json = $.parseJSON(data)
@ -674,7 +674,7 @@ var AIRTIME = (function(AIRTIME){
//hide any previous errors (if any) //hide any previous errors (if any)
$("#side_playlist .errors").empty().hide(); $("#side_playlist .errors").empty().hide();
var url = baseUrl+'/Webstream/save'; var url = baseUrl+'Webstream/save';
$.post(url, $.post(url,
{format: "json", id:id, description: description, url:streamurl, length: length, name: name}, {format: "json", id:id, description: description, url:streamurl, length: length, name: name},
function(json){ function(json){
@ -719,7 +719,7 @@ var AIRTIME = (function(AIRTIME){
var criteria = $('form').serializeArray(), var criteria = $('form').serializeArray(),
block_name = $('#playlist_name_display').text(), block_name = $('#playlist_name_display').text(),
block_desc = $('textarea[name="description"]').val(), block_desc = $('textarea[name="description"]').val(),
save_action = baseUrl+'/Playlist/save', save_action = baseUrl+'Playlist/save',
obj_id = $('input[id="obj_id"]').val(), obj_id = $('input[id="obj_id"]').val(),
obj_type = $('#obj_type').val(), obj_type = $('#obj_type').val(),
lastMod = getModified(), lastMod = getModified(),
@ -844,7 +844,7 @@ var AIRTIME = (function(AIRTIME){
} }
mod.fnNew = function() { mod.fnNew = function() {
var url = baseUrl+'/Playlist/new'; var url = baseUrl+'Playlist/new';
stopAudioPreview(); stopAudioPreview();
@ -857,7 +857,7 @@ var AIRTIME = (function(AIRTIME){
}; };
mod.fnWsNew = function() { mod.fnWsNew = function() {
var url = baseUrl+'/Webstream/new'; var url = baseUrl+'Webstream/new';
stopAudioPreview(); stopAudioPreview();
@ -871,7 +871,7 @@ var AIRTIME = (function(AIRTIME){
mod.fnNewBlock = function() { mod.fnNewBlock = function() {
var url = baseUrl+'/Playlist/new'; var url = baseUrl+'Playlist/new';
stopAudioPreview(); stopAudioPreview();
@ -902,7 +902,7 @@ var AIRTIME = (function(AIRTIME){
id = (plid === undefined) ? getId() : plid; id = (plid === undefined) ? getId() : plid;
lastMod = getModified(); lastMod = getModified();
type = $('#obj_type').val(); type = $('#obj_type').val();
url = baseUrl+'/Playlist/delete'; url = baseUrl+'Playlist/delete';
$.post(url, $.post(url,
{format: "json", ids: id, modified: lastMod, type: type}, {format: "json", ids: id, modified: lastMod, type: type},
@ -919,7 +919,7 @@ var AIRTIME = (function(AIRTIME){
id = (wsid === undefined) ? getId() : wsid; id = (wsid === undefined) ? getId() : wsid;
lastMod = getModified(); lastMod = getModified();
type = $('#obj_type').val(); type = $('#obj_type').val();
url = baseUrl+'/Webstream/delete'; url = baseUrl+'Webstream/delete';
$.post(url, $.post(url,
{format: "json", ids: id, modified: lastMod, type: type}, {format: "json", ids: id, modified: lastMod, type: type},
@ -992,20 +992,20 @@ var AIRTIME = (function(AIRTIME){
} }
mod.fnAddItems = function(aItems, iAfter, sAddType) { mod.fnAddItems = function(aItems, iAfter, sAddType) {
var sUrl = baseUrl+"/playlist/add-items"; var sUrl = baseUrl+"playlist/add-items";
oData = {"aItems": aItems, "afterItem": iAfter, "type": sAddType}; oData = {"aItems": aItems, "afterItem": iAfter, "type": sAddType};
playlistRequest(sUrl, oData); playlistRequest(sUrl, oData);
}; };
mod.fnMoveItems = function(aIds, iAfter) { mod.fnMoveItems = function(aIds, iAfter) {
var sUrl = baseUrl+"/playlist/move-items", var sUrl = baseUrl+"playlist/move-items",
oData = {"ids": aIds, "afterItem": iAfter}; oData = {"ids": aIds, "afterItem": iAfter};
playlistRequest(sUrl, oData); playlistRequest(sUrl, oData);
}; };
mod.fnDeleteItems = function(aItems) { mod.fnDeleteItems = function(aItems) {
var sUrl = baseUrl+"/playlist/delete-items", var sUrl = baseUrl+"playlist/delete-items",
oData = {"ids": aItems}; oData = {"ids": aItems};
playlistRequest(sUrl, oData); playlistRequest(sUrl, oData);

View File

@ -22,7 +22,7 @@ $(document).ready(function() {
function getDataAndPlot(startTimestamp, endTimestamp){ function getDataAndPlot(startTimestamp, endTimestamp){
// get data // get data
$.get(baseUrl+'/Listenerstat/get-data', {startTimestamp: startTimestamp, endTimestamp: endTimestamp}, function(data){ $.get(baseUrl+'Listenerstat/get-data', {startTimestamp: startTimestamp, endTimestamp: endTimestamp}, function(data){
data = JSON.parse(data); data = JSON.parse(data);
out = new Object(); out = new Object();
$.each(data, function(mpName, v){ $.each(data, function(mpName, v){
@ -177,4 +177,4 @@ function plot(datasets){
listenerstat_content.find(timeStartId).timepicker(oBaseTimePickerSettings); listenerstat_content.find(timeStartId).timepicker(oBaseTimePickerSettings);
listenerstat_content.find(dateEndId).datepicker(oBaseDatePickerSettings); listenerstat_content.find(dateEndId).datepicker(oBaseDatePickerSettings);
listenerstat_content.find(timeEndId).timepicker(oBaseTimePickerSettings); listenerstat_content.find(timeEndId).timepicker(oBaseTimePickerSettings);
} }

View File

@ -1,7 +1,7 @@
$(document).ready(function(){ $(document).ready(function(){
function doNotShowPopup(){ function doNotShowPopup(){
$.get(baseUrl+"/Usersettings/donotshowregistrationpopup", {format:"json"}); $.get(baseUrl+"Usersettings/donotshowregistrationpopup", {format:"json"});
} }
var dialog = $("#register_popup"); var dialog = $("#register_popup");
@ -19,7 +19,7 @@ $(document).ready(function(){
text: $.i18n._("Remind me in 1 week"), text: $.i18n._("Remind me in 1 week"),
"class": "btn", "class": "btn",
click: function() { click: function() {
var url = baseUrl+'/Usersettings/remindme'; var url = baseUrl+'Usersettings/remindme';
$.ajax({ $.ajax({
url: url, url: url,
data: {format:"json"} data: {format:"json"}
@ -32,7 +32,7 @@ $(document).ready(function(){
text: $.i18n._("Remind me never"), text: $.i18n._("Remind me never"),
"class": "btn", "class": "btn",
click: function() { click: function() {
var url =baseUrl+'/Usersettings/remindme-never'; var url =baseUrl+'Usersettings/remindme-never';
$.ajax({ $.ajax({
url: url, url: url,
data: {format:"json"} data: {format:"json"}

View File

@ -75,7 +75,7 @@ var AIRTIME = (function(AIRTIME) {
"bProcessing": true, "bProcessing": true,
"bServerSide": true, "bServerSide": true,
"sAjaxSource": baseUrl+"/Playouthistory/playout-history-feed", "sAjaxSource": baseUrl+"Playouthistory/playout-history-feed",
"sAjaxDataProp": "history", "sAjaxDataProp": "history",
"fnServerData": fnServerData, "fnServerData": fnServerData,
@ -92,7 +92,7 @@ var AIRTIME = (function(AIRTIME) {
"sDom": 'lf<"dt-process-rel"r><"H"T><"dataTables_scrolling"t><"F"ip>', "sDom": 'lf<"dt-process-rel"r><"H"T><"dataTables_scrolling"t><"F"ip>',
"oTableTools": { "oTableTools": {
"sSwfPath": baseUrl+"/js/datatables/plugin/TableTools/swf/copy_cvs_xls_pdf.swf", "sSwfPath": baseUrl+"js/datatables/plugin/TableTools/swf/copy_cvs_xls_pdf.swf",
"aButtons": [ "aButtons": [
{ {
"sExtends": "copy", "sExtends": "copy",
@ -111,7 +111,10 @@ var AIRTIME = (function(AIRTIME) {
"sExtends": "pdf", "sExtends": "pdf",
"fnClick": setFlashFileName "fnClick": setFlashFileName
}, },
"print" {
"sExtends": "print",
"sInfo" : sprintf($.i18n._("%sPrint view%sPlease use your browser's print function to print this table. Press escape when finished."), "<h6>", "</h6><p>")
}
] ]
} }
}); });

View File

@ -13,8 +13,8 @@ function setWatchedDirEvents() {
//knownPaths: [{text:'Desktop', image:'desktop.png', path:'/home'}], //knownPaths: [{text:'Desktop', image:'desktop.png', path:'/home'}],
knownPaths: [], knownPaths: [],
imageUrl: 'img/icons/', imageUrl: 'img/icons/',
systemImageUrl: baseUrl+'/css/img/', systemImageUrl: baseUrl+'css/img/',
handlerUrl: baseUrl+'/Preference/server-browse/format/json', handlerUrl: baseUrl+'Preference/server-browse/format/json',
title: $.i18n._('Choose Storage Folder'), title: $.i18n._('Choose Storage Folder'),
basePath: '', basePath: '',
requestMethod: 'POST', requestMethod: 'POST',
@ -33,8 +33,8 @@ function setWatchedDirEvents() {
//knownPaths: [{text:'Desktop', image:'desktop.png', path:'/home'}], //knownPaths: [{text:'Desktop', image:'desktop.png', path:'/home'}],
knownPaths: [], knownPaths: [],
imageUrl: 'img/icons/', imageUrl: 'img/icons/',
systemImageUrl: baseUrl+'/css/img/', systemImageUrl: baseUrl+'css/img/',
handlerUrl: baseUrl+'/Preference/server-browse/format/json', handlerUrl: baseUrl+'Preference/server-browse/format/json',
title: $.i18n._('Choose Folder to Watch'), title: $.i18n._('Choose Folder to Watch'),
basePath: '', basePath: '',
requestMethod: 'POST', requestMethod: 'POST',
@ -44,7 +44,7 @@ function setWatchedDirEvents() {
var url, chosen; var url, chosen;
if(confirm($.i18n._("Are you sure you want to change the storage folder?\nThis will remove the files from your Airtime library!"))){ if(confirm($.i18n._("Are you sure you want to change the storage folder?\nThis will remove the files from your Airtime library!"))){
url = baseUrl+"/Preference/change-stor-directory"; url = baseUrl+"Preference/change-stor-directory";
chosen = $('#storageFolder').val(); chosen = $('#storageFolder').val();
$.post(url, $.post(url,
@ -64,7 +64,7 @@ function setWatchedDirEvents() {
$('#watchedFolder-ok').click(function(){ $('#watchedFolder-ok').click(function(){
var url, chosen; var url, chosen;
url = baseUrl+"/Preference/reload-watch-directory"; url = baseUrl+"Preference/reload-watch-directory";
chosen = $('#watchedFolder').val(); chosen = $('#watchedFolder').val();
$.post(url, $.post(url,
@ -80,7 +80,7 @@ function setWatchedDirEvents() {
$('.selected-item').find('.ui-icon-refresh').click(function(){ $('.selected-item').find('.ui-icon-refresh').click(function(){
var folder = $(this).prev().text(); var folder = $(this).prev().text();
$.get(baseUrl+"/Preference/rescan-watch-directory", {format: "json", dir: folder}); $.get(baseUrl+"Preference/rescan-watch-directory", {format: "json", dir: folder});
}); });
$('.selected-item').find('.ui-icon-close').click(function(){ $('.selected-item').find('.ui-icon-close').click(function(){
@ -88,7 +88,7 @@ function setWatchedDirEvents() {
var row = $(this).parent(); var row = $(this).parent();
var folder = row.find('#folderPath').text(); var folder = row.find('#folderPath').text();
url = baseUrl+"/Preference/remove-watch-directory"; url = baseUrl+"Preference/remove-watch-directory";
$.post(url, $.post(url,
{format: "json", dir: folder}, {format: "json", dir: folder},

View File

@ -106,7 +106,7 @@ $(document).ready(function() {
$('#pref_save').live('click', function() { $('#pref_save').live('click', function() {
var data = $('#pref_form').serialize(); var data = $('#pref_form').serialize();
var url = baseUrl+'/Preference/index'; var url = baseUrl+'Preference/index';
$.post(url, {format: "json", data: data}, function(data){ $.post(url, {format: "json", data: data}, function(data){
var json = $.parseJSON(data); var json = $.parseJSON(data);

View File

@ -75,7 +75,7 @@ function showForIcecast(ele){
} }
function checkLiquidsoapStatus(){ function checkLiquidsoapStatus(){
var url = baseUrl+'/Preference/get-liquidsoap-status/format/json'; var url = baseUrl+'Preference/get-liquidsoap-status/format/json';
var id = $(this).attr("id"); var id = $(this).attr("id");
$.post(url, function(json){ $.post(url, function(json){
var json_obj = jQuery.parseJSON(json); var json_obj = jQuery.parseJSON(json);
@ -127,7 +127,7 @@ function setLiveSourceConnectionOverrideListener(){
live_dj_input.val(url) live_dj_input.val(url)
live_dj_input.attr("readonly", "readonly") live_dj_input.attr("readonly", "readonly")
live_dj_actions.hide() live_dj_actions.hide()
$.get(baseUrl+"/Preference/set-source-connection-url/", {format: "json", type: "livedj", url:encodeURIComponent(url), override: 1}); $.get(baseUrl+"Preference/set-source-connection-url/", {format: "json", type: "livedj", url:encodeURIComponent(url), override: 1});
event.preventDefault() event.preventDefault()
}) })
@ -142,7 +142,7 @@ function setLiveSourceConnectionOverrideListener(){
live_dj_input.val(url) live_dj_input.val(url)
live_dj_input.attr("readonly", "readonly") live_dj_input.attr("readonly", "readonly")
live_dj_actions.hide() live_dj_actions.hide()
$.get(baseUrl+"/Preference/set-source-connection-url", {format: "json", type: "livedj", url:encodeURIComponent(url), override: 0}); $.get(baseUrl+"Preference/set-source-connection-url", {format: "json", type: "livedj", url:encodeURIComponent(url), override: 0});
event.preventDefault() event.preventDefault()
}) })
@ -151,7 +151,7 @@ function setLiveSourceConnectionOverrideListener(){
master_dj_input.val(url) master_dj_input.val(url)
master_dj_input.attr("readonly", "readonly") master_dj_input.attr("readonly", "readonly")
master_dj_actions.hide() master_dj_actions.hide()
$.get(baseUrl+"/Preference/set-source-connection-url", {format: "json", type: "masterdj", url:encodeURIComponent(url), override: 1}) $.get(baseUrl+"Preference/set-source-connection-url", {format: "json", type: "masterdj", url:encodeURIComponent(url), override: 1})
event.preventDefault() event.preventDefault()
}) })
@ -165,7 +165,7 @@ function setLiveSourceConnectionOverrideListener(){
master_dj_input.val(url) master_dj_input.val(url)
master_dj_input.attr("readonly", "readonly") master_dj_input.attr("readonly", "readonly")
master_dj_actions.hide() master_dj_actions.hide()
$.get(baseUrl+"/Preference/set-source-connection-url", {format: "json", type: "masterdj", url:encodeURIComponent(url), override: 0}) $.get(baseUrl+"Preference/set-source-connection-url", {format: "json", type: "masterdj", url:encodeURIComponent(url), override: 0})
event.preventDefault() event.preventDefault()
}) })
} }
@ -420,7 +420,7 @@ $(document).ready(function() {
var confirm_pypo_restart_text = $.i18n._("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."); var confirm_pypo_restart_text = $.i18n._("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 (confirm(confirm_pypo_restart_text)) { if (confirm(confirm_pypo_restart_text)) {
var data = $('#stream_form').serialize(); var data = $('#stream_form').serialize();
var url = baseUrl+'/Preference/stream-setting'; var url = baseUrl+'Preference/stream-setting';
$.post(url, {format:"json", data: data}, function(data){ $.post(url, {format:"json", data: data}, function(data){
var json = $.parseJSON(data); var json = $.parseJSON(data);

View File

@ -50,7 +50,7 @@ function autoSelect(event, ui) {
function findHosts(request, callback) { function findHosts(request, callback) {
var search, url; var search, url;
url = baseUrl+"/User/get-hosts"; url = baseUrl+"User/get-hosts";
search = request.term; search = request.term;
var noResult = new Array(); var noResult = new Array();
@ -410,7 +410,7 @@ function setAddShowEvents() {
.fullCalendar('render'); .fullCalendar('render');
$("#add-show-form").hide(); $("#add-show-form").hide();
$.get(baseUrl+"/Schedule/get-form", {format:"json"}, function(json){ $.get(baseUrl+"Schedule/get-form", {format:"json"}, function(json){
$("#add-show-form") $("#add-show-form")
.empty() .empty()
.append(json.form); .append(json.form);
@ -456,7 +456,7 @@ function setAddShowEvents() {
applyPlatformOpacityRules: false applyPlatformOpacityRules: false
}); });
var action = baseUrl+"/Schedule/"+String(addShowButton.attr("data-action")); var action = baseUrl+"Schedule/"+String(addShowButton.attr("data-action"));
$.post(action, {format: "json", data: data, hosts: hosts, days: days}, function(json){ $.post(action, {format: "json", data: data, hosts: hosts, days: days}, function(json){
//addShowButton.removeClass("disabled"); //addShowButton.removeClass("disabled");
@ -476,7 +476,7 @@ function setAddShowEvents() {
.fullCalendar('render'); .fullCalendar('render');
$("#add-show-form").hide(); $("#add-show-form").hide();
$.get(baseUrl+"/Schedule/get-form", {format:"json"}, function(json){ $.get(baseUrl+"Schedule/get-form", {format:"json"}, function(json){
$("#add-show-form") $("#add-show-form")
.empty() .empty()
.append(json.form); .append(json.form);
@ -592,7 +592,7 @@ function setAddShowEvents() {
var loadingIcon = $('#icon-loader-small'); var loadingIcon = $('#icon-loader-small');
loadingIcon.show(); loadingIcon.show();
$.post(baseUrl+"/Schedule/calculate-duration", {startTime: startDateTime, endTime: endDateTime}, function(data){ $.post(baseUrl+"Schedule/calculate-duration", {startTime: startDateTime, endTime: endDateTime}, function(data){
$('#add_show_duration').val(JSON.parse(data)); $('#add_show_duration').val(JSON.parse(data));
loadingIcon.hide(); loadingIcon.hide();
}); });

View File

@ -176,7 +176,7 @@ function viewDisplay( view ) {
.fullCalendar( 'gotoDate', date ); .fullCalendar( 'gotoDate', date );
//save slotMin value to db //save slotMin value to db
var url = baseUrl+'/Schedule/set-time-interval/format/json'; var url = baseUrl+'Schedule/set-time-interval/format/json';
$.post(url, {timeInterval: slotMin}); $.post(url, {timeInterval: slotMin});
}); });
@ -201,7 +201,7 @@ function viewDisplay( view ) {
} }
//save view name to db //save view name to db
var url = baseUrl+'/Schedule/set-time-scale/format/json'; var url = baseUrl+'Schedule/set-time-scale/format/json';
$.post(url, {timeScale: view.name}); $.post(url, {timeScale: view.name});
} }
@ -293,7 +293,7 @@ function eventAfterRender( event, element, view ) {
} }
function eventDrop(event, dayDelta, minuteDelta, allDay, revertFunc, jsEvent, ui, view) { function eventDrop(event, dayDelta, minuteDelta, allDay, revertFunc, jsEvent, ui, view) {
var url = baseUrl+'/Schedule/move-show/format/json'; var url = baseUrl+'Schedule/move-show/format/json';
$.post(url, $.post(url,
{day: dayDelta, min: minuteDelta, showInstanceId: event.id}, {day: dayDelta, min: minuteDelta, showInstanceId: event.id},
@ -309,7 +309,7 @@ function eventDrop(event, dayDelta, minuteDelta, allDay, revertFunc, jsEvent, ui
} }
function eventResize( event, dayDelta, minuteDelta, revertFunc, jsEvent, ui, view ) { function eventResize( event, dayDelta, minuteDelta, revertFunc, jsEvent, ui, view ) {
var url = baseUrl+'/Schedule/resize-show/format/json'; var url = baseUrl+'Schedule/resize-show/format/json';
$.post(url, $.post(url,
{day: dayDelta, min: minuteDelta, showId: event.showId}, {day: dayDelta, min: minuteDelta, showId: event.showId},
@ -332,7 +332,7 @@ function getFullCalendarEvents(start, end, callback) {
start_date = makeTimeStamp(start); start_date = makeTimeStamp(start);
end_date = makeTimeStamp(end); end_date = makeTimeStamp(end);
url = baseUrl+'/Schedule/event-feed'; url = baseUrl+'Schedule/event-feed';
var d = new Date(); var d = new Date();
@ -342,7 +342,7 @@ function getFullCalendarEvents(start, end, callback) {
} }
function checkSCUploadStatus(){ function checkSCUploadStatus(){
var url = baseUrl+'/Library/get-upload-to-soundcloud-status/format/json'; var url = baseUrl+'Library/get-upload-to-soundcloud-status/format/json';
$("span[class*=progress]").each(function(){ $("span[class*=progress]").each(function(){
var id = $(this).attr("id"); var id = $(this).attr("id");
$.post(url, {format: "json", id: id, type:"show"}, function(json){ $.post(url, {format: "json", id: id, type:"show"}, function(json){
@ -358,7 +358,7 @@ function checkSCUploadStatus(){
* show icon * show icon
*/ */
function getCurrentShow(){ function getCurrentShow(){
var url = baseUrl+'/Schedule/get-current-show/format/json', var url = baseUrl+'Schedule/get-current-show/format/json',
id, id,
$el; $el;
$.post(url, {format: "json"}, function(json) { $.post(url, {format: "json"}, function(json) {
@ -436,7 +436,7 @@ function addQtipsToIcons(ele){
content: { content: {
text: $.i18n._("Retreiving data from the server..."), text: $.i18n._("Retreiving data from the server..."),
ajax: { ajax: {
url: baseUrl+"/Library/get-upload-to-soundcloud-status", url: baseUrl+"Library/get-upload-to-soundcloud-status",
type: "post", type: "post",
data: ({format: "json", id : id, type: "show"}), data: ({format: "json", id : id, type: "show"}),
success: function(json, status){ success: function(json, status){
@ -465,7 +465,7 @@ function addQtipsToIcons(ele){
content: { content: {
text: $.i18n._("Retreiving data from the server..."), text: $.i18n._("Retreiving data from the server..."),
ajax: { ajax: {
url: baseUrl+"/Library/get-upload-to-soundcloud-status", url: baseUrl+"Library/get-upload-to-soundcloud-status",
type: "post", type: "post",
data: ({format: "json", id : id, type: "show"}), data: ({format: "json", id : id, type: "show"}),
success: function(json, status){ success: function(json, status){

View File

@ -34,7 +34,7 @@ function checkShowLength(json) {
function confirmCancelShow(show_instance_id){ function confirmCancelShow(show_instance_id){
if (confirm($.i18n._('Cancel Current Show?'))) { if (confirm($.i18n._('Cancel Current Show?'))) {
var url = baseUrl+"/Schedule/cancel-current-show"; var url = baseUrl+"Schedule/cancel-current-show";
$.ajax({ $.ajax({
url: url, url: url,
data: {format: "json", id: show_instance_id}, data: {format: "json", id: show_instance_id},
@ -47,7 +47,7 @@ function confirmCancelShow(show_instance_id){
function confirmCancelRecordedShow(show_instance_id){ function confirmCancelRecordedShow(show_instance_id){
if (confirm($.i18n._('Stop recording current show?'))) { if (confirm($.i18n._('Stop recording current show?'))) {
var url = baseUrl+"/Schedule/cancel-current-show"; var url = baseUrl+"Schedule/cancel-current-show";
$.ajax({ $.ajax({
url: url, url: url,
data: {format: "json", id: show_instance_id}, data: {format: "json", id: show_instance_id},
@ -60,7 +60,7 @@ function confirmCancelRecordedShow(show_instance_id){
function uploadToSoundCloud(show_instance_id){ function uploadToSoundCloud(show_instance_id){
var url = baseUrl+"/Schedule/upload-to-sound-cloud"; var url = baseUrl+"Schedule/upload-to-sound-cloud";
var span = $(window.triggerElement).find(".recording"); var span = $(window.triggerElement).find(".recording");
$.post(url, $.post(url,
@ -80,7 +80,7 @@ function uploadToSoundCloud(show_instance_id){
} }
function checkCalendarSCUploadStatus(){ function checkCalendarSCUploadStatus(){
var url = baseUrl+'/Library/get-upload-to-soundcloud-status', var url = baseUrl+'Library/get-upload-to-soundcloud-status',
span, span,
id; id;
@ -328,7 +328,7 @@ function alertShowErrorAndReload(){
} }
$(document).ready(function() { $(document).ready(function() {
$.ajax({ url: baseUrl+"/Api/calendar-init/format/json", dataType:"json", success:createFullCalendar $.ajax({ url: baseUrl+"Api/calendar-init/format/json", dataType:"json", success:createFullCalendar
, error:function(jqXHR, textStatus, errorThrown){}}); , error:function(jqXHR, textStatus, errorThrown){}});
setInterval(checkCalendarSCUploadStatus, 5000); setInterval(checkCalendarSCUploadStatus, 5000);
@ -498,7 +498,7 @@ $(document).ready(function() {
} }
$.ajax({ $.ajax({
url: baseUrl+"/schedule/make-context-menu", url: baseUrl+"schedule/make-context-menu",
type: "GET", type: "GET",
data: {id : data.id, format: "json"}, data: {id : data.id, format: "json"},
dataType: "json", dataType: "json",

View File

@ -41,10 +41,12 @@ var AIRTIME = (function(AIRTIME){
mod.updateCalendarStatusIcon = function(json) { mod.updateCalendarStatusIcon = function(json) {
if (window.location.pathname.toLowerCase() != "/schedule") {
if (window.location.pathname.toLowerCase() != baseUrl+"schedule") {
return; return;
} }
var instance_id = json.schedule[0].instance; var instance_id = json.schedule[0].instance;
var lastElem = json.schedule[json.schedule.length-1]; var lastElem = json.schedule[json.schedule.length-1];
@ -286,7 +288,7 @@ var AIRTIME = (function(AIRTIME){
mod.disableUI(); mod.disableUI();
$.post(baseUrl+"/showbuilder/schedule-add", $.post(baseUrl+"showbuilder/schedule-add",
{"format": "json", "mediaIds": aMediaIds, "schedIds": aSchedIds}, {"format": "json", "mediaIds": aMediaIds, "schedIds": aSchedIds},
mod.fnItemCallback mod.fnItemCallback
); );
@ -296,7 +298,7 @@ var AIRTIME = (function(AIRTIME){
mod.disableUI(); mod.disableUI();
$.post(baseUrl+"/showbuilder/schedule-move", $.post(baseUrl+"showbuilder/schedule-move",
{"format": "json", "selectedItem": aSelect, "afterItem": aAfter}, {"format": "json", "selectedItem": aSelect, "afterItem": aAfter},
mod.fnItemCallback mod.fnItemCallback
); );
@ -306,7 +308,7 @@ var AIRTIME = (function(AIRTIME){
mod.disableUI(); mod.disableUI();
if (confirm($.i18n._("Delete selected item(s)?"))) { if (confirm($.i18n._("Delete selected item(s)?"))) {
$.post( baseUrl+"/showbuilder/schedule-remove", $.post( baseUrl+"showbuilder/schedule-remove",
{"items": aItems, "format": "json"}, {"items": aItems, "format": "json"},
mod.fnItemCallback mod.fnItemCallback
); );
@ -415,7 +417,7 @@ var AIRTIME = (function(AIRTIME){
localStorage.setItem('datatables-timeline', JSON.stringify(oData)); localStorage.setItem('datatables-timeline', JSON.stringify(oData));
$.ajax({ $.ajax({
url: baseUrl+"/usersettings/set-timeline-datatable", url: baseUrl+"usersettings/set-timeline-datatable",
type: "POST", type: "POST",
data: {settings : oData, format: "json"}, data: {settings : oData, format: "json"},
dataType: "json" dataType: "json"
@ -577,7 +579,7 @@ var AIRTIME = (function(AIRTIME){
if (!isAudioSupported(aData.mime)) { if (!isAudioSupported(aData.mime)) {
$image.html('<span class="ui-icon ui-icon-locked"></span>'); $image.html('<span class="ui-icon ui-icon-locked"></span>');
} else { } else {
$image.html('<img title="'+$.i18n._("Track preview")+'" src="'+baseUrl+'/css/images/icon_audioclip.png"></img>') $image.html('<img title="'+$.i18n._("Track preview")+'" src="'+baseUrl+'css/images/icon_audioclip.png"></img>')
.click(function() { .click(function() {
open_show_preview(aData.instance, aData.pos); open_show_preview(aData.instance, aData.pos);
return false; return false;
@ -815,7 +817,7 @@ var AIRTIME = (function(AIRTIME){
"sAjaxDataProp": "schedule", "sAjaxDataProp": "schedule",
"oLanguage": datatables_dict, "oLanguage": datatables_dict,
"sAjaxSource": baseUrl+"/showbuilder/builder-feed" "sAjaxSource": baseUrl+"showbuilder/builder-feed"
}); });
$sbTable.find("tbody").on("click", "input:checkbox", function(ev) { $sbTable.find("tbody").on("click", "input:checkbox", function(ev) {
@ -1059,7 +1061,7 @@ var AIRTIME = (function(AIRTIME){
} }
if (confirm(msg)) { if (confirm(msg)) {
var url = baseUrl+"/Schedule/cancel-current-show"; var url = baseUrl+"Schedule/cancel-current-show";
$.ajax({ $.ajax({
url: url, url: url,
data: {format: "json", id: data.instance}, data: {format: "json", id: data.instance},
@ -1241,7 +1243,7 @@ var AIRTIME = (function(AIRTIME){
} }
request = $.ajax({ request = $.ajax({
url: baseUrl+"/showbuilder/context-menu", url: baseUrl+"showbuilder/context-menu",
type: "GET", type: "GET",
data: {id : data.id, format: "json"}, data: {id : data.id, format: "json"},
dataType: "json", dataType: "json",

View File

@ -171,7 +171,7 @@ AIRTIME = (function(AIRTIME) {
schedTable.fnDraw(); schedTable.fnDraw();
$.ajax( { $.ajax( {
url : baseUrl+"/usersettings/set-now-playing-screen-settings", url : baseUrl+"usersettings/set-now-playing-screen-settings",
type : "POST", type : "POST",
data : { data : {
settings : { settings : {
@ -197,7 +197,7 @@ AIRTIME = (function(AIRTIME) {
schedTable.fnDraw(); schedTable.fnDraw();
$.ajax( { $.ajax( {
url : baseUrl+"/usersettings/set-now-playing-screen-settings", url : baseUrl+"usersettings/set-now-playing-screen-settings",
type : "POST", type : "POST",
data : { data : {
settings : { settings : {
@ -271,7 +271,7 @@ AIRTIME = (function(AIRTIME) {
$.ajax( { $.ajax( {
"dataType" : "json", "dataType" : "json",
"type" : "GET", "type" : "GET",
"url" : baseUrl+"/showbuilder/check-builder-feed", "url" : baseUrl+"showbuilder/check-builder-feed",
"data" : data, "data" : data,
"success" : function(json) { "success" : function(json) {
if (json.update === true) { if (json.update === true) {

View File

@ -69,7 +69,7 @@ function success(data, textStatus, jqXHR){
} }
function updateStatus(getDiskInfo){ function updateStatus(getDiskInfo){
$.getJSON( baseUrl+"/api/status/format/json/diskinfo/"+getDiskInfo, null, success); $.getJSON( baseUrl+"api/status/format/json/diskinfo/"+getDiskInfo, null, success);
} }

View File

@ -26,13 +26,13 @@ function populateForm(entries){
} }
function rowClickCallback(row_id){ function rowClickCallback(row_id){
$.ajax({ url: baseUrl+'/User/get-user-data/id/'+ row_id +'/format/json', dataType:"json", success:function(data){ $.ajax({ url: baseUrl+'User/get-user-data/id/'+ row_id +'/format/json', dataType:"json", success:function(data){
populateForm(data.entries); populateForm(data.entries);
}}); }});
} }
function removeUserCallback(row_id, nRow){ function removeUserCallback(row_id, nRow){
$.ajax({ url: baseUrl+'/User/remove-user/id/'+ row_id +'/format/json', dataType:"text", success:function(data){ $.ajax({ url: baseUrl+'User/remove-user/id/'+ row_id +'/format/json', dataType:"text", success:function(data){
var o = $('#users_datatable').dataTable().fnDeleteRow(nRow); var o = $('#users_datatable').dataTable().fnDeleteRow(nRow);
}}); }});
} }
@ -66,7 +66,7 @@ function populateUserTable() {
$('#users_datatable').dataTable( { $('#users_datatable').dataTable( {
"bProcessing": true, "bProcessing": true,
"bServerSide": true, "bServerSide": true,
"sAjaxSource": baseUrl+"/User/get-user-data-table-info/format/json", "sAjaxSource": baseUrl+"User/get-user-data-table-info/format/json",
"fnServerData": function ( sSource, aoData, fnCallback ) { "fnServerData": function ( sSource, aoData, fnCallback ) {
$.ajax( { $.ajax( {
"dataType": 'json', "dataType": 'json',
@ -187,7 +187,7 @@ $(document).ready(function() {
$('#save_user').live('click', function(){ $('#save_user').live('click', function(){
var data = $('#user_form').serialize(); var data = $('#user_form').serialize();
var url = baseUrl+'/User/add-user'; var url = baseUrl+'User/add-user';
$.post(url, {format: "json", data: data}, function(data){ $.post(url, {format: "json", data: data}, function(data){
var json = $.parseJSON(data); var json = $.parseJSON(data);

View File

@ -78,6 +78,10 @@ else
echo "NGINX config for Airtime already exists..." echo "NGINX config for Airtime already exists..."
fi fi
#Install Sourcefabric's custom Liquidsoap debian package
apt-get -y --force-yes install sourcefabric-keyring
apt-get -y --force-yes install liquidsoap
# php-fpm Airtime pool file # php-fpm Airtime pool file
echo "----------------------------------------------------" echo "----------------------------------------------------"
echo "2.2 Airtime php pool file" echo "2.2 Airtime php pool file"

View File

@ -126,7 +126,7 @@ class AirtimeInstall
*/ */
public static function DbConnect($p_exitOnError = true) public static function DbConnect($p_exitOnError = true)
{ {
global $CC_CONFIG; $CC_CONFIG = Config::getConfig();
try { try {
$con = Propel::getConnection(); $con = Propel::getConnection();
} catch (Exception $e) { } catch (Exception $e) {
@ -147,7 +147,7 @@ class AirtimeInstall
* install script. */ * install script. */
public static function InstallStorageDirectory() public static function InstallStorageDirectory()
{ {
global $CC_CONFIG; $CC_CONFIG = Config::getConfig();
echo "* Storage directory setup".PHP_EOL; echo "* Storage directory setup".PHP_EOL;
$ini = parse_ini_file(__DIR__."/airtime-install.ini"); $ini = parse_ini_file(__DIR__."/airtime-install.ini");
@ -183,7 +183,7 @@ class AirtimeInstall
public static function CreateDatabaseUser() public static function CreateDatabaseUser()
{ {
global $CC_CONFIG; $CC_CONFIG = Config::getConfig();
echo " * Creating Airtime database user".PHP_EOL; echo " * Creating Airtime database user".PHP_EOL;
@ -208,7 +208,7 @@ class AirtimeInstall
public static function CreateDatabase() public static function CreateDatabase()
{ {
global $CC_CONFIG; $CC_CONFIG = Config::getConfig();
echo " * Creating Airtime database".PHP_EOL; echo " * Creating Airtime database".PHP_EOL;
@ -412,7 +412,7 @@ class AirtimeInstall
public static function InstallPhpCode() public static function InstallPhpCode()
{ {
global $CC_CONFIG; $CC_CONFIG = Config::getConfig();
echo "* Installing PHP code to ".AirtimeInstall::CONF_DIR_WWW.PHP_EOL; echo "* Installing PHP code to ".AirtimeInstall::CONF_DIR_WWW.PHP_EOL;
exec("mkdir -p ".AirtimeInstall::CONF_DIR_WWW); exec("mkdir -p ".AirtimeInstall::CONF_DIR_WWW);
exec("cp -R ".AirtimeInstall::GetAirtimeSrcDir()."/* ".AirtimeInstall::CONF_DIR_WWW); exec("cp -R ".AirtimeInstall::GetAirtimeSrcDir()."/* ".AirtimeInstall::CONF_DIR_WWW);
@ -461,7 +461,7 @@ class AirtimeInstall
} }
public static function CreateZendPhpLogFile(){ public static function CreateZendPhpLogFile(){
global $CC_CONFIG; $CC_CONFIG = Config::getConfig();
$path = AirtimeInstall::CONF_DIR_LOG; $path = AirtimeInstall::CONF_DIR_LOG;
$file = $path.'/zendphp.log'; $file = $path.'/zendphp.log';

View File

@ -10,6 +10,8 @@ require_once(__DIR__.'/AirtimeInstall.php');
require_once(__DIR__.'/airtime-constants.php'); require_once(__DIR__.'/airtime-constants.php');
require_once(AirtimeInstall::GetAirtimeSrcDir().'/application/configs/conf.php'); require_once(AirtimeInstall::GetAirtimeSrcDir().'/application/configs/conf.php');
Config::loadConfig();
$CC_CONFIG = Config::getConfig();
require_once 'propel/runtime/lib/Propel.php'; require_once 'propel/runtime/lib/Propel.php';
Propel::init(AirtimeInstall::GetAirtimeSrcDir()."/application/configs/airtime-conf-production.php"); Propel::init(AirtimeInstall::GetAirtimeSrcDir()."/application/configs/airtime-conf-production.php");
@ -24,7 +26,6 @@ AirtimeInstall::DbConnect(true);
AirtimeInstall::InstallPostgresScriptingLanguage(); AirtimeInstall::InstallPostgresScriptingLanguage();
//Load Database parameters //Load Database parameters
global $CC_CONFIG;
$dbuser = $CC_CONFIG['dsn']['username']; $dbuser = $CC_CONFIG['dsn']['username'];
$dbpasswd = $CC_CONFIG['dsn']['password']; $dbpasswd = $CC_CONFIG['dsn']['password'];
$dbname = $CC_CONFIG['dsn']['database']; $dbname = $CC_CONFIG['dsn']['database'];

View File

@ -16,6 +16,8 @@ $iniExists = file_exists("/etc/airtime/airtime.conf");
if ($iniExists){ if ($iniExists){
//reinstall, Will ask if we should rewrite config files. //reinstall, Will ask if we should rewrite config files.
require_once(AirtimeInstall::GetAirtimeSrcDir().'/application/configs/conf.php'); require_once(AirtimeInstall::GetAirtimeSrcDir().'/application/configs/conf.php');
Config::loadConfig();
$CC_CONFIG = Config::getConfig();
require_once 'propel/runtime/lib/Propel.php'; require_once 'propel/runtime/lib/Propel.php';
Propel::init(AirtimeInstall::GetAirtimeSrcDir()."/application/configs/airtime-conf-production.php"); Propel::init(AirtimeInstall::GetAirtimeSrcDir()."/application/configs/airtime-conf-production.php");
$version = AirtimeInstall::GetVersionInstalled(); $version = AirtimeInstall::GetVersionInstalled();
@ -51,6 +53,8 @@ if ($overwrite) {
} }
if (!$iniExists){ if (!$iniExists){
require_once(AirtimeInstall::GetAirtimeSrcDir().'/application/configs/conf.php'); require_once(AirtimeInstall::GetAirtimeSrcDir().'/application/configs/conf.php');
Config::loadConfig();
$CC_CONFIG = Config::getConfig();
require_once 'propel/runtime/lib/Propel.php'; require_once 'propel/runtime/lib/Propel.php';
Propel::init(AirtimeInstall::GetAirtimeSrcDir()."/application/configs/airtime-conf-production.php"); Propel::init(AirtimeInstall::GetAirtimeSrcDir()."/application/configs/airtime-conf-production.php");
} }

View File

@ -17,6 +17,8 @@ if (!file_exists(AirtimeIni::CONF_FILE_AIRTIME)) {
} }
require_once(__DIR__.'/airtime-constants.php'); require_once(__DIR__.'/airtime-constants.php');
require_once(AirtimeInstall::GetAirtimeSrcDir().'/application/configs/conf.php'); require_once(AirtimeInstall::GetAirtimeSrcDir().'/application/configs/conf.php');
Config::loadConfig();
$CC_CONFIG = Config::getConfig();
require_once 'propel/runtime/lib/Propel.php'; require_once 'propel/runtime/lib/Propel.php';
@ -37,6 +39,7 @@ $sql = "SELECT pg_cancel_backend(procpid) FROM pg_stat_activity WHERE datname =
$command = "echo \"$sql\" | su postgres -c psql"; $command = "echo \"$sql\" | su postgres -c psql";
@exec($command, $output); @exec($command, $output);
$CC_CONFIG = Config::getConfig();
echo " * Dropping the database '".$CC_CONFIG["dsn"]["database"]."'...".PHP_EOL; echo " * Dropping the database '".$CC_CONFIG["dsn"]["database"]."'...".PHP_EOL;
//dropdb returns 1 if other sessions are using the database, otherwise returns 0 //dropdb returns 1 if other sessions are using the database, otherwise returns 0

View File

@ -36,7 +36,7 @@ $version = AirtimeInstall::GetVersionInstalled();
echo "******************************** Upgrade Begin *********************************".PHP_EOL; echo "******************************** Upgrade Begin *********************************".PHP_EOL;
global $CC_CONFIG; $CC_CONFIG = Config::getConfig();
$user = $CC_CONFIG['dsn']['username']; $user = $CC_CONFIG['dsn']['username'];
$password = $CC_CONFIG['dsn']['password']; $password = $CC_CONFIG['dsn']['password'];
$host = $CC_CONFIG['dsn']['hostspec']; $host = $CC_CONFIG['dsn']['hostspec'];
@ -83,11 +83,11 @@ if (strcmp($version, "2.0.3") < 0) {
if (strcmp($version, "2.1.0") < 0) { if (strcmp($version, "2.1.0") < 0) {
passthru("php --php-ini $SCRIPTPATH/../airtime-php.ini $SCRIPTPATH/../upgrades/airtime-2.1.0/airtime-upgrade.php"); passthru("php --php-ini $SCRIPTPATH/../airtime-php.ini $SCRIPTPATH/../upgrades/airtime-2.1.0/airtime-upgrade.php");
pause(); pause();
} }
if (strcmp($version, "2.1.1") < 0) { if (strcmp($version, "2.1.1") < 0) {
passthru("php --php-ini $SCRIPTPATH/../airtime-php.ini $SCRIPTPATH/../upgrades/airtime-2.1.1/airtime-upgrade.php"); passthru("php --php-ini $SCRIPTPATH/../airtime-php.ini $SCRIPTPATH/../upgrades/airtime-2.1.1/airtime-upgrade.php");
pause(); pause();
} }
if (strcmp($version, "2.1.2") < 0) { if (strcmp($version, "2.1.2") < 0) {
passthru("php --php-ini $SCRIPTPATH/../airtime-php.ini $SCRIPTPATH/../upgrades/airtime-2.1.2/airtime-upgrade.php"); passthru("php --php-ini $SCRIPTPATH/../airtime-php.ini $SCRIPTPATH/../upgrades/airtime-2.1.2/airtime-upgrade.php");
pause(); pause();
@ -95,11 +95,11 @@ if (strcmp($version, "2.1.2") < 0) {
if (strcmp($version, "2.1.3") < 0) { if (strcmp($version, "2.1.3") < 0) {
passthru("php --php-ini $SCRIPTPATH/../airtime-php.ini $SCRIPTPATH/../upgrades/airtime-2.1.3/airtime-upgrade.php"); passthru("php --php-ini $SCRIPTPATH/../airtime-php.ini $SCRIPTPATH/../upgrades/airtime-2.1.3/airtime-upgrade.php");
pause(); pause();
} }
if (strcmp($version, "2.2.0") < 0) { if (strcmp($version, "2.2.0") < 0) {
passthru("php --php-ini $SCRIPTPATH/../airtime-php.ini $SCRIPTPATH/../upgrades/airtime-2.2.0/airtime-upgrade.php"); passthru("php --php-ini $SCRIPTPATH/../airtime-php.ini $SCRIPTPATH/../upgrades/airtime-2.2.0/airtime-upgrade.php");
pause(); pause();
} }
if (strcmp($version, "2.2.1") < 0) { if (strcmp($version, "2.2.1") < 0) {
passthru("php --php-ini $SCRIPTPATH/../airtime-php.ini $SCRIPTPATH/../upgrades/airtime-2.2.1/airtime-upgrade.php"); passthru("php --php-ini $SCRIPTPATH/../airtime-php.ini $SCRIPTPATH/../upgrades/airtime-2.2.1/airtime-upgrade.php");
pause(); pause();

View File

@ -0,0 +1,16 @@
<?php
/* This class deals with any modifications to config files in /etc/airtime
* as well as backups. All functions other than start() should be marked
* as private. */
class AirtimeConfigFileUpgrade{
public static function start(){
echo "* Updating configFiles".PHP_EOL;
self::task0();
}
private static function task0(){
UpgradeCommon::upgradeConfigFiles();
}
}

View File

@ -0,0 +1,24 @@
<?php
/* All functions other than start() should be marked as
* private.
*/
class AirtimeDatabaseUpgrade{
public static function start($p_dbValues){
echo "* Updating Database".PHP_EOL;
self::task0($p_dbValues);
echo " * Complete".PHP_EOL;
}
private static function task0($p_dbValues){
$username = $p_dbValues['database']['dbuser'];
$password = $p_dbValues['database']['dbpass'];
$host = $p_dbValues['database']['host'];
$database = $p_dbValues['database']['dbname'];
$dir = __DIR__;
passthru("export PGPASSWORD=$password && psql -h $host -U $username -q -f $dir/data/upgrade.sql $database 2>&1 | grep -v \"will create implicit index\"");
}
}

View File

@ -0,0 +1,11 @@
<?php
require_once 'DbUpgrade.php';
require_once 'ConfFileUpgrade.php';
require_once 'common/UpgradeCommon.php';
$filename = "/etc/airtime/airtime.conf";
$values = parse_ini_file($filename, true);
AirtimeConfigFileUpgrade::start();
AirtimeDatabaseUpgrade::start($values);

View File

@ -0,0 +1,322 @@
<?php
/* These are helper functions that are common to each upgrade such as
* creating connections to a database, backing up config files etc.
*/
class UpgradeCommon{
const CONF_FILE_AIRTIME = "/etc/airtime/airtime.conf";
const CONF_FILE_PYPO = "/etc/airtime/pypo.cfg";
const CONF_FILE_LIQUIDSOAP = "/etc/airtime/liquidsoap.cfg";
const CONF_FILE_MEDIAMONITOR = "/etc/airtime/media-monitor.cfg";
const CONF_FILE_API_CLIENT = "/etc/airtime/api_client.cfg";
const CONF_PYPO_GRP = "pypo";
const CONF_WWW_DATA_GRP = "www-data";
const CONF_BACKUP_SUFFIX = "220";
const VERSION_NUMBER = "2.2.0";
public static function SetDefaultTimezone()
{
$sql = "SELECT valstr from cc_pref WHERE keystr = 'timezone'";
$result = self::queryDb($sql);
$timezone = $result->fetchColumn();
date_default_timezone_set($timezone);
}
public static function connectToDatabase($p_exitOnError = true)
{
try {
$con = Propel::getConnection();
} catch (Exception $e) {
echo $e->getMessage().PHP_EOL;
echo "Database connection problem.".PHP_EOL;
echo "Check if database exists with corresponding permissions.".PHP_EOL;
if ($p_exitOnError) {
exit(1);
}
return false;
}
return true;
}
public static function DbTableExists($p_name)
{
$con = Propel::getConnection();
try {
$sql = "SELECT * FROM ".$p_name." LIMIT 1";
$con->query($sql);
} catch (PDOException $e){
return false;
}
return true;
}
private static function GetAirtimeSrcDir()
{
return __DIR__."/../../../../airtime_mvc";
}
public static function MigrateTablesToVersion($dir, $version)
{
echo "Upgrading database, may take several minutes, please wait".PHP_EOL;
$appDir = self::GetAirtimeSrcDir();
$command = "php --php-ini $dir/../../airtime-php.ini ".
"$appDir/library/doctrine/migrations/doctrine-migrations.phar ".
"--configuration=$dir/common/migrations.xml ".
"--db-configuration=$appDir/library/doctrine/migrations/migrations-db.php ".
"--no-interaction migrations:migrate $version";
system($command);
}
public static function BypassMigrations($dir, $version)
{
$appDir = self::GetAirtimeSrcDir();
$command = "php --php-ini $dir/../../airtime-php.ini ".
"$appDir/library/doctrine/migrations/doctrine-migrations.phar ".
"--configuration=$dir/common/migrations.xml ".
"--db-configuration=$appDir/library/doctrine/migrations/migrations-db.php ".
"--no-interaction --add migrations:version $version";
system($command);
}
public static function upgradeConfigFiles(){
$configFiles = array(UpgradeCommon::CONF_FILE_AIRTIME,
UpgradeCommon::CONF_FILE_PYPO,
//this is not necessary because liquidsoap configs
//are automatically generated
//UpgradeCommon::CONF_FILE_LIQUIDSOAP,
UpgradeCommon::CONF_FILE_MEDIAMONITOR,
UpgradeCommon::CONF_FILE_API_CLIENT);
// Backup the config files
$suffix = date("Ymdhis")."-".UpgradeCommon::VERSION_NUMBER;
foreach ($configFiles as $conf) {
// do not back up monit cfg -- ok?? not being done anyway
if (file_exists($conf)) {
echo "Backing up $conf to $conf$suffix.bak".PHP_EOL;
//copy($conf, $conf.$suffix.".bak");
exec("cp -p $conf $conf$suffix.bak"); //use cli version to preserve file attributes
}
}
self::CreateIniFiles(UpgradeCommon::CONF_BACKUP_SUFFIX);
self::MergeConfigFiles($configFiles, $suffix);
//HACK: This will fix a last minute bug we discovered with our upgrade scripts.
//Will be fixed properly in 2.3.0
$old = "list_all_db_files = 'list-all-files/format/json/api_key/%%api_key%%/dir_id/%%dir_id%%'";
$new = "list_all_db_files = 'list-all-files/format/json/api_key/%%api_key%%/dir_id/%%dir_id%%/all/%%all%%'";
exec("sed -i \"s#$old#$new#g\" /etc/airtime/api_client.cfg");
$old = "update_start_playing_url = 'notify-media-item-start-play/api_key/%%api_key%%/media_id/%%media_id%%/schedule_id/%%schedule_id%%'";
$new = "update_start_playing_url = 'notify-media-item-start-play/api_key/%%api_key%%/media_id/%%media_id%%/'";
exec("sed -i \"s#$old#$new#g\" /etc/airtime/api_client.cfg");
}
/**
* This function creates the /etc/airtime configuration folder
* and copies the default config files to it.
*/
public static function CreateIniFiles($suffix)
{
if (!file_exists("/etc/airtime/")){
if (!mkdir("/etc/airtime/", 0755, true)){
echo "Could not create /etc/airtime/ directory. Exiting.";
exit(1);
}
}
$config_copy = array(
"../etc/airtime.conf" => self::CONF_FILE_AIRTIME,
"../etc/pypo.cfg" => self::CONF_FILE_PYPO,
"../etc/media-monitor.cfg" => self::CONF_FILE_MEDIAMONITOR,
"../etc/api_client.cfg" => self::CONF_FILE_API_CLIENT
);
echo "Copying configs:\n";
foreach ($config_copy as $path_part => $destination) {
$full_path = OsPath::normpath(OsPath::join(__DIR__,
"$path_part.$suffix"));
echo "'$full_path' --> '$destination'\n";
if(!copy($full_path, $destination)) {
echo "Failed on the copying operation above\n";
exit(1);
}
}
}
private static function MergeConfigFiles(array $configFiles, $suffix) {
foreach ($configFiles as $conf) {
if (file_exists("$conf$suffix.bak")) {
if($conf === self::CONF_FILE_AIRTIME) {
// Parse with sections
$newSettings = parse_ini_file($conf, true);
$oldSettings = parse_ini_file("$conf$suffix.bak", true);
}
else {
$newSettings = self::ReadPythonConfig($conf);
$oldSettings = self::ReadPythonConfig("$conf$suffix.bak");
}
$settings = array_keys($newSettings);
foreach($settings as $section) {
if(isset($oldSettings[$section])) {
if(is_array($oldSettings[$section])) {
$sectionKeys = array_keys($newSettings[$section]);
foreach($sectionKeys as $sectionKey) {
if(isset($oldSettings[$section][$sectionKey])) {
self::UpdateIniValue($conf, $sectionKey,
$oldSettings[$section][$sectionKey]);
}
}
} else {
self::UpdateIniValue($conf, $section,
$oldSettings[$section]);
}
}
}
}
}
}
private static function ReadPythonConfig($p_filename)
{
$values = array();
$fh = fopen($p_filename, 'r');
while(!feof($fh)){
$line = fgets($fh);
if(substr(trim($line), 0, 1) == '#' || trim($line) == ""){
continue;
}else{
$info = explode('=', $line, 2);
$values[trim($info[0])] = trim($info[1]);
}
}
return $values;
}
/**
* This function updates an INI style config file.
*
* A property and the value the property should be changed to are
* supplied. If the property is not found, then no changes are made.
*
* @param string $p_filename
* The path the to the file.
* @param string $p_property
* The property to look for in order to change its value.
* @param string $p_value
* The value the property should be changed to.
*
*/
private static function UpdateIniValue($p_filename, $p_property, $p_value)
{
$lines = file($p_filename);
$n = count($lines);
foreach ($lines as &$line) {
if ($line[0] != "#"){
$key_value = explode("=", $line);
$key = trim($key_value[0]);
if ($key == $p_property){
$line = "$p_property = $p_value".PHP_EOL;
}
}
}
$fp=fopen($p_filename, 'w');
for($i=0; $i<$n; $i++){
fwrite($fp, $lines[$i]);
}
fclose($fp);
}
public static function queryDb($p_sql){
$con = Propel::getConnection();
try {
$result = $con->query($p_sql);
} catch (Exception $e) {
echo "Error executing $p_sql. Exiting.";
exit(1);
}
return $result;
}
}
class OsPath {
// this function is from http://stackoverflow.com/questions/2670299/is-there-a-php-equivalent-function-to-the-python-os-path-normpath
public static function normpath($path)
{
if (empty($path))
return '.';
if (strpos($path, '/') === 0)
$initial_slashes = true;
else
$initial_slashes = false;
if (
($initial_slashes) &&
(strpos($path, '//') === 0) &&
(strpos($path, '///') === false)
)
$initial_slashes = 2;
$initial_slashes = (int) $initial_slashes;
$comps = explode('/', $path);
$new_comps = array();
foreach ($comps as $comp)
{
if (in_array($comp, array('', '.')))
continue;
if (
($comp != '..') ||
(!$initial_slashes && !$new_comps) ||
($new_comps && (end($new_comps) == '..'))
)
array_push($new_comps, $comp);
elseif ($new_comps)
array_pop($new_comps);
}
$comps = $new_comps;
$path = implode('/', $comps);
if ($initial_slashes)
$path = str_repeat('/', $initial_slashes) . $path;
if ($path)
return $path;
else
return '.';
}
/* Similar to the os.path.join python method
* http://stackoverflow.com/a/1782990/276949 */
public static function join() {
$args = func_get_args();
$paths = array();
foreach($args as $arg) {
$paths = array_merge($paths, (array)$arg);
}
foreach($paths as &$path) {
$path = trim($path, DIRECTORY_SEPARATOR);
}
if (substr($args[0], 0, 1) == DIRECTORY_SEPARATOR) {
$paths[0] = DIRECTORY_SEPARATOR . $paths[0];
}
return join(DIRECTORY_SEPARATOR, $paths);
}
}

View File

@ -0,0 +1,3 @@
DELETE FROM cc_pref WHERE keystr = 'system_version';
INSERT INTO cc_pref (keystr, valstr) VALUES ('system_version', '2.3.0');

View File

@ -0,0 +1,32 @@
[database]
host = localhost
dbname = airtime
dbuser = airtime
dbpass = airtime
[rabbitmq]
host = 127.0.0.1
port = 5672
user = guest
password = guest
vhost = /
[general]
api_key = AAA
web_server_user = www-data
airtime_dir = x
base_url = localhost
base_port = 80
base_dir = ''
;How many hours ahead of time should Airtime playout engine (PYPO)
;cache scheduled media files.
cache_ahead_hours = 1
[monit]
monit_user = guest
monit_password = airtime
[soundcloud]
connection_retries = 3
time_between_retries = 60

View File

@ -0,0 +1,128 @@
bin_dir = "/usr/lib/airtime/api_clients"
#############################
## Common
#############################
# Value needed to access the API
api_key = 'AAA'
# Path to the base of the API
api_base = 'api'
# URL to get the version number of the server API
version_url = 'version/api_key/%%api_key%%'
#URL to register a components IP Address with the central web server
register_component = 'register-component/format/json/api_key/%%api_key%%/component/%%component%%'
# Hostname
host = 'localhost'
base_port = 80
base_dir = ''
#############################
## Config for Media Monitor
#############################
# URL to setup the media monitor
media_setup_url = 'media-monitor-setup/format/json/api_key/%%api_key%%'
# Tell Airtime the file id associated with a show instance.
upload_recorded = 'upload-recorded/format/json/api_key/%%api_key%%/fileid/%%fileid%%/showinstanceid/%%showinstanceid%%'
# URL to tell Airtime to update file's meta data
update_media_url = 'reload-metadata/format/json/api_key/%%api_key%%/mode/%%mode%%'
# URL to tell Airtime we want a listing of all files it knows about
list_all_db_files = 'list-all-files/format/json/api_key/%%api_key%%/dir_id/%%dir_id%%/all/%%all%%'
# URL to tell Airtime we want a listing of all dirs its watching (including the stor dir)
list_all_watched_dirs = 'list-all-watched-dirs/format/json/api_key/%%api_key%%'
# URL to tell Airtime we want to add watched directory
add_watched_dir = 'add-watched-dir/format/json/api_key/%%api_key%%/path/%%path%%'
# URL to tell Airtime we want to add watched directory
remove_watched_dir = 'remove-watched-dir/format/json/api_key/%%api_key%%/path/%%path%%'
# URL to tell Airtime we want to add watched directory
set_storage_dir = 'set-storage-dir/format/json/api_key/%%api_key%%/path/%%path%%'
# URL to tell Airtime about file system mount change
update_fs_mount = 'update-file-system-mount/format/json/api_key/%%api_key%%'
# URL to commit multiple updates from media monitor at the same time
reload_metadata_group = 'reload-metadata-group/format/json/api_key/%%api_key%%'
# URL to tell Airtime about file system mount change
handle_watched_dir_missing = 'handle-watched-dir-missing/format/json/api_key/%%api_key%%/dir/%%dir%%'
#############################
## Config for Recorder
#############################
# URL to get the schedule of shows set to record
show_schedule_url = 'recorded-shows/format/json/api_key/%%api_key%%'
# URL to upload the recorded show's file to Airtime
upload_file_url = 'upload-file/format/json/api_key/%%api_key%%'
# URL to commit multiple updates from media monitor at the same time
#number of retries to upload file if connection problem
upload_retries = 3
#time to wait between attempts to upload file if connection problem (in seconds)
upload_wait = 60
################################################################################
# Uncomment *one of the sets* of values from the API clients below, and comment
# out all the others.
################################################################################
#############################
## Config for Pypo
#############################
# Schedule export path.
# %%from%% - starting date/time in the form YYYY-MM-DD-hh-mm
# %%to%% - starting date/time in the form YYYY-MM-DD-hh-mm
export_url = 'schedule/api_key/%%api_key%%'
get_media_url = 'get-media/file/%%file%%/api_key/%%api_key%%'
# Update whether a schedule group has begun playing.
update_item_url = 'notify-schedule-group-play/api_key/%%api_key%%/schedule_id/%%schedule_id%%'
# Update whether an audio clip is currently playing.
update_start_playing_url = 'notify-media-item-start-play/api_key/%%api_key%%/media_id/%%media_id%%/'
# URL to tell Airtime we want to get stream setting
get_stream_setting = 'get-stream-setting/format/json/api_key/%%api_key%%/'
#URL to update liquidsoap status
update_liquidsoap_status = 'update-liquidsoap-status/format/json/api_key/%%api_key%%/msg/%%msg%%/stream_id/%%stream_id%%/boot_time/%%boot_time%%'
#URL to check live stream auth
check_live_stream_auth = 'check-live-stream-auth/format/json/api_key/%%api_key%%/username/%%username%%/password/%%password%%/djtype/%%djtype%%'
#URL to update source status
update_source_status = 'update-source-status/format/json/api_key/%%api_key%%/sourcename/%%sourcename%%/status/%%status%%'
get_bootstrap_info = 'get-bootstrap-info/format/json/api_key/%%api_key%%'
get_files_without_replay_gain = 'get-files-without-replay-gain/api_key/%%api_key%%/dir_id/%%dir_id%%'
update_replay_gain_value = 'update-replay-gain-value/api_key/%%api_key%%'
notify_webstream_data = 'notify-webstream-data/api_key/%%api_key%%/media_id/%%media_id%%/format/json'
notify_liquidsoap_started = 'rabbitmq-do-push/api_key/%%api_key%%/format/json'
get_stream_parameters = 'get-stream-parameters/api_key/%%api_key%%/format/json'
push_stream_stats = 'push-stream-stats/api_key/%%api_key%%/format/json'
update_stream_setting_table = 'update-stream-setting-table/api_key/%%api_key%%/format/json'

View File

@ -0,0 +1,31 @@
api_client = "airtime"
# where the binary files live
bin_dir = '/usr/lib/airtime/media-monitor'
# where the logging files live
log_dir = '/var/log/airtime/media-monitor'
############################################
# RabbitMQ settings #
############################################
rabbitmq_host = 'localhost'
rabbitmq_user = 'guest'
rabbitmq_password = 'guest'
rabbitmq_vhost = '/'
############################################
# Media-Monitor preferences #
############################################
check_filesystem_events = 5 #how long to queue up events performed on the files themselves.
check_airtime_events = 30 #how long to queue metadata input from airtime.
# MM2 only:
touch_interval = 5
chunking_number = 450
request_max_wait = 3.0
rmq_event_wait = 0.1
logpath = '/var/log/airtime/media-monitor/media-monitor.log'
index_path = '/var/tmp/airtime/media-monitor/last_index'

View File

@ -0,0 +1,85 @@
############################################
# pypo - configuration #
############################################
# Set the type of client you are using.
# Currently supported types:
# 1) "obp" = Open Broadcast Platform
# 2) "airtime"
#
api_client = "airtime"
############################################
# Cache Directories #
# *include* trailing slash !! #
############################################
cache_dir = '/var/tmp/airtime/pypo/cache/'
file_dir = '/var/tmp/airtime/pypo/files/'
tmp_dir = '/var/tmp/airtime/pypo/tmp/'
############################################
# Setup Directories #
# Do *not* include trailing slash !! #
############################################
cache_base_dir = '/var/tmp/airtime/pypo'
bin_dir = '/usr/lib/airtime/pypo'
log_base_dir = '/var/log/airtime'
pypo_log_dir = '/var/log/airtime/pypo'
liquidsoap_log_dir = '/var/log/airtime/pypo-liquidsoap'
############################################
# Liquidsoap settings #
############################################
ls_host = '127.0.0.1'
ls_port = '1234'
############################################
# RabbitMQ settings #
############################################
rabbitmq_host = 'localhost'
rabbitmq_user = 'guest'
rabbitmq_password = 'guest'
rabbitmq_vhost = '/'
############################################
# pypo preferences #
############################################
# Poll interval in seconds.
#
# This will rarely need to be changed because any schedule changes are
# automatically sent to pypo immediately.
#
# This is how often the poll script downloads new schedules and files from the
# server in the event that no changes are made to the schedule.
#
poll_interval = 3600 # in seconds.
# Push interval in seconds.
#
# This is how often the push script checks whether it has something new to
# push to liquidsoap.
#
# It's hard to imagine a situation where this should be more than 1 second.
#
push_interval = 1 # in seconds
# 'pre' or 'otf'. 'pre' cues while playlist preparation
# while 'otf' (on the fly) cues while loading into ls
# (needs the post_processor patch)
cue_style = 'pre'
############################################
# Recorded Audio settings #
############################################
record_bitrate = 256
record_samplerate = 44100
record_channels = 2
record_sample_size = 16
#can be either ogg|mp3, mp3 recording requires installation of the package "lame"
record_file_type = 'ogg'
# base path to store recordered shows at
base_recorded_files = '/var/tmp/airtime/show-recorder/'

View File

@ -5,7 +5,12 @@ exitIfNotRoot();
date_default_timezone_set("UTC"); date_default_timezone_set("UTC");
$values = parse_ini_file('/etc/airtime/airtime.conf', true); $values = parse_ini_file('/etc/airtime/airtime.conf', true);
$CC_CONFIG['phpDir'] = $values['general']['airtime_dir'];
require_once($CC_CONFIG['phpDir'].'/application/configs/conf.php');
Config::loadConfig();
$CC_CONFIG = Config::getConfig();
/*
// Name of the web server user // Name of the web server user
$CC_CONFIG['webServerUser'] = $values['general']['web_server_user']; $CC_CONFIG['webServerUser'] = $values['general']['web_server_user'];
$CC_CONFIG['phpDir'] = $values['general']['airtime_dir']; $CC_CONFIG['phpDir'] = $values['general']['airtime_dir'];
@ -25,11 +30,11 @@ $CC_CONFIG['apiKey'] = array($values['general']['api_key']);
$CC_CONFIG['soundcloud-connection-retries'] = $values['soundcloud']['connection_retries']; $CC_CONFIG['soundcloud-connection-retries'] = $values['soundcloud']['connection_retries'];
$CC_CONFIG['soundcloud-connection-wait'] = $values['soundcloud']['time_between_retries']; $CC_CONFIG['soundcloud-connection-wait'] = $values['soundcloud']['time_between_retries'];
*/
require_once($CC_CONFIG['phpDir'].'/application/configs/constants.php'); require_once($CC_CONFIG['phpDir'].'/application/configs/constants.php');
require_once($CC_CONFIG['phpDir'].'/application/configs/conf.php'); //require_once($CC_CONFIG['phpDir'].'/application/configs/conf.php');
$CC_CONFIG['phpDir'] = $values['general']['airtime_dir']; //$CC_CONFIG['phpDir'] = $values['general']['airtime_dir'];
// Ensure library/ is on include_path // Ensure library/ is on include_path
set_include_path(implode(PATH_SEPARATOR, array( set_include_path(implode(PATH_SEPARATOR, array(
@ -38,7 +43,7 @@ realpath($CC_CONFIG['phpDir'] . '/library')
))); )));
function my_autoload($classname){ function my_autoload($classname){
global $CC_CONFIG; $CC_CONFIG = Config::getConfig();
$info = explode('_', $classname); $info = explode('_', $classname);
if (isset($info[1]) && isset($info[2])) { if (isset($info[1]) && isset($info[2])) {
$filename = $info[2].".php"; $filename = $info[2].".php";