Merge branch 'devel' into 2.3.x-saas
Conflicts: airtime_mvc/application/controllers/PreferenceController.php airtime_mvc/application/forms/AddShowWhen.php airtime_mvc/application/forms/GeneralPreferences.php airtime_mvc/application/forms/LiveStreamingPreferences.php airtime_mvc/application/forms/SoundcloudPreferences.php airtime_mvc/application/forms/SupportSettings.php airtime_mvc/application/views/scripts/form/preferences.phtml airtime_mvc/application/views/scripts/form/preferences_email_server.phtml airtime_mvc/application/views/scripts/form/preferences_general.phtml airtime_mvc/application/views/scripts/form/preferences_livestream.phtml airtime_mvc/application/views/scripts/form/support-setting.phtml airtime_mvc/application/views/scripts/schedule/add- show-form.phtml airtime_mvc/public/js/airtime/preferences/preferences.js python_apps/api_clients/api_client.py python_apps/pypo/listenerstat.py
This commit is contained in:
commit
8cd6bd9aa4
346 changed files with 48955 additions and 11856 deletions
|
@ -112,6 +112,10 @@ Non-linked code:
|
||||||
- Web site: http://code.google.com/p/jq-serverbrowse/
|
- Web site: http://code.google.com/p/jq-serverbrowse/
|
||||||
- License: BSD 2-Clause
|
- License: BSD 2-Clause
|
||||||
|
|
||||||
|
* Flot
|
||||||
|
- Web site: http://www.flotcharts.org/
|
||||||
|
- License: MIT
|
||||||
|
|
||||||
-------------
|
-------------
|
||||||
Media-Monitor
|
Media-Monitor
|
||||||
-------------
|
-------------
|
||||||
|
|
2
README
2
README
|
@ -8,7 +8,7 @@ Home page: http://airtime.sourcefabric.org/
|
||||||
|
|
||||||
Major features:
|
Major features:
|
||||||
* Web-based remote station management. Authorized personnel can add
|
* Web-based remote station management. Authorized personnel can add
|
||||||
program material, create playlists, and schedule programming all via
|
program material, create playlists and schedule programming all via
|
||||||
a web interface.
|
a web interface.
|
||||||
* Automation. Airtime has a scheduler function that enables users to
|
* Automation. Airtime has a scheduler function that enables users to
|
||||||
set shows with playlists for playback at a date and time of their choosing.
|
set shows with playlists for playback at a date and time of their choosing.
|
||||||
|
|
2
VERSION
2
VERSION
|
@ -1,2 +1,2 @@
|
||||||
PRODUCT_ID=Airtime
|
PRODUCT_ID=Airtime
|
||||||
PRODUCT_RELEASE=2.2.1
|
PRODUCT_RELEASE=2.3.0
|
||||||
|
|
|
@ -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';
|
||||||
|
|
||||||
|
@ -7,9 +10,12 @@ Propel::init(__DIR__."/configs/airtime-conf-production.php");
|
||||||
|
|
||||||
require_once __DIR__."/configs/constants.php";
|
require_once __DIR__."/configs/constants.php";
|
||||||
require_once 'Preference.php';
|
require_once 'Preference.php';
|
||||||
|
require_once 'Locale.php';
|
||||||
require_once "DateHelper.php";
|
require_once "DateHelper.php";
|
||||||
require_once "OsPath.php";
|
require_once "OsPath.php";
|
||||||
require_once "Database.php";
|
require_once "Database.php";
|
||||||
|
require_once "Timezone.php";
|
||||||
|
require_once __DIR__.'/forms/helpers/ValidationTypes.php';
|
||||||
require_once __DIR__.'/controllers/plugins/RabbitMqPlugin.php';
|
require_once __DIR__.'/controllers/plugins/RabbitMqPlugin.php';
|
||||||
|
|
||||||
|
|
||||||
|
@ -17,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");
|
||||||
|
@ -31,6 +34,8 @@ Zend_Validate::setDefaultNamespaces("Zend");
|
||||||
$front = Zend_Controller_Front::getInstance();
|
$front = Zend_Controller_Front::getInstance();
|
||||||
$front->registerPlugin(new RabbitMqPlugin());
|
$front->registerPlugin(new RabbitMqPlugin());
|
||||||
|
|
||||||
|
//localization configuration
|
||||||
|
Application_Model_Locale::configureLocalization();
|
||||||
|
|
||||||
/* The bootstrap class should only be used to initialize actions that return a view.
|
/* The bootstrap class should only be used to initialize actions that return a view.
|
||||||
Actions that return JSON will not use the bootstrap class! */
|
Actions that return JSON will not use the bootstrap class! */
|
||||||
|
@ -43,46 +48,71 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
|
||||||
$view->doctype('XHTML1_STRICT');
|
$view->doctype('XHTML1_STRICT');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function _initGlobals()
|
||||||
|
{
|
||||||
|
$view = $this->getResource('view');
|
||||||
|
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||||
|
|
||||||
|
$view->headScript()->appendScript("var baseUrl = '$baseUrl'");
|
||||||
|
|
||||||
|
$user = Application_Model_User::GetCurrentUser();
|
||||||
|
if (!is_null($user)){
|
||||||
|
$userType = $user->getType();
|
||||||
|
} else {
|
||||||
|
$userType = "";
|
||||||
|
}
|
||||||
|
$view->headScript()->appendScript("var userType = '$userType';");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
protected function _initHeadLink()
|
protected function _initHeadLink()
|
||||||
{
|
{
|
||||||
global $CC_CONFIG;
|
$CC_CONFIG = Config::getConfig();
|
||||||
|
|
||||||
$view = $this->getResource('view');
|
$view = $this->getResource('view');
|
||||||
$baseUrl = Zend_Controller_Front::getInstance()->getBaseUrl();
|
|
||||||
|
|
||||||
$view->headLink()->appendStylesheet($baseUrl.'/css/redmond/jquery-ui-1.8.8.custom.css?'.$CC_CONFIG['airtime_version']);
|
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||||
$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/redmond/jquery-ui-1.8.8.custom.css?'.$CC_CONFIG['airtime_version']);
|
||||||
$view->headLink()->appendStylesheet($baseUrl.'/css/styles.css?'.$CC_CONFIG['airtime_version']);
|
$view->headLink()->appendStylesheet($baseUrl.'css/pro_dropdown_3.css?'.$CC_CONFIG['airtime_version']);
|
||||||
$view->headLink()->appendStylesheet($baseUrl.'/css/masterpanel.css?'.$CC_CONFIG['airtime_version']);
|
$view->headLink()->appendStylesheet($baseUrl.'css/qtip/jquery.qtip.min.css?'.$CC_CONFIG['airtime_version']);
|
||||||
$view->headLink()->appendStylesheet($baseUrl.'/css/bootstrap.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/bootstrap.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 = Zend_Controller_Front::getInstance()->getBaseUrl();
|
|
||||||
|
|
||||||
$view->headScript()->appendFile($baseUrl.'/js/libs/jquery-1.7.2.min.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
|
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||||
$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-1.7.2.min.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/libs/jquery-ui-1.8.18.custom.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/libs/jquery.stickyPanel.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/qtip/jquery.qtip.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/jplayer/jquery.jplayer.min.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
|
||||||
$view->headScript()->appendScript("var baseUrl='$baseUrl/'");
|
$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/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.'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()->appendScript("$.i18n.setDictionary(general_dict)");
|
||||||
|
$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/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)){
|
||||||
|
@ -103,8 +133,18 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
|
||||||
}
|
}
|
||||||
|
|
||||||
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"
|
||||||
|
&& !($_SERVER['REQUEST_URI'] == $baseUrl.'Dashboard/stream-player' ||
|
||||||
|
strncmp($_SERVER['REQUEST_URI'], $baseUrl.'audiopreview/audio-preview', strlen($baseUrl.'audiopreview/audio-preview'))==0)) {
|
||||||
|
|
||||||
|
$client_id = Application_Model_Preference::GetClientId();
|
||||||
|
$view->headScript()->appendScript("var livechat_client_id = '$client_id';");
|
||||||
|
$view->headScript()->appendFile($baseUrl . 'js/airtime/common/livechat.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function _initViewHelpers()
|
protected function _initViewHelpers()
|
||||||
|
|
|
@ -332,10 +332,10 @@ class Application_Common_DateHelper
|
||||||
// if year is < 1753 or > 9999 it's out of range
|
// if year is < 1753 or > 9999 it's out of range
|
||||||
if ($year < 1753) {
|
if ($year < 1753) {
|
||||||
$retVal['success'] = false;
|
$retVal['success'] = false;
|
||||||
$retVal['errMsg'] = "The year '$year' must be within the range of 1753 - 9999";
|
$retVal['errMsg'] = sprintf(_("The year %s must be within the range of 1753 - 9999"), $year);
|
||||||
} else if (!checkdate($month, $day, $year)) {
|
} else if (!checkdate($month, $day, $year)) {
|
||||||
$retVal['success'] = false;
|
$retVal['success'] = false;
|
||||||
$retVal['errMsg'] = "'$year-$month-$day' is not a valid date";
|
$retVal['errMsg'] = sprintf(_("%s-%s-%s is not a valid date"), $year, $month, $day);
|
||||||
} else {
|
} else {
|
||||||
// check time
|
// check time
|
||||||
if (isset($timeInfo)) {
|
if (isset($timeInfo)) {
|
||||||
|
@ -359,7 +359,7 @@ class Application_Common_DateHelper
|
||||||
|
|
||||||
if ( ($hour < 0 || $hour > 23) || ($min < 0 || $min > 59) || ($sec < 0 || $sec > 59) ) {
|
if ( ($hour < 0 || $hour > 23) || ($min < 0 || $min > 59) || ($sec < 0 || $sec > 59) ) {
|
||||||
$retVal['success'] = false;
|
$retVal['success'] = false;
|
||||||
$retVal['errMsg'] = "'$timeInfo[0]:$timeInfo[1]:$timeInfo[2]' is not a valid time";
|
$retVal['errMsg'] = sprintf(_("%s:%s:%s is not a valid time"), $timeInfo[0], $timeInfo[1] ,$timeInfo[2]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -63,4 +63,18 @@ class Application_Common_OsPath{
|
||||||
|
|
||||||
return join(DIRECTORY_SEPARATOR, $paths);
|
return join(DIRECTORY_SEPARATOR, $paths);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function getBaseDir() {
|
||||||
|
$baseUrl = dirname($_SERVER['SCRIPT_NAME']);
|
||||||
|
|
||||||
|
if ($baseUrl[0] != "/") {
|
||||||
|
$baseUrl = "/".$baseUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($baseUrl[strlen($baseUrl) -1] != "/") {
|
||||||
|
$baseUrl = $baseUrl."/";
|
||||||
|
}
|
||||||
|
|
||||||
|
return $baseUrl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
31
airtime_mvc/application/common/Timezone.php
Normal file
31
airtime_mvc/application/common/Timezone.php
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
class Application_Common_Timezone
|
||||||
|
{
|
||||||
|
public static function getTimezones()
|
||||||
|
{
|
||||||
|
$regions = array(
|
||||||
|
'Africa' => DateTimeZone::AFRICA,
|
||||||
|
'America' => DateTimeZone::AMERICA,
|
||||||
|
'Antarctica' => DateTimeZone::ANTARCTICA,
|
||||||
|
'Arctic' => DateTimeZone::ARCTIC,
|
||||||
|
'Asia' => DateTimeZone::ASIA,
|
||||||
|
'Atlantic' => DateTimeZone::ATLANTIC,
|
||||||
|
'Australia' => DateTimeZone::AUSTRALIA,
|
||||||
|
'Europe' => DateTimeZone::EUROPE,
|
||||||
|
'Indian' => DateTimeZone::INDIAN,
|
||||||
|
'Pacific' => DateTimeZone::PACIFIC
|
||||||
|
);
|
||||||
|
|
||||||
|
$tzlist = array();
|
||||||
|
|
||||||
|
foreach ($regions as $name => $mask) {
|
||||||
|
$ids = DateTimeZone::listIdentifiers($mask);
|
||||||
|
foreach ($ids as $id) {
|
||||||
|
$tzlist[$id] = str_replace("_", " ", $id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $tzlist;
|
||||||
|
}
|
||||||
|
}
|
|
@ -26,18 +26,21 @@ $ccAcl->add(new Zend_Acl_Resource('library'))
|
||||||
->add(new Zend_Acl_Resource('listenerstat'))
|
->add(new Zend_Acl_Resource('listenerstat'))
|
||||||
->add(new Zend_Acl_Resource('usersettings'))
|
->add(new Zend_Acl_Resource('usersettings'))
|
||||||
->add(new Zend_Acl_Resource('audiopreview'))
|
->add(new Zend_Acl_Resource('audiopreview'))
|
||||||
->add(new Zend_Acl_Resource('webstream'));
|
->add(new Zend_Acl_Resource('webstream'))
|
||||||
|
->add(new Zend_Acl_Resource('locale'));
|
||||||
|
|
||||||
/** Creating permissions */
|
/** Creating permissions */
|
||||||
$ccAcl->allow('G', 'index')
|
$ccAcl->allow('G', 'index')
|
||||||
->allow('G', 'login')
|
->allow('G', 'login')
|
||||||
->allow('G', 'error')
|
->allow('G', 'error')
|
||||||
|
->allow('G', 'user', 'edit-user')
|
||||||
->allow('G', 'showbuilder')
|
->allow('G', 'showbuilder')
|
||||||
->allow('G', 'api')
|
->allow('G', 'api')
|
||||||
->allow('G', 'schedule')
|
->allow('G', 'schedule')
|
||||||
->allow('G', 'dashboard')
|
->allow('G', 'dashboard')
|
||||||
->allow('G', 'audiopreview')
|
->allow('G', 'audiopreview')
|
||||||
->allow('G', 'webstream')
|
->allow('G', 'webstream')
|
||||||
|
->allow('G', 'locale')
|
||||||
->allow('H', 'preference', 'is-import-in-progress')
|
->allow('H', 'preference', 'is-import-in-progress')
|
||||||
->allow('H', 'usersettings')
|
->allow('H', 'usersettings')
|
||||||
->allow('H', 'plupload')
|
->allow('H', 'plupload')
|
||||||
|
|
|
@ -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'];
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
// This file generated by Propel 1.5.2 convert-conf target
|
// This file generated by Propel 1.5.2 convert-conf target
|
||||||
// from XML runtime conf file /home/rudi/Airtime/airtime_mvc/build/runtime-conf.xml
|
// from XML runtime conf file /home/rudi/reps/Airtime/airtime_mvc/build/runtime-conf.xml
|
||||||
$conf = array (
|
$conf = array (
|
||||||
'datasources' =>
|
'datasources' =>
|
||||||
array (
|
array (
|
||||||
|
|
|
@ -197,4 +197,11 @@ return array (
|
||||||
'BaseCcListenerCountPeer' => 'airtime/om/BaseCcListenerCountPeer.php',
|
'BaseCcListenerCountPeer' => 'airtime/om/BaseCcListenerCountPeer.php',
|
||||||
'BaseCcListenerCount' => 'airtime/om/BaseCcListenerCount.php',
|
'BaseCcListenerCount' => 'airtime/om/BaseCcListenerCount.php',
|
||||||
'BaseCcListenerCountQuery' => 'airtime/om/BaseCcListenerCountQuery.php',
|
'BaseCcListenerCountQuery' => 'airtime/om/BaseCcListenerCountQuery.php',
|
||||||
|
'CcLocaleTableMap' => 'airtime/map/CcLocaleTableMap.php',
|
||||||
|
'CcLocalePeer' => 'airtime/CcLocalePeer.php',
|
||||||
|
'CcLocale' => 'airtime/CcLocale.php',
|
||||||
|
'CcLocaleQuery' => 'airtime/CcLocaleQuery.php',
|
||||||
|
'BaseCcLocalePeer' => 'airtime/om/BaseCcLocalePeer.php',
|
||||||
|
'BaseCcLocale' => 'airtime/om/BaseCcLocale.php',
|
||||||
|
'BaseCcLocaleQuery' => 'airtime/om/BaseCcLocaleQuery.php',
|
||||||
);
|
);
|
|
@ -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 */
|
||||||
|
|
||||||
|
'soundcloud-client-id' => '2CLCxcSXYzx7QhhPVHN4A',
|
||||||
|
'soundcloud-client-secret' => 'pZ7beWmF06epXLHVUP1ufOg2oEnIt9XhE8l8xt0bBs',
|
||||||
|
|
||||||
|
"rootDir" => __DIR__."/../.."
|
||||||
|
);
|
||||||
|
|
||||||
|
$filename = isset($_SERVER['AIRTIME_CONF']) ? $_SERVER['AIRTIME_CONF'] : "/etc/airtime/airtime.conf";
|
||||||
|
|
||||||
$filename = $p_path;
|
|
||||||
$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'];
|
||||||
|
|
||||||
|
@ -86,5 +54,16 @@ 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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,6 +32,8 @@ define('MDATA_KEY_CONDUCTOR' , 'conductor');
|
||||||
define('MDATA_KEY_LANGUAGE' , 'language');
|
define('MDATA_KEY_LANGUAGE' , 'language');
|
||||||
define('MDATA_KEY_REPLAYGAIN' , 'replay_gain');
|
define('MDATA_KEY_REPLAYGAIN' , 'replay_gain');
|
||||||
define('MDATA_KEY_OWNER_ID' , 'owner_id');
|
define('MDATA_KEY_OWNER_ID' , 'owner_id');
|
||||||
|
define('MDATA_KEY_CUE_IN' , 'cuein');
|
||||||
|
define('MDATA_KEY_CUE_OUT' , 'cueout');
|
||||||
|
|
||||||
define('UI_MDATA_VALUE_FORMAT_FILE' , 'File');
|
define('UI_MDATA_VALUE_FORMAT_FILE' , 'File');
|
||||||
define('UI_MDATA_VALUE_FORMAT_STREAM' , 'live stream');
|
define('UI_MDATA_VALUE_FORMAT_STREAM' , 'live stream');
|
||||||
|
|
|
@ -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'];
|
|
||||||
|
|
|
@ -9,85 +9,85 @@
|
||||||
*/
|
*/
|
||||||
$pages = array(
|
$pages = array(
|
||||||
array(
|
array(
|
||||||
'label' => 'Now Playing',
|
'label' => _('Now Playing'),
|
||||||
'module' => 'default',
|
'module' => 'default',
|
||||||
'controller' => 'Showbuilder',
|
'controller' => 'Showbuilder',
|
||||||
'action' => 'index',
|
'action' => 'index',
|
||||||
'resource' => 'showbuilder'
|
'resource' => 'showbuilder'
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'label' => 'Add Media',
|
'label' => _('Add Media'),
|
||||||
'module' => 'default',
|
'module' => 'default',
|
||||||
'controller' => 'Plupload',
|
'controller' => 'Plupload',
|
||||||
'action' => 'index',
|
'action' => 'index',
|
||||||
'resource' => 'plupload'
|
'resource' => 'plupload'
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'label' => 'Library',
|
'label' => _('Library'),
|
||||||
'module' => 'default',
|
'module' => 'default',
|
||||||
'controller' => 'Library',
|
'controller' => 'Library',
|
||||||
'action' => 'index',
|
'action' => 'index',
|
||||||
'resource' => 'playlist'
|
'resource' => 'playlist'
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'label' => 'Calendar',
|
'label' => _('Calendar'),
|
||||||
'module' => 'default',
|
'module' => 'default',
|
||||||
'controller' => 'Schedule',
|
'controller' => 'Schedule',
|
||||||
'action' => 'index',
|
'action' => 'index',
|
||||||
'resource' => 'schedule'
|
'resource' => 'schedule'
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'label' => 'System',
|
'label' => _('System'),
|
||||||
'uri' => '#',
|
'uri' => '#',
|
||||||
'resource' => 'preference',
|
'resource' => 'preference',
|
||||||
'pages' => array(
|
'pages' => array(
|
||||||
array(
|
array(
|
||||||
'label' => 'Preferences',
|
'label' => _('Preferences'),
|
||||||
'module' => 'default',
|
'module' => 'default',
|
||||||
'controller' => 'Preference'
|
'controller' => 'Preference'
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'label' => 'Users',
|
'label' => _('Users'),
|
||||||
'module' => 'default',
|
'module' => 'default',
|
||||||
'controller' => 'user',
|
'controller' => 'user',
|
||||||
'action' => 'add-user',
|
'action' => 'add-user',
|
||||||
'resource' => 'user'
|
'resource' => 'user'
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'label' => 'Media Folders',
|
'label' => _('Media Folders'),
|
||||||
'module' => 'default',
|
'module' => 'default',
|
||||||
'controller' => 'Preference',
|
'controller' => 'Preference',
|
||||||
'action' => 'directory-config',
|
'action' => 'directory-config',
|
||||||
'id' => 'manage_folder'
|
'id' => 'manage_folder'
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'label' => 'Streams',
|
'label' => _('Streams'),
|
||||||
'module' => 'default',
|
'module' => 'default',
|
||||||
'controller' => 'Preference',
|
'controller' => 'Preference',
|
||||||
'action' => 'stream-setting'
|
'action' => 'stream-setting'
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'label' => 'Support Feedback',
|
'label' => _('Support Feedback'),
|
||||||
'module' => 'default',
|
'module' => 'default',
|
||||||
'controller' => 'Preference',
|
'controller' => 'Preference',
|
||||||
'action' => 'support-setting'
|
'action' => 'support-setting'
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'label' => 'Status',
|
'label' => _('Status'),
|
||||||
'module' => 'default',
|
'module' => 'default',
|
||||||
'controller' => 'systemstatus',
|
'controller' => 'systemstatus',
|
||||||
'action' => 'index',
|
'action' => 'index',
|
||||||
'resource' => 'systemstatus'
|
'resource' => 'systemstatus'
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'label' => 'Playout History',
|
'label' => _('Playout History'),
|
||||||
'module' => 'default',
|
'module' => 'default',
|
||||||
'controller' => 'playouthistory',
|
'controller' => 'playouthistory',
|
||||||
'action' => 'index',
|
'action' => 'index',
|
||||||
'resource' => 'playouthistory'
|
'resource' => 'playouthistory'
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'label' => 'Listener Stats',
|
'label' => _('Listener Stats'),
|
||||||
'module' => 'default',
|
'module' => 'default',
|
||||||
'controller' => 'listenerstat',
|
'controller' => 'listenerstat',
|
||||||
'action' => 'index',
|
'action' => 'index',
|
||||||
|
@ -96,24 +96,24 @@ $pages = array(
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'label' => 'Help',
|
'label' => _('Help'),
|
||||||
'uri' => '#',
|
'uri' => '#',
|
||||||
'resource' => 'dashboard',
|
'resource' => 'dashboard',
|
||||||
'pages' => array(
|
'pages' => array(
|
||||||
array(
|
array(
|
||||||
'label' => 'Getting Started',
|
'label' => _('Getting Started'),
|
||||||
'module' => 'default',
|
'module' => 'default',
|
||||||
'controller' => 'dashboard',
|
'controller' => 'dashboard',
|
||||||
'action' => 'help',
|
'action' => 'help',
|
||||||
'resource' => 'dashboard'
|
'resource' => 'dashboard'
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'label' => 'User Manual',
|
'label' => _('User Manual'),
|
||||||
'uri' => "http://www.sourcefabric.org/en/airtime/manuals/",
|
'uri' => "http://www.sourcefabric.org/en/airtime/manuals/",
|
||||||
'target' => "_blank"
|
'target' => "_blank"
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'label' => 'About',
|
'label' => _('About'),
|
||||||
'module' => 'default',
|
'module' => 'default',
|
||||||
'controller' => 'dashboard',
|
'controller' => 'dashboard',
|
||||||
'action' => 'about',
|
'action' => 'about',
|
||||||
|
|
|
@ -42,18 +42,19 @@ class ApiController extends Zend_Controller_Action
|
||||||
->addActionContext('notify-webstream-data' , 'json')
|
->addActionContext('notify-webstream-data' , 'json')
|
||||||
->addActionContext('get-stream-parameters' , 'json')
|
->addActionContext('get-stream-parameters' , 'json')
|
||||||
->addActionContext('push-stream-stats' , 'json')
|
->addActionContext('push-stream-stats' , 'json')
|
||||||
|
->addActionContext('update-stream-setting-table' , 'json')
|
||||||
->initContext();
|
->initContext();
|
||||||
}
|
}
|
||||||
|
|
||||||
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"]) &&
|
||||||
is_null(Zend_Auth::getInstance()->getStorage()->read())) {
|
is_null(Zend_Auth::getInstance()->getStorage()->read())) {
|
||||||
header('HTTP/1.0 401 Unauthorized');
|
header('HTTP/1.0 401 Unauthorized');
|
||||||
print 'You are not allowed to access this resource.';
|
print _('You are not allowed to access this resource.');
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -80,7 +81,7 @@ class ApiController extends Zend_Controller_Action
|
||||||
|
|
||||||
if (is_null(Zend_Auth::getInstance()->getStorage()->read())) {
|
if (is_null(Zend_Auth::getInstance()->getStorage()->read())) {
|
||||||
header('HTTP/1.0 401 Unauthorized');
|
header('HTTP/1.0 401 Unauthorized');
|
||||||
print 'You are not allowed to access this resource.';
|
print _('You are not allowed to access this resource.');
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -282,7 +283,7 @@ class ApiController extends Zend_Controller_Action
|
||||||
echo isset($_GET['callback']) ? $_GET['callback'].'('.json_encode($result).')' : json_encode($result);
|
echo isset($_GET['callback']) ? $_GET['callback'].'('.json_encode($result).')' : json_encode($result);
|
||||||
} else {
|
} else {
|
||||||
header('HTTP/1.0 401 Unauthorized');
|
header('HTTP/1.0 401 Unauthorized');
|
||||||
print 'You are not allowed to access this resource. ';
|
print _('You are not allowed to access this resource. ');
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -321,7 +322,7 @@ class ApiController extends Zend_Controller_Action
|
||||||
echo isset($_GET['callback']) ? $_GET['callback'].'('.json_encode($result).')' : json_encode($result);
|
echo isset($_GET['callback']) ? $_GET['callback'].'('.json_encode($result).')' : json_encode($result);
|
||||||
} else {
|
} else {
|
||||||
header('HTTP/1.0 401 Unauthorized');
|
header('HTTP/1.0 401 Unauthorized');
|
||||||
print 'You are not allowed to access this resource. ';
|
print _('You are not allowed to access this resource. ');
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -490,6 +491,7 @@ class ApiController extends Zend_Controller_Action
|
||||||
// If the file already exists we will update and make sure that
|
// If the file already exists we will update and make sure that
|
||||||
// it's marked as 'exists'.
|
// it's marked as 'exists'.
|
||||||
$file->setFileExistsFlag(true);
|
$file->setFileExistsFlag(true);
|
||||||
|
$file->setFileHiddenFlag(false);
|
||||||
$file->setMetadata($md);
|
$file->setMetadata($md);
|
||||||
}
|
}
|
||||||
if ($md['is_record'] != 0) {
|
if ($md['is_record'] != 0) {
|
||||||
|
@ -502,7 +504,7 @@ class ApiController extends Zend_Controller_Action
|
||||||
|
|
||||||
//File is not in database anymore.
|
//File is not in database anymore.
|
||||||
if (is_null($file)) {
|
if (is_null($file)) {
|
||||||
$return_hash['error'] = "File does not exist in Airtime.";
|
$return_hash['error'] = _("File does not exist in Airtime.");
|
||||||
|
|
||||||
return $return_hash;
|
return $return_hash;
|
||||||
}
|
}
|
||||||
|
@ -515,7 +517,7 @@ class ApiController extends Zend_Controller_Action
|
||||||
$md['MDATA_KEY_ORIGINAL_PATH']);
|
$md['MDATA_KEY_ORIGINAL_PATH']);
|
||||||
|
|
||||||
if (is_null($file)) {
|
if (is_null($file)) {
|
||||||
$return_hash['error'] = 'File does not exist in Airtime';
|
$return_hash['error'] = _('File does not exist in Airtime');
|
||||||
} else {
|
} else {
|
||||||
$filepath = $md['MDATA_KEY_FILEPATH'];
|
$filepath = $md['MDATA_KEY_FILEPATH'];
|
||||||
//$filepath = str_replace("\\", "", $filepath);
|
//$filepath = str_replace("\\", "", $filepath);
|
||||||
|
@ -527,7 +529,7 @@ class ApiController extends Zend_Controller_Action
|
||||||
$file = Application_Model_StoredFile::RecallByFilepath($filepath);
|
$file = Application_Model_StoredFile::RecallByFilepath($filepath);
|
||||||
|
|
||||||
if (is_null($file)) {
|
if (is_null($file)) {
|
||||||
$return_hash['error'] = "File doesn't exist in Airtime.";
|
$return_hash['error'] = _("File doesn't exist in Airtime.");
|
||||||
Logging::warn("Attempt to delete file that doesn't exist.
|
Logging::warn("Attempt to delete file that doesn't exist.
|
||||||
Path: '$filepath'");
|
Path: '$filepath'");
|
||||||
|
|
||||||
|
@ -573,7 +575,7 @@ class ApiController extends Zend_Controller_Action
|
||||||
Logging::info("Received bad request(key=$k), no 'mode' parameter. Bad request is:");
|
Logging::info("Received bad request(key=$k), no 'mode' parameter. Bad request is:");
|
||||||
Logging::info( $info_json );
|
Logging::info( $info_json );
|
||||||
array_push( $responses, array(
|
array_push( $responses, array(
|
||||||
'error' => "Bad request. no 'mode' parameter passed.",
|
'error' => _("Bad request. no 'mode' parameter passed."),
|
||||||
'key' => $k));
|
'key' => $k));
|
||||||
continue;
|
continue;
|
||||||
} elseif ( !in_array($info_json['mode'], $valid_modes) ) {
|
} elseif ( !in_array($info_json['mode'], $valid_modes) ) {
|
||||||
|
@ -583,7 +585,7 @@ class ApiController extends Zend_Controller_Action
|
||||||
Logging::info("Received bad request(key=$k). 'mode' parameter was invalid with value: '$mode'. Request:");
|
Logging::info("Received bad request(key=$k). 'mode' parameter was invalid with value: '$mode'. Request:");
|
||||||
Logging::info( $info_json );
|
Logging::info( $info_json );
|
||||||
array_push( $responses, array(
|
array_push( $responses, array(
|
||||||
'error' => "Bad request. 'mode' parameter is invalid",
|
'error' => _("Bad request. 'mode' parameter is invalid"),
|
||||||
'key' => $k,
|
'key' => $k,
|
||||||
'mode' => $mode ) );
|
'mode' => $mode ) );
|
||||||
continue;
|
continue;
|
||||||
|
@ -1003,4 +1005,13 @@ class ApiController extends Zend_Controller_Action
|
||||||
$this->view->data = $data;
|
$this->view->data = $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function updateStreamSettingTableAction() {
|
||||||
|
$request = $this->getRequest();
|
||||||
|
$data = json_decode($request->getParam("data"), true);
|
||||||
|
|
||||||
|
foreach ($data as $k=>$v) {
|
||||||
|
Application_Model_StreamSetting::SetListenerStatError($k, $v);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,31 +19,30 @@ 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');
|
||||||
$audioFileTitle = $this->_getParam('audioFileTitle');
|
$audioFileTitle = $this->_getParam('audioFileTitle');
|
||||||
$type = $this->_getParam('type');
|
$type = $this->_getParam('type');
|
||||||
|
|
||||||
$request = $this->getRequest();
|
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||||
$baseUrl = $request->getBaseUrl();
|
|
||||||
|
|
||||||
$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") {
|
||||||
|
@ -74,24 +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');
|
||||||
|
|
||||||
$request = $this->getRequest();
|
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||||
$baseUrl = $request->getBaseUrl();
|
|
||||||
|
|
||||||
$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;
|
||||||
|
@ -101,24 +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');
|
||||||
|
|
||||||
$request = $this->getRequest();
|
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||||
$baseUrl = $request->getBaseUrl();
|
|
||||||
|
|
||||||
$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;
|
||||||
|
@ -180,6 +177,8 @@ class AudiopreviewController extends Zend_Controller_Action
|
||||||
|
|
||||||
private function createElementMap($track)
|
private function createElementMap($track)
|
||||||
{
|
{
|
||||||
|
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||||
|
|
||||||
$elementMap = array( 'element_title' => isset($track['track_title'])?$track['track_title']:"",
|
$elementMap = array( 'element_title' => isset($track['track_title'])?$track['track_title']:"",
|
||||||
'element_artist' => isset($track['artist_name'])?$track['artist_name']:"",
|
'element_artist' => isset($track['artist_name'])?$track['artist_name']:"",
|
||||||
'element_id' => isset($track['id'])?$track['id']:"",
|
'element_id' => isset($track['id'])?$track['id']:"",
|
||||||
|
@ -213,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'] = "/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'];
|
||||||
}
|
}
|
||||||
|
@ -227,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');
|
||||||
|
|
||||||
$request = $this->getRequest();
|
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||||
$baseUrl = $request->getBaseUrl();
|
|
||||||
|
|
||||||
$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;
|
||||||
|
@ -258,6 +256,7 @@ class AudiopreviewController extends Zend_Controller_Action
|
||||||
*/
|
*/
|
||||||
public function getShowAction()
|
public function getShowAction()
|
||||||
{
|
{
|
||||||
|
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||||
// disable the view and the layout
|
// disable the view and the layout
|
||||||
$this->view->layout()->disableLayout();
|
$this->view->layout()->disableLayout();
|
||||||
$this->_helper->viewRenderer->setNoRender(true);
|
$this->_helper->viewRenderer->setNoRender(true);
|
||||||
|
@ -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'] = "/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'];
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,9 +33,9 @@ class DashboardController extends Zend_Controller_Action
|
||||||
Application_Model_RabbitMq::SendMessageToPypo("disconnect_source", $data);
|
Application_Model_RabbitMq::SendMessageToPypo("disconnect_source", $data);
|
||||||
} else {
|
} else {
|
||||||
if ($source_connected) {
|
if ($source_connected) {
|
||||||
$this->view->error = "You don't have permission to disconnect source.";
|
$this->view->error = _("You don't have permission to disconnect source.");
|
||||||
} else {
|
} else {
|
||||||
$this->view->error = "There is no source connected to this input.";
|
$this->view->error = _("There is no source connected to this input.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -79,12 +79,12 @@ class DashboardController extends Zend_Controller_Action
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if ($source_connected) {
|
if ($source_connected) {
|
||||||
$this->view->error = "You don't have permission to switch source.";
|
$this->view->error = _("You don't have permission to switch source.");
|
||||||
} else {
|
} else {
|
||||||
if ($sourcename == 'scheduled_play') {
|
if ($sourcename == 'scheduled_play') {
|
||||||
$this->view->error = "You don't have permission to disconnect source.";
|
$this->view->error = _("You don't have permission to disconnect source.");
|
||||||
} else {
|
} else {
|
||||||
$this->view->error = "There is no source connected to this input.";
|
$this->view->error = _("There is no source connected to this input.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -96,19 +96,18 @@ class DashboardController extends Zend_Controller_Action
|
||||||
|
|
||||||
public function streamPlayerAction()
|
public function streamPlayerAction()
|
||||||
{
|
{
|
||||||
global $CC_CONFIG;
|
$CC_CONFIG = Config::getConfig();
|
||||||
|
|
||||||
$request = $this->getRequest();
|
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||||
$baseUrl = $request->getBaseUrl();
|
|
||||||
|
|
||||||
$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";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -14,12 +14,12 @@ class ErrorController extends Zend_Controller_Action
|
||||||
|
|
||||||
// 404 error -- controller or action not found
|
// 404 error -- controller or action not found
|
||||||
$this->getResponse()->setHttpResponseCode(404);
|
$this->getResponse()->setHttpResponseCode(404);
|
||||||
$this->view->message = 'Page not found';
|
$this->view->message = _('Page not found');
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
// application error
|
// application error
|
||||||
$this->getResponse()->setHttpResponseCode(500);
|
$this->getResponse()->setHttpResponseCode(500);
|
||||||
$this->view->message = 'Application error';
|
$this->view->message = _('Application error');
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,45 +12,47 @@ class LibraryController extends Zend_Controller_Action
|
||||||
$ajaxContext = $this->_helper->getHelper('AjaxContext');
|
$ajaxContext = $this->_helper->getHelper('AjaxContext');
|
||||||
$ajaxContext->addActionContext('contents-feed', 'json')
|
$ajaxContext->addActionContext('contents-feed', 'json')
|
||||||
->addActionContext('delete', 'json')
|
->addActionContext('delete', 'json')
|
||||||
|
->addActionContext('duplicate', 'json')
|
||||||
->addActionContext('delete-group', 'json')
|
->addActionContext('delete-group', 'json')
|
||||||
->addActionContext('context-menu', 'json')
|
->addActionContext('context-menu', 'json')
|
||||||
->addActionContext('get-file-metadata', 'html')
|
->addActionContext('get-file-metadata', 'html')
|
||||||
->addActionContext('upload-file-soundcloud', 'json')
|
->addActionContext('upload-file-soundcloud', 'json')
|
||||||
->addActionContext('get-upload-to-soundcloud-status', 'json')
|
->addActionContext('get-upload-to-soundcloud-status', 'json')
|
||||||
->addActionContext('set-num-entries', 'json')
|
->addActionContext('set-num-entries', 'json')
|
||||||
|
->addActionContext('edit-file-md', 'json')
|
||||||
->initContext();
|
->initContext();
|
||||||
}
|
}
|
||||||
|
|
||||||
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/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 {
|
||||||
|
|
||||||
|
@ -90,7 +92,7 @@ class LibraryController extends Zend_Controller_Action
|
||||||
|
|
||||||
protected function playlistNotFound($p_type)
|
protected function playlistNotFound($p_type)
|
||||||
{
|
{
|
||||||
$this->view->error = "$p_type not found";
|
$this->view->error = sprintf(_("%s not found"), $p_type);
|
||||||
|
|
||||||
Logging::info("$p_type not found");
|
Logging::info("$p_type not found");
|
||||||
Application_Model_Library::changePlaylist(null, $p_type);
|
Application_Model_Library::changePlaylist(null, $p_type);
|
||||||
|
@ -99,7 +101,7 @@ class LibraryController extends Zend_Controller_Action
|
||||||
|
|
||||||
protected function playlistUnknownError($e)
|
protected function playlistUnknownError($e)
|
||||||
{
|
{
|
||||||
$this->view->error = "Something went wrong.";
|
$this->view->error = _("Something went wrong.");
|
||||||
Logging::info($e->getMessage());
|
Logging::info($e->getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -142,19 +144,21 @@ class LibraryController extends Zend_Controller_Action
|
||||||
|
|
||||||
public function contextMenuAction()
|
public function contextMenuAction()
|
||||||
{
|
{
|
||||||
|
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||||
$id = $this->_getParam('id');
|
$id = $this->_getParam('id');
|
||||||
$type = $this->_getParam('type');
|
$type = $this->_getParam('type');
|
||||||
//playlist||timeline
|
//playlist||timeline
|
||||||
$screen = $this->_getParam('screen');
|
$screen = $this->_getParam('screen');
|
||||||
$request = $this->getRequest();
|
|
||||||
$baseUrl = $request->getBaseUrl();
|
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||||
|
|
||||||
$menu = array();
|
$menu = array();
|
||||||
|
|
||||||
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
|
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
|
||||||
$user = new Application_Model_User($userInfo->id);
|
$user = new Application_Model_User($userInfo->id);
|
||||||
|
|
||||||
//Open a jPlayer window and play the audio clip.
|
//Open a jPlayer window and play the audio clip.
|
||||||
$menu["play"] = array("name"=> "Preview", "icon" => "play", "disabled" => false);
|
$menu["play"] = array("name"=> _("Preview"), "icon" => "play", "disabled" => false);
|
||||||
|
|
||||||
$isAdminOrPM = $user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER));
|
$isAdminOrPM = $user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER));
|
||||||
|
|
||||||
|
@ -175,23 +179,23 @@ class LibraryController extends Zend_Controller_Action
|
||||||
}
|
}
|
||||||
if ($isAdminOrPM || $obj->getCreatorId() == $user->getId()) {
|
if ($isAdminOrPM || $obj->getCreatorId() == $user->getId()) {
|
||||||
if ($obj_sess->type === "playlist") {
|
if ($obj_sess->type === "playlist") {
|
||||||
$menu["pl_add"] = array("name"=> "Add to Playlist", "icon" => "add-playlist", "icon" => "copy");
|
$menu["pl_add"] = array("name"=> _("Add to Playlist"), "icon" => "add-playlist", "icon" => "copy");
|
||||||
} elseif ($obj_sess->type === "block" && $obj->isStatic()) {
|
} elseif ($obj_sess->type === "block" && $obj->isStatic()) {
|
||||||
$menu["pl_add"] = array("name"=> "Add to Smart Block", "icon" => "add-playlist", "icon" => "copy");
|
$menu["pl_add"] = array("name"=> _("Add to Smart Block"), "icon" => "add-playlist", "icon" => "copy");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($isAdminOrPM || $file->getFileOwnerId() == $user->getId()) {
|
if ($isAdminOrPM || $file->getFileOwnerId() == $user->getId()) {
|
||||||
$menu["del"] = array("name"=> "Delete", "icon" => "delete", "url" => "/library/delete");
|
$menu["del"] = array("name"=> _("Delete"), "icon" => "delete", "url" => $baseUrl."library/delete");
|
||||||
$menu["edit"] = array("name"=> "Edit Metadata", "icon" => "edit", "url" => "/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");
|
||||||
} elseif ($type === 'block') {
|
} elseif ($type === 'block') {
|
||||||
$obj = new Application_Model_Block($id);
|
$obj = new Application_Model_Block($id);
|
||||||
if (!$obj->isStatic()) {
|
if (!$obj->isStatic()) {
|
||||||
|
@ -199,35 +203,38 @@ class LibraryController extends Zend_Controller_Action
|
||||||
}
|
}
|
||||||
if (($isAdminOrPM || $obj->getCreatorId() == $user->getId()) && $screen == "playlist") {
|
if (($isAdminOrPM || $obj->getCreatorId() == $user->getId()) && $screen == "playlist") {
|
||||||
if ($obj_sess->type === "playlist") {
|
if ($obj_sess->type === "playlist") {
|
||||||
$menu["pl_add"] = array("name"=> "Add to Playlist", "icon" => "add-playlist", "icon" => "copy");
|
$menu["pl_add"] = array("name"=> _("Add to Playlist"), "icon" => "add-playlist", "icon" => "copy");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($obj_sess->id !== $id && $screen == "playlist") {
|
if ($obj_sess->id !== $id && $screen == "playlist") {
|
||||||
if ($isAdminOrPM || $obj->getCreatorId() == $user->getId()) {
|
if ($isAdminOrPM || $obj->getCreatorId() == $user->getId()) {
|
||||||
$menu["edit"] = array("name"=> "Edit", "icon" => "edit");
|
$menu["edit"] = array("name"=> _("Edit"), "icon" => "edit");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($isAdminOrPM || $obj->getCreatorId() == $user->getId()) {
|
if ($isAdminOrPM || $obj->getCreatorId() == $user->getId()) {
|
||||||
$menu["del"] = array("name"=> "Delete", "icon" => "delete", "url" => "/library/delete");
|
$menu["del"] = array("name"=> _("Delete"), "icon" => "delete", "url" => $baseUrl."library/delete");
|
||||||
}
|
}
|
||||||
} elseif ($type == "stream") {
|
} elseif ($type == "stream") {
|
||||||
|
|
||||||
$webstream = CcWebstreamQuery::create()->findPK($id);
|
$webstream = CcWebstreamQuery::create()->findPK($id);
|
||||||
$obj = new Application_Model_Webstream($webstream);
|
$obj = new Application_Model_Webstream($webstream);
|
||||||
|
|
||||||
|
$menu["play"]["mime"] = $webstream->getDbMime();
|
||||||
|
|
||||||
if (isset($obj_sess->id) && $screen == "playlist") {
|
if (isset($obj_sess->id) && $screen == "playlist") {
|
||||||
if ($isAdminOrPM || $obj->getCreatorId() == $user->getId()) {
|
if ($isAdminOrPM || $obj->getCreatorId() == $user->getId()) {
|
||||||
if ($obj_sess->type === "playlist") {
|
if ($obj_sess->type === "playlist") {
|
||||||
$menu["pl_add"] = array("name"=> "Add to Playlist", "icon" => "add-playlist", "icon" => "copy");
|
$menu["pl_add"] = array("name"=> _("Add to Playlist"), "icon" => "add-playlist", "icon" => "copy");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($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" => "/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" => "/library/delete");
|
$menu["del"] = array("name"=> _("Delete"), "icon" => "delete", "url" => $baseUrl."library/delete");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -238,26 +245,26 @@ class LibraryController extends Zend_Controller_Action
|
||||||
$menu["sep1"] = "-----------";
|
$menu["sep1"] = "-----------";
|
||||||
|
|
||||||
//create a sub menu for Soundcloud actions.
|
//create a sub menu for Soundcloud actions.
|
||||||
$menu["soundcloud"] = array("name" => "Soundcloud", "icon" => "soundcloud", "items" => array());
|
$menu["soundcloud"] = array("name" => _("Soundcloud"), "icon" => "soundcloud", "items" => array());
|
||||||
|
|
||||||
$scid = $file->getSoundCloudId();
|
$scid = $file->getSoundCloudId();
|
||||||
|
|
||||||
if ($scid > 0) {
|
if ($scid > 0) {
|
||||||
$url = $file->getSoundCloudLinkToFile();
|
$url = $file->getSoundCloudLinkToFile();
|
||||||
$menu["soundcloud"]["items"]["view"] = array("name" => "View on Soundcloud", "icon" => "soundcloud", "url" => $url);
|
$menu["soundcloud"]["items"]["view"] = array("name" => _("View on Soundcloud"), "icon" => "soundcloud", "url" => $url);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!is_null($scid)) {
|
if (!is_null($scid)) {
|
||||||
$text = "Re-upload to SoundCloud";
|
$text = _("Re-upload to SoundCloud");
|
||||||
} else {
|
} else {
|
||||||
$text = "Upload to SoundCloud";
|
$text = _("Upload to SoundCloud");
|
||||||
}
|
}
|
||||||
|
|
||||||
$menu["soundcloud"]["items"]["upload"] = array("name" => $text, "icon" => "soundcloud", "url" => "/library/upload-file-soundcloud/id/{$id}");
|
$menu["soundcloud"]["items"]["upload"] = array("name" => $text, "icon" => "soundcloud", "url" => $baseUrl."library/upload-file-soundcloud/id/{$id}");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($menu)) {
|
if (empty($menu)) {
|
||||||
$menu["noaction"] = array("name"=>"No action available");
|
$menu["noaction"] = array("name"=>_("No action available"));
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->view->items = $menu;
|
$this->view->items = $menu;
|
||||||
|
@ -277,7 +284,7 @@ class LibraryController extends Zend_Controller_Action
|
||||||
$streams = array();
|
$streams = array();
|
||||||
|
|
||||||
$message = null;
|
$message = null;
|
||||||
$noPermissionMsg = "You don't have permission to delete selected items.";
|
$noPermissionMsg = _("You don't have permission to delete selected items.");
|
||||||
|
|
||||||
foreach ($mediaItems as $media) {
|
foreach ($mediaItems as $media) {
|
||||||
|
|
||||||
|
@ -326,7 +333,7 @@ class LibraryController extends Zend_Controller_Action
|
||||||
$message = $noPermissionMsg;
|
$message = $noPermissionMsg;
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
//could throw a scheduled in future exception.
|
//could throw a scheduled in future exception.
|
||||||
$message = "Could not delete some scheduled files.";
|
$message = _("Could not delete some scheduled files.");
|
||||||
Logging::debug($e->getMessage());
|
Logging::debug($e->getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -337,10 +344,42 @@ class LibraryController extends Zend_Controller_Action
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// duplicate playlist
|
||||||
|
public function duplicateAction(){
|
||||||
|
$params = $this->getRequest()->getParams();
|
||||||
|
$id = $params['id'];
|
||||||
|
|
||||||
|
$originalPl = new Application_Model_Playlist($id);
|
||||||
|
$newPl = new Application_Model_Playlist();
|
||||||
|
|
||||||
|
$contents = $originalPl->getContents();
|
||||||
|
foreach ($contents as &$c) {
|
||||||
|
if ($c['type'] == '0') {
|
||||||
|
$c[1] = 'audioclip';
|
||||||
|
} else if ($c['type'] == '2') {
|
||||||
|
$c[1] = 'block';
|
||||||
|
} else if ($c['type'] == '1') {
|
||||||
|
$c[1] = 'stream';
|
||||||
|
}
|
||||||
|
$c[0] = $c['item_id'];
|
||||||
|
}
|
||||||
|
$newPl->addAudioClips($contents, null, 'begining');
|
||||||
|
|
||||||
|
$newPl->setCreator(Application_Model_User::getCurrentUser()->getId());
|
||||||
|
$newPl->setDescription($originalPl->getDescription());
|
||||||
|
|
||||||
|
list($plFadeIn, ) = $originalPl->getFadeInfo(0);
|
||||||
|
list(, $plFadeOut) = $originalPl->getFadeInfo($originalPl->getSize()-1);
|
||||||
|
|
||||||
|
$newPl->setfades($plFadeIn, $plFadeOut);
|
||||||
|
$newPl->setName(sprintf(_("Copy of %s"), $originalPl->getName()));
|
||||||
|
}
|
||||||
|
|
||||||
public function contentsFeedAction()
|
public function contentsFeedAction()
|
||||||
{
|
{
|
||||||
$params = $this->getRequest()->getParams();
|
$params = $this->getRequest()->getParams();
|
||||||
|
|
||||||
|
# terrible name for the method below. it does not only search files.
|
||||||
$r = Application_Model_StoredFile::searchLibraryFiles($params);
|
$r = Application_Model_StoredFile::searchLibraryFiles($params);
|
||||||
|
|
||||||
//TODO move this to the datatables row callback.
|
//TODO move this to the datatables row callback.
|
||||||
|
@ -381,12 +420,17 @@ class LibraryController extends Zend_Controller_Action
|
||||||
}
|
}
|
||||||
|
|
||||||
$form = new Application_Form_EditAudioMD();
|
$form = new Application_Form_EditAudioMD();
|
||||||
|
$form->startForm($file_id);
|
||||||
$form->populate($file->getDbColMetadata());
|
$form->populate($file->getDbColMetadata());
|
||||||
|
|
||||||
if ($request->isPost()) {
|
if ($request->isPost()) {
|
||||||
if ($form->isValid($request->getPost())) {
|
if ($form->isValid($request->getPost())) {
|
||||||
|
|
||||||
$formdata = $form->getValues();
|
$formValues = $this->_getParam('data', null);
|
||||||
|
$formdata = array();
|
||||||
|
foreach ($formValues as $val) {
|
||||||
|
$formdata[$val["name"]] = $val["value"];
|
||||||
|
}
|
||||||
$file->setDbColMetadata($formdata);
|
$file->setDbColMetadata($formdata);
|
||||||
|
|
||||||
$data = $file->getMetadata();
|
$data = $file->getMetadata();
|
||||||
|
@ -401,6 +445,7 @@ class LibraryController extends Zend_Controller_Action
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->view->form = $form;
|
$this->view->form = $form;
|
||||||
|
$this->view->dialog = $this->view->render('library/edit-file-md.phtml');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getFileMetadataAction()
|
public function getFileMetadataAction()
|
||||||
|
@ -453,10 +498,10 @@ class LibraryController extends Zend_Controller_Action
|
||||||
|
|
||||||
$this->view->md = $md;
|
$this->view->md = $md;
|
||||||
if ($block->isStatic()) {
|
if ($block->isStatic()) {
|
||||||
$this->view->blType = 'Static';
|
$this->view->blType = _('Static');
|
||||||
$this->view->contents = $block->getContents();
|
$this->view->contents = $block->getContents();
|
||||||
} else {
|
} else {
|
||||||
$this->view->blType = 'Dynamic';
|
$this->view->blType = _('Dynamic');
|
||||||
$this->view->contents = $block->getCriteria();
|
$this->view->contents = $block->getCriteria();
|
||||||
}
|
}
|
||||||
$this->view->block = $block;
|
$this->view->block = $block;
|
||||||
|
|
|
@ -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();
|
||||||
|
@ -47,6 +47,18 @@ class ListenerstatController extends Zend_Controller_Action
|
||||||
'his_time_end' => $end->format("H:i")
|
'his_time_end' => $end->format("H:i")
|
||||||
));
|
));
|
||||||
|
|
||||||
|
$errorStatus = Application_Model_StreamSetting::GetAllListenerStatErrors();
|
||||||
|
Logging::info($errorStatus);
|
||||||
|
$out = array();
|
||||||
|
foreach ($errorStatus as $v) {
|
||||||
|
$key = explode('_listener_stat_error', $v['keyname']);
|
||||||
|
if ($v['value'] != 'OK') {
|
||||||
|
$v['value'] = _("Please make sure admin user/password is correct on System->Streams page.");
|
||||||
|
}
|
||||||
|
$out[$key[0]] = $v['value'];
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->view->errorStatus = $out;
|
||||||
$this->view->date_form = $form;
|
$this->view->date_form = $form;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
396
airtime_mvc/application/controllers/LocaleController.php
Normal file
396
airtime_mvc/application/controllers/LocaleController.php
Normal file
|
@ -0,0 +1,396 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
class LocaleController extends Zend_Controller_Action
|
||||||
|
{
|
||||||
|
public function init()
|
||||||
|
{
|
||||||
|
$ajaxContext = $this->_helper->getHelper("AjaxContext");
|
||||||
|
$ajaxContext->addActionContext("general-translation-table", "json")
|
||||||
|
->addActionContext("datatables-translation-table", "json")
|
||||||
|
->initContext();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function datatablesTranslationTableAction()
|
||||||
|
{
|
||||||
|
$this->view->layout()->disableLayout();
|
||||||
|
$this->_helper->viewRenderer->setNoRender(true);
|
||||||
|
header("Content-type: text/javascript");
|
||||||
|
|
||||||
|
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||||
|
$locale = Application_Model_Preference::GetLocale();
|
||||||
|
echo "var datatables_dict =" .
|
||||||
|
file_get_contents(Application_Common_OsPath::join(
|
||||||
|
$_SERVER["DOCUMENT_ROOT"],
|
||||||
|
$baseUrl,
|
||||||
|
"js/datatables/i18n/",
|
||||||
|
$locale.".txt")
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function generalTranslationTableAction()
|
||||||
|
{
|
||||||
|
$translations = array (
|
||||||
|
//common/common.js
|
||||||
|
"Audio Player" => _("Audio Player"),
|
||||||
|
//dashboard/dashboard.js
|
||||||
|
"Recording:" => _("Recording:"),
|
||||||
|
"Master Stream" => _("Master Stream"),
|
||||||
|
"Live Stream" => _("Live Stream"),
|
||||||
|
"Nothing Scheduled" => _("Nothing Scheduled"),
|
||||||
|
"Current Show:" => _("Current Show:"),
|
||||||
|
"Current" => _("Current"),
|
||||||
|
//dashboard/versiontooltip.js
|
||||||
|
"You are running the latest version" => _("You are running the latest version"),
|
||||||
|
"New version available: " => _("New version available: "),
|
||||||
|
"This version will soon be obsolete." => _("This version will soon be obsolete."),
|
||||||
|
"This version is no longer supported." => _("This version is no longer supported."),
|
||||||
|
"Please upgrade to " => _("Please upgrade to "),
|
||||||
|
//library/events/library_playlistbuilder.js
|
||||||
|
"Add to current playlist" => _("Add to current playlist"),
|
||||||
|
"Add to current smart block" => _("Add to current smart block"),
|
||||||
|
"Adding 1 Item" => _("Adding 1 Item"),
|
||||||
|
"Adding %s Items" => _("Adding %s Items"),
|
||||||
|
"You can only add tracks to smart blocks." => _("You can only add tracks to smart blocks."),
|
||||||
|
"You can only add tracks, smart blocks, and webstreams to playlists." => _("You can only add tracks, smart blocks, and webstreams to playlists."),
|
||||||
|
//library/events/library_showbuilder.js
|
||||||
|
//already in library/events/library_playlistbuilder.js
|
||||||
|
"Please select a cursor position on timeline." => _("Please select a cursor position on timeline."),
|
||||||
|
//"Adding 1 Item" => _("Adding 1 Item"),
|
||||||
|
//"Adding %s Items" => _("Adding %s Items"),
|
||||||
|
//library/library.js
|
||||||
|
"Edit Metadata" => _("Edit Metadata"),
|
||||||
|
"Add to selected show" => _("Add to selected show"),
|
||||||
|
"Select" => _("Select"),
|
||||||
|
"Select this page" => _("Select this page"),
|
||||||
|
"Deselect this page" => _("Deselect this page"),
|
||||||
|
"Deselect all" => _("Deselect all"),
|
||||||
|
"Are you sure you want to delete the selected item(s)?" => _("Are you sure you want to delete the selected item(s)?"),
|
||||||
|
"Title" => _("Title"),
|
||||||
|
"Creator" => _("Creator"),
|
||||||
|
"Album" => _("Album"),
|
||||||
|
"Bit Rate" => _("Bit Rate"),
|
||||||
|
"BPM" => _("BPM"),
|
||||||
|
"Composer" => _("Composer"),
|
||||||
|
"Conductor" => _("Conductor"),
|
||||||
|
"Copyright" => _("Copyright"),
|
||||||
|
"Encoded By" => _("Encoded By"),
|
||||||
|
"Genre" => _("Genre"),
|
||||||
|
"ISRC" => _("ISRC"),
|
||||||
|
"Label" => _("Label"),
|
||||||
|
"Language" => _("Language"),
|
||||||
|
"Last Modified" => _("Last Modified"),
|
||||||
|
"Last Played" => _("Last Played"),
|
||||||
|
"Length" => _("Length"),
|
||||||
|
"Mime" => _("Mime"),
|
||||||
|
"Mood" => _("Mood"),
|
||||||
|
"Owner" => _("Owner"),
|
||||||
|
"Replay Gain" => _("Replay Gain"),
|
||||||
|
"Sample Rate" => _("Sample Rate"),
|
||||||
|
"Track Number" => _("Track Number"),
|
||||||
|
"Uploaded" => _("Uploaded"),
|
||||||
|
"Website" => _("Website"),
|
||||||
|
"Year" => _("Year"),
|
||||||
|
"Loading..." => _("Loading..."),
|
||||||
|
"All" => _("All"),
|
||||||
|
"Files" => _("Files"),
|
||||||
|
"Playlists" => _("Playlists"),
|
||||||
|
"Smart Blocks" => _("Smart Blocks"),
|
||||||
|
"Web Streams" => _("Web Streams"),
|
||||||
|
"Unknown type: " => _("Unknown type: "),
|
||||||
|
"Are you sure you want to delete the selected item?" => _("Are you sure you want to delete the selected item?"),
|
||||||
|
"Uploading in progress..." => _("Uploading in progress..."),
|
||||||
|
"Retrieving data from the server..." => _("Retrieving data from the server..."),
|
||||||
|
"The soundcloud id for this file is: " => _("The soundcloud id for this file is: "),
|
||||||
|
"There was an error while uploading to soundcloud." => _("There was an error while uploading to soundcloud."),
|
||||||
|
"Error code: " => _("Error code: "),
|
||||||
|
"Error msg: " => _("Error msg: "),
|
||||||
|
"Input must be a positive number" => _("Input must be a positive number"),
|
||||||
|
"Input must be a number" => _("Input must be a number"),
|
||||||
|
"Input must be in the format: yyyy-mm-dd" => _("Input must be in the format: yyyy-mm-dd"),
|
||||||
|
"Input must be in the format: hh:mm:ss.t" => _("Input must be in the format: hh:mm:ss.t"),
|
||||||
|
//library/plupload.js
|
||||||
|
"You are currently uploading files. %sGoing to another screen will cancel the upload process. %sAre you sure you want to leave the page?"
|
||||||
|
=> _("You are currently uploading files. %sGoing to another screen will cancel the upload process. %sAre you sure you want to leave the page?"),
|
||||||
|
//library/spl.js
|
||||||
|
"please put in a time '00:00:00 (.0)'" => _("please put in a time '00:00:00 (.0)'"),
|
||||||
|
"please put in a time in seconds '00 (.0)'" => _("please put in a time in seconds '00 (.0)'"),
|
||||||
|
"Your browser does not support playing this file type: " => _("Your browser does not support playing this file type: "),
|
||||||
|
"Dynamic block is not previewable" => _("Dynamic block is not previewable"),
|
||||||
|
"Limit to: " => _("Limit to: "),
|
||||||
|
"Playlist saved" => _("Playlist saved"),
|
||||||
|
"Playlist shuffled" => _("Playlist shuffled"),
|
||||||
|
"Airtime is unsure about the status of this file. This can happen when the file is on a remote drive that is unaccessible or the file is in a directory that isn't 'watched' anymore."
|
||||||
|
=> _("Airtime is unsure about the status of this file. This can happen when the file is on a remote drive that is unaccessible or the file is in a directory that isn't 'watched' anymore."),
|
||||||
|
//listenerstat/listenerstat.js
|
||||||
|
"Listener Count on %s: %s" => _("Listener Count on %s: %s"),
|
||||||
|
//nowplaying/register.js
|
||||||
|
"Remind me in 1 week" => _("Remind me in 1 week"),
|
||||||
|
"Remind me never" => _("Remind me never"),
|
||||||
|
"Yes, help Airtime" => _("Yes, help Airtime"),
|
||||||
|
"Image must be one of jpg, jpeg, png, or gif" => _("Image must be one of jpg, jpeg, png, or gif"),
|
||||||
|
//playlist/smart_blockbuilder.js
|
||||||
|
"A static smart block will save the criteria and generate the block content immediately. This allows you to edit and view it in the Library before adding it to a show."
|
||||||
|
=> _("A static smart block will save the criteria and generate the block content immediately. This allows you to edit and view it in the Library before adding it to a show."),
|
||||||
|
"A dynamic smart block will only save the criteria. The block content will get generated upon adding it to a show. You will not be able to view and edit the content in the Library."
|
||||||
|
=> _("A dynamic smart block will only save the criteria. The block content will get generated upon adding it to a show. You will not be able to view and edit the content in the Library."),
|
||||||
|
"The desired block length will not be reached if Airtime cannot find enough unique tracks to match your criteria. Enable this option if you wish to allow tracks to be added multiple times to the smart block."
|
||||||
|
=> _("The desired block length will not be reached if Airtime cannot find enough unique tracks to match your criteria. Enable this option if you wish to allow tracks to be added multiple times to the smart block."),
|
||||||
|
"Smart block shuffled" => _("Smart block shuffled"),
|
||||||
|
"Smart block generated and criteria saved" => _("Smart block generated and criteria saved"),
|
||||||
|
"Smart block saved" => _("Smart block saved"),
|
||||||
|
"Processing..." => _("Processing..."),
|
||||||
|
"Select modifier" => _("Select modifier"),
|
||||||
|
"contains" => _("contains"),
|
||||||
|
"does not contain" => _("does not contain"),
|
||||||
|
"is" => _("is"),
|
||||||
|
"is not" => _("is not"),
|
||||||
|
"starts with" => _("starts with"),
|
||||||
|
"ends with" => _("ends with"),
|
||||||
|
"is greater than" => _("is greater than"),
|
||||||
|
"is less than" => _("is less than"),
|
||||||
|
"is in the range" => _("is in the range"),
|
||||||
|
//playouthistory/historytable.js
|
||||||
|
"Title" => _("Title"),
|
||||||
|
"Creator" => _("Creator"),
|
||||||
|
"Played" => _("Played"),
|
||||||
|
"Length" => _("Length"),
|
||||||
|
"Composer" => _("Composer"),
|
||||||
|
"Copyright" => _("Copyright"),
|
||||||
|
"All" => _("All"),
|
||||||
|
"Copied %s row%s to the clipboard" => _("Copied %s row%s to the clipboard"),
|
||||||
|
"%sPrint view%sPlease use your browser's print function to print this table. Press escape when finished." => _("%sPrint view%sPlease use your browser's print function to print this table. Press escape when finished."),
|
||||||
|
//preferences/musicdirs.js
|
||||||
|
"Choose Storage Folder" => _("Choose Storage Folder"),
|
||||||
|
"Choose Folder to Watch" => _("Choose Folder to Watch"),
|
||||||
|
"Are you sure you want to change the storage folder?\nThis will remove the files from your Airtime library!"
|
||||||
|
=> _("Are you sure you want to change the storage folder?\nThis will remove the files from your Airtime library!"),
|
||||||
|
"Manage Media Folders" => _("Manage Media Folders"),
|
||||||
|
"Are you sure you want to remove the watched folder?" => _("Are you sure you want to remove the watched folder?"),
|
||||||
|
"This path is currently not accessible." => _("This path is currently not accessible."),
|
||||||
|
//preferences/streamsetting.js
|
||||||
|
"Connected to the streaming server" => _("Connected to the streaming server"),
|
||||||
|
"The stream is disabled" => _("The stream is disabled"),
|
||||||
|
"Getting information from the server..." => _("Getting information from the server..."),
|
||||||
|
"Can not connect to the streaming server" => _("Can not connect to the streaming server"),
|
||||||
|
"If Airtime is behind a router or firewall, you may need to configure port forwarding and this field information will be incorrect. In this case you will need to manually update this field so it shows the correct host/port/mount that your DJ's need to connect to. The allowed range is between 1024 and 49151."
|
||||||
|
=> _("If Airtime is behind a router or firewall, you may need to configure port forwarding and this field information will be incorrect. In this case you will need to manually update this field so it shows the correct host/port/mount that your DJ's need to connect to. The allowed range is between 1024 and 49151."),
|
||||||
|
"For more details, please read the %sAirtime Manual%s" => _("For more details, please read the %sAirtime Manual%s"),
|
||||||
|
"Check this option to enable metadata for OGG streams (stream metadata is the track title, artist, and show name that is displayed in an audio player). VLC and mplayer have a serious bug when playing an OGG/VORBIS stream that has metadata information enabled: they will disconnect from the stream after every song. If you are using an OGG stream and your listeners do not require support for these audio players, then feel free to enable this option."
|
||||||
|
=> _("Check this option to enable metadata for OGG streams (stream metadata is the track title, artist, and show name that is displayed in an audio player). VLC and mplayer have a serious bug when playing an OGG/VORBIS stream that has metadata information enabled: they will disconnect from the stream after every song. If you are using an OGG stream and your listeners do not require support for these audio players, then feel free to enable this option."),
|
||||||
|
"Check this box to automatically switch off Master/Show source upon source disconnection." => _("Check this box to automatically switch off Master/Show source upon source disconnection."),
|
||||||
|
"Check this box to automatically switch on Master/Show source upon source connection." => _("Check this box to automatically switch on Master/Show source upon source connection."),
|
||||||
|
"If your Icecast server expects a username of 'source', this field can be left blank." => _("If your Icecast server expects a username of 'source', this field can be left blank."),
|
||||||
|
"If your live streaming client does not ask for a username, this field should be 'source'." => _("If your live streaming client does not ask for a username, this field should be 'source'."),
|
||||||
|
"If you change the username or password values for an enabled stream the playout engine will be rebooted and your listeners will hear silence for 5-10 seconds. Changing the following fields will NOT cause a reboot: Stream Label (Global Settings), and Switch Transition Fade(s), Master Username, and Master Password (Input Stream Settings). If Airtime is recording, and if the change causes a playout engine restart, the recording will be interrupted."
|
||||||
|
=> _("If you change the username or password values for an enabled stream the playout engine will be rebooted and your listeners will hear silence for 5-10 seconds. Changing the following fields will NOT cause a reboot: Stream Label (Global Settings), and Switch Transition Fade(s), Master Username, and Master Password (Input Stream Settings). If Airtime is recording, and if the change causes a playout engine restart, the recording will be interrupted."),
|
||||||
|
"This is the admin username and password for Icecast/SHOUTcast to get listener statistics." => _("This is the admin username and password for Icecast/SHOUTcast to get listener statistics."),
|
||||||
|
//preferences/support-setting.js
|
||||||
|
"Image must be one of jpg, jpeg, png, or gif" => _("Image must be one of jpg, jpeg, png, or gif"),
|
||||||
|
//schedule/add-show.js
|
||||||
|
"No result found" => _("No result found"),
|
||||||
|
"This follows the same security pattern for the shows: only users assigned to the show can connect." => _("This follows the same security pattern for the shows: only users assigned to the show can connect."),
|
||||||
|
"Specify custom authentication which will work only for this show." => _("Specify custom authentication which will work only for this show."),
|
||||||
|
"If your live streaming client does not ask for a username, this field should be 'source'." => _("If your live streaming client does not ask for a username, this field should be 'source'."),
|
||||||
|
"The show instance doesn't exist anymore!" => _("The show instance doesn't exist anymore!"),
|
||||||
|
//schedule/full-calendar-functions
|
||||||
|
//already in schedule/add-show.js
|
||||||
|
//"The show instance doesn't exist anymore!" => _("The show instance doesn't exist anymore!"),
|
||||||
|
"Show" => _("Show"),
|
||||||
|
"Show is empty" => _("Show is empty"),
|
||||||
|
"1m" => _("1m"),
|
||||||
|
"5m" => _("5m"),
|
||||||
|
"10m" => _("10m"),
|
||||||
|
"15m" => _("15m"),
|
||||||
|
"30m" => _("30m"),
|
||||||
|
"60m" => _("60m"),
|
||||||
|
"Uploading in progress..." => _("Uploading in progress..."),
|
||||||
|
"Retreiving data from the server..." => _("Retreiving data from the server..."),
|
||||||
|
//already in library/library.js
|
||||||
|
//"The soundcloud id for this file is: " => _("The soundcloud id for this file is: "),
|
||||||
|
//"There was error while uploading to soundcloud." => _("There was error while uploading to soundcloud."),
|
||||||
|
//"Error code: " => _("Error code: "),
|
||||||
|
//"Error msg: " => _("Error msg: "),
|
||||||
|
"This show has no scheduled content." => _("This show has no scheduled content."),
|
||||||
|
"This show is not completely filled with content." => _("This show is not completely filled with content."),
|
||||||
|
//already in schedule/add-show.js
|
||||||
|
//"The show instance doesn"t exist anymore!" => _("The show instance doesn"t exist anymore!"),
|
||||||
|
//schedule/schedule.js
|
||||||
|
"January" => _("January"),
|
||||||
|
"February" => _("February"),
|
||||||
|
"March" => _("March"),
|
||||||
|
"April" => _("April"),
|
||||||
|
"May" => _("May"),
|
||||||
|
"June" => _("June"),
|
||||||
|
"July" => _("July"),
|
||||||
|
"August" => _("August"),
|
||||||
|
"September" => _("September"),
|
||||||
|
"October" => _("October"),
|
||||||
|
"November" => _("November"),
|
||||||
|
"December" => _("December"),
|
||||||
|
"Jan" => _("Jan"),
|
||||||
|
"Feb" => _("Feb"),
|
||||||
|
"Mar" => _("Mar"),
|
||||||
|
"Apr" => _("Apr"),
|
||||||
|
"May" => _("May"),
|
||||||
|
"Jun" => _("Jun"),
|
||||||
|
"Jul" => _("Jul"),
|
||||||
|
"Aug" => _("Aug"),
|
||||||
|
"Sep" => _("Sep"),
|
||||||
|
"Oct" => _("Oct"),
|
||||||
|
"Nov" => _("Nov"),
|
||||||
|
"Dec" => _("Dec"),
|
||||||
|
"today" => _("today"),
|
||||||
|
"day" => _("day"),
|
||||||
|
"week" => _("week"),
|
||||||
|
"month" => _("month"),
|
||||||
|
"Sunday" => _("Sunday"),
|
||||||
|
"Monday" => _("Monday"),
|
||||||
|
"Tuesday" => _("Tuesday"),
|
||||||
|
"Wednesday" => _("Wednesday"),
|
||||||
|
"Thursday" => _("Thursday"),
|
||||||
|
"Friday" => _("Friday"),
|
||||||
|
"Saturday" => _("Saturday"),
|
||||||
|
"Sun" => _("Sun"),
|
||||||
|
"Mon" => _("Mon"),
|
||||||
|
"Tue" => _("Tue"),
|
||||||
|
"Wed" => _("Wed"),
|
||||||
|
"Thu" => _("Thu"),
|
||||||
|
"Fri" => _("Fri"),
|
||||||
|
"Sat" => _("Sat"),
|
||||||
|
"Shows longer than their scheduled time will be cut off by a following show." => _("Shows longer than their scheduled time will be cut off by a following show."),
|
||||||
|
"Cancel Current Show?" => _("Cancel Current Show?"),
|
||||||
|
"Stop recording current show?" => _("Stop recording current show?"),
|
||||||
|
"Ok" => _("Ok"),
|
||||||
|
"Contents of Show" => _("Contents of Show"),
|
||||||
|
//already in schedule/add-show.js
|
||||||
|
//"The show instance doesn"t exist anymore!" => _("The show instance doesn"t exist anymore!"),
|
||||||
|
"Remove all content?" => _("Remove all content?"),
|
||||||
|
//showbuilder/builder.js
|
||||||
|
"Delete selected item(s)?" => _("Delete selected item(s)?"),
|
||||||
|
"Start" => _("Start"),
|
||||||
|
"End" => _("End"),
|
||||||
|
"Duration" => _("Duration"),
|
||||||
|
//already in library/library.js
|
||||||
|
//"Title" => _("Title"),
|
||||||
|
//"Creator" => _("Creator"),
|
||||||
|
//"Album" => _("Album"),
|
||||||
|
//"Mime" => _("Mime"),
|
||||||
|
"Cue In" => _("Cue In"),
|
||||||
|
"Cue Out" => _("Cue Out"),
|
||||||
|
"Fade In" => _("Fade In"),
|
||||||
|
"Fade Out" => _("Fade Out"),
|
||||||
|
"Show Empty" => _("Show Empty"),
|
||||||
|
"Recording From Line In" => _("Recording From Line In"),
|
||||||
|
"Track preview" => _("Track preview"),
|
||||||
|
//already in library/spl.js
|
||||||
|
//"Airtime is unsure about the status of this file. This can happen when the file is on a remote drive that is unaccessible or the file is in a directory that isn"t "watched" anymore."
|
||||||
|
//=> _("Airtime is unsure about the status of this file. This can happen when the file is on a remote drive that is unaccessible or the file is in a directory that isn"t "watched" anymore."),
|
||||||
|
"Cannot schedule outside a show." => _("Cannot schedule outside a show."),
|
||||||
|
"Moving 1 Item" => _("Moving 1 Item"),
|
||||||
|
"Moving %s Items" => _("Moving %s Items"),
|
||||||
|
//already in library/library.js
|
||||||
|
//"Select" => _("Select"),
|
||||||
|
"Select all" => _("Select all"),
|
||||||
|
"Select none" => _("Select none"),
|
||||||
|
"Remove overbooked tracks" => _("Remove overbooked tracks"),
|
||||||
|
"Remove selected scheduled items" => _("Remove selected scheduled items"),
|
||||||
|
"Jump to the current playing track" => _("Jump to the current playing track"),
|
||||||
|
"Cancel current show" => _("Cancel current show"),
|
||||||
|
//already in schedule/schedule.js
|
||||||
|
//"Cancel Current Show?" => _("Cancel Current Show?"),
|
||||||
|
"Stop recording current show?" => _("Stop recording current show?"),
|
||||||
|
//showbuilder/main_builder.js
|
||||||
|
"Open library to add or remove content" => _("Open library to add or remove content"),
|
||||||
|
"Add / Remove Content" => _("Add / Remove Content"),
|
||||||
|
//status/status.js
|
||||||
|
"in use" => _("in use"),
|
||||||
|
"Disk" => _("Disk"),
|
||||||
|
//serverbrowse/serverbrowse.js
|
||||||
|
"Look in" => _("Look in"),
|
||||||
|
"Cancel" => _("Cancel"),
|
||||||
|
"Open" => _("Open"),
|
||||||
|
//user/user.js
|
||||||
|
"Admin" => _("Admin"),
|
||||||
|
"DJ" => _("DJ"),
|
||||||
|
"Program Manager" => _("Program Manager"),
|
||||||
|
"Guest" => _("Guest"),
|
||||||
|
"Guests can do the following:" => _("Guests can do the following:"),
|
||||||
|
"View schedule" => _("View schedule"),
|
||||||
|
"View show content" => _("View show content"),
|
||||||
|
"DJs can do the following:" => _("DJs can do the following:"),
|
||||||
|
"Manage assigned show content" => _("Manage assigned show content"),
|
||||||
|
"Import media files" => _("Import media files"),
|
||||||
|
"Create playlists, smart blocks, and webstreams" => _("Create playlists, smart blocks, and webstreams"),
|
||||||
|
"Manage their own library content" => _("Manage their own library content"),
|
||||||
|
"Progam Managers can do the following:" => _("Progam Managers can do the following:"),
|
||||||
|
"View and manage show content" => _("View and manage show content"),
|
||||||
|
"Schedule shows" => _("Schedule shows"),
|
||||||
|
"Manage all library content" => _("Manage all library content"),
|
||||||
|
"Admins can do the following:" => _("Admins can do the following:"),
|
||||||
|
"Manage preferences" => _("Manage preferences"),
|
||||||
|
"Manage users" => _("Manage users"),
|
||||||
|
"Manage watched folders" => _("Manage watched folders"),
|
||||||
|
"Send support feedback" => _("Send support feedback"),
|
||||||
|
"View system status" => _("View system status"),
|
||||||
|
"Access playout history" => _("Access playout history"),
|
||||||
|
"View listener stats" => _("View listener stats"),
|
||||||
|
//dataTables/ColVis.js
|
||||||
|
"Show / hide columns" => _("Show / hide columns"),
|
||||||
|
//datatables.columnFilter.js
|
||||||
|
"From {from} to {to}" => _("From {from} to {to}"),
|
||||||
|
"kbps" => _("kbps"),
|
||||||
|
"yyyy-mm-dd" => _("yyyy-mm-dd"),
|
||||||
|
"hh:mm:ss.t" => _("hh:mm:ss.t"),
|
||||||
|
"kHz" => _("kHz"),
|
||||||
|
//datepicker
|
||||||
|
//months are already in schedule/schedule.js
|
||||||
|
"Su" => _("Su"),
|
||||||
|
"Mo" => _("Mo"),
|
||||||
|
"Tu" => _("Tu"),
|
||||||
|
"We" => _("We"),
|
||||||
|
"Th" => _("Th"),
|
||||||
|
"Fr" => _("Fr"),
|
||||||
|
"Sa" => _("Sa"),
|
||||||
|
"Close" => _("Close"),
|
||||||
|
//timepicker
|
||||||
|
"Hour" => _("Hour"),
|
||||||
|
"Minute" => _("Minute"),
|
||||||
|
"Done" => _("Done"),
|
||||||
|
//plupload ships with translation files but a lot are incomplete
|
||||||
|
//so we will keep them here to prevent incomplete translations
|
||||||
|
"Select files" => _("Select files"),
|
||||||
|
"Add files to the upload queue and click the start button." => _("Add files to the upload queue and click the start button."),
|
||||||
|
"Filename" => _("Add files to the upload queue and click the start button."),
|
||||||
|
"Status" => _("Status"),
|
||||||
|
"Size" => _("Status"),
|
||||||
|
"Add Files" => _("Add Files"),
|
||||||
|
"Stop Upload" => _("Stop Upload"),
|
||||||
|
"Start upload" => _("Start upload"),
|
||||||
|
"Add files" => _("Add files"),
|
||||||
|
"Uploaded %d/%d files"=> _("Uploaded %d/%d files"),
|
||||||
|
"N/A" => _("N/A"),
|
||||||
|
"Drag files here." => _("Drag files here."),
|
||||||
|
"File extension error." => _("File extension error."),
|
||||||
|
"File size error." => _("File size error."),
|
||||||
|
"File count error." => _("File count error."),
|
||||||
|
"Init error." => _("Init error."),
|
||||||
|
"HTTP Error." => _("HTTP Error."),
|
||||||
|
"Security error." => _("Security error."),
|
||||||
|
"Generic error." => _("Generic error."),
|
||||||
|
"IO error." => _("IO error."),
|
||||||
|
"File: %s" => _("File: %s"),
|
||||||
|
"Close" => _("Close"),
|
||||||
|
"%d files queued" => _("%d files queued"),
|
||||||
|
"File: %f, size: %s, max file size: %m" => _("File: %f, size: %s, max file size: %m"),
|
||||||
|
"Upload URL might be wrong or doesn't exist" => _("Upload URL might be wrong or doesn't exist"),
|
||||||
|
"Error: File too large: " => _("Error: File too large: "),
|
||||||
|
"Error: Invalid file extension: " => _("Error: Invalid file extension: ")
|
||||||
|
|
||||||
|
);
|
||||||
|
$this->view->layout()->disableLayout();
|
||||||
|
$this->_helper->viewRenderer->setNoRender(true);
|
||||||
|
header("Content-type: text/javascript");
|
||||||
|
echo "var general_dict=".json_encode($translations);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -5,14 +5,18 @@ class LoginController extends Zend_Controller_Action
|
||||||
|
|
||||||
public function init()
|
public function init()
|
||||||
{
|
{
|
||||||
/* Initialize action controller here */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function indexAction()
|
public function indexAction()
|
||||||
{
|
{
|
||||||
global $CC_CONFIG;
|
$CC_CONFIG = Config::getConfig();
|
||||||
|
|
||||||
|
$request = $this->getRequest();
|
||||||
|
|
||||||
|
Application_Model_Locale::configureLocalization($request->getcookie('airtime_locale', 'en_CA'));
|
||||||
|
if (Zend_Auth::getInstance()->hasIdentity())
|
||||||
|
{
|
||||||
|
|
||||||
if (Zend_Auth::getInstance()->hasIdentity()) {
|
|
||||||
$this->_redirect('Showbuilder');
|
$this->_redirect('Showbuilder');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,14 +24,14 @@ class LoginController extends Zend_Controller_Action
|
||||||
$this->_helper->layout->setLayout('login');
|
$this->_helper->layout->setLayout('login');
|
||||||
|
|
||||||
$error = false;
|
$error = false;
|
||||||
$request = $this->getRequest();
|
|
||||||
$baseUrl = $request->getBaseUrl();
|
|
||||||
|
|
||||||
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/login/login.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||||
|
|
||||||
|
$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();
|
||||||
|
|
||||||
$message = "Please enter your user name and password";
|
$message = _("Please enter your user name and password");
|
||||||
|
|
||||||
if ($request->isPost()) {
|
if ($request->isPost()) {
|
||||||
// if the post contains recaptcha field, which means form had recaptcha field.
|
// if the post contains recaptcha field, which means form had recaptcha field.
|
||||||
|
@ -39,6 +43,7 @@ class LoginController extends Zend_Controller_Action
|
||||||
//get the username and password from the form
|
//get the username and password from the form
|
||||||
$username = $form->getValue('username');
|
$username = $form->getValue('username');
|
||||||
$password = $form->getValue('password');
|
$password = $form->getValue('password');
|
||||||
|
$locale = $form->getValue('locale');
|
||||||
if (Application_Model_Subjects::getLoginAttempts($username) >= 3 && $form->getElement('captcha') == NULL) {
|
if (Application_Model_Subjects::getLoginAttempts($username) >= 3 && $form->getElement('captcha') == NULL) {
|
||||||
$form->addRecaptcha();
|
$form->addRecaptcha();
|
||||||
} else {
|
} else {
|
||||||
|
@ -64,9 +69,12 @@ class LoginController extends Zend_Controller_Action
|
||||||
$tempSess = new Zend_Session_Namespace("referrer");
|
$tempSess = new Zend_Session_Namespace("referrer");
|
||||||
$tempSess->referrer = 'login';
|
$tempSess->referrer = 'login';
|
||||||
|
|
||||||
|
//set the user locale in case user changed it in when logging in
|
||||||
|
Application_Model_Preference::SetUserLocale($auth->getIdentity()->id, $locale);
|
||||||
|
|
||||||
$this->_redirect('Showbuilder');
|
$this->_redirect('Showbuilder');
|
||||||
} else {
|
} else {
|
||||||
$message = "Wrong username or password provided. Please try again.";
|
$message = _("Wrong username or password provided. Please try again.");
|
||||||
Application_Model_Subjects::increaseLoginAttempts($username);
|
Application_Model_Subjects::increaseLoginAttempts($username);
|
||||||
Application_Model_LoginAttempts::increaseAttempts($_SERVER['REMOTE_ADDR']);
|
Application_Model_LoginAttempts::increaseAttempts($_SERVER['REMOTE_ADDR']);
|
||||||
$form = new Application_Form_Login();
|
$form = new Application_Form_Login();
|
||||||
|
@ -94,11 +102,11 @@ class LoginController extends Zend_Controller_Action
|
||||||
|
|
||||||
public function passwordRestoreAction()
|
public function passwordRestoreAction()
|
||||||
{
|
{
|
||||||
global $CC_CONFIG;
|
$CC_CONFIG = Config::getConfig();
|
||||||
|
|
||||||
$request = $this->getRequest();
|
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||||
$baseUrl = $request->getBaseUrl();
|
|
||||||
$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');
|
||||||
|
@ -128,10 +136,10 @@ class LoginController extends Zend_Controller_Action
|
||||||
if ($success) {
|
if ($success) {
|
||||||
$this->_helper->redirector('password-restore-after', 'login');
|
$this->_helper->redirector('password-restore-after', 'login');
|
||||||
} else {
|
} else {
|
||||||
$form->email->addError($this->view->translate("Email could not be sent. Check your mail server settings and ensure it has been configured properly."));
|
$form->email->addError($this->view->translate(_("Email could not be sent. Check your mail server settings and ensure it has been configured properly.")));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$form->email->addError($this->view->translate("Given email not found."));
|
$form->email->addError($this->view->translate(_("Given email not found.")));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,6 +25,7 @@ class PlaylistController extends Zend_Controller_Action
|
||||||
->addActionContext('smart-block-generate', 'json')
|
->addActionContext('smart-block-generate', 'json')
|
||||||
->addActionContext('smart-block-shuffle', 'json')
|
->addActionContext('smart-block-shuffle', 'json')
|
||||||
->addActionContext('get-block-info', 'json')
|
->addActionContext('get-block-info', 'json')
|
||||||
|
->addActionContext('shuffle', 'json')
|
||||||
->initContext();
|
->initContext();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -41,7 +42,7 @@ class PlaylistController extends Zend_Controller_Action
|
||||||
$modified = $this->_getParam('modified', null);
|
$modified = $this->_getParam('modified', null);
|
||||||
if ($obj->getLastModified("U") !== $modified) {
|
if ($obj->getLastModified("U") !== $modified) {
|
||||||
$this->createFullResponse($obj);
|
$this->createFullResponse($obj);
|
||||||
throw new PlaylistOutDatedException("You are viewing an older version of {$obj->getName()}");
|
throw new PlaylistOutDatedException(sprintf(_("You are viewing an older version of %s"), $obj->getName()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -72,7 +73,6 @@ class PlaylistController extends Zend_Controller_Action
|
||||||
$isBlock = true;
|
$isBlock = true;
|
||||||
$viewPath = 'playlist/smart-block.phtml';
|
$viewPath = 'playlist/smart-block.phtml';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($obj)) {
|
if (isset($obj)) {
|
||||||
$formatter = new LengthFormatter($obj->getLength());
|
$formatter = new LengthFormatter($obj->getLength());
|
||||||
$this->view->length = $formatter->format();
|
$this->view->length = $formatter->format();
|
||||||
|
@ -94,7 +94,11 @@ class PlaylistController extends Zend_Controller_Action
|
||||||
} else {
|
} else {
|
||||||
$this->view->obj = $obj;
|
$this->view->obj = $obj;
|
||||||
$this->view->id = $obj->getId();
|
$this->view->id = $obj->getId();
|
||||||
$this->view->html = $this->view->render($viewPath);
|
if ($isJson) {
|
||||||
|
return $this->view->html = $this->view->render($viewPath);
|
||||||
|
} else {
|
||||||
|
$this->view->html = $this->view->render($viewPath);
|
||||||
|
}
|
||||||
unset($this->view->obj);
|
unset($this->view->obj);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -113,14 +117,14 @@ class PlaylistController extends Zend_Controller_Action
|
||||||
|
|
||||||
private function blockDynamic($obj)
|
private function blockDynamic($obj)
|
||||||
{
|
{
|
||||||
$this->view->error = "You cannot add tracks to dynamic blocks.";
|
$this->view->error = _("You cannot add tracks to dynamic blocks.");
|
||||||
$this->createFullResponse($obj);
|
$this->createFullResponse($obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
private function playlistNotFound($p_type, $p_isJson = false)
|
private function playlistNotFound($p_type, $p_isJson = false)
|
||||||
{
|
{
|
||||||
$p_type = ucfirst($p_type);
|
$p_type = ucfirst($p_type);
|
||||||
$this->view->error = "{$p_type} not found";
|
$this->view->error = sprintf(_("%s not found"), $p_type);
|
||||||
|
|
||||||
Logging::info("{$p_type} not found");
|
Logging::info("{$p_type} not found");
|
||||||
Application_Model_Library::changePlaylist(null, $p_type);
|
Application_Model_Library::changePlaylist(null, $p_type);
|
||||||
|
@ -134,26 +138,26 @@ class PlaylistController extends Zend_Controller_Action
|
||||||
|
|
||||||
private function playlistNoPermission($p_type)
|
private function playlistNoPermission($p_type)
|
||||||
{
|
{
|
||||||
$this->view->error = "You don't have permission to delete selected {$p_type}(s).";
|
$this->view->error = sprintf(_("You don't have permission to delete selected %s(s)."), $p_type);
|
||||||
$this->changePlaylist(null, $p_type);
|
$this->changePlaylist(null, $p_type);
|
||||||
$this->createFullResponse(null);
|
$this->createFullResponse(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
private function playlistUnknownError($e)
|
private function playlistUnknownError($e)
|
||||||
{
|
{
|
||||||
$this->view->error = "Something went wrong.";
|
$this->view->error = _("Something went wrong.");
|
||||||
Logging::info($e->getMessage());
|
Logging::info($e->getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
private function wrongTypeToBlock($obj)
|
private function wrongTypeToBlock($obj)
|
||||||
{
|
{
|
||||||
$this->view->error = "You can only add tracks to smart block.";
|
$this->view->error = _("You can only add tracks to smart block.");
|
||||||
$this->createFullResponse($obj);
|
$this->createFullResponse($obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
private function wrongTypeToPlaylist($obj)
|
private function wrongTypeToPlaylist($obj)
|
||||||
{
|
{
|
||||||
$this->view->error = "You can only add tracks, smart blocks, and webstreams to playlists.";
|
$this->view->error = _("You can only add tracks, smart blocks, and webstreams to playlists.");
|
||||||
$this->createFullResponse($obj);
|
$this->createFullResponse($obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -165,9 +169,9 @@ class PlaylistController extends Zend_Controller_Action
|
||||||
|
|
||||||
$objInfo = Application_Model_Library::getObjInfo($type);
|
$objInfo = Application_Model_Library::getObjInfo($type);
|
||||||
|
|
||||||
$name = 'Untitled Playlist';
|
$name = _('Untitled Playlist');
|
||||||
if ($type == 'block') {
|
if ($type == 'block') {
|
||||||
$name = 'Untitled Smart Block';
|
$name = _('Untitled Smart Block');
|
||||||
}
|
}
|
||||||
|
|
||||||
$obj = new $objInfo['className']();
|
$obj = new $objInfo['className']();
|
||||||
|
@ -430,7 +434,7 @@ class PlaylistController extends Zend_Controller_Action
|
||||||
|
|
||||||
public function setPlaylistNameDescAction()
|
public function setPlaylistNameDescAction()
|
||||||
{
|
{
|
||||||
$name = $this->_getParam('name', 'Unknown Playlist');
|
$name = $this->_getParam('name', _('Unknown Playlist'));
|
||||||
$description = $this->_getParam('description', "");
|
$description = $this->_getParam('description', "");
|
||||||
$type = $this->_getParam('type');
|
$type = $this->_getParam('type');
|
||||||
|
|
||||||
|
@ -538,6 +542,26 @@ class PlaylistController extends Zend_Controller_Action
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function shuffleAction()
|
||||||
|
{
|
||||||
|
$request = $this->getRequest();
|
||||||
|
$params = $request->getPost();
|
||||||
|
try {
|
||||||
|
$pl = new Application_Model_Playlist($params['obj_id']);
|
||||||
|
$result = $pl->shuffle();
|
||||||
|
|
||||||
|
if ($result['result'] == 0) {
|
||||||
|
die(json_encode(array("result"=>0, "html"=>$this->createFullResponse($pl, true))));
|
||||||
|
} else {
|
||||||
|
die(json_encode($result));
|
||||||
|
}
|
||||||
|
} catch (PlaylistNotFoundException $e) {
|
||||||
|
$this->playlistNotFound('block', true);
|
||||||
|
} catch (Exception $e) {
|
||||||
|
$this->playlistUnknownError($e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public function getBlockInfoAction()
|
public function getBlockInfoAction()
|
||||||
{
|
{
|
||||||
$request = $this->getRequest();
|
$request = $this->getRequest();
|
||||||
|
|
|
@ -8,14 +8,15 @@ class PlayouthistoryController extends Zend_Controller_Action
|
||||||
$ajaxContext
|
$ajaxContext
|
||||||
->addActionContext('playout-history-feed', 'json')
|
->addActionContext('playout-history-feed', 'json')
|
||||||
->initContext();
|
->initContext();
|
||||||
}
|
}
|
||||||
|
|
||||||
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();
|
||||||
|
|
||||||
//default time is the last 24 hours.
|
//default time is the last 24 hours.
|
||||||
$now = time();
|
$now = time();
|
||||||
|
@ -37,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()
|
||||||
|
@ -81,4 +82,5 @@ class PlayouthistoryController extends Zend_Controller_Action
|
||||||
$this->view->iTotalRecords = $r["iTotalRecords"];
|
$this->view->iTotalRecords = $r["iTotalRecords"];
|
||||||
$this->view->history = $r["history"];
|
$this->view->history = $r["history"];
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,16 +13,17 @@ class PluploadController 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();
|
$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->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()
|
||||||
|
|
|
@ -20,36 +20,50 @@ 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();
|
||||||
$baseUrl = $request->getBaseUrl();
|
|
||||||
|
|
||||||
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/preferences/preferences.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
$isSaas = Application_Model_Preference::GetPlanLevel() == 'disabled'?false:true;
|
||||||
|
|
||||||
|
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||||
|
|
||||||
|
$this->view->headScript()->appendFile($baseUrl.'js/airtime/preferences/preferences.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||||
$this->view->statusMsg = "";
|
$this->view->statusMsg = "";
|
||||||
|
|
||||||
$form = new Application_Form_Preferences();
|
$form = new Application_Form_Preferences();
|
||||||
|
|
||||||
if ($request->isPost()) {
|
if ($request->isPost()) {
|
||||||
if ($form->isValid($request->getPost())) {
|
$params = $request->getPost();
|
||||||
$values = $form->getValues();
|
$postData = explode('&', $params['data']);
|
||||||
|
foreach($postData as $k=>$v) {
|
||||||
|
$v = explode('=', $v);
|
||||||
|
$values[$v[0]] = urldecode($v[1]);
|
||||||
|
}
|
||||||
|
if ($form->isValid($values)) {
|
||||||
|
|
||||||
Application_Model_Preference::SetHeadTitle($values["preferences_general"]["stationName"], $this->view);
|
Application_Model_Preference::SetHeadTitle($values["stationName"], $this->view);
|
||||||
Application_Model_Preference::SetDefaultFade($values["preferences_general"]["stationDefaultFade"]);
|
Application_Model_Preference::SetDefaultFade($values["stationDefaultFade"]);
|
||||||
Application_Model_Preference::SetAllow3rdPartyApi($values["preferences_general"]["thirdPartyApi"]);
|
Application_Model_Preference::SetAllow3rdPartyApi($values["thirdPartyApi"]);
|
||||||
Application_Model_Preference::SetTimezone($values["preferences_general"]["timezone"]);
|
Application_Model_Preference::SetDefaultLocale($values["locale"]);
|
||||||
Application_Model_Preference::SetWeekStartDay($values["preferences_general"]["weekStartDay"]);
|
Application_Model_Preference::SetDefaultTimezone($values["timezone"]);
|
||||||
|
Application_Model_Preference::SetWeekStartDay($values["weekStartDay"]);
|
||||||
|
|
||||||
Application_Model_Preference::SetUploadToSoundcloudOption($values["preferences_soundcloud"]["UploadToSoundcloudOption"]);
|
Application_Model_Preference::SetAutoUploadRecordedShowToSoundcloud($values["UseSoundCloud"]);
|
||||||
Application_Model_Preference::SetSoundCloudDownloadbleOption($values["preferences_soundcloud"]["SoundCloudDownloadbleOption"]);
|
Application_Model_Preference::SetUploadToSoundcloudOption($values["UploadToSoundcloudOption"]);
|
||||||
Application_Model_Preference::SetSoundCloudUser($values["preferences_soundcloud"]["SoundCloudUser"]);
|
Application_Model_Preference::SetSoundCloudDownloadbleOption($values["SoundCloudDownloadbleOption"]);
|
||||||
Application_Model_Preference::SetSoundCloudPassword($values["preferences_soundcloud"]["SoundCloudPassword"]);
|
Application_Model_Preference::SetSoundCloudUser($values["SoundCloudUser"]);
|
||||||
Application_Model_Preference::SetSoundCloudTags($values["preferences_soundcloud"]["SoundCloudTags"]);
|
Application_Model_Preference::SetSoundCloudPassword($values["SoundCloudPassword"]);
|
||||||
Application_Model_Preference::SetSoundCloudGenre($values["preferences_soundcloud"]["SoundCloudGenre"]);
|
Application_Model_Preference::SetSoundCloudTags($values["SoundCloudTags"]);
|
||||||
Application_Model_Preference::SetSoundCloudTrackType($values["preferences_soundcloud"]["SoundCloudTrackType"]);
|
Application_Model_Preference::SetSoundCloudGenre($values["SoundCloudGenre"]);
|
||||||
Application_Model_Preference::SetSoundCloudLicense($values["preferences_soundcloud"]["SoundCloudLicense"]);
|
Application_Model_Preference::SetSoundCloudTrackType($values["SoundCloudTrackType"]);
|
||||||
|
Application_Model_Preference::SetSoundCloudLicense($values["SoundCloudLicense"]);
|
||||||
|
|
||||||
$this->view->statusMsg = "<div class='success'>Preferences updated.</div>";
|
$this->view->statusMsg = "<div class='success'>". _("Preferences updated.")."</div>";
|
||||||
|
$this->view->form = $form;
|
||||||
|
die(json_encode(array("valid"=>"true", "html"=>$this->view->render('preference/index.phtml'))));
|
||||||
|
} else {
|
||||||
|
$this->view->form = $form;
|
||||||
|
die(json_encode(array("valid"=>"false", "html"=>$this->view->render('preference/index.phtml'))));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$this->view->form = $form;
|
$this->view->form = $form;
|
||||||
|
@ -57,19 +71,25 @@ 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 = $request->getBaseUrl();
|
|
||||||
|
|
||||||
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/preferences/support-setting.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||||
|
|
||||||
|
$this->view->headScript()->appendFile($baseUrl.'js/airtime/preferences/support-setting.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||||
$this->view->statusMsg = "";
|
$this->view->statusMsg = "";
|
||||||
|
|
||||||
|
|
||||||
$form = new Application_Form_SupportSettings();
|
$form = new Application_Form_SupportSettings();
|
||||||
if ($request->isPost()) {
|
if ($request->isPost()) {
|
||||||
$values = $request->getPost();
|
$values = $request->getPost();
|
||||||
if ($form->isValid($values)) {
|
if ($values["Publicise"] != 1) {
|
||||||
|
Application_Model_Preference::SetSupportFeedback($values["SupportFeedback"]);
|
||||||
|
Application_Model_Preference::SetPublicise($values["Publicise"]);
|
||||||
|
if (isset($values["Privacy"])) {
|
||||||
|
Application_Model_Preference::SetPrivacyPolicyCheck($values["Privacy"]);
|
||||||
|
}
|
||||||
|
} else if ($form->isValid($values)) {
|
||||||
Application_Model_Preference::SetHeadTitle($values["stationName"], $this->view);
|
Application_Model_Preference::SetHeadTitle($values["stationName"], $this->view);
|
||||||
Application_Model_Preference::SetPhone($values["Phone"]);
|
Application_Model_Preference::SetPhone($values["Phone"]);
|
||||||
Application_Model_Preference::SetEmail($values["Email"]);
|
Application_Model_Preference::SetEmail($values["Email"]);
|
||||||
|
@ -85,9 +105,10 @@ class PreferenceController extends Zend_Controller_Action
|
||||||
if (isset($values["Privacy"])) {
|
if (isset($values["Privacy"])) {
|
||||||
Application_Model_Preference::SetPrivacyPolicyCheck($values["Privacy"]);
|
Application_Model_Preference::SetPrivacyPolicyCheck($values["Privacy"]);
|
||||||
}
|
}
|
||||||
$this->view->statusMsg = "<div class='success'>Support setting updated.</div>";
|
|
||||||
}
|
}
|
||||||
|
$this->view->statusMsg = "<div class='success'>"._("Support setting updated.")."</div>";
|
||||||
}
|
}
|
||||||
|
|
||||||
$logo = Application_Model_Preference::GetStationLogo();
|
$logo = Application_Model_Preference::GetStationLogo();
|
||||||
if ($logo) {
|
if ($logo) {
|
||||||
$this->view->logoImg = $logo;
|
$this->view->logoImg = $logo;
|
||||||
|
@ -97,21 +118,20 @@ class PreferenceController extends Zend_Controller_Action
|
||||||
$privacyChecked = true;
|
$privacyChecked = true;
|
||||||
}
|
}
|
||||||
$this->view->privacyChecked = $privacyChecked;
|
$this->view->privacyChecked = $privacyChecked;
|
||||||
$this->view->section_title = 'Support Feedback';
|
$this->view->section_title = _('Support Feedback');
|
||||||
$this->view->form = $form;
|
$this->view->form = $form;
|
||||||
//$form->render($this->view);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
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'){
|
||||||
$request = $this->getRequest();
|
|
||||||
$baseUrl = $request->getBaseUrl();
|
|
||||||
|
|
||||||
$this->view->headScript()->appendFile($baseUrl.'/js/serverbrowse/serverbrowser.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||||
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/preferences/musicdirs.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
|
||||||
|
$this->view->headScript()->appendFile($baseUrl.'js/serverbrowse/serverbrowser.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||||
|
$this->view->headScript()->appendFile($baseUrl.'js/airtime/preferences/musicdirs.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||||
|
|
||||||
$watched_dirs_pref = new Application_Form_WatchedDirPreferences();
|
$watched_dirs_pref = new Application_Form_WatchedDirPreferences();
|
||||||
|
|
||||||
|
@ -121,12 +141,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 = $request->getBaseUrl();
|
|
||||||
|
|
||||||
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/preferences/streamsetting.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||||
|
|
||||||
|
$this->view->headScript()->appendFile($baseUrl.'js/airtime/preferences/streamsetting.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||||
|
|
||||||
// get current settings
|
// get current settings
|
||||||
$temp = Application_Model_StreamSetting::getStreamSetting();
|
$temp = Application_Model_StreamSetting::getStreamSetting();
|
||||||
|
@ -174,10 +195,37 @@ class PreferenceController extends Zend_Controller_Action
|
||||||
$form->addSubForm($subform, "s".$i."_subform");
|
$form->addSubForm($subform, "s".$i."_subform");
|
||||||
}
|
}
|
||||||
if ($request->isPost()) {
|
if ($request->isPost()) {
|
||||||
$values = $request->getPost();
|
$params = $request->getPost();
|
||||||
|
/* Parse through post data and put in format
|
||||||
|
* $form->isValid() is expecting it in
|
||||||
|
*/
|
||||||
|
$postData = explode('&', $params['data']);
|
||||||
|
$s1_data = array();
|
||||||
|
$s2_data = array();
|
||||||
|
$s3_data = array();
|
||||||
|
foreach($postData as $k=>$v) {
|
||||||
|
$v = explode('=', urldecode($v));
|
||||||
|
if (strpos($v[0], "s1_data") !== false) {
|
||||||
|
/* In this case $v[0] may be 's1_data[enable]' , for example.
|
||||||
|
* We only want the 'enable' part
|
||||||
|
*/
|
||||||
|
preg_match('/\[(.*)\]/', $v[0], $matches);
|
||||||
|
$s1_data[$matches[1]] = $v[1];
|
||||||
|
} elseif (strpos($v[0], "s2_data") !== false) {
|
||||||
|
preg_match('/\[(.*)\]/', $v[0], $matches);
|
||||||
|
$s2_data[$matches[1]] = $v[1];
|
||||||
|
} elseif (strpos($v[0], "s3_data") !== false) {
|
||||||
|
preg_match('/\[(.*)\]/', $v[0], $matches);
|
||||||
|
$s3_data[$matches[1]] = $v[1];
|
||||||
|
} else {
|
||||||
|
$values[$v[0]] = $v[1];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$values["s1_data"] = $s1_data;
|
||||||
|
$values["s2_data"] = $s2_data;
|
||||||
|
$values["s3_data"] = $s3_data;
|
||||||
|
|
||||||
$error = false;
|
$error = false;
|
||||||
|
|
||||||
if ($form->isValid($values)) {
|
if ($form->isValid($values)) {
|
||||||
|
|
||||||
$values['icecast_vorbis_metadata'] = $form->getValue('icecast_vorbis_metadata');
|
$values['icecast_vorbis_metadata'] = $form->getValue('icecast_vorbis_metadata');
|
||||||
|
@ -193,6 +241,17 @@ class PreferenceController extends Zend_Controller_Action
|
||||||
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::setReplayGainModifier($values["replayGainModifier"]);
|
||||||
|
|
||||||
// store stream update timestamp
|
// store stream update timestamp
|
||||||
Application_Model_Preference::SetStreamUpdateTimestamp();
|
Application_Model_Preference::SetStreamUpdateTimestamp();
|
||||||
|
|
||||||
|
@ -204,12 +263,23 @@ class PreferenceController extends Zend_Controller_Action
|
||||||
}
|
}
|
||||||
|
|
||||||
Application_Model_RabbitMq::SendMessageToPypo("update_stream_setting", $data);
|
Application_Model_RabbitMq::SendMessageToPypo("update_stream_setting", $data);
|
||||||
$this->view->statusMsg = "<div class='success'>Stream Setting Updated.</div>";
|
|
||||||
|
$live_stream_subform->updateVariables();
|
||||||
|
$this->view->enable_stream_conf = Application_Model_Preference::GetEnableStreamConf();
|
||||||
|
$this->view->form = $form;
|
||||||
|
$this->view->num_stream = $num_of_stream;
|
||||||
|
$this->view->statusMsg = "<div class='success'>"._("Stream Setting Updated.")."</div>";
|
||||||
|
die(json_encode(array("valid"=>"true", "html"=>$this->view->render('preference/stream-setting.phtml'))));
|
||||||
|
} else {
|
||||||
|
$live_stream_subform->updateVariables();
|
||||||
|
$this->view->enable_stream_conf = Application_Model_Preference::GetEnableStreamConf();
|
||||||
|
$this->view->form = $form;
|
||||||
|
$this->view->num_stream = $num_of_stream;
|
||||||
|
die(json_encode(array("valid"=>"false", "html"=>$this->view->render('preference/stream-setting.phtml'))));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$live_stream_subform->updateVariables();
|
$live_stream_subform->updateVariables();
|
||||||
$this->view->confirm_pypo_restart_text = "If you change the username or password values for an enabled stream the playout engine will be rebooted and your listeners will hear silence for 5-10 seconds. Changing the following fields will NOT cause a reboot: Stream Label (Global Settings), and Switch Transition Fade(s), Master Username, and Master Password (Input Stream Settings). If Airtime is recording, and if the change causes a playout engine restart, the recording will be interrupted.";
|
|
||||||
|
|
||||||
$this->view->num_stream = $num_of_stream;
|
$this->view->num_stream = $num_of_stream;
|
||||||
$this->view->enable_stream_conf = Application_Model_Preference::GetEnableStreamConf();
|
$this->view->enable_stream_conf = Application_Model_Preference::GetEnableStreamConf();
|
||||||
|
@ -225,7 +295,7 @@ class PreferenceController extends Zend_Controller_Action
|
||||||
|
|
||||||
if (is_null($path)) {
|
if (is_null($path)) {
|
||||||
$element = array();
|
$element = array();
|
||||||
$element["name"] = "path should be specified";
|
$element["name"] = _("path should be specified");
|
||||||
$element["isFolder"] = false;
|
$element["isFolder"] = false;
|
||||||
$element["isError"] = true;
|
$element["isError"] = true;
|
||||||
$result[$path] = $element;
|
$result[$path] = $element;
|
||||||
|
@ -284,13 +354,14 @@ class PreferenceController extends Zend_Controller_Action
|
||||||
|
|
||||||
public function rescanWatchDirectoryAction()
|
public function rescanWatchDirectoryAction()
|
||||||
{
|
{
|
||||||
$dir = Application_Model_MusicDir::getDirByPath($this->getRequest()->getParam("dir"));
|
$dir_path = $this->getRequest()->getParam('dir');
|
||||||
$id = $dir->getId();
|
$dir = Application_Model_MusicDir::getDirByPath($dir_path);
|
||||||
$data = array();
|
$data = array( 'directory' => $dir->getDirectory(),
|
||||||
$data['directory'] = $dir->getDirectory();
|
'id' => $dir->getId());
|
||||||
$data['id'] = $id;
|
|
||||||
Application_Model_RabbitMq::SendMessageToMediaMonitor('rescan_watch', $data);
|
Application_Model_RabbitMq::SendMessageToMediaMonitor('rescan_watch', $data);
|
||||||
die();
|
Logging::info("Unhiding all files belonging to:: $dir_path");
|
||||||
|
$dir->unhideFiles();
|
||||||
|
die(); # Get rid of this ugliness later
|
||||||
}
|
}
|
||||||
|
|
||||||
public function removeWatchDirectoryAction()
|
public function removeWatchDirectoryAction()
|
||||||
|
@ -319,7 +390,7 @@ class PreferenceController extends Zend_Controller_Action
|
||||||
$num_of_stream = intval(Application_Model_Preference::GetNumOfStreams());
|
$num_of_stream = intval(Application_Model_Preference::GetNumOfStreams());
|
||||||
for ($i=1; $i<=$num_of_stream; $i++) {
|
for ($i=1; $i<=$num_of_stream; $i++) {
|
||||||
$status = Application_Model_StreamSetting::getLiquidsoapError($i);
|
$status = Application_Model_StreamSetting::getLiquidsoapError($i);
|
||||||
$status = $status == NULL?"Problem with Liquidsoap...":$status;
|
$status = $status == NULL?_("Problem with Liquidsoap..."):$status;
|
||||||
if (!Application_Model_StreamSetting::getStreamEnabled($i)) {
|
if (!Application_Model_StreamSetting::getStreamEnabled($i)) {
|
||||||
$status = "N/A";
|
$status = "N/A";
|
||||||
}
|
}
|
||||||
|
|
|
@ -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($this->view->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);
|
||||||
|
@ -227,6 +226,7 @@ class ScheduleController extends Zend_Controller_Action
|
||||||
$id = $this->_getParam('id');
|
$id = $this->_getParam('id');
|
||||||
$menu = array();
|
$menu = array();
|
||||||
$epochNow = time();
|
$epochNow = time();
|
||||||
|
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||||
|
|
||||||
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
|
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
|
||||||
$user = new Application_Model_User($userInfo->id);
|
$user = new Application_Model_User($userInfo->id);
|
||||||
|
@ -249,8 +249,8 @@ class ScheduleController extends Zend_Controller_Action
|
||||||
$file = $instance->getRecordedFile();
|
$file = $instance->getRecordedFile();
|
||||||
$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" => "/library/edit-file-md/id/".$fileId);
|
"url" => $baseUrl."library/edit-file-md/id/".$fileId);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($epochNow < $showStartLocalDT->getTimestamp()) {
|
if ($epochNow < $showStartLocalDT->getTimestamp()) {
|
||||||
|
@ -258,17 +258,17 @@ class ScheduleController extends Zend_Controller_Action
|
||||||
&& !$instance->isRecorded()
|
&& !$instance->isRecorded()
|
||||||
&& !$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" => "/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" => "/schedule/clear-show");
|
"url" => $baseUrl."schedule/clear-show");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$instance->isRecorded()) {
|
if (!$instance->isRecorded()) {
|
||||||
|
|
||||||
$menu["content"] = array("name"=> "Show Content", "icon" => "overview", "url" => "/schedule/show-content-dialog");
|
$menu["content"] = array("name"=> _("Show Content"), "icon" => "overview", "url" => $baseUrl."schedule/show-content-dialog");
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($showEndLocalDT->getTimestamp() <= $epochNow
|
if ($showEndLocalDT->getTimestamp() <= $epochNow
|
||||||
|
@ -281,10 +281,10 @@ class ScheduleController extends Zend_Controller_Action
|
||||||
|
|
||||||
if ($scid > 0) {
|
if ($scid > 0) {
|
||||||
$url = $file->getSoundCloudLinkToFile();
|
$url = $file->getSoundCloudLinkToFile();
|
||||||
$menu["soundcloud_view"] = array("name" => "View on Soundcloud", "icon" => "soundcloud", "url" => $url);
|
$menu["soundcloud_view"] = array("name" => _("View on Soundcloud"), "icon" => "soundcloud", "url" => $url);
|
||||||
}
|
}
|
||||||
|
|
||||||
$text = is_null($scid) ? 'Upload to SoundCloud' : 'Re-upload to SoundCloud';
|
$text = is_null($scid) ? _('Upload to SoundCloud') : _('Re-upload to SoundCloud');
|
||||||
$menu["soundcloud_upload"] = array("name"=> $text, "icon" => "soundcloud");
|
$menu["soundcloud_upload"] = array("name"=> $text, "icon" => "soundcloud");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -292,34 +292,34 @@ class ScheduleController extends Zend_Controller_Action
|
||||||
$epochNow < $showEndLocalDT->getTimestamp() && $isAdminOrPM) {
|
$epochNow < $showEndLocalDT->getTimestamp() && $isAdminOrPM) {
|
||||||
|
|
||||||
if ($instance->isRecorded()) {
|
if ($instance->isRecorded()) {
|
||||||
$menu["cancel_recorded"] = array("name"=> "Cancel Current Show", "icon" => "delete");
|
$menu["cancel_recorded"] = array("name"=> _("Cancel Current Show"), "icon" => "delete");
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
if (!$instance->isRebroadcast()) {
|
if (!$instance->isRebroadcast()) {
|
||||||
$menu["edit"] = array("name"=> "Edit Show", "icon" => "edit", "_type"=>"all", "url" => "/Schedule/populate-show-form");
|
$menu["edit"] = array("name"=> _("Edit Show"), "icon" => "edit", "_type"=>"all", "url" => $baseUrl."Schedule/populate-show-form");
|
||||||
}
|
}
|
||||||
|
|
||||||
$menu["cancel"] = array("name"=> "Cancel Current Show", "icon" => "delete");
|
$menu["cancel"] = array("name"=> _("Cancel Current Show"), "icon" => "delete");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($epochNow < $showStartLocalDT->getTimestamp()) {
|
if ($epochNow < $showStartLocalDT->getTimestamp()) {
|
||||||
|
|
||||||
if (!$instance->isRebroadcast() && $isAdminOrPM) {
|
if (!$instance->isRebroadcast() && $isAdminOrPM) {
|
||||||
$menu["edit"] = array("name"=> "Edit Show", "icon" => "edit", "_type"=>"all", "url" => "/Schedule/populate-show-form");
|
$menu["edit"] = array("name"=> _("Edit Show"), "icon" => "edit", "_type"=>"all", "url" => $baseUrl."Schedule/populate-show-form");
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($instance->getShow()->isRepeating() && $isAdminOrPM) {
|
if ($instance->getShow()->isRepeating() && $isAdminOrPM) {
|
||||||
|
|
||||||
//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" => "/schedule/delete-show");
|
$menu["del"]["items"]["single"] = array("name"=> _("Delete This Instance"), "icon" => "delete", "url" => $baseUrl."schedule/delete-show");
|
||||||
|
|
||||||
$menu["del"]["items"]["following"] = array("name"=> "Delete This Instance and All Following", "icon" => "delete", "url" => "/schedule/cancel-show");
|
$menu["del"]["items"]["following"] = array("name"=> _("Delete This Instance and All Following"), "icon" => "delete", "url" => $baseUrl."schedule/cancel-show");
|
||||||
} elseif ($isAdminOrPM) {
|
} elseif ($isAdminOrPM) {
|
||||||
|
|
||||||
$menu["del"] = array("name"=> "Delete", "icon" => "delete", "url" => "/schedule/delete-show");
|
$menu["del"] = array("name"=> _("Delete"), "icon" => "delete", "url" => $baseUrl."schedule/delete-show");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -442,8 +442,10 @@ class ScheduleController extends Zend_Controller_Action
|
||||||
$originalDateTime->setTimezone(new DateTimeZone(date_default_timezone_get()));
|
$originalDateTime->setTimezone(new DateTimeZone(date_default_timezone_get()));
|
||||||
//$timestamp = Application_Common_DateHelper::ConvertToLocalDateTimeString($originalDateTime->format("Y-m-d H:i:s"));
|
//$timestamp = Application_Common_DateHelper::ConvertToLocalDateTimeString($originalDateTime->format("Y-m-d H:i:s"));
|
||||||
$this->view->additionalShowInfo =
|
$this->view->additionalShowInfo =
|
||||||
"Rebroadcast of show \"$originalShowName\" from "
|
sprintf(_("Rebroadcast of show %s from %s at %s"),
|
||||||
.$originalDateTime->format("l, F jS")." at ".$originalDateTime->format("G:i");
|
$originalShowName,
|
||||||
|
$originalDateTime->format("l, F jS"),
|
||||||
|
$originalDateTime->format("G:i"));
|
||||||
}
|
}
|
||||||
$this->view->showLength = $show->getShowLength();
|
$this->view->showLength = $show->getShowLength();
|
||||||
$this->view->timeFilled = $show->getTimeScheduled();
|
$this->view->timeFilled = $show->getTimeScheduled();
|
||||||
|
@ -833,8 +835,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#/';
|
||||||
|
@ -848,9 +848,9 @@ 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'));
|
||||||
|
|
||||||
//returns format jjmenu is looking for.
|
//returns format jjmenu is looking for.
|
||||||
die(json_encode($menu));
|
die(json_encode($menu));
|
||||||
|
@ -876,8 +876,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');
|
||||||
|
|
||||||
|
|
|
@ -18,12 +18,14 @@ 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();
|
||||||
$baseUrl = $request->getBaseUrl();
|
|
||||||
$user = Application_Model_User::getCurrentUser();
|
|
||||||
|
|
||||||
|
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||||
|
|
||||||
|
$user = Application_Model_User::GetCurrentUser();
|
||||||
$userType = $user->getType();
|
$userType = $user->getType();
|
||||||
$this->view->headScript()->appendScript("localStorage.setItem( 'user-type', '$userType' );");
|
$this->view->headScript()->appendScript("localStorage.setItem( 'user-type', '$userType' );");
|
||||||
|
|
||||||
|
@ -43,27 +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($this->view->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()) {
|
||||||
|
@ -105,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');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -120,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.
|
||||||
|
@ -163,16 +164,18 @@ 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()
|
||||||
{
|
{
|
||||||
|
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||||
|
|
||||||
$id = $this->_getParam('id');
|
$id = $this->_getParam('id');
|
||||||
$now = floatval(microtime(true));
|
$now = floatval(microtime(true));
|
||||||
|
|
||||||
|
@ -184,15 +187,15 @@ class ShowbuilderController extends Zend_Controller_Action
|
||||||
$item = CcScheduleQuery::create()->findPK($id);
|
$item = CcScheduleQuery::create()->findPK($id);
|
||||||
$instance = $item->getCcShowInstances();
|
$instance = $item->getCcShowInstances();
|
||||||
|
|
||||||
$menu["preview"] = array("name"=> "Preview", "icon" => "play");
|
$menu["preview"] = array("name"=> _("Preview"), "icon" => "play");
|
||||||
//select the cursor
|
//select the cursor
|
||||||
$menu["selCurs"] = array("name"=> "Select cursor","icon" => "select-cursor");
|
$menu["selCurs"] = array("name"=> _("Select cursor"),"icon" => "select-cursor");
|
||||||
$menu["delCurs"] = array("name"=> "Remove cursor","icon" => "select-cursor");
|
$menu["delCurs"] = array("name"=> _("Remove cursor"),"icon" => "select-cursor");
|
||||||
|
|
||||||
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"=> "Remove from show", "icon" => "delete", "url" => "/showbuilder/schedule-remove");
|
$menu["del"] = array("name"=> _("Delete"), "icon" => "delete", "url" => $baseUrl."showbuilder/schedule-remove");
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->view->items = $menu;
|
$this->view->items = $menu;
|
||||||
|
@ -206,7 +209,7 @@ class ShowbuilderController extends Zend_Controller_Action
|
||||||
$instance = CcShowInstancesQuery::create()->findPK($id);
|
$instance = CcShowInstancesQuery::create()->findPK($id);
|
||||||
|
|
||||||
if (is_null($instance)) {
|
if (is_null($instance)) {
|
||||||
$this->view->error = "show does not exist";
|
$this->view->error = _("show does not exist");
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,12 +4,11 @@ class SystemstatusController extends Zend_Controller_Action
|
||||||
{
|
{
|
||||||
public function init()
|
public function init()
|
||||||
{
|
{
|
||||||
global $CC_CONFIG;
|
$CC_CONFIG = Config::getConfig();
|
||||||
|
|
||||||
$request = $this->getRequest();
|
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||||
$baseUrl = $request->getBaseUrl();
|
|
||||||
|
|
||||||
$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()
|
||||||
|
|
|
@ -10,20 +10,21 @@ class UserController extends Zend_Controller_Action
|
||||||
->addActionContext('get-user-data-table-info', 'json')
|
->addActionContext('get-user-data-table-info', 'json')
|
||||||
->addActionContext('get-user-data', 'json')
|
->addActionContext('get-user-data', 'json')
|
||||||
->addActionContext('remove-user', 'json')
|
->addActionContext('remove-user', 'json')
|
||||||
|
->addActionContext('edit-user', 'json')
|
||||||
->initContext();
|
->initContext();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function addUserAction()
|
public function addUserAction()
|
||||||
{
|
{
|
||||||
global $CC_CONFIG;
|
$CC_CONFIG = Config::getConfig();
|
||||||
|
|
||||||
$request = $this->getRequest();
|
$request = $this->getRequest();
|
||||||
$baseUrl = $request->getBaseUrl();
|
$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) {
|
||||||
|
@ -31,46 +32,71 @@ 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();
|
||||||
|
|
||||||
$this->view->successMessage = "";
|
$this->view->successMessage = "";
|
||||||
|
|
||||||
if ($request->isPost()) {
|
if ($request->isPost()) {
|
||||||
if ($form->isValid($request->getPost())) {
|
$params = $request->getPost();
|
||||||
|
$postData = explode('&', $params['data']);
|
||||||
|
foreach($postData as $k=>$v) {
|
||||||
|
$v = explode('=', $v);
|
||||||
|
$formData[$v[0]] = urldecode($v[1]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($form->isValid($formData)) {
|
||||||
|
|
||||||
$formdata = $form->getValues();
|
|
||||||
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->successMessage = "<div class='errors'>Specific action is not allowed in demo version!</div>";
|
$this->view->form = $form;
|
||||||
} elseif ($form->validateLogin($formdata)) {
|
$this->view->successMessage = "<div class='errors'>"._("Specific action is not allowed in demo version!")."</div>";
|
||||||
$user = new Application_Model_User($formdata['user_id']);
|
die(json_encode(array("valid"=>"false", "html"=>$this->view->render('user/add-user.phtml'))));
|
||||||
$user->setFirstName($formdata['first_name']);
|
} elseif ($form->validateLogin($formData)) {
|
||||||
$user->setLastName($formdata['last_name']);
|
$user = new Application_Model_User($formData['user_id']);
|
||||||
$user->setLogin($formdata['login']);
|
if (empty($formData['user_id'])) {
|
||||||
|
$user->setLogin($formData['login']);
|
||||||
|
}
|
||||||
|
$user->setFirstName($formData['first_name']);
|
||||||
|
$user->setLastName($formData['last_name']);
|
||||||
// We don't allow 6 x's as a password.
|
// We don't allow 6 x's as a password.
|
||||||
// The reason is because we that as a password placeholder
|
// The reason is because we that as a password placeholder
|
||||||
// on the client side.
|
// on the client side.
|
||||||
if ($formdata['password'] != "xxxxxx") {
|
if ($formData['password'] != "xxxxxx") {
|
||||||
$user->setPassword($formdata['password']);
|
$user->setPassword($formData['password']);
|
||||||
}
|
}
|
||||||
$user->setType($formdata['type']);
|
$user->setType($formData['type']);
|
||||||
$user->setEmail($formdata['email']);
|
$user->setEmail($formData['email']);
|
||||||
$user->setCellPhone($formdata['cell_phone']);
|
$user->setCellPhone($formData['cell_phone']);
|
||||||
$user->setSkype($formdata['skype']);
|
$user->setSkype($formData['skype']);
|
||||||
$user->setJabber($formdata['jabber']);
|
$user->setJabber($formData['jabber']);
|
||||||
$user->save();
|
$user->save();
|
||||||
|
|
||||||
$form->reset();
|
// Language and timezone settings are saved on a per-user basis
|
||||||
|
// By default, the default language, and timezone setting on
|
||||||
|
// preferences page is what gets assigned.
|
||||||
|
Application_Model_Preference::SetUserLocale($user->getId());
|
||||||
|
Application_Model_Preference::SetUserTimezone($user->getId());
|
||||||
|
|
||||||
if (strlen($formdata['user_id']) == 0) {
|
$form->reset();
|
||||||
$this->view->successMessage = "<div class='success'>User added successfully!</div>";
|
$this->view->form = $form;
|
||||||
|
|
||||||
|
if (strlen($formData['user_id']) == 0) {
|
||||||
|
$this->view->successMessage = "<div class='success'>"._("User added successfully!")."</div>";
|
||||||
} else {
|
} else {
|
||||||
$this->view->successMessage = "<div class='success'>User updated successfully!</div>";
|
$this->view->successMessage = "<div class='success'>"._("User updated successfully!")."</div>";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
die(json_encode(array("valid"=>"true", "html"=>$this->view->render('user/add-user.phtml'))));
|
||||||
|
} else {
|
||||||
|
$this->view->form = $form;
|
||||||
|
die(json_encode(array("valid"=>"false", "html"=>$this->view->render('user/add-user.phtml'))));
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
$this->view->form = $form;
|
||||||
|
die(json_encode(array("valid"=>"false", "html"=>$this->view->render('user/add-user.phtml'))));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -98,6 +124,52 @@ class UserController extends Zend_Controller_Action
|
||||||
$this->view->entries = Application_Model_User::GetUserData($id);
|
$this->view->entries = Application_Model_User::GetUserData($id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function editUserAction()
|
||||||
|
{
|
||||||
|
$request = $this->getRequest();
|
||||||
|
$form = new Application_Form_EditUser();
|
||||||
|
if ($request->isPost()) {
|
||||||
|
$formData = $request->getPost();
|
||||||
|
|
||||||
|
if (isset($CC_CONFIG['demo']) && $CC_CONFIG['demo'] == 1
|
||||||
|
&& $formData['cu_login'] == 'admin') {
|
||||||
|
$this->view->form = $form;
|
||||||
|
$this->view->successMessage = "<div class='errors'>"._("Specific action is not allowed in demo version!")."</div>";
|
||||||
|
die(json_encode(array("html"=>$this->view->render('user/edit-user.phtml'))));
|
||||||
|
} else if ($form->isValid($formData) &&
|
||||||
|
$form->validateLogin($formData['cu_login'], $formData['cu_user_id'])) {
|
||||||
|
$user = new Application_Model_User($formData['cu_user_id']);
|
||||||
|
$user->setFirstName($formData['cu_first_name']);
|
||||||
|
$user->setLastName($formData['cu_last_name']);
|
||||||
|
// We don't allow 6 x's as a password.
|
||||||
|
// The reason is because we use that as a password placeholder
|
||||||
|
// on the client side.
|
||||||
|
if ($formData['cu_password'] != "xxxxxx") {
|
||||||
|
$user->setPassword($formData['cu_password']);
|
||||||
|
}
|
||||||
|
$user->setEmail($formData['cu_email']);
|
||||||
|
$user->setCellPhone($formData['cu_cell_phone']);
|
||||||
|
$user->setSkype($formData['cu_skype']);
|
||||||
|
$user->setJabber($formData['cu_jabber']);
|
||||||
|
$user->save();
|
||||||
|
|
||||||
|
Application_Model_Preference::SetUserLocale($user->getId(), $formData['cu_locale']);
|
||||||
|
Application_Model_Preference::SetUserTimezone($user->getId(), $formData['cu_timezone']);
|
||||||
|
|
||||||
|
//configure localization with new locale setting
|
||||||
|
Application_Model_Locale::configureLocalization($formData['cu_locale']);
|
||||||
|
//reinitialize form so language gets translated
|
||||||
|
$form = new Application_Form_EditUser();
|
||||||
|
|
||||||
|
$this->view->successMessage = "<div class='success'>"._("Settings updated successfully!")."</div>";
|
||||||
|
}
|
||||||
|
$this->view->form = $form;
|
||||||
|
$this->view->html = $this->view->render('user/edit-user.phtml');
|
||||||
|
}
|
||||||
|
$this->view->form = $form;
|
||||||
|
$this->view->html = $this->view->render('user/edit-user.phtml');
|
||||||
|
}
|
||||||
|
|
||||||
public function removeUserAction()
|
public function removeUserAction()
|
||||||
{
|
{
|
||||||
// action body
|
// action body
|
||||||
|
|
|
@ -26,11 +26,11 @@ class WebstreamController extends Zend_Controller_Action
|
||||||
|
|
||||||
//we're not saving this primary key in the DB so it's OK to be -1
|
//we're not saving this primary key in the DB so it's OK to be -1
|
||||||
$webstream->setDbId(-1);
|
$webstream->setDbId(-1);
|
||||||
$webstream->setDbName("Untitled Webstream");
|
$webstream->setDbName(_("Untitled Webstream"));
|
||||||
$webstream->setDbDescription("");
|
$webstream->setDbDescription("");
|
||||||
$webstream->setDbUrl("http://");
|
$webstream->setDbUrl("http://");
|
||||||
$webstream->setDbLength("00:30:00");
|
$webstream->setDbLength("00:30:00");
|
||||||
$webstream->setDbName("Untitled Webstream");
|
$webstream->setDbName(_("Untitled Webstream"));
|
||||||
$webstream->setDbCreatorId($userInfo->id);
|
$webstream->setDbCreatorId($userInfo->id);
|
||||||
$webstream->setDbUtime(new DateTime("now", new DateTimeZone('UTC')));
|
$webstream->setDbUtime(new DateTime("now", new DateTimeZone('UTC')));
|
||||||
$webstream->setDbMtime(new DateTime("now", new DateTimeZone('UTC')));
|
$webstream->setDbMtime(new DateTime("now", new DateTimeZone('UTC')));
|
||||||
|
@ -135,7 +135,7 @@ class WebstreamController extends Zend_Controller_Action
|
||||||
|
|
||||||
Application_Model_Library::changePlaylist($streamId, "stream");
|
Application_Model_Library::changePlaylist($streamId, "stream");
|
||||||
|
|
||||||
$this->view->statusMessage = "<div class='success'>Webstream saved.</div>";
|
$this->view->statusMessage = "<div class='success'>"._("Webstream saved.")."</div>";
|
||||||
$this->view->streamId = $streamId;
|
$this->view->streamId = $streamId;
|
||||||
$this->view->length = $di->format("%Hh %Im");
|
$this->view->length = $di->format("%Hh %Im");
|
||||||
} else {
|
} else {
|
||||||
|
@ -143,7 +143,7 @@ class WebstreamController extends Zend_Controller_Action
|
||||||
}
|
}
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
Logging::debug($e->getMessage());
|
Logging::debug($e->getMessage());
|
||||||
$this->view->statusMessage = "<div class='errors'>Invalid form values.</div>";
|
$this->view->statusMessage = "<div class='errors'>"._("Invalid form values.")."</div>";
|
||||||
$this->view->streamId = -1;
|
$this->view->streamId = -1;
|
||||||
$this->view->analysis = $analysis;
|
$this->view->analysis = $analysis;
|
||||||
}
|
}
|
||||||
|
|
|
@ -152,7 +152,10 @@ class Zend_Controller_Plugin_Acl extends Zend_Controller_Plugin_Abstract
|
||||||
$resourceName .= $controller;
|
$resourceName .= $controller;
|
||||||
|
|
||||||
/** Check if the controller/action can be accessed by the current user */
|
/** Check if the controller/action can be accessed by the current user */
|
||||||
if (!$this->getAcl()->isAllowed($this->_roleName, $resourceName, $request->getActionName())) {
|
if (!$this->getAcl()->has($resourceName)
|
||||||
|
|| !$this->getAcl()->isAllowed($this->_roleName,
|
||||||
|
$resourceName,
|
||||||
|
$request->getActionName())) {
|
||||||
/** Redirect to access denied page */
|
/** Redirect to access denied page */
|
||||||
$this->denyAccess();
|
$this->denyAccess();
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,7 +23,7 @@ class Application_Form_AddShowAbsoluteRebroadcastDates extends Zend_Form_SubForm
|
||||||
$text->setAttrib('class', 'input_text');
|
$text->setAttrib('class', 'input_text');
|
||||||
$text->addFilter('StringTrim');
|
$text->addFilter('StringTrim');
|
||||||
$text->addValidator('date', false, array('HH:mm'));
|
$text->addValidator('date', false, array('HH:mm'));
|
||||||
$text->addValidator('regex', false, array('/^[0-2]?[0-9]:[0-5][0-9]$/', 'messages' => 'Invalid character entered'));
|
$text->addValidator('regex', false, array('/^[0-2]?[0-9]:[0-5][0-9]$/', 'messages' => _('Invalid character entered')));
|
||||||
$text->setRequired(false);
|
$text->setRequired(false);
|
||||||
$text->setDecorators(array('ViewHelper'));
|
$text->setDecorators(array('ViewHelper'));
|
||||||
$this->addElement($text);
|
$this->addElement($text);
|
||||||
|
@ -55,12 +55,12 @@ class Application_Form_AddShowAbsoluteRebroadcastDates extends Zend_Form_SubForm
|
||||||
}
|
}
|
||||||
|
|
||||||
if (trim($day) == "") {
|
if (trim($day) == "") {
|
||||||
$this->getElement('add_show_rebroadcast_date_absolute_'.$i)->setErrors(array("Day must be specified"));
|
$this->getElement('add_show_rebroadcast_date_absolute_'.$i)->setErrors(array(_("Day must be specified")));
|
||||||
$valid = false;
|
$valid = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (trim($time) == "") {
|
if (trim($time) == "") {
|
||||||
$this->getElement('add_show_rebroadcast_time_absolute_'.$i)->setErrors(array("Time must be specified"));
|
$this->getElement('add_show_rebroadcast_time_absolute_'.$i)->setErrors(array(_("Time must be specified")));
|
||||||
$valid = false;
|
$valid = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -83,7 +83,7 @@ class Application_Form_AddShowAbsoluteRebroadcastDates extends Zend_Form_SubForm
|
||||||
$rebroad_start = new DateTime($rebroad_start);
|
$rebroad_start = new DateTime($rebroad_start);
|
||||||
|
|
||||||
if ($rebroad_start < $show_end) {
|
if ($rebroad_start < $show_end) {
|
||||||
$this->getElement('add_show_rebroadcast_time_absolute_'.$i)->setErrors(array("Must wait at least 1 hour to rebroadcast"));
|
$this->getElement('add_show_rebroadcast_time_absolute_'.$i)->setErrors(array(_("Must wait at least 1 hour to rebroadcast")));
|
||||||
$valid = false;
|
$valid = false;
|
||||||
$noError = false;
|
$noError = false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,13 +7,13 @@ class Application_Form_AddShowLiveStream extends Zend_Form_SubForm
|
||||||
public function init()
|
public function init()
|
||||||
{
|
{
|
||||||
$cb_airtime_auth = new Zend_Form_Element_Checkbox("cb_airtime_auth");
|
$cb_airtime_auth = new Zend_Form_Element_Checkbox("cb_airtime_auth");
|
||||||
$cb_airtime_auth->setLabel("Use Airtime Authentication:")
|
$cb_airtime_auth->setLabel(_("Use Airtime Authentication:"))
|
||||||
->setRequired(false)
|
->setRequired(false)
|
||||||
->setDecorators(array('ViewHelper'));
|
->setDecorators(array('ViewHelper'));
|
||||||
$this->addElement($cb_airtime_auth);
|
$this->addElement($cb_airtime_auth);
|
||||||
|
|
||||||
$cb_custom_auth = new Zend_Form_Element_Checkbox("cb_custom_auth");
|
$cb_custom_auth = new Zend_Form_Element_Checkbox("cb_custom_auth");
|
||||||
$cb_custom_auth ->setLabel("Use Custom Authentication:")
|
$cb_custom_auth ->setLabel(_("Use Custom Authentication:"))
|
||||||
->setRequired(false)
|
->setRequired(false)
|
||||||
->setDecorators(array('ViewHelper'));
|
->setDecorators(array('ViewHelper'));
|
||||||
$this->addElement($cb_custom_auth);
|
$this->addElement($cb_custom_auth);
|
||||||
|
@ -23,7 +23,7 @@ class Application_Form_AddShowLiveStream extends Zend_Form_SubForm
|
||||||
$custom_username->setAttrib('class', 'input_text')
|
$custom_username->setAttrib('class', 'input_text')
|
||||||
->setAttrib('autocomplete', 'off')
|
->setAttrib('autocomplete', 'off')
|
||||||
->setAllowEmpty(true)
|
->setAllowEmpty(true)
|
||||||
->setLabel('Custom Username')
|
->setLabel(_('Custom Username'))
|
||||||
->setFilters(array('StringTrim'))
|
->setFilters(array('StringTrim'))
|
||||||
->setValidators(array(
|
->setValidators(array(
|
||||||
new ConditionalNotEmpty(array("cb_custom_auth"=>"1"))))
|
new ConditionalNotEmpty(array("cb_custom_auth"=>"1"))))
|
||||||
|
@ -36,7 +36,7 @@ class Application_Form_AddShowLiveStream extends Zend_Form_SubForm
|
||||||
->setAttrib('autocomplete', 'off')
|
->setAttrib('autocomplete', 'off')
|
||||||
->setAttrib('renderPassword','true')
|
->setAttrib('renderPassword','true')
|
||||||
->setAllowEmpty(true)
|
->setAllowEmpty(true)
|
||||||
->setLabel('Custom Password')
|
->setLabel(_('Custom Password'))
|
||||||
->setFilters(array('StringTrim'))
|
->setFilters(array('StringTrim'))
|
||||||
->setValidators(array(
|
->setValidators(array(
|
||||||
new ConditionalNotEmpty(array("cb_custom_auth"=>"1"))))
|
new ConditionalNotEmpty(array("cb_custom_auth"=>"1"))))
|
||||||
|
@ -60,12 +60,12 @@ class Application_Form_AddShowLiveStream extends Zend_Form_SubForm
|
||||||
if ($data['cb_custom_auth'] == 1) {
|
if ($data['cb_custom_auth'] == 1) {
|
||||||
if (trim($data['custom_username']) == '') {
|
if (trim($data['custom_username']) == '') {
|
||||||
$element = $this->getElement("custom_username");
|
$element = $this->getElement("custom_username");
|
||||||
$element->addError("Username field cannot be empty.");
|
$element->addError(_("Username field cannot be empty."));
|
||||||
$isValid = false;
|
$isValid = false;
|
||||||
}
|
}
|
||||||
if (trim($data['custom_password']) == '') {
|
if (trim($data['custom_password']) == '') {
|
||||||
$element = $this->getElement("custom_password");
|
$element = $this->getElement("custom_password");
|
||||||
$element->addError("Password field cannot be empty.");
|
$element->addError(_("Password field cannot be empty."));
|
||||||
$isValid = false;
|
$isValid = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,13 +7,13 @@ class Application_Form_AddShowRR extends Zend_Form_SubForm
|
||||||
{
|
{
|
||||||
// Add record element
|
// Add record element
|
||||||
$this->addElement('checkbox', 'add_show_record', array(
|
$this->addElement('checkbox', 'add_show_record', array(
|
||||||
'label' => 'Record from Line In?',
|
'label' => _('Record from Line In?'),
|
||||||
'required' => false,
|
'required' => false,
|
||||||
));
|
));
|
||||||
|
|
||||||
// Add record element
|
// Add record element
|
||||||
$this->addElement('checkbox', 'add_show_rebroadcast', array(
|
$this->addElement('checkbox', 'add_show_rebroadcast', array(
|
||||||
'label' => 'Rebroadcast?',
|
'label' => _('Rebroadcast?'),
|
||||||
'required' => false,
|
'required' => false,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,7 @@ class Application_Form_AddShowRebroadcastDates extends Zend_Form_SubForm
|
||||||
$relativeDates = array();
|
$relativeDates = array();
|
||||||
$relativeDates[""] = "";
|
$relativeDates[""] = "";
|
||||||
for ($i=0; $i<=30; $i++) {
|
for ($i=0; $i<=30; $i++) {
|
||||||
$relativeDates["$i days"] = "+$i days";
|
$relativeDates["$i days"] = "+$i "._("days");
|
||||||
}
|
}
|
||||||
|
|
||||||
for ($i=1; $i<=10; $i++) {
|
for ($i=1; $i<=10; $i++) {
|
||||||
|
@ -28,7 +28,7 @@ class Application_Form_AddShowRebroadcastDates extends Zend_Form_SubForm
|
||||||
$text->setAttrib('class', 'input_text');
|
$text->setAttrib('class', 'input_text');
|
||||||
$text->addFilter('StringTrim');
|
$text->addFilter('StringTrim');
|
||||||
$text->addValidator('date', false, array('HH:mm'));
|
$text->addValidator('date', false, array('HH:mm'));
|
||||||
$text->addValidator('regex', false, array('/^[0-2]?[0-9]:[0-5][0-9]$/', 'messages' => 'Invalid character entered'));
|
$text->addValidator('regex', false, array('/^[0-2]?[0-9]:[0-5][0-9]$/', 'messages' => _('Invalid character entered')));
|
||||||
$text->setRequired(false);
|
$text->setRequired(false);
|
||||||
$text->setDecorators(array('ViewHelper'));
|
$text->setDecorators(array('ViewHelper'));
|
||||||
$this->addElement($text);
|
$this->addElement($text);
|
||||||
|
@ -60,12 +60,12 @@ class Application_Form_AddShowRebroadcastDates extends Zend_Form_SubForm
|
||||||
}
|
}
|
||||||
|
|
||||||
if (trim($days) == "") {
|
if (trim($days) == "") {
|
||||||
$this->getElement('add_show_rebroadcast_date_'.$i)->setErrors(array("Day must be specified"));
|
$this->getElement('add_show_rebroadcast_date_'.$i)->setErrors(array(_("Day must be specified")));
|
||||||
$valid = false;
|
$valid = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (trim($time) == "") {
|
if (trim($time) == "") {
|
||||||
$this->getElement('add_show_rebroadcast_time_'.$i)->setErrors(array("Time must be specified"));
|
$this->getElement('add_show_rebroadcast_time_'.$i)->setErrors(array(_("Time must be specified")));
|
||||||
$valid = false;
|
$valid = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -92,7 +92,7 @@ class Application_Form_AddShowRebroadcastDates extends Zend_Form_SubForm
|
||||||
$rebroad_start->add(new DateInterval("P".$day."D"));
|
$rebroad_start->add(new DateInterval("P".$day."D"));
|
||||||
|
|
||||||
if ($rebroad_start < $show_end) {
|
if ($rebroad_start < $show_end) {
|
||||||
$this->getElement('add_show_rebroadcast_time_'.$i)->setErrors(array("Must wait at least 1 hour to rebroadcast"));
|
$this->getElement('add_show_rebroadcast_time_'.$i)->setErrors(array(_("Must wait at least 1 hour to rebroadcast")));
|
||||||
$valid = false;
|
$valid = false;
|
||||||
$noError = false;
|
$noError = false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,12 +8,12 @@ class Application_Form_AddShowRepeats extends Zend_Form_SubForm
|
||||||
//Add type select
|
//Add type select
|
||||||
$this->addElement('select', 'add_show_repeat_type', array(
|
$this->addElement('select', 'add_show_repeat_type', array(
|
||||||
'required' => true,
|
'required' => true,
|
||||||
'label' => 'Repeat Type:',
|
'label' => _('Repeat Type:'),
|
||||||
'class' => ' input_select',
|
'class' => ' input_select',
|
||||||
'multiOptions' => array(
|
'multiOptions' => array(
|
||||||
"0" => "weekly",
|
"0" => _("weekly"),
|
||||||
"1" => "bi-weekly",
|
"1" => _("bi-weekly"),
|
||||||
"2" => "monthly"
|
"2" => _("monthly")
|
||||||
),
|
),
|
||||||
));
|
));
|
||||||
|
|
||||||
|
@ -22,22 +22,22 @@ class Application_Form_AddShowRepeats extends Zend_Form_SubForm
|
||||||
'multiCheckbox',
|
'multiCheckbox',
|
||||||
'add_show_day_check',
|
'add_show_day_check',
|
||||||
array(
|
array(
|
||||||
'label' => 'Select Days:',
|
'label' => _('Select Days:'),
|
||||||
'required' => false,
|
'required' => false,
|
||||||
'multiOptions' => array(
|
'multiOptions' => array(
|
||||||
"0" => "Sun",
|
"0" => _("Sun"),
|
||||||
"1" => "Mon",
|
"1" => _("Mon"),
|
||||||
"2" => "Tue",
|
"2" => _("Tue"),
|
||||||
"3" => "Wed",
|
"3" => _("Wed"),
|
||||||
"4" => "Thu",
|
"4" => _("Thu"),
|
||||||
"5" => "Fri",
|
"5" => _("Fri"),
|
||||||
"6" => "Sat",
|
"6" => _("Sat"),
|
||||||
),
|
),
|
||||||
));
|
));
|
||||||
|
|
||||||
// Add end date element
|
// Add end date element
|
||||||
$this->addElement('text', 'add_show_end_date', array(
|
$this->addElement('text', 'add_show_end_date', array(
|
||||||
'label' => 'Date End:',
|
'label' => _('Date End:'),
|
||||||
'class' => 'input_text',
|
'class' => 'input_text',
|
||||||
'value' => date("Y-m-d"),
|
'value' => date("Y-m-d"),
|
||||||
'required' => false,
|
'required' => false,
|
||||||
|
@ -50,7 +50,7 @@ class Application_Form_AddShowRepeats extends Zend_Form_SubForm
|
||||||
|
|
||||||
// Add no end element
|
// Add no end element
|
||||||
$this->addElement('checkbox', 'add_show_no_end', array(
|
$this->addElement('checkbox', 'add_show_no_end', array(
|
||||||
'label' => 'No End?',
|
'label' => _('No End?'),
|
||||||
'required' => false,
|
'required' => false,
|
||||||
'checked' => true,
|
'checked' => true,
|
||||||
));
|
));
|
||||||
|
@ -76,7 +76,7 @@ class Application_Form_AddShowRepeats extends Zend_Form_SubForm
|
||||||
$end_epoch = strtotime($end_timestamp);
|
$end_epoch = strtotime($end_timestamp);
|
||||||
|
|
||||||
if ($end_epoch < $start_epoch) {
|
if ($end_epoch < $start_epoch) {
|
||||||
$this->getElement('add_show_end_date')->setErrors(array('End date must be after start date'));
|
$this->getElement('add_show_end_date')->setErrors(array(_('End date must be after start date')));
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@ class Application_Form_AddShowStyle extends Zend_Form_SubForm
|
||||||
{
|
{
|
||||||
// Add show background-color input
|
// Add show background-color input
|
||||||
$this->addElement('text', 'add_show_background_color', array(
|
$this->addElement('text', 'add_show_background_color', array(
|
||||||
'label' => 'Background Colour:',
|
'label' => _('Background Colour:'),
|
||||||
'class' => 'input_text',
|
'class' => 'input_text',
|
||||||
'filters' => array('StringTrim')
|
'filters' => array('StringTrim')
|
||||||
));
|
));
|
||||||
|
@ -19,14 +19,14 @@ 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
|
||||||
$this->addElement('text', 'add_show_color', array(
|
$this->addElement('text', 'add_show_color', array(
|
||||||
'label' => 'Text Colour:',
|
'label' => _('Text Colour:'),
|
||||||
'class' => 'input_text',
|
'class' => 'input_text',
|
||||||
'filters' => array('StringTrim')
|
'filters' => array('StringTrim')
|
||||||
));
|
));
|
||||||
|
@ -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))
|
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,7 @@ class Application_Form_AddShowWhat extends Zend_Form_SubForm
|
||||||
{
|
{
|
||||||
public function init()
|
public function init()
|
||||||
{
|
{
|
||||||
|
$notEmptyValidator = Application_Form_Helper_ValidationTypes::overrideNotEmptyValidator();
|
||||||
// retrieves the length limit for each char field
|
// retrieves the length limit for each char field
|
||||||
// and store to assoc array
|
// and store to assoc array
|
||||||
$maxLens = Application_Model_Show::getMaxLengths();
|
$maxLens = Application_Model_Show::getMaxLengths();
|
||||||
|
@ -22,27 +23,26 @@ class Application_Form_AddShowWhat extends Zend_Form_SubForm
|
||||||
|
|
||||||
// Add name element
|
// Add name element
|
||||||
$this->addElement('text', 'add_show_name', array(
|
$this->addElement('text', 'add_show_name', array(
|
||||||
'label' => 'Name:',
|
'label' => _('Name:'),
|
||||||
'class' => 'input_text',
|
'class' => 'input_text',
|
||||||
'required' => true,
|
'required' => true,
|
||||||
'filters' => array('StringTrim'),
|
'filters' => array('StringTrim'),
|
||||||
'validators' => array('NotEmpty'),
|
'value' => _('Untitled Show'),
|
||||||
'value' => 'Untitled Show',
|
'validators' => array($notEmptyValidator, array('StringLength', false, array(0, $maxLens['name'])))
|
||||||
'validators' => array(array('StringLength', false, array(0, $maxLens['name'])))
|
|
||||||
));
|
));
|
||||||
|
|
||||||
// Add URL element
|
// Add URL element
|
||||||
$this->addElement('text', 'add_show_url', array(
|
$this->addElement('text', 'add_show_url', array(
|
||||||
'label' => 'URL:',
|
'label' => _('URL:'),
|
||||||
'class' => 'input_text',
|
'class' => 'input_text',
|
||||||
'required' => false,
|
'required' => false,
|
||||||
'filters' => array('StringTrim'),
|
'filters' => array('StringTrim'),
|
||||||
'validators' => array('NotEmpty', array('StringLength', false, array(0, $maxLens['url'])))
|
'validators' => array($notEmptyValidator, array('StringLength', false, array(0, $maxLens['url'])))
|
||||||
));
|
));
|
||||||
|
|
||||||
// Add genre element
|
// Add genre element
|
||||||
$this->addElement('text', 'add_show_genre', array(
|
$this->addElement('text', 'add_show_genre', array(
|
||||||
'label' => 'Genre:',
|
'label' => _('Genre:'),
|
||||||
'class' => 'input_text',
|
'class' => 'input_text',
|
||||||
'required' => false,
|
'required' => false,
|
||||||
'filters' => array('StringTrim'),
|
'filters' => array('StringTrim'),
|
||||||
|
@ -51,7 +51,7 @@ class Application_Form_AddShowWhat extends Zend_Form_SubForm
|
||||||
|
|
||||||
// Add the description element
|
// Add the description element
|
||||||
$this->addElement('textarea', 'add_show_description', array(
|
$this->addElement('textarea', 'add_show_description', array(
|
||||||
'label' => 'Description:',
|
'label' => _('Description:'),
|
||||||
'required' => false,
|
'required' => false,
|
||||||
'class' => 'input_text_area',
|
'class' => 'input_text_area',
|
||||||
'validators' => array(array('StringLength', false, array(0, $maxLens['description'])))
|
'validators' => array(array('StringLength', false, array(0, $maxLens['description'])))
|
||||||
|
|
|
@ -9,16 +9,22 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm
|
||||||
array('ViewScript', array('viewScript' => 'form/add-show-when.phtml'))
|
array('ViewScript', array('viewScript' => 'form/add-show-when.phtml'))
|
||||||
));
|
));
|
||||||
|
|
||||||
|
$notEmptyValidator = Application_Form_Helper_ValidationTypes::overrideNotEmptyValidator();
|
||||||
|
$dateValidator = Application_Form_Helper_ValidationTypes::overrrideDateValidator("YYYY-MM-DD");
|
||||||
|
$regexValidator = Application_Form_Helper_ValidationTypes::overrideRegexValidator(
|
||||||
|
"/^[0-2]?[0-9]:[0-5][0-9]$/",
|
||||||
|
_("'%value%' does not fit the time format 'HH:mm'"));
|
||||||
|
|
||||||
// Add start date element
|
// Add start date element
|
||||||
$startDate = new Zend_Form_Element_Text('add_show_start_date');
|
$startDate = new Zend_Form_Element_Text('add_show_start_date');
|
||||||
$startDate->class = 'input_text';
|
$startDate->class = 'input_text';
|
||||||
$startDate->setRequired(true)
|
$startDate->setRequired(true)
|
||||||
->setLabel('Date/Time Start:')
|
->setLabel(_('Date/Time Start:'))
|
||||||
->setValue(date("Y-m-d"))
|
->setValue(date("Y-m-d"))
|
||||||
->setFilters(array('StringTrim'))
|
->setFilters(array('StringTrim'))
|
||||||
->setValidators(array(
|
->setValidators(array(
|
||||||
'NotEmpty',
|
$notEmptyValidator,
|
||||||
array('date', false, array('YYYY-MM-DD'))))
|
$dateValidator))
|
||||||
->setDecorators(array('ViewHelper'));
|
->setDecorators(array('ViewHelper'));
|
||||||
$startDate->setAttrib('alt', 'date');
|
$startDate->setAttrib('alt', 'date');
|
||||||
$this->addElement($startDate);
|
$this->addElement($startDate);
|
||||||
|
@ -30,9 +36,8 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm
|
||||||
->setValue('00:00')
|
->setValue('00:00')
|
||||||
->setFilters(array('StringTrim'))
|
->setFilters(array('StringTrim'))
|
||||||
->setValidators(array(
|
->setValidators(array(
|
||||||
'NotEmpty',
|
$notEmptyValidator,
|
||||||
array('date', false, array('HH:mm')),
|
$regexValidator
|
||||||
array('regex', false, array('/^[0-2]?[0-9]:[0-5][0-9]$/', 'messages' => 'Time format should be HH:mm'))
|
|
||||||
))->setDecorators(array('ViewHelper'));
|
))->setDecorators(array('ViewHelper'));
|
||||||
$startTime->setAttrib('alt', 'time');
|
$startTime->setAttrib('alt', 'time');
|
||||||
$this->addElement($startTime);
|
$this->addElement($startTime);
|
||||||
|
@ -41,12 +46,12 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm
|
||||||
$endDate = new Zend_Form_Element_Text('add_show_end_date_no_repeat');
|
$endDate = new Zend_Form_Element_Text('add_show_end_date_no_repeat');
|
||||||
$endDate->class = 'input_text';
|
$endDate->class = 'input_text';
|
||||||
$endDate->setRequired(true)
|
$endDate->setRequired(true)
|
||||||
->setLabel('Date/Time End:')
|
->setLabel(_('Date/Time End:'))
|
||||||
->setValue(date("Y-m-d"))
|
->setValue(date("Y-m-d"))
|
||||||
->setFilters(array('StringTrim'))
|
->setFilters(array('StringTrim'))
|
||||||
->setValidators(array(
|
->setValidators(array(
|
||||||
'NotEmpty',
|
$notEmptyValidator,
|
||||||
array('date', false, array('YYYY-MM-DD'))))
|
$dateValidator))
|
||||||
->setDecorators(array('ViewHelper'));
|
->setDecorators(array('ViewHelper'));
|
||||||
$endDate->setAttrib('alt', 'date');
|
$endDate->setAttrib('alt', 'date');
|
||||||
$this->addElement($endDate);
|
$this->addElement($endDate);
|
||||||
|
@ -58,16 +63,15 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm
|
||||||
->setValue('01:00')
|
->setValue('01:00')
|
||||||
->setFilters(array('StringTrim'))
|
->setFilters(array('StringTrim'))
|
||||||
->setValidators(array(
|
->setValidators(array(
|
||||||
'NotEmpty',
|
$notEmptyValidator,
|
||||||
array('date', false, array('HH:mm')),
|
$regexValidator))
|
||||||
array('regex', false, array('/^[0-2]?[0-9]:[0-5][0-9]$/', 'messages' => 'Time format should be HH:mm'))))
|
|
||||||
->setDecorators(array('ViewHelper'));
|
->setDecorators(array('ViewHelper'));
|
||||||
$endTime->setAttrib('alt', 'time');
|
$endTime->setAttrib('alt', 'time');
|
||||||
$this->addElement($endTime);
|
$this->addElement($endTime);
|
||||||
|
|
||||||
// Add duration element
|
// Add duration element
|
||||||
$this->addElement('text', 'add_show_duration', array(
|
$this->addElement('text', 'add_show_duration', array(
|
||||||
'label' => 'Duration:',
|
'label' => _('Duration:'),
|
||||||
'class' => 'input_text',
|
'class' => 'input_text',
|
||||||
'value' => '01h 00m',
|
'value' => '01h 00m',
|
||||||
'readonly' => true,
|
'readonly' => true,
|
||||||
|
@ -76,7 +80,7 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm
|
||||||
|
|
||||||
// Add repeats element
|
// Add repeats element
|
||||||
$this->addElement('checkbox', 'add_show_repeats', array(
|
$this->addElement('checkbox', 'add_show_repeats', array(
|
||||||
'label' => 'Repeats?',
|
'label' => _('Repeats?'),
|
||||||
'required' => false,
|
'required' => false,
|
||||||
'decorators' => array('ViewHelper')
|
'decorators' => array('ViewHelper')
|
||||||
));
|
));
|
||||||
|
@ -96,7 +100,7 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm
|
||||||
$showEndDateTime = new DateTime($end_time);
|
$showEndDateTime = new DateTime($end_time);
|
||||||
if ($validateStartDate) {
|
if ($validateStartDate) {
|
||||||
if ($showStartDateTime->getTimestamp() < $nowDateTime->getTimestamp()) {
|
if ($showStartDateTime->getTimestamp() < $nowDateTime->getTimestamp()) {
|
||||||
$this->getElement('add_show_start_time')->setErrors(array('Cannot create show in the past'));
|
$this->getElement('add_show_start_time')->setErrors(array(_('Cannot create show in the past')));
|
||||||
$valid = false;
|
$valid = false;
|
||||||
}
|
}
|
||||||
// if edit action, check if original show start time is in the past. CC-3864
|
// if edit action, check if original show start time is in the past. CC-3864
|
||||||
|
@ -104,7 +108,7 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm
|
||||||
if ($originalStartDate->getTimestamp() < $nowDateTime->getTimestamp()) {
|
if ($originalStartDate->getTimestamp() < $nowDateTime->getTimestamp()) {
|
||||||
$this->getElement('add_show_start_time')->setValue($originalStartDate->format("H:i"));
|
$this->getElement('add_show_start_time')->setValue($originalStartDate->format("H:i"));
|
||||||
$this->getElement('add_show_start_date')->setValue($originalStartDate->format("Y-m-d"));
|
$this->getElement('add_show_start_date')->setValue($originalStartDate->format("Y-m-d"));
|
||||||
$this->getElement('add_show_start_time')->setErrors(array('Cannot modify start date/time of the show that is already started'));
|
$this->getElement('add_show_start_time')->setErrors(array(_('Cannot modify start date/time of the show that is already started')));
|
||||||
$this->disableStartDateAndTime();
|
$this->disableStartDateAndTime();
|
||||||
$valid = false;
|
$valid = false;
|
||||||
}
|
}
|
||||||
|
@ -113,7 +117,7 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm
|
||||||
|
|
||||||
// if end time is in the past, return error
|
// if end time is in the past, return error
|
||||||
if ($showEndDateTime->getTimestamp() < $nowDateTime->getTimestamp()) {
|
if ($showEndDateTime->getTimestamp() < $nowDateTime->getTimestamp()) {
|
||||||
$this->getElement('add_show_end_time')->setErrors(array('End date/time cannot be in the past'));
|
$this->getElement('add_show_end_time')->setErrors(array(_('End date/time cannot be in the past')));
|
||||||
$valid = false;
|
$valid = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -123,15 +127,15 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm
|
||||||
$hours = $matches[1];
|
$hours = $matches[1];
|
||||||
$minutes = $matches[2];
|
$minutes = $matches[2];
|
||||||
if ($formData["add_show_duration"] == "00h 00m") {
|
if ($formData["add_show_duration"] == "00h 00m") {
|
||||||
$this->getElement('add_show_duration')->setErrors(array('Cannot have duration 00h 00m'));
|
$this->getElement('add_show_duration')->setErrors(array(_('Cannot have duration 00h 00m')));
|
||||||
$valid = false;
|
$valid = false;
|
||||||
} elseif (strpos($formData["add_show_duration"], 'h') !== false && $hours >= 24) {
|
} elseif (strpos($formData["add_show_duration"], 'h') !== false && $hours >= 24) {
|
||||||
if ($hours > 24 || ($hours == 24 && $minutes > 0)) {
|
if ($hours > 24 || ($hours == 24 && $minutes > 0)) {
|
||||||
$this->getElement('add_show_duration')->setErrors(array('Cannot have duration greater than 24h'));
|
$this->getElement('add_show_duration')->setErrors(array(_('Cannot have duration greater than 24h')));
|
||||||
$valid = false;
|
$valid = false;
|
||||||
}
|
}
|
||||||
} elseif ( strstr($formData["add_show_duration"], '-') ) {
|
} elseif ( strstr($formData["add_show_duration"], '-') ) {
|
||||||
$this->getElement('add_show_duration')->setErrors(array('Cannot have duration < 0m'));
|
$this->getElement('add_show_duration')->setErrors(array(_('Cannot have duration < 0m')));
|
||||||
$valid = false;
|
$valid = false;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -234,7 +238,7 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm
|
||||||
|
|
||||||
if ($overlapping) {
|
if ($overlapping) {
|
||||||
$valid = false;
|
$valid = false;
|
||||||
$this->getElement('add_show_duration')->setErrors(array('Cannot schedule overlapping shows'));
|
$this->getElement('add_show_duration')->setErrors(array(_('Cannot schedule overlapping shows')));
|
||||||
break 1;
|
break 1;
|
||||||
} else {
|
} else {
|
||||||
$repeatShowStart->setTimezone($localTimezone);
|
$repeatShowStart->setTimezone($localTimezone);
|
||||||
|
@ -248,12 +252,12 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$valid = false;
|
$valid = false;
|
||||||
$this->getElement('add_show_duration')->setErrors(array('Cannot schedule overlapping shows'));
|
$this->getElement('add_show_duration')->setErrors(array(_('Cannot schedule overlapping shows')));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$overlapping = Application_Model_Schedule::checkOverlappingShows($show_start, $show_end, $update, $instanceId);
|
$overlapping = Application_Model_Schedule::checkOverlappingShows($show_start, $show_end, $update, $instanceId);
|
||||||
if ($overlapping) {
|
if ($overlapping) {
|
||||||
$this->getElement('add_show_duration')->setErrors(array('Cannot schedule overlapping shows'));
|
$this->getElement('add_show_duration')->setErrors(array(_('Cannot schedule overlapping shows')));
|
||||||
$valid = false;
|
$valid = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@ class Application_Form_AddShowWho extends Zend_Form_SubForm
|
||||||
{
|
{
|
||||||
// Add hosts autocomplete
|
// Add hosts autocomplete
|
||||||
$this->addElement('text', 'add_show_hosts_autocomplete', array(
|
$this->addElement('text', 'add_show_hosts_autocomplete', array(
|
||||||
'label' => 'Search Users:',
|
'label' => _('Search Users:'),
|
||||||
'class' => 'input_text ui-autocomplete-input',
|
'class' => 'input_text ui-autocomplete-input',
|
||||||
'required' => false
|
'required' => false
|
||||||
));
|
));
|
||||||
|
@ -21,7 +21,7 @@ class Application_Form_AddShowWho extends Zend_Form_SubForm
|
||||||
|
|
||||||
//Add hosts selection
|
//Add hosts selection
|
||||||
$hosts = new Zend_Form_Element_MultiCheckbox('add_show_hosts');
|
$hosts = new Zend_Form_Element_MultiCheckbox('add_show_hosts');
|
||||||
$hosts->setLabel('DJs:')
|
$hosts->setLabel(_('DJs:'))
|
||||||
->setMultiOptions($options);
|
->setMultiOptions($options);
|
||||||
|
|
||||||
$this->addElement($hosts);
|
$this->addElement($hosts);
|
||||||
|
|
|
@ -10,86 +10,98 @@ class Application_Form_AddUser extends Zend_Form
|
||||||
'../application/validate',
|
'../application/validate',
|
||||||
'validate');
|
'validate');
|
||||||
* */
|
* */
|
||||||
|
$notEmptyValidator = Application_Form_Helper_ValidationTypes::overrideNotEmptyValidator();
|
||||||
|
$emailValidator = Application_Form_Helper_ValidationTypes::overrideEmailAddressValidator();
|
||||||
|
|
||||||
|
$this->setAttrib('id', 'user_form');
|
||||||
|
|
||||||
$hidden = new Zend_Form_Element_Hidden('user_id');
|
$hidden = new Zend_Form_Element_Hidden('user_id');
|
||||||
$hidden->setDecorators(array('ViewHelper'));
|
$hidden->setDecorators(array('ViewHelper'));
|
||||||
$this->addElement($hidden);
|
$this->addElement($hidden);
|
||||||
|
|
||||||
$login = new Zend_Form_Element_Text('login');
|
$login = new Zend_Form_Element_Text('login');
|
||||||
$login->setLabel('Username:');
|
$login->setLabel(_('Username:'));
|
||||||
$login->setAttrib('class', 'input_text');
|
$login->setAttrib('class', 'input_text');
|
||||||
$login->setRequired(true);
|
$login->setRequired(true);
|
||||||
|
$login->addValidator($notEmptyValidator);
|
||||||
$login->addFilter('StringTrim');
|
$login->addFilter('StringTrim');
|
||||||
//$login->addValidator('UserNameValidate');
|
//$login->addValidator('UserNameValidate');
|
||||||
$this->addElement($login);
|
$this->addElement($login);
|
||||||
|
|
||||||
$password = new Zend_Form_Element_Password('password');
|
$password = new Zend_Form_Element_Password('password');
|
||||||
$password->setLabel('Password:');
|
$password->setLabel(_('Password:'));
|
||||||
$password->setAttrib('class', 'input_text');
|
$password->setAttrib('class', 'input_text');
|
||||||
$password->setRequired(true);
|
$password->setRequired(true);
|
||||||
$password->addFilter('StringTrim');
|
$password->addFilter('StringTrim');
|
||||||
$password->addValidator('NotEmpty');
|
$password->addValidator($notEmptyValidator);
|
||||||
$this->addElement($password);
|
$this->addElement($password);
|
||||||
|
|
||||||
|
$passwordVerify = new Zend_Form_Element_Password('passwordVerify');
|
||||||
|
$passwordVerify->setLabel(_('Verify Password:'));
|
||||||
|
$passwordVerify->setAttrib('class', 'input_text');
|
||||||
|
$passwordVerify->setRequired(true);
|
||||||
|
$passwordVerify->addFilter('StringTrim');
|
||||||
|
$passwordVerify->addValidator($notEmptyValidator);
|
||||||
|
$this->addElement($passwordVerify);
|
||||||
|
|
||||||
$firstName = new Zend_Form_Element_Text('first_name');
|
$firstName = new Zend_Form_Element_Text('first_name');
|
||||||
$firstName->setLabel('Firstname:');
|
$firstName->setLabel(_('Firstname:'));
|
||||||
$firstName->setAttrib('class', 'input_text');
|
$firstName->setAttrib('class', 'input_text');
|
||||||
$firstName->addFilter('StringTrim');
|
$firstName->addFilter('StringTrim');
|
||||||
$firstName->addValidator('NotEmpty');
|
|
||||||
$this->addElement($firstName);
|
$this->addElement($firstName);
|
||||||
|
|
||||||
$lastName = new Zend_Form_Element_Text('last_name');
|
$lastName = new Zend_Form_Element_Text('last_name');
|
||||||
$lastName->setLabel('Lastname:');
|
$lastName->setLabel(_('Lastname:'));
|
||||||
$lastName->setAttrib('class', 'input_text');
|
$lastName->setAttrib('class', 'input_text');
|
||||||
$lastName->addFilter('StringTrim');
|
$lastName->addFilter('StringTrim');
|
||||||
$lastName->addValidator('NotEmpty');
|
|
||||||
$this->addElement($lastName);
|
$this->addElement($lastName);
|
||||||
|
|
||||||
$email = new Zend_Form_Element_Text('email');
|
$email = new Zend_Form_Element_Text('email');
|
||||||
$email->setLabel('Email:');
|
$email->setLabel(_('Email:'));
|
||||||
$email->setAttrib('class', 'input_text');
|
$email->setAttrib('class', 'input_text');
|
||||||
$email->addFilter('StringTrim');
|
$email->addFilter('StringTrim');
|
||||||
$email->setRequired(true);
|
$email->setRequired(true);
|
||||||
$email->addValidator('EmailAddress');
|
$email->addValidator($notEmptyValidator);
|
||||||
|
$email->addValidator($emailValidator);
|
||||||
$this->addElement($email);
|
$this->addElement($email);
|
||||||
|
|
||||||
$cellPhone = new Zend_Form_Element_Text('cell_phone');
|
$cellPhone = new Zend_Form_Element_Text('cell_phone');
|
||||||
$cellPhone->setLabel('Mobile Phone:');
|
$cellPhone->setLabel(_('Mobile Phone:'));
|
||||||
$cellPhone->setAttrib('class', 'input_text');
|
$cellPhone->setAttrib('class', 'input_text');
|
||||||
$cellPhone->addFilter('StringTrim');
|
$cellPhone->addFilter('StringTrim');
|
||||||
$this->addElement($cellPhone);
|
$this->addElement($cellPhone);
|
||||||
|
|
||||||
$skype = new Zend_Form_Element_Text('skype');
|
$skype = new Zend_Form_Element_Text('skype');
|
||||||
$skype->setLabel('Skype:');
|
$skype->setLabel(_('Skype:'));
|
||||||
$skype->setAttrib('class', 'input_text');
|
$skype->setAttrib('class', 'input_text');
|
||||||
$skype->addFilter('StringTrim');
|
$skype->addFilter('StringTrim');
|
||||||
$this->addElement($skype);
|
$this->addElement($skype);
|
||||||
|
|
||||||
$jabber = new Zend_Form_Element_Text('jabber');
|
$jabber = new Zend_Form_Element_Text('jabber');
|
||||||
$jabber->setLabel('Jabber:');
|
$jabber->setLabel(_('Jabber:'));
|
||||||
$jabber->setAttrib('class', 'input_text');
|
$jabber->setAttrib('class', 'input_text');
|
||||||
$jabber->addFilter('StringTrim');
|
$jabber->addFilter('StringTrim');
|
||||||
$jabber->addValidator('EmailAddress');
|
$jabber->addValidator($emailValidator);
|
||||||
$this->addElement($jabber);
|
$this->addElement($jabber);
|
||||||
|
|
||||||
$select = new Zend_Form_Element_Select('type');
|
$select = new Zend_Form_Element_Select('type');
|
||||||
$select->setLabel('User Type:');
|
$select->setLabel(_('User Type:'));
|
||||||
$select->setAttrib('class', 'input_select');
|
$select->setAttrib('class', 'input_select');
|
||||||
$select->setAttrib('style', 'width: 40%');
|
$select->setAttrib('style', 'width: 40%');
|
||||||
$select->setMultiOptions(array(
|
$select->setMultiOptions(array(
|
||||||
"G" => "Guest",
|
"G" => _("Guest"),
|
||||||
"H" => "DJ",
|
"H" => _("DJ"),
|
||||||
"P" => "Program Manager",
|
"P" => _("Program Manager"),
|
||||||
"A" => "Admin"
|
"A" => _("Admin")
|
||||||
));
|
));
|
||||||
$select->setRequired(true);
|
$select->setRequired(true);
|
||||||
$this->addElement($select);
|
$this->addElement($select);
|
||||||
|
|
||||||
$submit = new Zend_Form_Element_Submit('submit');
|
$saveBtn = new Zend_Form_Element_Button('save_user');
|
||||||
$submit->setAttrib('class', 'ui-button ui-state-default right-floated');
|
$saveBtn->setAttrib('class', 'btn btn-small right-floated');
|
||||||
$submit->setIgnore(true);
|
$saveBtn->setIgnore(true);
|
||||||
$submit->setLabel('Save');
|
$saveBtn->setLabel(_('Save'));
|
||||||
$this->addElement($submit);
|
$this->addElement($saveBtn);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function validateLogin($data)
|
public function validateLogin($data)
|
||||||
|
@ -98,7 +110,7 @@ class Application_Form_AddUser extends Zend_Form
|
||||||
$count = CcSubjsQuery::create()->filterByDbLogin($data['login'])->count();
|
$count = CcSubjsQuery::create()->filterByDbLogin($data['login'])->count();
|
||||||
|
|
||||||
if ($count != 0) {
|
if ($count != 0) {
|
||||||
$this->getElement('login')->setErrors(array("Login name is not unique."));
|
$this->getElement('login')->setErrors(array(_("Login name is not unique.")));
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -106,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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,7 @@ class Application_Form_DateRange extends Zend_Form_SubForm
|
||||||
$startDate = new Zend_Form_Element_Text('his_date_start');
|
$startDate = new Zend_Form_Element_Text('his_date_start');
|
||||||
$startDate->class = 'input_text';
|
$startDate->class = 'input_text';
|
||||||
$startDate->setRequired(true)
|
$startDate->setRequired(true)
|
||||||
->setLabel('Date Start:')
|
->setLabel(_('Date Start:'))
|
||||||
->setValue(date("Y-m-d"))
|
->setValue(date("Y-m-d"))
|
||||||
->setFilters(array('StringTrim'))
|
->setFilters(array('StringTrim'))
|
||||||
->setValidators(array(
|
->setValidators(array(
|
||||||
|
@ -32,7 +32,7 @@ class Application_Form_DateRange extends Zend_Form_SubForm
|
||||||
->setValidators(array(
|
->setValidators(array(
|
||||||
'NotEmpty',
|
'NotEmpty',
|
||||||
array('date', false, array('HH:mm')),
|
array('date', false, array('HH:mm')),
|
||||||
array('regex', false, array('/^[0-2]?[0-9]:[0-5][0-9]$/', 'messages' => 'Invalid character entered'))))
|
array('regex', false, array('/^[0-2]?[0-9]:[0-5][0-9]$/', 'messages' => _('Invalid character entered')))))
|
||||||
->setDecorators(array('ViewHelper'));
|
->setDecorators(array('ViewHelper'));
|
||||||
$startTime->setAttrib('alt', 'time');
|
$startTime->setAttrib('alt', 'time');
|
||||||
$this->addElement($startTime);
|
$this->addElement($startTime);
|
||||||
|
@ -41,7 +41,7 @@ class Application_Form_DateRange extends Zend_Form_SubForm
|
||||||
$endDate = new Zend_Form_Element_Text('his_date_end');
|
$endDate = new Zend_Form_Element_Text('his_date_end');
|
||||||
$endDate->class = 'input_text';
|
$endDate->class = 'input_text';
|
||||||
$endDate->setRequired(true)
|
$endDate->setRequired(true)
|
||||||
->setLabel('Date End:')
|
->setLabel(_('Date End:'))
|
||||||
->setValue(date("Y-m-d"))
|
->setValue(date("Y-m-d"))
|
||||||
->setFilters(array('StringTrim'))
|
->setFilters(array('StringTrim'))
|
||||||
->setValidators(array(
|
->setValidators(array(
|
||||||
|
@ -60,7 +60,7 @@ class Application_Form_DateRange extends Zend_Form_SubForm
|
||||||
->setValidators(array(
|
->setValidators(array(
|
||||||
'NotEmpty',
|
'NotEmpty',
|
||||||
array('date', false, array('HH:mm')),
|
array('date', false, array('HH:mm')),
|
||||||
array('regex', false, array('/^[0-2]?[0-9]:[0-5][0-9]$/', 'messages' => 'Invalid character entered'))))
|
array('regex', false, array('/^[0-2]?[0-9]:[0-5][0-9]$/', 'messages' => _('Invalid character entered')))))
|
||||||
->setDecorators(array('ViewHelper'));
|
->setDecorators(array('ViewHelper'));
|
||||||
$endTime->setAttrib('alt', 'time');
|
$endTime->setAttrib('alt', 'time');
|
||||||
$this->addElement($endTime);
|
$this->addElement($endTime);
|
||||||
|
|
|
@ -2,82 +2,89 @@
|
||||||
|
|
||||||
class Application_Form_EditAudioMD extends Zend_Form
|
class Application_Form_EditAudioMD extends Zend_Form
|
||||||
{
|
{
|
||||||
public function init()
|
|
||||||
|
public function init() {}
|
||||||
|
|
||||||
|
public function startForm($p_id)
|
||||||
{
|
{
|
||||||
|
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||||
// Set the method for the display form to POST
|
// Set the method for the display form to POST
|
||||||
$this->setMethod('post');
|
$this->setMethod('post');
|
||||||
|
|
||||||
|
$this->addElement('hidden', 'file_id', array(
|
||||||
|
'value' => $p_id
|
||||||
|
));
|
||||||
// Add title field
|
// Add title field
|
||||||
$this->addElement('text', 'track_title', array(
|
$this->addElement('text', 'track_title', array(
|
||||||
'label' => 'Title:',
|
'label' => _('Title:'),
|
||||||
'class' => 'input_text',
|
'class' => 'input_text',
|
||||||
'filters' => array('StringTrim'),
|
'filters' => array('StringTrim'),
|
||||||
));
|
));
|
||||||
|
|
||||||
// Add artist field
|
// Add artist field
|
||||||
$this->addElement('text', 'artist_name', array(
|
$this->addElement('text', 'artist_name', array(
|
||||||
'label' => 'Creator:',
|
'label' => _('Creator:'),
|
||||||
'class' => 'input_text',
|
'class' => 'input_text',
|
||||||
'filters' => array('StringTrim'),
|
'filters' => array('StringTrim'),
|
||||||
));
|
));
|
||||||
|
|
||||||
// Add album field
|
// Add album field
|
||||||
$this->addElement('text', 'album_title', array(
|
$this->addElement('text', 'album_title', array(
|
||||||
'label' => 'Album:',
|
'label' => _('Album:'),
|
||||||
'class' => 'input_text',
|
'class' => 'input_text',
|
||||||
'filters' => array('StringTrim')
|
'filters' => array('StringTrim')
|
||||||
));
|
));
|
||||||
|
|
||||||
// Add track number field
|
// Add track number field
|
||||||
$this->addElement('text', 'track_number', array(
|
$this->addElement('text', 'track_number', array(
|
||||||
'label' => 'Track:',
|
'label' => _('Track:'),
|
||||||
'class' => 'input_text',
|
'class' => 'input_text',
|
||||||
'filters' => array('StringTrim')
|
'filters' => array('StringTrim')
|
||||||
));
|
));
|
||||||
|
|
||||||
// Add genre field
|
// Add genre field
|
||||||
$this->addElement('text', 'genre', array(
|
$this->addElement('text', 'genre', array(
|
||||||
'label' => 'Genre:',
|
'label' => _('Genre:'),
|
||||||
'class' => 'input_text',
|
'class' => 'input_text',
|
||||||
'filters' => array('StringTrim')
|
'filters' => array('StringTrim')
|
||||||
));
|
));
|
||||||
|
|
||||||
// Add year field
|
// Add year field
|
||||||
$this->addElement('text', 'year', array(
|
$this->addElement('text', 'year', array(
|
||||||
'label' => 'Year:',
|
'label' => _('Year:'),
|
||||||
'class' => 'input_text',
|
'class' => 'input_text',
|
||||||
'filters' => array('StringTrim'),
|
'filters' => array('StringTrim'),
|
||||||
'validators' => array(
|
'validators' => array(
|
||||||
array('date', false, array('YYYY-MM-DD')),
|
Application_Form_Helper_ValidationTypes::overrrideDateValidator("YYYY-MM-DD"),
|
||||||
array('date', false, array('YYYY-MM')),
|
Application_Form_Helper_ValidationTypes::overrrideDateValidator("YYYY-MM"),
|
||||||
array('date', false, array('YYYY'))
|
Application_Form_Helper_ValidationTypes::overrrideDateValidator("YYYY")
|
||||||
)
|
)
|
||||||
));
|
));
|
||||||
|
|
||||||
// Add label field
|
// Add label field
|
||||||
$this->addElement('text', 'label', array(
|
$this->addElement('text', 'label', array(
|
||||||
'label' => 'Label:',
|
'label' => _('Label:'),
|
||||||
'class' => 'input_text',
|
'class' => 'input_text',
|
||||||
'filters' => array('StringTrim')
|
'filters' => array('StringTrim')
|
||||||
));
|
));
|
||||||
|
|
||||||
// Add composer field
|
// Add composer field
|
||||||
$this->addElement('text', 'composer', array(
|
$this->addElement('text', 'composer', array(
|
||||||
'label' => 'Composer:',
|
'label' => _('Composer:'),
|
||||||
'class' => 'input_text',
|
'class' => 'input_text',
|
||||||
'filters' => array('StringTrim')
|
'filters' => array('StringTrim')
|
||||||
));
|
));
|
||||||
|
|
||||||
// Add conductor field
|
// Add conductor field
|
||||||
$this->addElement('text', 'conductor', array(
|
$this->addElement('text', 'conductor', array(
|
||||||
'label' => 'Conductor:',
|
'label' => _('Conductor:'),
|
||||||
'class' => 'input_text',
|
'class' => 'input_text',
|
||||||
'filters' => array('StringTrim')
|
'filters' => array('StringTrim')
|
||||||
));
|
));
|
||||||
|
|
||||||
// Add mood field
|
// Add mood field
|
||||||
$this->addElement('text', 'mood', array(
|
$this->addElement('text', 'mood', array(
|
||||||
'label' => 'Mood:',
|
'label' => _('Mood:'),
|
||||||
'class' => 'input_text',
|
'class' => 'input_text',
|
||||||
'filters' => array('StringTrim')
|
'filters' => array('StringTrim')
|
||||||
));
|
));
|
||||||
|
@ -85,7 +92,7 @@ class Application_Form_EditAudioMD extends Zend_Form
|
||||||
// Add bmp field
|
// Add bmp field
|
||||||
$bpm = new Zend_Form_Element_Text('bpm');
|
$bpm = new Zend_Form_Element_Text('bpm');
|
||||||
$bpm->class = 'input_text';
|
$bpm->class = 'input_text';
|
||||||
$bpm->setLabel('BPM:')
|
$bpm->setLabel(_('BPM:'))
|
||||||
->setFilters(array('StringTrim'))
|
->setFilters(array('StringTrim'))
|
||||||
->setValidators(array(
|
->setValidators(array(
|
||||||
new Zend_Validate_StringLength(array('min'=>0,'max' => 8)),
|
new Zend_Validate_StringLength(array('min'=>0,'max' => 8)),
|
||||||
|
@ -94,54 +101,53 @@ class Application_Form_EditAudioMD extends Zend_Form
|
||||||
|
|
||||||
// Add copyright field
|
// Add copyright field
|
||||||
$this->addElement('text', 'copyright', array(
|
$this->addElement('text', 'copyright', array(
|
||||||
'label' => 'Copyright:',
|
'label' => _('Copyright:'),
|
||||||
'class' => 'input_text',
|
'class' => 'input_text',
|
||||||
'filters' => array('StringTrim')
|
'filters' => array('StringTrim')
|
||||||
));
|
));
|
||||||
|
|
||||||
// Add isrc number field
|
// Add isrc number field
|
||||||
$this->addElement('text', 'isrc_number', array(
|
$this->addElement('text', 'isrc_number', array(
|
||||||
'label' => 'ISRC Number:',
|
'label' => _('ISRC Number:'),
|
||||||
'class' => 'input_text',
|
'class' => 'input_text',
|
||||||
'filters' => array('StringTrim')
|
'filters' => array('StringTrim')
|
||||||
));
|
));
|
||||||
|
|
||||||
// Add website field
|
// Add website field
|
||||||
$this->addElement('text', 'info_url', array(
|
$this->addElement('text', 'info_url', array(
|
||||||
'label' => 'Website:',
|
'label' => _('Website:'),
|
||||||
'class' => 'input_text',
|
'class' => 'input_text',
|
||||||
'filters' => array('StringTrim')
|
'filters' => array('StringTrim')
|
||||||
));
|
));
|
||||||
|
|
||||||
// Add language field
|
// Add language field
|
||||||
$this->addElement('text', 'language', array(
|
$this->addElement('text', 'language', array(
|
||||||
'label' => 'Language:',
|
'label' => _('Language:'),
|
||||||
'class' => 'input_text',
|
'class' => 'input_text',
|
||||||
'filters' => array('StringTrim')
|
'filters' => array('StringTrim')
|
||||||
));
|
));
|
||||||
|
|
||||||
// Add the submit button
|
// Add the submit button
|
||||||
$this->addElement('submit', 'submit', array(
|
$this->addElement('button', 'editmdsave', array(
|
||||||
'ignore' => true,
|
'ignore' => true,
|
||||||
'class' => 'btn',
|
'class' => 'btn',
|
||||||
'label' => 'Save',
|
'label' => _('Save'),
|
||||||
'decorators' => array(
|
'decorators' => array(
|
||||||
'ViewHelper'
|
'ViewHelper'
|
||||||
)
|
)
|
||||||
));
|
));
|
||||||
|
|
||||||
// Add the submit button
|
// Add the submit button
|
||||||
$this->addElement('button', 'cancel', array(
|
$this->addElement('button', 'editmdcancel', array(
|
||||||
'ignore' => true,
|
'ignore' => true,
|
||||||
'class' => 'btn md-cancel',
|
'class' => 'btn md-cancel',
|
||||||
'label' => 'Cancel',
|
'label' => _('Cancel'),
|
||||||
'onclick' => 'javascript:document.location.href = "/Library"',
|
|
||||||
'decorators' => array(
|
'decorators' => array(
|
||||||
'ViewHelper'
|
'ViewHelper'
|
||||||
)
|
)
|
||||||
));
|
));
|
||||||
|
|
||||||
$this->addDisplayGroup(array('submit', 'cancel'), 'submitButtons', array(
|
$this->addDisplayGroup(array('editmdsave', 'editmdcancel'), 'submitButtons', array(
|
||||||
'decorators' => array(
|
'decorators' => array(
|
||||||
'FormElements',
|
'FormElements',
|
||||||
'DtDdWrapper'
|
'DtDdWrapper'
|
||||||
|
|
147
airtime_mvc/application/forms/EditUser.php
Normal file
147
airtime_mvc/application/forms/EditUser.php
Normal file
|
@ -0,0 +1,147 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
class Application_Form_EditUser extends Zend_Form
|
||||||
|
{
|
||||||
|
|
||||||
|
public function init()
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
$this->addElementPrefixPath('Application_Validate',
|
||||||
|
'../application/validate',
|
||||||
|
'validate');
|
||||||
|
* */
|
||||||
|
|
||||||
|
$currentUser = Application_Model_User::getCurrentUser();
|
||||||
|
$currentUserId = $currentUser->getId();
|
||||||
|
$userData = Application_Model_User::GetUserData($currentUserId);
|
||||||
|
$notEmptyValidator = Application_Form_Helper_ValidationTypes::overrideNotEmptyValidator();
|
||||||
|
$emailValidator = Application_Form_Helper_ValidationTypes::overrideEmailAddressValidator();
|
||||||
|
|
||||||
|
$this->setDecorators(array(
|
||||||
|
array('ViewScript', array('viewScript' => 'form/edit-user.phtml', "currentUser" => $currentUser->getLogin()))));
|
||||||
|
$this->setAttrib('id', 'current-user-form');
|
||||||
|
|
||||||
|
$hidden = new Zend_Form_Element_Hidden('cu_user_id');
|
||||||
|
$hidden->setDecorators(array('ViewHelper'));
|
||||||
|
$hidden->setValue($userData["id"]);
|
||||||
|
$this->addElement($hidden);
|
||||||
|
|
||||||
|
$login = new Zend_Form_Element_Text('cu_login');
|
||||||
|
$login->setLabel(_('Username:'));
|
||||||
|
$login->setValue($userData["login"]);
|
||||||
|
$login->setAttrib('class', 'input_text');
|
||||||
|
$login->setAttrib('readonly', 'readonly');
|
||||||
|
$login->setRequired(true);
|
||||||
|
$login->addValidator($notEmptyValidator);
|
||||||
|
$login->addFilter('StringTrim');
|
||||||
|
$login->setDecorators(array('viewHelper'));
|
||||||
|
$this->addElement($login);
|
||||||
|
|
||||||
|
$password = new Zend_Form_Element_Password('cu_password');
|
||||||
|
$password->setLabel(_('Password:'));
|
||||||
|
$password->setAttrib('class', 'input_text');
|
||||||
|
$password->setRequired(true);
|
||||||
|
$password->addFilter('StringTrim');
|
||||||
|
$password->addValidator($notEmptyValidator);
|
||||||
|
$password->setDecorators(array('viewHelper'));
|
||||||
|
$this->addElement($password);
|
||||||
|
|
||||||
|
$passwordVerify = new Zend_Form_Element_Password('cu_passwordVerify');
|
||||||
|
$passwordVerify->setLabel(_('Verify Password:'));
|
||||||
|
$passwordVerify->setAttrib('class', 'input_text');
|
||||||
|
$passwordVerify->setRequired(true);
|
||||||
|
$passwordVerify->addFilter('StringTrim');
|
||||||
|
$passwordVerify->addValidator($notEmptyValidator);
|
||||||
|
$passwordVerify->setDecorators(array('viewHelper'));
|
||||||
|
$this->addElement($passwordVerify);
|
||||||
|
|
||||||
|
$firstName = new Zend_Form_Element_Text('cu_first_name');
|
||||||
|
$firstName->setLabel(_('Firstname:'));
|
||||||
|
$firstName->setValue($userData["first_name"]);
|
||||||
|
$firstName->setAttrib('class', 'input_text');
|
||||||
|
$firstName->addFilter('StringTrim');
|
||||||
|
$firstName->setDecorators(array('viewHelper'));
|
||||||
|
$this->addElement($firstName);
|
||||||
|
|
||||||
|
$lastName = new Zend_Form_Element_Text('cu_last_name');
|
||||||
|
$lastName->setLabel(_('Lastname:'));
|
||||||
|
$lastName->setValue($userData["last_name"]);
|
||||||
|
$lastName->setAttrib('class', 'input_text');
|
||||||
|
$lastName->addFilter('StringTrim');
|
||||||
|
$lastName->setDecorators(array('viewHelper'));
|
||||||
|
$this->addElement($lastName);
|
||||||
|
|
||||||
|
$email = new Zend_Form_Element_Text('cu_email');
|
||||||
|
$email->setLabel(_('Email:'));
|
||||||
|
$email->setValue($userData["email"]);
|
||||||
|
$email->setAttrib('class', 'input_text');
|
||||||
|
$email->addFilter('StringTrim');
|
||||||
|
$email->setRequired(true);
|
||||||
|
$email->addValidator($notEmptyValidator);
|
||||||
|
$email->addValidator($emailValidator);
|
||||||
|
$email->setDecorators(array('viewHelper'));
|
||||||
|
$this->addElement($email);
|
||||||
|
|
||||||
|
$cellPhone = new Zend_Form_Element_Text('cu_cell_phone');
|
||||||
|
$cellPhone->setLabel(_('Mobile Phone:'));
|
||||||
|
$cellPhone->setValue($userData["cell_phone"]);
|
||||||
|
$cellPhone->setAttrib('class', 'input_text');
|
||||||
|
$cellPhone->addFilter('StringTrim');
|
||||||
|
$cellPhone->setDecorators(array('viewHelper'));
|
||||||
|
$this->addElement($cellPhone);
|
||||||
|
|
||||||
|
$skype = new Zend_Form_Element_Text('cu_skype');
|
||||||
|
$skype->setLabel(_('Skype:'));
|
||||||
|
$skype->setValue($userData["skype_contact"]);
|
||||||
|
$skype->setAttrib('class', 'input_text');
|
||||||
|
$skype->addFilter('StringTrim');
|
||||||
|
$skype->setDecorators(array('viewHelper'));
|
||||||
|
$this->addElement($skype);
|
||||||
|
|
||||||
|
$jabber = new Zend_Form_Element_Text('cu_jabber');
|
||||||
|
$jabber->setLabel(_('Jabber:'));
|
||||||
|
$jabber->setValue($userData["jabber_contact"]);
|
||||||
|
$jabber->setAttrib('class', 'input_text');
|
||||||
|
$jabber->addFilter('StringTrim');
|
||||||
|
$jabber->addValidator($emailValidator);
|
||||||
|
$jabber->setDecorators(array('viewHelper'));
|
||||||
|
$this->addElement($jabber);
|
||||||
|
|
||||||
|
$locale = new Zend_Form_Element_Select("cu_locale");
|
||||||
|
$locale->setLabel(_("Language:"));
|
||||||
|
$locale->setMultiOptions(Application_Model_Locale::getLocales());
|
||||||
|
$locale->setValue(Application_Model_Preference::GetUserLocale($currentUserId));
|
||||||
|
$locale->setDecorators(array('ViewHelper'));
|
||||||
|
$this->addElement($locale);
|
||||||
|
|
||||||
|
$timezone = new Zend_Form_Element_Select("cu_timezone");
|
||||||
|
$timezone->setLabel(_("Timezone:"));
|
||||||
|
$timezone->setMultiOptions(Application_Common_Timezone::getTimezones());
|
||||||
|
$timezone->setValue(Application_Model_Preference::GetUserTimezone($currentUserId));
|
||||||
|
$timezone->setDecorators(array('ViewHelper'));
|
||||||
|
$this->addElement($timezone);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function validateLogin($p_login, $p_userId) {
|
||||||
|
$count = CcSubjsQuery::create()
|
||||||
|
->filterByDbLogin($p_login)
|
||||||
|
->filterByDbId($p_userId, Criteria::NOT_EQUAL)
|
||||||
|
->count();
|
||||||
|
|
||||||
|
if ($count != 0) {
|
||||||
|
$this->getElement('cu_login')->setErrors(array(_("Login name is not unique.")));
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
|
@ -13,7 +13,7 @@ class Application_Form_EmailServerPreferences extends Zend_Form_SubForm
|
||||||
|
|
||||||
// Enable system emails
|
// Enable system emails
|
||||||
$this->addElement('checkbox', 'enableSystemEmail', array(
|
$this->addElement('checkbox', 'enableSystemEmail', array(
|
||||||
'label' => 'Enable System Emails (Password Reset)',
|
'label' => _('Enable System Emails (Password Reset)'),
|
||||||
'required' => false,
|
'required' => false,
|
||||||
'value' => Application_Model_Preference::GetEnableSystemEmail(),
|
'value' => Application_Model_Preference::GetEnableSystemEmail(),
|
||||||
'decorators' => array(
|
'decorators' => array(
|
||||||
|
@ -23,14 +23,14 @@ class Application_Form_EmailServerPreferences extends Zend_Form_SubForm
|
||||||
|
|
||||||
$this->addElement('text', 'systemEmail', array(
|
$this->addElement('text', 'systemEmail', array(
|
||||||
'class' => 'input_text',
|
'class' => 'input_text',
|
||||||
'label' => 'Reset Password \'From\' Email',
|
'label' => _("Reset Password 'From' Email"),
|
||||||
'value' => Application_Model_Preference::GetSystemEmail(),
|
'value' => Application_Model_Preference::GetSystemEmail(),
|
||||||
'readonly' => true,
|
'readonly' => true,
|
||||||
'decorators' => array('viewHelper')
|
'decorators' => array('viewHelper')
|
||||||
));
|
));
|
||||||
|
|
||||||
$this->addElement('checkbox', 'configureMailServer', array(
|
$this->addElement('checkbox', 'configureMailServer', array(
|
||||||
'label' => 'Configure Mail Server',
|
'label' => _('Configure Mail Server'),
|
||||||
'required' => false,
|
'required' => false,
|
||||||
'value' => Application_Model_Preference::GetMailServerConfigured(),
|
'value' => Application_Model_Preference::GetMailServerConfigured(),
|
||||||
'decorators' => array (
|
'decorators' => array (
|
||||||
|
@ -39,7 +39,7 @@ class Application_Form_EmailServerPreferences extends Zend_Form_SubForm
|
||||||
));
|
));
|
||||||
|
|
||||||
$this->addElement('checkbox', 'msRequiresAuth', array(
|
$this->addElement('checkbox', 'msRequiresAuth', array(
|
||||||
'label' => 'Requires Authentication',
|
'label' => _('Requires Authentication'),
|
||||||
'required' => false,
|
'required' => false,
|
||||||
'value' => Application_Model_Preference::GetMailServerRequiresAuth(),
|
'value' => Application_Model_Preference::GetMailServerRequiresAuth(),
|
||||||
'decorators' => array(
|
'decorators' => array(
|
||||||
|
@ -49,7 +49,7 @@ class Application_Form_EmailServerPreferences extends Zend_Form_SubForm
|
||||||
|
|
||||||
$this->addElement('text', 'mailServer', array(
|
$this->addElement('text', 'mailServer', array(
|
||||||
'class' => 'input_text',
|
'class' => 'input_text',
|
||||||
'label' => 'Mail Server',
|
'label' => _('Mail Server'),
|
||||||
'value' => Application_Model_Preference::GetMailServer(),
|
'value' => Application_Model_Preference::GetMailServer(),
|
||||||
'readonly' => true,
|
'readonly' => true,
|
||||||
'decorators' => array('viewHelper'),
|
'decorators' => array('viewHelper'),
|
||||||
|
@ -63,7 +63,7 @@ class Application_Form_EmailServerPreferences extends Zend_Form_SubForm
|
||||||
|
|
||||||
$this->addElement('text', 'email', array(
|
$this->addElement('text', 'email', array(
|
||||||
'class' => 'input_text',
|
'class' => 'input_text',
|
||||||
'label' => 'Email Address',
|
'label' => _('Email Address'),
|
||||||
'value' => Application_Model_Preference::GetMailServerEmailAddress(),
|
'value' => Application_Model_Preference::GetMailServerEmailAddress(),
|
||||||
'readonly' => true,
|
'readonly' => true,
|
||||||
'decorators' => array('viewHelper'),
|
'decorators' => array('viewHelper'),
|
||||||
|
@ -78,7 +78,7 @@ class Application_Form_EmailServerPreferences extends Zend_Form_SubForm
|
||||||
|
|
||||||
$this->addElement('password', 'ms_password', array(
|
$this->addElement('password', 'ms_password', array(
|
||||||
'class' => 'input_text',
|
'class' => 'input_text',
|
||||||
'label' => 'Password',
|
'label' => _('Password'),
|
||||||
'value' => Application_Model_Preference::GetMailServerPassword(),
|
'value' => Application_Model_Preference::GetMailServerPassword(),
|
||||||
'readonly' => true,
|
'readonly' => true,
|
||||||
'decorators' => array('viewHelper'),
|
'decorators' => array('viewHelper'),
|
||||||
|
@ -96,7 +96,7 @@ class Application_Form_EmailServerPreferences extends Zend_Form_SubForm
|
||||||
$port->class = 'input_text';
|
$port->class = 'input_text';
|
||||||
$port->setRequired(false)
|
$port->setRequired(false)
|
||||||
->setValue(Application_Model_Preference::GetMailServerPort())
|
->setValue(Application_Model_Preference::GetMailServerPort())
|
||||||
->setLabel('Port')
|
->setLabel(_('Port'))
|
||||||
->setAttrib('readonly', true)
|
->setAttrib('readonly', true)
|
||||||
->setDecorators(array('viewHelper'));
|
->setDecorators(array('viewHelper'));
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,7 @@ class Application_Form_GeneralPreferences extends Zend_Form_SubForm
|
||||||
|
|
||||||
public function init()
|
public function init()
|
||||||
{
|
{
|
||||||
|
$notEmptyValidator = Application_Form_Helper_ValidationTypes::overrideNotEmptyValidator();
|
||||||
$this->setDecorators(array(
|
$this->setDecorators(array(
|
||||||
array('ViewScript', array('viewScript' => 'form/preferences_general.phtml'))
|
array('ViewScript', array('viewScript' => 'form/preferences_general.phtml'))
|
||||||
));
|
));
|
||||||
|
@ -17,7 +18,7 @@ class Application_Form_GeneralPreferences extends Zend_Form_SubForm
|
||||||
//Station name
|
//Station name
|
||||||
$this->addElement('text', 'stationName', array(
|
$this->addElement('text', 'stationName', array(
|
||||||
'class' => 'input_text',
|
'class' => 'input_text',
|
||||||
'label' => 'Station Name',
|
'label' => _('Station Name'),
|
||||||
'required' => false,
|
'required' => false,
|
||||||
'filters' => array('StringTrim'),
|
'filters' => array('StringTrim'),
|
||||||
'value' => Application_Model_Preference::GetStationName(),
|
'value' => Application_Model_Preference::GetStationName(),
|
||||||
|
@ -29,12 +30,12 @@ class Application_Form_GeneralPreferences extends Zend_Form_SubForm
|
||||||
//Default station fade
|
//Default station fade
|
||||||
$this->addElement('text', 'stationDefaultFade', array(
|
$this->addElement('text', 'stationDefaultFade', array(
|
||||||
'class' => 'input_text',
|
'class' => 'input_text',
|
||||||
'label' => 'Default Fade (s):',
|
'label' => _('Default Fade (s):'),
|
||||||
'required' => false,
|
'required' => true,
|
||||||
'filters' => array('StringTrim'),
|
'filters' => array('StringTrim'),
|
||||||
'validators' => array(array('regex', false,
|
'validators' => array(array($notEmptyValidator, 'regex', false,
|
||||||
array('/^[0-9]{1,2}(\.\d{1})?$/',
|
array('/^[0-9]{1,2}(\.\d{1})?$/',
|
||||||
'messages' => 'enter a time in seconds 0{.0}'))),
|
'messages' => _('enter a time in seconds 0{.0}')))),
|
||||||
'value' => $defaultFade,
|
'value' => $defaultFade,
|
||||||
'decorators' => array(
|
'decorators' => array(
|
||||||
'ViewHelper'
|
'ViewHelper'
|
||||||
|
@ -42,9 +43,10 @@ class Application_Form_GeneralPreferences extends Zend_Form_SubForm
|
||||||
));
|
));
|
||||||
|
|
||||||
$third_party_api = new Zend_Form_Element_Radio('thirdPartyApi');
|
$third_party_api = new Zend_Form_Element_Radio('thirdPartyApi');
|
||||||
$third_party_api->setLabel('Website Widgets:');
|
$third_party_api->setLabel(
|
||||||
$third_party_api->setMultiOptions(array("Disabled",
|
sprintf(_('Allow Remote Websites To Access "Schedule" Info?%s (Enable this to make front-end widgets work.)'), '<br>'));
|
||||||
"Enabled"));
|
$third_party_api->setMultiOptions(array(_("Disabled"),
|
||||||
|
_("Enabled")));
|
||||||
$third_party_api->setValue(Application_Model_Preference::GetAllow3rdPartyApi());
|
$third_party_api->setValue(Application_Model_Preference::GetAllow3rdPartyApi());
|
||||||
$third_party_api->setDecorators(array('ViewHelper'));
|
$third_party_api->setDecorators(array('ViewHelper'));
|
||||||
$this->addElement($third_party_api);
|
$this->addElement($third_party_api);
|
||||||
|
@ -63,50 +65,30 @@ class Application_Form_GeneralPreferences extends Zend_Form_SubForm
|
||||||
)
|
)
|
||||||
));
|
));
|
||||||
|
|
||||||
|
$locale = new Zend_Form_Element_Select("locale");
|
||||||
|
$locale->setLabel(_("Default Interface Language"));
|
||||||
|
$locale->setMultiOptions(Application_Model_Locale::getLocales());
|
||||||
|
$locale->setValue(Application_Model_Preference::GetDefaultLocale());
|
||||||
|
$locale->setDecorators(array('ViewHelper'));
|
||||||
|
$this->addElement($locale);
|
||||||
|
|
||||||
/* Form Element for setting the Timezone */
|
/* Form Element for setting the Timezone */
|
||||||
$timezone = new Zend_Form_Element_Select("timezone");
|
$timezone = new Zend_Form_Element_Select("timezone");
|
||||||
$timezone->setLabel("Timezone");
|
$timezone->setLabel(_("Default Interface Timezone"));
|
||||||
$timezone->setMultiOptions($this->getTimezones());
|
$timezone->setMultiOptions(Application_Common_Timezone::getTimezones());
|
||||||
$timezone->setValue(Application_Model_Preference::GetTimezone());
|
$timezone->setValue(Application_Model_Preference::GetDefaultTimezone());
|
||||||
$timezone->setDecorators(array('ViewHelper'));
|
$timezone->setDecorators(array('ViewHelper'));
|
||||||
$this->addElement($timezone);
|
$this->addElement($timezone);
|
||||||
|
|
||||||
/* Form Element for setting which day is the start of the week */
|
/* Form Element for setting which day is the start of the week */
|
||||||
$week_start_day = new Zend_Form_Element_Select("weekStartDay");
|
$week_start_day = new Zend_Form_Element_Select("weekStartDay");
|
||||||
$week_start_day->setLabel("Week Starts On");
|
$week_start_day->setLabel(_("Week Starts On"));
|
||||||
$week_start_day->setMultiOptions($this->getWeekStartDays());
|
$week_start_day->setMultiOptions($this->getWeekStartDays());
|
||||||
$week_start_day->setValue(Application_Model_Preference::GetWeekStartDay());
|
$week_start_day->setValue(Application_Model_Preference::GetWeekStartDay());
|
||||||
$week_start_day->setDecorators(array('ViewHelper'));
|
$week_start_day->setDecorators(array('ViewHelper'));
|
||||||
$this->addElement($week_start_day);
|
$this->addElement($week_start_day);
|
||||||
}
|
}
|
||||||
|
|
||||||
private function getTimezones()
|
|
||||||
{
|
|
||||||
$regions = array(
|
|
||||||
'Africa' => DateTimeZone::AFRICA,
|
|
||||||
'America' => DateTimeZone::AMERICA,
|
|
||||||
'Antarctica' => DateTimeZone::ANTARCTICA,
|
|
||||||
'Arctic' => DateTimeZone::ARCTIC,
|
|
||||||
'Asia' => DateTimeZone::ASIA,
|
|
||||||
'Atlantic' => DateTimeZone::ATLANTIC,
|
|
||||||
'Australia' => DateTimeZone::AUSTRALIA,
|
|
||||||
'Europe' => DateTimeZone::EUROPE,
|
|
||||||
'Indian' => DateTimeZone::INDIAN,
|
|
||||||
'Pacific' => DateTimeZone::PACIFIC
|
|
||||||
);
|
|
||||||
|
|
||||||
$tzlist = array();
|
|
||||||
|
|
||||||
foreach ($regions as $name => $mask) {
|
|
||||||
$ids = DateTimeZone::listIdentifiers($mask);
|
|
||||||
foreach ($ids as $id) {
|
|
||||||
$tzlist[$id] = str_replace("_", " ", $id);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return $tzlist;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static function getWidgetCode() {
|
private static function getWidgetCode() {
|
||||||
|
|
||||||
$host = $_SERVER['SERVER_NAME'];
|
$host = $_SERVER['SERVER_NAME'];
|
||||||
|
@ -146,13 +128,13 @@ CODE;
|
||||||
private function getWeekStartDays()
|
private function getWeekStartDays()
|
||||||
{
|
{
|
||||||
$days = array(
|
$days = array(
|
||||||
'Sunday',
|
_('Sunday'),
|
||||||
'Monday',
|
_('Monday'),
|
||||||
'Tuesday',
|
_('Tuesday'),
|
||||||
'Wednesday',
|
_('Wednesday'),
|
||||||
'Thursday',
|
_('Thursday'),
|
||||||
'Friday',
|
_('Friday'),
|
||||||
'Saturday'
|
_('Saturday')
|
||||||
);
|
);
|
||||||
|
|
||||||
return $days;
|
return $days;
|
||||||
|
|
|
@ -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";
|
||||||
|
|
||||||
|
@ -16,24 +16,24 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm
|
||||||
|
|
||||||
// automatic trasition on source disconnection
|
// automatic trasition on source disconnection
|
||||||
$auto_transition = new Zend_Form_Element_Checkbox("auto_transition");
|
$auto_transition = new Zend_Form_Element_Checkbox("auto_transition");
|
||||||
$auto_transition->setLabel("Auto Switch Off")
|
$auto_transition->setLabel(_("Auto Switch Off"))
|
||||||
->setValue(Application_Model_Preference::GetAutoTransition())
|
->setValue(Application_Model_Preference::GetAutoTransition())
|
||||||
->setDecorators(array('ViewHelper'));
|
->setDecorators(array('ViewHelper'));
|
||||||
$this->addElement($auto_transition);
|
$this->addElement($auto_transition);
|
||||||
|
|
||||||
// automatic switch on upon source connection
|
// automatic switch on upon source connection
|
||||||
$auto_switch = new Zend_Form_Element_Checkbox("auto_switch");
|
$auto_switch = new Zend_Form_Element_Checkbox("auto_switch");
|
||||||
$auto_switch->setLabel("Auto Switch On")
|
$auto_switch->setLabel(_("Auto Switch On"))
|
||||||
->setValue(Application_Model_Preference::GetAutoSwitch())
|
->setValue(Application_Model_Preference::GetAutoSwitch())
|
||||||
->setDecorators(array('ViewHelper'));
|
->setDecorators(array('ViewHelper'));
|
||||||
$this->addElement($auto_switch);
|
$this->addElement($auto_switch);
|
||||||
|
|
||||||
// Default transition fade
|
// Default transition fade
|
||||||
$transition_fade = new Zend_Form_Element_Text("transition_fade");
|
$transition_fade = new Zend_Form_Element_Text("transition_fade");
|
||||||
$transition_fade->setLabel("Switch Transition Fade (s)")
|
$transition_fade->setLabel(_("Switch Transition Fade (s)"))
|
||||||
->setFilters(array('StringTrim'))
|
->setFilters(array('StringTrim'))
|
||||||
->addValidator('regex', false, array('/^[0-9]{1,2}(\.\d{1,6})?$/',
|
->addValidator('regex', false, array('/^[0-9]{1,2}(\.\d{1,6})?$/',
|
||||||
'messages' => 'enter a time in seconds 00{.000000}'))
|
'messages' => _('enter a time in seconds 00{.000000}')))
|
||||||
->setValue($defaultFade)
|
->setValue($defaultFade)
|
||||||
->setDecorators(array('ViewHelper'));
|
->setDecorators(array('ViewHelper'));
|
||||||
$this->addElement($transition_fade);
|
$this->addElement($transition_fade);
|
||||||
|
@ -42,7 +42,7 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm
|
||||||
$master_username = new Zend_Form_Element_Text('master_username');
|
$master_username = new Zend_Form_Element_Text('master_username');
|
||||||
$master_username->setAttrib('autocomplete', 'off')
|
$master_username->setAttrib('autocomplete', 'off')
|
||||||
->setAllowEmpty(true)
|
->setAllowEmpty(true)
|
||||||
->setLabel('Master Username')
|
->setLabel(_('Master Username'))
|
||||||
->setFilters(array('StringTrim'))
|
->setFilters(array('StringTrim'))
|
||||||
->setValue(Application_Model_Preference::GetLiveStreamMasterUsername())
|
->setValue(Application_Model_Preference::GetLiveStreamMasterUsername())
|
||||||
->setDecorators(array('ViewHelper'));
|
->setDecorators(array('ViewHelper'));
|
||||||
|
@ -59,7 +59,7 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm
|
||||||
->setAttrib('renderPassword','true')
|
->setAttrib('renderPassword','true')
|
||||||
->setAllowEmpty(true)
|
->setAllowEmpty(true)
|
||||||
->setValue(Application_Model_Preference::GetLiveStreamMasterPassword())
|
->setValue(Application_Model_Preference::GetLiveStreamMasterPassword())
|
||||||
->setLabel('Master Password')
|
->setLabel(_('Master Password'))
|
||||||
->setFilters(array('StringTrim'))
|
->setFilters(array('StringTrim'))
|
||||||
->setDecorators(array('ViewHelper'));
|
->setDecorators(array('ViewHelper'));
|
||||||
$this->addElement($master_password);
|
$this->addElement($master_password);
|
||||||
|
@ -67,7 +67,7 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm
|
||||||
//Master source connection url
|
//Master source connection url
|
||||||
$master_dj_connection_url = new Zend_Form_Element_Text('master_dj_connection_url');
|
$master_dj_connection_url = new Zend_Form_Element_Text('master_dj_connection_url');
|
||||||
$master_dj_connection_url->setAttrib('readonly', true)
|
$master_dj_connection_url->setAttrib('readonly', true)
|
||||||
->setLabel('Master Source Connection URL')
|
->setLabel(_('Master Source Connection URL'))
|
||||||
->setValue(Application_Model_Preference::GetMasterDJSourceConnectionURL())
|
->setValue(Application_Model_Preference::GetMasterDJSourceConnectionURL())
|
||||||
->setDecorators(array('ViewHelper'));
|
->setDecorators(array('ViewHelper'));
|
||||||
$this->addElement($master_dj_connection_url);
|
$this->addElement($master_dj_connection_url);
|
||||||
|
@ -75,7 +75,7 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm
|
||||||
//Show source connection url
|
//Show source connection url
|
||||||
$live_dj_connection_url = new Zend_Form_Element_Text('live_dj_connection_url');
|
$live_dj_connection_url = new Zend_Form_Element_Text('live_dj_connection_url');
|
||||||
$live_dj_connection_url->setAttrib('readonly', true)
|
$live_dj_connection_url->setAttrib('readonly', true)
|
||||||
->setLabel('Show Source Connection URL')
|
->setLabel(_('Show Source Connection URL'))
|
||||||
->setValue(Application_Model_Preference::GetLiveDJSourceConnectionURL())
|
->setValue(Application_Model_Preference::GetLiveDJSourceConnectionURL())
|
||||||
->setDecorators(array('ViewHelper'));
|
->setDecorators(array('ViewHelper'));
|
||||||
$this->addElement($live_dj_connection_url);
|
$this->addElement($live_dj_connection_url);
|
||||||
|
@ -93,7 +93,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();
|
||||||
|
|
|
@ -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');
|
||||||
|
@ -16,7 +16,7 @@ class Application_Form_Login extends Zend_Form
|
||||||
|
|
||||||
// Add username element
|
// Add username element
|
||||||
$this->addElement('text', 'username', array(
|
$this->addElement('text', 'username', array(
|
||||||
'label' => 'Username:',
|
'label' => _('Username:'),
|
||||||
'class' => 'input_text',
|
'class' => 'input_text',
|
||||||
'required' => true,
|
'required' => true,
|
||||||
'value' => (isset($CC_CONFIG['demo']) && $CC_CONFIG['demo'] == 1)?'admin':'',
|
'value' => (isset($CC_CONFIG['demo']) && $CC_CONFIG['demo'] == 1)?'admin':'',
|
||||||
|
@ -31,7 +31,7 @@ class Application_Form_Login extends Zend_Form
|
||||||
|
|
||||||
// Add password element
|
// Add password element
|
||||||
$this->addElement('password', 'password', array(
|
$this->addElement('password', 'password', array(
|
||||||
'label' => 'Password:',
|
'label' => _('Password:'),
|
||||||
'class' => 'input_text',
|
'class' => 'input_text',
|
||||||
'required' => true,
|
'required' => true,
|
||||||
'value' => (isset($CC_CONFIG['demo']) && $CC_CONFIG['demo'] == 1)?'admin':'',
|
'value' => (isset($CC_CONFIG['demo']) && $CC_CONFIG['demo'] == 1)?'admin':'',
|
||||||
|
@ -44,6 +44,12 @@ class Application_Form_Login extends Zend_Form
|
||||||
)
|
)
|
||||||
));
|
));
|
||||||
|
|
||||||
|
$locale = new Zend_Form_Element_Select("locale");
|
||||||
|
$locale->setLabel(_("Language:"));
|
||||||
|
$locale->setMultiOptions(Application_Model_Locale::getLocales());
|
||||||
|
$locale->setDecorators(array('ViewHelper'));
|
||||||
|
$this->addElement($locale);
|
||||||
|
|
||||||
$recaptchaNeeded = false;
|
$recaptchaNeeded = false;
|
||||||
if (Application_Model_LoginAttempts::getAttempts($_SERVER['REMOTE_ADDR']) >= 3) {
|
if (Application_Model_LoginAttempts::getAttempts($_SERVER['REMOTE_ADDR']) >= 3) {
|
||||||
$recaptchaNeeded = true;
|
$recaptchaNeeded = true;
|
||||||
|
@ -56,7 +62,7 @@ class Application_Form_Login extends Zend_Form
|
||||||
// Add the submit button
|
// Add the submit button
|
||||||
$this->addElement('submit', 'submit', array(
|
$this->addElement('submit', 'submit', array(
|
||||||
'ignore' => true,
|
'ignore' => true,
|
||||||
'label' => 'Login',
|
'label' => _('Login'),
|
||||||
'class' => 'ui-button ui-widget ui-state-default ui-button-text-only center',
|
'class' => 'ui-button ui-widget ui-state-default ui-button-text-only center',
|
||||||
'decorators' => array(
|
'decorators' => array(
|
||||||
'ViewHelper'
|
'ViewHelper'
|
||||||
|
@ -74,7 +80,7 @@ class Application_Form_Login extends Zend_Form
|
||||||
|
|
||||||
$captcha = new Zend_Form_Element_Captcha('captcha',
|
$captcha = new Zend_Form_Element_Captcha('captcha',
|
||||||
array(
|
array(
|
||||||
'label' => 'Type the characters you see in the picture below.',
|
'label' => _('Type the characters you see in the picture below.'),
|
||||||
'captcha' => 'ReCaptcha',
|
'captcha' => 'ReCaptcha',
|
||||||
'captchaOptions' => array(
|
'captchaOptions' => array(
|
||||||
'captcha' => 'ReCaptcha',
|
'captcha' => 'ReCaptcha',
|
||||||
|
|
|
@ -10,20 +10,22 @@ class Application_Form_PasswordChange extends Zend_Form
|
||||||
array('ViewScript', array('viewScript' => 'form/password-change.phtml'))
|
array('ViewScript', array('viewScript' => 'form/password-change.phtml'))
|
||||||
));
|
));
|
||||||
|
|
||||||
|
$notEmptyValidator = Application_Form_Helper_ValidationTypes::overrideNotEmptyValidator();
|
||||||
|
$stringLengthValidator = Application_Form_Helper_ValidationTypes::overrideStringLengthValidator(6, 80);
|
||||||
|
|
||||||
$this->addElement('password', 'password', array(
|
$this->addElement('password', 'password', array(
|
||||||
'label' => 'Password',
|
'label' => _('Password'),
|
||||||
'required' => true,
|
'required' => true,
|
||||||
'filters' => array('stringTrim'),
|
'filters' => array('stringTrim'),
|
||||||
'validators' => array(
|
'validators' => array($notEmptyValidator,
|
||||||
array('stringLength', false, array(6, 80)),
|
$stringLengthValidator),
|
||||||
),
|
|
||||||
'decorators' => array(
|
'decorators' => array(
|
||||||
'ViewHelper'
|
'ViewHelper'
|
||||||
)
|
)
|
||||||
));
|
));
|
||||||
|
|
||||||
$this->addElement('password', 'password_confirm', array(
|
$this->addElement('password', 'password_confirm', array(
|
||||||
'label' => 'Confirm new password',
|
'label' => _('Confirm new password'),
|
||||||
'required' => true,
|
'required' => true,
|
||||||
'filters' => array('stringTrim'),
|
'filters' => array('stringTrim'),
|
||||||
'validators' => array(
|
'validators' => array(
|
||||||
|
@ -31,14 +33,14 @@ class Application_Form_PasswordChange extends Zend_Form
|
||||||
return $value == $context['password'];
|
return $value == $context['password'];
|
||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
'errorMessages' => array("Password confirmation does not match your password."),
|
'errorMessages' => array(_("Password confirmation does not match your password.")),
|
||||||
'decorators' => array(
|
'decorators' => array(
|
||||||
'ViewHelper'
|
'ViewHelper'
|
||||||
)
|
)
|
||||||
));
|
));
|
||||||
|
|
||||||
$this->addElement('submit', 'submit', array(
|
$this->addElement('submit', 'submit', array(
|
||||||
'label' => 'Get new password',
|
'label' => _('Get new password'),
|
||||||
'ignore' => true,
|
'ignore' => true,
|
||||||
'class' => 'ui-button ui-widget ui-state-default ui-button-text-only center',
|
'class' => 'ui-button ui-widget ui-state-default ui-button-text-only center',
|
||||||
'decorators' => array(
|
'decorators' => array(
|
||||||
|
|
|
@ -11,7 +11,7 @@ class Application_Form_PasswordRestore extends Zend_Form
|
||||||
));
|
));
|
||||||
|
|
||||||
$this->addElement('text', 'email', array(
|
$this->addElement('text', 'email', array(
|
||||||
'label' => 'E-mail',
|
'label' => _('E-mail'),
|
||||||
'required' => true,
|
'required' => true,
|
||||||
'filters' => array(
|
'filters' => array(
|
||||||
'stringTrim',
|
'stringTrim',
|
||||||
|
@ -22,7 +22,7 @@ class Application_Form_PasswordRestore extends Zend_Form
|
||||||
));
|
));
|
||||||
|
|
||||||
$this->addElement('text', 'username', array(
|
$this->addElement('text', 'username', array(
|
||||||
'label' => 'Username',
|
'label' => _('Username'),
|
||||||
'required' => false,
|
'required' => false,
|
||||||
'filters' => array(
|
'filters' => array(
|
||||||
'stringTrim',
|
'stringTrim',
|
||||||
|
@ -33,7 +33,7 @@ class Application_Form_PasswordRestore extends Zend_Form
|
||||||
));
|
));
|
||||||
|
|
||||||
$this->addElement('submit', 'submit', array(
|
$this->addElement('submit', 'submit', array(
|
||||||
'label' => 'Restore password',
|
'label' => _('Restore password'),
|
||||||
'ignore' => true,
|
'ignore' => true,
|
||||||
'class' => 'ui-button ui-widget ui-state-default ui-button-text-only center',
|
'class' => 'ui-button ui-widget ui-state-default ui-button-text-only center',
|
||||||
'decorators' => array(
|
'decorators' => array(
|
||||||
|
@ -43,7 +43,7 @@ class Application_Form_PasswordRestore extends Zend_Form
|
||||||
|
|
||||||
$cancel = new Zend_Form_Element_Button("cancel");
|
$cancel = new Zend_Form_Element_Button("cancel");
|
||||||
$cancel->class = 'ui-button ui-widget ui-state-default ui-button-text-only center';
|
$cancel->class = 'ui-button ui-widget ui-state-default ui-button-text-only center';
|
||||||
$cancel->setLabel("Cancel")
|
$cancel->setLabel(_("Cancel"))
|
||||||
->setIgnore(True)
|
->setIgnore(True)
|
||||||
->setAttrib('onclick', 'redirectToLogin();')
|
->setAttrib('onclick', 'redirectToLogin();')
|
||||||
->setDecorators(array('ViewHelper'));
|
->setDecorators(array('ViewHelper'));
|
||||||
|
|
|
@ -4,7 +4,8 @@ class Application_Form_Preferences extends Zend_Form
|
||||||
{
|
{
|
||||||
public function init()
|
public function init()
|
||||||
{
|
{
|
||||||
$this->setAction('/Preference');
|
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||||
|
|
||||||
$this->setMethod('post');
|
$this->setMethod('post');
|
||||||
|
|
||||||
$this->setDecorators(array(
|
$this->setDecorators(array(
|
||||||
|
@ -17,13 +18,5 @@ class Application_Form_Preferences extends Zend_Form
|
||||||
$soundcloud_pref = new Application_Form_SoundcloudPreferences();
|
$soundcloud_pref = new Application_Form_SoundcloudPreferences();
|
||||||
$this->addSubForm($soundcloud_pref, 'preferences_soundcloud');
|
$this->addSubForm($soundcloud_pref, 'preferences_soundcloud');
|
||||||
|
|
||||||
$this->addElement('submit', 'submit', array(
|
|
||||||
'class' => 'ui-button ui-state-default right-floated',
|
|
||||||
'ignore' => true,
|
|
||||||
'label' => 'Save',
|
|
||||||
'decorators' => array(
|
|
||||||
'ViewHelper'
|
|
||||||
)
|
|
||||||
));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@ class Application_Form_RegisterAirtime extends Zend_Form
|
||||||
|
|
||||||
public function init()
|
public function init()
|
||||||
{
|
{
|
||||||
$this->setAction('/Showbuilder');
|
$this->setAction(Application_Common_OsPath::getBaseDir().'/Showbuilder');
|
||||||
$this->setMethod('post');
|
$this->setMethod('post');
|
||||||
|
|
||||||
$country_list = Application_Model_Preference::GetCountryList();
|
$country_list = Application_Model_Preference::GetCountryList();
|
||||||
|
@ -27,7 +27,7 @@ class Application_Form_RegisterAirtime extends Zend_Form
|
||||||
|
|
||||||
// Station Name
|
// Station Name
|
||||||
$stnName = new Zend_Form_Element_Text("stnName");
|
$stnName = new Zend_Form_Element_Text("stnName");
|
||||||
$stnName->setLabel("Station Name")
|
$stnName->setLabel(_("Station Name"))
|
||||||
->setRequired(true)
|
->setRequired(true)
|
||||||
->setValue(Application_Model_Preference::GetStationName())
|
->setValue(Application_Model_Preference::GetStationName())
|
||||||
->setDecorators(array('ViewHelper'));
|
->setDecorators(array('ViewHelper'));
|
||||||
|
@ -36,7 +36,7 @@ class Application_Form_RegisterAirtime extends Zend_Form
|
||||||
// Phone number
|
// Phone number
|
||||||
$this->addElement('text', 'Phone', array(
|
$this->addElement('text', 'Phone', array(
|
||||||
'class' => 'input_text',
|
'class' => 'input_text',
|
||||||
'label' => 'Phone:',
|
'label' => _('Phone:'),
|
||||||
'required' => false,
|
'required' => false,
|
||||||
'filters' => array('StringTrim'),
|
'filters' => array('StringTrim'),
|
||||||
'value' => Application_Model_Preference::GetPhone(),
|
'value' => Application_Model_Preference::GetPhone(),
|
||||||
|
@ -48,7 +48,7 @@ class Application_Form_RegisterAirtime extends Zend_Form
|
||||||
//Email
|
//Email
|
||||||
$this->addElement('text', 'Email', array(
|
$this->addElement('text', 'Email', array(
|
||||||
'class' => 'input_text',
|
'class' => 'input_text',
|
||||||
'label' => 'Email:',
|
'label' => _('Email:'),
|
||||||
'required' => false,
|
'required' => false,
|
||||||
'filters' => array('StringTrim'),
|
'filters' => array('StringTrim'),
|
||||||
'value' => Application_Model_Preference::GetEmail(),
|
'value' => Application_Model_Preference::GetEmail(),
|
||||||
|
@ -59,7 +59,7 @@ class Application_Form_RegisterAirtime extends Zend_Form
|
||||||
|
|
||||||
// Station Web Site
|
// Station Web Site
|
||||||
$this->addElement('text', 'StationWebSite', array(
|
$this->addElement('text', 'StationWebSite', array(
|
||||||
'label' => 'Station Web Site:',
|
'label' => _('Station Web Site:'),
|
||||||
'required' => false,
|
'required' => false,
|
||||||
'class' => 'input_text',
|
'class' => 'input_text',
|
||||||
'value' => Application_Model_Preference::GetStationWebSite(),
|
'value' => Application_Model_Preference::GetStationWebSite(),
|
||||||
|
@ -70,7 +70,7 @@ class Application_Form_RegisterAirtime extends Zend_Form
|
||||||
|
|
||||||
// county list dropdown
|
// county list dropdown
|
||||||
$this->addElement('select', 'Country', array(
|
$this->addElement('select', 'Country', array(
|
||||||
'label' => 'Country:',
|
'label' => _('Country:'),
|
||||||
'required' => false,
|
'required' => false,
|
||||||
'value' => Application_Model_Preference::GetStationCountry(),
|
'value' => Application_Model_Preference::GetStationCountry(),
|
||||||
'multiOptions' => $country_list,
|
'multiOptions' => $country_list,
|
||||||
|
@ -81,7 +81,7 @@ class Application_Form_RegisterAirtime extends Zend_Form
|
||||||
|
|
||||||
// Station city
|
// Station city
|
||||||
$this->addElement('text', 'City', array(
|
$this->addElement('text', 'City', array(
|
||||||
'label' => 'City:',
|
'label' => _('City:'),
|
||||||
'required' => false,
|
'required' => false,
|
||||||
'class' => 'input_text',
|
'class' => 'input_text',
|
||||||
'value' => Application_Model_Preference::GetStationCity(),
|
'value' => Application_Model_Preference::GetStationCity(),
|
||||||
|
@ -93,7 +93,7 @@ class Application_Form_RegisterAirtime extends Zend_Form
|
||||||
// Station Description
|
// Station Description
|
||||||
$description = new Zend_Form_Element_Textarea('Description');
|
$description = new Zend_Form_Element_Textarea('Description');
|
||||||
$description->class = 'input_text_area';
|
$description->class = 'input_text_area';
|
||||||
$description->setLabel('Station Description:')
|
$description->setLabel(_('Station Description:'))
|
||||||
->setRequired(false)
|
->setRequired(false)
|
||||||
->setValue(Application_Model_Preference::GetStationDescription())
|
->setValue(Application_Model_Preference::GetStationDescription())
|
||||||
->setDecorators(array('ViewHelper'))
|
->setDecorators(array('ViewHelper'))
|
||||||
|
@ -103,7 +103,7 @@ class Application_Form_RegisterAirtime extends Zend_Form
|
||||||
|
|
||||||
// Station Logo
|
// Station Logo
|
||||||
$upload = new Zend_Form_Element_File('Logo');
|
$upload = new Zend_Form_Element_File('Logo');
|
||||||
$upload->setLabel('Station Logo:')
|
$upload->setLabel(_('Station Logo:'))
|
||||||
->setRequired(false)
|
->setRequired(false)
|
||||||
->setDecorators(array('File'))
|
->setDecorators(array('File'))
|
||||||
->addValidator('Count', false, 1)
|
->addValidator('Count', false, 1)
|
||||||
|
@ -113,7 +113,7 @@ class Application_Form_RegisterAirtime extends Zend_Form
|
||||||
|
|
||||||
//enable support feedback
|
//enable support feedback
|
||||||
$this->addElement('checkbox', 'SupportFeedback', array(
|
$this->addElement('checkbox', 'SupportFeedback', array(
|
||||||
'label' => 'Send support feedback',
|
'label' => _('Send support feedback'),
|
||||||
'required' => false,
|
'required' => false,
|
||||||
'value' => 1,
|
'value' => 1,
|
||||||
'decorators' => array(
|
'decorators' => array(
|
||||||
|
@ -123,7 +123,7 @@ class Application_Form_RegisterAirtime extends Zend_Form
|
||||||
|
|
||||||
// checkbox for publicise
|
// checkbox for publicise
|
||||||
$checkboxPublicise = new Zend_Form_Element_Checkbox("Publicise");
|
$checkboxPublicise = new Zend_Form_Element_Checkbox("Publicise");
|
||||||
$checkboxPublicise->setLabel('Promote my station on Sourcefabric.org')
|
$checkboxPublicise->setLabel(_('Promote my station on Sourcefabric.org'))
|
||||||
->setRequired(false)
|
->setRequired(false)
|
||||||
->setDecorators(array('ViewHelper'))
|
->setDecorators(array('ViewHelper'))
|
||||||
->setValue(Application_Model_Preference::GetPublicise());
|
->setValue(Application_Model_Preference::GetPublicise());
|
||||||
|
@ -145,7 +145,10 @@ class Application_Form_RegisterAirtime extends Zend_Form
|
||||||
|
|
||||||
// checkbox for privacy policy
|
// checkbox for privacy policy
|
||||||
$checkboxPrivacy = new Zend_Form_Element_Checkbox("Privacy");
|
$checkboxPrivacy = new Zend_Form_Element_Checkbox("Privacy");
|
||||||
$checkboxPrivacy->setLabel("By checking this box, I agree to Sourcefabric's <a id=\"link_to_privacy\" href=\"http://www.sourcefabric.org/en/about/policy/\" onclick=\"window.open(this.href); return false;\">privacy policy</a>.")
|
$checkboxPrivacy->setLabel(
|
||||||
|
sprintf(_("By checking this box, I agree to Sourcefabric's %sprivacy policy%s."),
|
||||||
|
"<a id='link_to_privacy' href='http://www.sourcefabric.org/en/about/policy/' onclick='window.open(this.href); return false;'>",
|
||||||
|
"</a>"))
|
||||||
->setDecorators(array('ViewHelper'));
|
->setDecorators(array('ViewHelper'));
|
||||||
$this->addElement($checkboxPrivacy);
|
$this->addElement($checkboxPrivacy);
|
||||||
}
|
}
|
||||||
|
@ -160,7 +163,7 @@ class Application_Form_RegisterAirtime extends Zend_Form
|
||||||
if (isset($data["Privacy"])) {
|
if (isset($data["Privacy"])) {
|
||||||
$checkPrivacy = $this->getElement('Privacy');
|
$checkPrivacy = $this->getElement('Privacy');
|
||||||
if ($data["SupportFeedback"] == "1" && $data["Privacy"] != "1") {
|
if ($data["SupportFeedback"] == "1" && $data["Privacy"] != "1") {
|
||||||
$checkPrivacy->addError("You have to agree to privacy policy.");
|
$checkPrivacy->addError(_("You have to agree to privacy policy."));
|
||||||
$isValid = false;
|
$isValid = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,7 @@ class Application_Form_ShowBuilder extends Zend_Form_SubForm
|
||||||
$startDate = new Zend_Form_Element_Text('sb_date_start');
|
$startDate = new Zend_Form_Element_Text('sb_date_start');
|
||||||
$startDate->class = 'input_text';
|
$startDate->class = 'input_text';
|
||||||
$startDate->setRequired(true)
|
$startDate->setRequired(true)
|
||||||
->setLabel('Date Start:')
|
->setLabel(_('Date Start:'))
|
||||||
->setValue(date("Y-m-d"))
|
->setValue(date("Y-m-d"))
|
||||||
->setFilters(array('StringTrim'))
|
->setFilters(array('StringTrim'))
|
||||||
->setValidators(array(
|
->setValidators(array(
|
||||||
|
@ -34,7 +34,7 @@ class Application_Form_ShowBuilder extends Zend_Form_SubForm
|
||||||
->setValidators(array(
|
->setValidators(array(
|
||||||
'NotEmpty',
|
'NotEmpty',
|
||||||
array('date', false, array('HH:mm')),
|
array('date', false, array('HH:mm')),
|
||||||
array('regex', false, array('/^[0-2]?[0-9]:[0-5][0-9]$/', 'messages' => 'Invalid character entered'))))
|
array('regex', false, array('/^[0-2]?[0-9]:[0-5][0-9]$/', 'messages' => _('Invalid character entered')))))
|
||||||
->setDecorators(array('ViewHelper'));
|
->setDecorators(array('ViewHelper'));
|
||||||
$startTime->setAttrib('alt', 'time');
|
$startTime->setAttrib('alt', 'time');
|
||||||
$this->addElement($startTime);
|
$this->addElement($startTime);
|
||||||
|
@ -43,7 +43,7 @@ class Application_Form_ShowBuilder extends Zend_Form_SubForm
|
||||||
$endDate = new Zend_Form_Element_Text('sb_date_end');
|
$endDate = new Zend_Form_Element_Text('sb_date_end');
|
||||||
$endDate->class = 'input_text';
|
$endDate->class = 'input_text';
|
||||||
$endDate->setRequired(true)
|
$endDate->setRequired(true)
|
||||||
->setLabel('Date End:')
|
->setLabel(_('Date End:'))
|
||||||
->setValue(date("Y-m-d"))
|
->setValue(date("Y-m-d"))
|
||||||
->setFilters(array('StringTrim'))
|
->setFilters(array('StringTrim'))
|
||||||
->setValidators(array(
|
->setValidators(array(
|
||||||
|
@ -62,14 +62,14 @@ class Application_Form_ShowBuilder extends Zend_Form_SubForm
|
||||||
->setValidators(array(
|
->setValidators(array(
|
||||||
'NotEmpty',
|
'NotEmpty',
|
||||||
array('date', false, array('HH:mm')),
|
array('date', false, array('HH:mm')),
|
||||||
array('regex', false, array('/^[0-2]?[0-9]:[0-5][0-9]$/', 'messages' => 'Invalid character entered'))))
|
array('regex', false, array('/^[0-2]?[0-9]:[0-5][0-9]$/', 'messages' => _('Invalid character entered')))))
|
||||||
->setDecorators(array('ViewHelper'));
|
->setDecorators(array('ViewHelper'));
|
||||||
$endTime->setAttrib('alt', 'time');
|
$endTime->setAttrib('alt', 'time');
|
||||||
$this->addElement($endTime);
|
$this->addElement($endTime);
|
||||||
|
|
||||||
// add a select to choose a show.
|
// add a select to choose a show.
|
||||||
$showSelect = new Zend_Form_Element_Select("sb_show_filter");
|
$showSelect = new Zend_Form_Element_Select("sb_show_filter");
|
||||||
$showSelect->setLabel("Show:");
|
$showSelect->setLabel(_("Show:"));
|
||||||
$showSelect->setMultiOptions($this->getShowNames());
|
$showSelect->setMultiOptions($this->getShowNames());
|
||||||
$showSelect->setValue(null);
|
$showSelect->setValue(null);
|
||||||
$showSelect->setDecorators(array('ViewHelper'));
|
$showSelect->setDecorators(array('ViewHelper'));
|
||||||
|
@ -77,7 +77,7 @@ class Application_Form_ShowBuilder extends Zend_Form_SubForm
|
||||||
|
|
||||||
if ($user->getType() === 'H') {
|
if ($user->getType() === 'H') {
|
||||||
$myShows = new Zend_Form_Element_Checkbox('sb_my_shows');
|
$myShows = new Zend_Form_Element_Checkbox('sb_my_shows');
|
||||||
$myShows->setLabel('All My Shows:')
|
$myShows->setLabel(_('All My Shows:'))
|
||||||
->setDecorators(array('ViewHelper'));
|
->setDecorators(array('ViewHelper'));
|
||||||
$this->addElement($myShows);
|
$this->addElement($myShows);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,88 +1,119 @@
|
||||||
<?php
|
<?php
|
||||||
class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
|
class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
|
||||||
{
|
{
|
||||||
private $criteriaOptions = array(
|
private $criteriaOptions;
|
||||||
0 => "Select criteria",
|
private $stringCriteriaOptions;
|
||||||
"album_title" => "Album",
|
private $numericCriteriaOptions;
|
||||||
"bit_rate" => "Bit Rate (Kbps)",
|
private $limitOptions;
|
||||||
"bpm" => "BPM",
|
|
||||||
"composer" => "Composer",
|
|
||||||
"conductor" => "Conductor",
|
|
||||||
"copyright" => "Copyright",
|
|
||||||
"artist_name" => "Creator",
|
|
||||||
"encoded_by" => "Encoded By",
|
|
||||||
"genre" => "Genre",
|
|
||||||
"isrc_number" => "ISRC",
|
|
||||||
"label" => "Label",
|
|
||||||
"language" => "Language",
|
|
||||||
"mtime" => "Last Modified",
|
|
||||||
"lptime" => "Last Played",
|
|
||||||
"length" => "Length",
|
|
||||||
"mime" => "Mime",
|
|
||||||
"mood" => "Mood",
|
|
||||||
"owner_id" => "Owner",
|
|
||||||
"replay_gain" => "Replay Gain",
|
|
||||||
"sample_rate" => "Sample Rate (kHz)",
|
|
||||||
"track_title" => "Title",
|
|
||||||
"track_number" => "Track Number",
|
|
||||||
"utime" => "Uploaded",
|
|
||||||
"info_url" => "Website",
|
|
||||||
"year" => "Year"
|
|
||||||
);
|
|
||||||
|
|
||||||
private $criteriaTypes = array(
|
private $criteriaTypes = array(
|
||||||
0 => "",
|
0 => "",
|
||||||
"album_title" => "s",
|
"album_title" => "s",
|
||||||
"bit_rate" => "n",
|
"bit_rate" => "n",
|
||||||
"bpm" => "n",
|
"bpm" => "n",
|
||||||
"composer" => "s",
|
"composer" => "s",
|
||||||
"conductor" => "s",
|
"conductor" => "s",
|
||||||
"copyright" => "s",
|
"copyright" => "s",
|
||||||
"artist_name" => "s",
|
"artist_name" => "s",
|
||||||
"encoded_by" => "s",
|
"encoded_by" => "s",
|
||||||
"utime" => "n",
|
"utime" => "n",
|
||||||
"mtime" => "n",
|
"mtime" => "n",
|
||||||
"lptime" => "n",
|
"lptime" => "n",
|
||||||
"genre" => "s",
|
"genre" => "s",
|
||||||
"isrc_number" => "s",
|
"isrc_number" => "s",
|
||||||
"label" => "s",
|
"label" => "s",
|
||||||
"language" => "s",
|
"language" => "s",
|
||||||
"length" => "n",
|
"length" => "n",
|
||||||
"mime" => "s",
|
"mime" => "s",
|
||||||
"mood" => "s",
|
"mood" => "s",
|
||||||
"owner_id" => "s",
|
"owner_id" => "s",
|
||||||
"replay_gain" => "n",
|
"replay_gain" => "n",
|
||||||
"sample_rate" => "n",
|
"sample_rate" => "n",
|
||||||
"track_title" => "s",
|
"track_title" => "s",
|
||||||
"track_number" => "n",
|
"track_number" => "n",
|
||||||
"info_url" => "s",
|
"info_url" => "s",
|
||||||
"year" => "n"
|
"year" => "n"
|
||||||
);
|
);
|
||||||
|
|
||||||
private $stringCriteriaOptions = array(
|
private function getCriteriaOptions($option = null)
|
||||||
"0" => "Select modifier",
|
{
|
||||||
"contains" => "contains",
|
if (!isset($this->criteriaOptions)) {
|
||||||
"does not contain" => "does not contain",
|
$this->criteriaOptions = array(
|
||||||
"is" => "is",
|
0 => _("Select criteria"),
|
||||||
"is not" => "is not",
|
"album_title" => _("Album"),
|
||||||
"starts with" => "starts with",
|
"bit_rate" => _("Bit Rate (Kbps)"),
|
||||||
"ends with" => "ends with"
|
"bpm" => _("BPM"),
|
||||||
);
|
"composer" => _("Composer"),
|
||||||
|
"conductor" => _("Conductor"),
|
||||||
|
"copyright" => _("Copyright"),
|
||||||
|
"artist_name" => _("Creator"),
|
||||||
|
"encoded_by" => _("Encoded By"),
|
||||||
|
"genre" => _("Genre"),
|
||||||
|
"isrc_number" => _("ISRC"),
|
||||||
|
"label" => _("Label"),
|
||||||
|
"language" => _("Language"),
|
||||||
|
"mtime" => _("Last Modified"),
|
||||||
|
"lptime" => _("Last Played"),
|
||||||
|
"length" => _("Length"),
|
||||||
|
"mime" => _("Mime"),
|
||||||
|
"mood" => _("Mood"),
|
||||||
|
"owner_id" => _("Owner"),
|
||||||
|
"replay_gain" => _("Replay Gain"),
|
||||||
|
"sample_rate" => _("Sample Rate (kHz)"),
|
||||||
|
"track_title" => _("Title"),
|
||||||
|
"track_number" => _("Track Number"),
|
||||||
|
"utime" => _("Uploaded"),
|
||||||
|
"info_url" => _("Website"),
|
||||||
|
"year" => _("Year")
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
private $numericCriteriaOptions = array(
|
if (is_null($option)) return $this->criteriaOptions;
|
||||||
"0" => "Select modifier",
|
else return $this->criteriaOptions[$option];
|
||||||
"is" => "is",
|
}
|
||||||
"is not" => "is not",
|
|
||||||
"is greater than" => "is greater than",
|
private function getStringCriteriaOptions()
|
||||||
"is less than" => "is less than",
|
{
|
||||||
"is in the range" => "is in the range"
|
if (!isset($this->stringCriteriaOptions)) {
|
||||||
);
|
$this->stringCriteriaOptions = array(
|
||||||
|
"0" => _("Select modifier"),
|
||||||
|
"contains" => _("contains"),
|
||||||
|
"does not contain" => _("does not contain"),
|
||||||
|
"is" => _("is"),
|
||||||
|
"is not" => _("is not"),
|
||||||
|
"starts with" => _("starts with"),
|
||||||
|
"ends with" => _("ends with")
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return $this->stringCriteriaOptions;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function getNumericCriteriaOptions()
|
||||||
|
{
|
||||||
|
if (!isset($this->numericCriteriaOptions)) {
|
||||||
|
$this->numericCriteriaOptions = array(
|
||||||
|
"0" => _("Select modifier"),
|
||||||
|
"is" => _("is"),
|
||||||
|
"is not" => _("is not"),
|
||||||
|
"is greater than" => _("is greater than"),
|
||||||
|
"is less than" => _("is less than"),
|
||||||
|
"is in the range" => _("is in the range")
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return $this->numericCriteriaOptions;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function getLimitOptions()
|
||||||
|
{
|
||||||
|
if (!isset($this->limitOptions)) {
|
||||||
|
$this->limitOptions = array(
|
||||||
|
"hours" => _("hours"),
|
||||||
|
"minutes" => _("minutes"),
|
||||||
|
"items" => _("items")
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return $this->limitOptions;
|
||||||
|
}
|
||||||
|
|
||||||
private $limitOptions = array(
|
|
||||||
"hours" => "hours",
|
|
||||||
"minutes" => "minutes",
|
|
||||||
"items" => "items"
|
|
||||||
);
|
|
||||||
|
|
||||||
public function init()
|
public function init()
|
||||||
{
|
{
|
||||||
|
@ -99,11 +130,11 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
|
||||||
}
|
}
|
||||||
|
|
||||||
$spType = new Zend_Form_Element_Radio('sp_type');
|
$spType = new Zend_Form_Element_Radio('sp_type');
|
||||||
$spType->setLabel('Set smart block type:')
|
$spType->setLabel(_('Set smart block type:'))
|
||||||
->setDecorators(array('viewHelper'))
|
->setDecorators(array('viewHelper'))
|
||||||
->setMultiOptions(array(
|
->setMultiOptions(array(
|
||||||
'static' => 'Static',
|
'static' => _('Static'),
|
||||||
'dynamic' => 'Dynamic'
|
'dynamic' => _('Dynamic')
|
||||||
))
|
))
|
||||||
->setValue($blockType);
|
->setValue($blockType);
|
||||||
$this->addElement($spType);
|
$this->addElement($spType);
|
||||||
|
@ -126,7 +157,7 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
|
||||||
if (isset($storedCrit["crit"])) {
|
if (isset($storedCrit["crit"])) {
|
||||||
$criteriaKeys = array_keys($storedCrit["crit"]);
|
$criteriaKeys = array_keys($storedCrit["crit"]);
|
||||||
}
|
}
|
||||||
$numElements = count($this->criteriaOptions);
|
$numElements = count($this->getCriteriaOptions());
|
||||||
for ($i = 0; $i < $numElements; $i++) {
|
for ($i = 0; $i < $numElements; $i++) {
|
||||||
$criteriaType = "";
|
$criteriaType = "";
|
||||||
|
|
||||||
|
@ -153,7 +184,7 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
|
||||||
$criteria->setAttrib('class', 'input_select sp_input_select'.$invisible)
|
$criteria->setAttrib('class', 'input_select sp_input_select'.$invisible)
|
||||||
->setValue('Select criteria')
|
->setValue('Select criteria')
|
||||||
->setDecorators(array('viewHelper'))
|
->setDecorators(array('viewHelper'))
|
||||||
->setMultiOptions($this->criteriaOptions);
|
->setMultiOptions($this->getCriteriaOptions());
|
||||||
if ($i != 0 && !isset($criteriaKeys[$i])) {
|
if ($i != 0 && !isset($criteriaKeys[$i])) {
|
||||||
$criteria->setAttrib('disabled', 'disabled');
|
$criteria->setAttrib('disabled', 'disabled');
|
||||||
}
|
}
|
||||||
|
@ -174,13 +205,13 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
|
||||||
}
|
}
|
||||||
if (isset($criteriaKeys[$i])) {
|
if (isset($criteriaKeys[$i])) {
|
||||||
if ($criteriaType == "s") {
|
if ($criteriaType == "s") {
|
||||||
$criteriaModifers->setMultiOptions($this->stringCriteriaOptions);
|
$criteriaModifers->setMultiOptions($this->getStringCriteriaOptions());
|
||||||
} else {
|
} else {
|
||||||
$criteriaModifers->setMultiOptions($this->numericCriteriaOptions);
|
$criteriaModifers->setMultiOptions($this->getNumericCriteriaOptions());
|
||||||
}
|
}
|
||||||
$criteriaModifers->setValue($storedCrit["crit"][$criteriaKeys[$i]][$j]["modifier"]);
|
$criteriaModifers->setValue($storedCrit["crit"][$criteriaKeys[$i]][$j]["modifier"]);
|
||||||
} else {
|
} else {
|
||||||
$criteriaModifers->setMultiOptions(array('0' => 'Select modifier'));
|
$criteriaModifers->setMultiOptions(array('0' => _('Select modifier')));
|
||||||
}
|
}
|
||||||
$this->addElement($criteriaModifers);
|
$this->addElement($criteriaModifers);
|
||||||
|
|
||||||
|
@ -214,7 +245,7 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
|
||||||
|
|
||||||
$repeatTracks = new Zend_Form_Element_Checkbox('sp_repeat_tracks');
|
$repeatTracks = new Zend_Form_Element_Checkbox('sp_repeat_tracks');
|
||||||
$repeatTracks->setDecorators(array('viewHelper'))
|
$repeatTracks->setDecorators(array('viewHelper'))
|
||||||
->setLabel('Allow Repeat Tracks:');
|
->setLabel(_('Allow Repeat Tracks:'));
|
||||||
if (isset($storedCrit["repeat_tracks"])) {
|
if (isset($storedCrit["repeat_tracks"])) {
|
||||||
$repeatTracks->setChecked($storedCrit["repeat_tracks"]["value"] == 1?true:false);
|
$repeatTracks->setChecked($storedCrit["repeat_tracks"]["value"] == 1?true:false);
|
||||||
}
|
}
|
||||||
|
@ -223,7 +254,7 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
|
||||||
$limit = new Zend_Form_Element_Select('sp_limit_options');
|
$limit = new Zend_Form_Element_Select('sp_limit_options');
|
||||||
$limit->setAttrib('class', 'sp_input_select')
|
$limit->setAttrib('class', 'sp_input_select')
|
||||||
->setDecorators(array('viewHelper'))
|
->setDecorators(array('viewHelper'))
|
||||||
->setMultiOptions($this->limitOptions);
|
->setMultiOptions($this->getLimitOptions());
|
||||||
if (isset($storedCrit["limit"])) {
|
if (isset($storedCrit["limit"])) {
|
||||||
$limit->setValue($storedCrit["limit"]["modifier"]);
|
$limit->setValue($storedCrit["limit"]["modifier"]);
|
||||||
}
|
}
|
||||||
|
@ -231,7 +262,7 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
|
||||||
|
|
||||||
$limitValue = new Zend_Form_Element_Text('sp_limit_value');
|
$limitValue = new Zend_Form_Element_Text('sp_limit_value');
|
||||||
$limitValue->setAttrib('class', 'sp_input_text_limit')
|
$limitValue->setAttrib('class', 'sp_input_text_limit')
|
||||||
->setLabel('Limit to')
|
->setLabel(_('Limit to'))
|
||||||
->setDecorators(array('viewHelper'));
|
->setDecorators(array('viewHelper'));
|
||||||
$this->addElement($limitValue);
|
$this->addElement($limitValue);
|
||||||
if (isset($storedCrit["limit"])) {
|
if (isset($storedCrit["limit"])) {
|
||||||
|
@ -253,23 +284,23 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
|
||||||
|
|
||||||
$generate = new Zend_Form_Element_Button('generate_button');
|
$generate = new Zend_Form_Element_Button('generate_button');
|
||||||
$generate->setAttrib('class', 'btn btn-small');
|
$generate->setAttrib('class', 'btn btn-small');
|
||||||
$generate->setAttrib('title', 'Generate playlist content and save criteria');
|
$generate->setAttrib('title', _('Generate playlist content and save criteria'));
|
||||||
$generate->setIgnore(true);
|
$generate->setIgnore(true);
|
||||||
$generate->setLabel('Generate');
|
$generate->setLabel(_('Generate'));
|
||||||
$generate->setDecorators(array('viewHelper'));
|
$generate->setDecorators(array('viewHelper'));
|
||||||
$this->addElement($generate);
|
$this->addElement($generate);
|
||||||
|
|
||||||
$shuffle = new Zend_Form_Element_Button('shuffle_button');
|
$shuffle = new Zend_Form_Element_Button('shuffle_button');
|
||||||
$shuffle->setAttrib('class', 'btn btn-small');
|
$shuffle->setAttrib('class', 'btn btn-small');
|
||||||
$shuffle->setAttrib('title', 'Shuffle playlist content');
|
$shuffle->setAttrib('title', _('Shuffle playlist content'));
|
||||||
$shuffle->setIgnore(true);
|
$shuffle->setIgnore(true);
|
||||||
$shuffle->setLabel('Shuffle');
|
$shuffle->setLabel(_('Shuffle'));
|
||||||
$shuffle->setDecorators(array('viewHelper'));
|
$shuffle->setDecorators(array('viewHelper'));
|
||||||
$this->addElement($shuffle);
|
$this->addElement($shuffle);
|
||||||
|
|
||||||
$this->setDecorators(array(
|
$this->setDecorators(array(
|
||||||
array('ViewScript', array('viewScript' => 'form/smart-block-criteria.phtml', "openOption"=> $openSmartBlockOption,
|
array('ViewScript', array('viewScript' => 'form/smart-block-criteria.phtml', "openOption"=> $openSmartBlockOption,
|
||||||
'criteriasLength' => count($this->criteriaOptions), 'poolCount' => $files['count'], 'modRowMap' => $modRowMap,
|
'criteriasLength' => count($this->getCriteriaOptions()), 'poolCount' => $files['count'], 'modRowMap' => $modRowMap,
|
||||||
'showPoolCount' => $showPoolCount))
|
'showPoolCount' => $showPoolCount))
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
@ -278,24 +309,24 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
|
||||||
{
|
{
|
||||||
$data = Application_Model_Block::organizeSmartPlyalistCriteria($params['data']);
|
$data = Application_Model_Block::organizeSmartPlyalistCriteria($params['data']);
|
||||||
// add elelments that needs to be added
|
// add elelments that needs to be added
|
||||||
// set multioption for modifier according to creiteria_field
|
// set multioption for modifier according to criteria_field
|
||||||
$modRowMap = array();
|
$modRowMap = array();
|
||||||
foreach ($data['criteria'] as $critKey=>$d) {
|
foreach ($data['criteria'] as $critKey=>$d) {
|
||||||
$count = 1;
|
$count = 1;
|
||||||
foreach ($d as $modKey=>$modInfo) {
|
foreach ($d as $modKey=>$modInfo) {
|
||||||
if ($modKey == 0) {
|
if ($modKey == 0) {
|
||||||
$eleCrit = $this->getElement("sp_criteria_field_".$critKey."_".$modKey);
|
$eleCrit = $this->getElement("sp_criteria_field_".$critKey."_".$modKey);
|
||||||
$eleCrit->setValue($this->criteriaOptions[$modInfo['sp_criteria_field']]);
|
$eleCrit->setValue($this->getCriteriaOptions($modInfo['sp_criteria_field']));
|
||||||
$eleCrit->setAttrib("disabled", null);
|
$eleCrit->setAttrib("disabled", null);
|
||||||
|
|
||||||
$eleMod = $this->getElement("sp_criteria_modifier_".$critKey."_".$modKey);
|
$eleMod = $this->getElement("sp_criteria_modifier_".$critKey."_".$modKey);
|
||||||
$criteriaType = $this->criteriaTypes[$modInfo['sp_criteria_field']];
|
$criteriaType = $this->criteriaTypes[$modInfo['sp_criteria_field']];
|
||||||
if ($criteriaType == "s") {
|
if ($criteriaType == "s") {
|
||||||
$eleMod->setMultiOptions($this->stringCriteriaOptions);
|
$eleMod->setMultiOptions($this->getStringCriteriaOptions());
|
||||||
} elseif ($criteriaType == "n") {
|
} elseif ($criteriaType == "n") {
|
||||||
$eleMod->setMultiOptions($this->numericCriteriaOptions);
|
$eleMod->setMultiOptions($this->getNumericCriteriaOptions());
|
||||||
} else {
|
} else {
|
||||||
$eleMod->setMultiOptions(array('0' => 'Select modifier'));
|
$eleMod->setMultiOptions(array('0' => _('Select modifier')));
|
||||||
}
|
}
|
||||||
$eleMod->setValue($modInfo['sp_criteria_modifier']);
|
$eleMod->setValue($modInfo['sp_criteria_modifier']);
|
||||||
$eleMod->setAttrib("disabled", null);
|
$eleMod->setAttrib("disabled", null);
|
||||||
|
@ -316,10 +347,10 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
|
||||||
$criteria->setAttrib('class', 'input_select sp_input_select sp-invisible')
|
$criteria->setAttrib('class', 'input_select sp_input_select sp-invisible')
|
||||||
->setValue('Select criteria')
|
->setValue('Select criteria')
|
||||||
->setDecorators(array('viewHelper'))
|
->setDecorators(array('viewHelper'))
|
||||||
->setMultiOptions($this->criteriaOptions);
|
->setMultiOptions($this->getCriteriaOptions());
|
||||||
|
|
||||||
$criteriaType = $this->criteriaTypes[$modInfo['sp_criteria_field']];
|
$criteriaType = $this->criteriaTypes[$modInfo['sp_criteria_field']];
|
||||||
$criteria->setValue($this->criteriaOptions[$modInfo['sp_criteria_field']]);
|
$criteria->setValue($this->getCriteriaOptions($modInfo['sp_criteria_field']));
|
||||||
$this->addElement($criteria);
|
$this->addElement($criteria);
|
||||||
|
|
||||||
/****************** MODIFIER ***********/
|
/****************** MODIFIER ***********/
|
||||||
|
@ -329,11 +360,11 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
|
||||||
->setDecorators(array('viewHelper'));
|
->setDecorators(array('viewHelper'));
|
||||||
|
|
||||||
if ($criteriaType == "s") {
|
if ($criteriaType == "s") {
|
||||||
$criteriaModifers->setMultiOptions($this->stringCriteriaOptions);
|
$criteriaModifers->setMultiOptions($this->getStringCriteriaOptions());
|
||||||
} elseif ($criteriaType == "n") {
|
} elseif ($criteriaType == "n") {
|
||||||
$criteriaModifers->setMultiOptions($this->numericCriteriaOptions);
|
$criteriaModifers->setMultiOptions($this->getNumericCriteriaOptions());
|
||||||
} else {
|
} else {
|
||||||
$criteriaModifers->setMultiOptions(array('0' => 'Select modifier'));
|
$criteriaModifers->setMultiOptions(array('0' => _('Select modifier')));
|
||||||
}
|
}
|
||||||
$criteriaModifers->setValue($modInfo['sp_criteria_modifier']);
|
$criteriaModifers->setValue($modInfo['sp_criteria_modifier']);
|
||||||
$this->addElement($criteriaModifers);
|
$this->addElement($criteriaModifers);
|
||||||
|
@ -427,25 +458,25 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
|
||||||
if ($data['etc']['sp_limit_options'] == 'hours' || $data['etc']['sp_limit_options'] == 'mins') {
|
if ($data['etc']['sp_limit_options'] == 'hours' || $data['etc']['sp_limit_options'] == 'mins') {
|
||||||
$element = $this->getElement("sp_limit_value");
|
$element = $this->getElement("sp_limit_value");
|
||||||
if ($data['etc']['sp_limit_value'] == "" || floatval($data['etc']['sp_limit_value']) <= 0) {
|
if ($data['etc']['sp_limit_value'] == "" || floatval($data['etc']['sp_limit_value']) <= 0) {
|
||||||
$element->addError("Limit cannot be empty or smaller than 0");
|
$element->addError(_("Limit cannot be empty or smaller than 0"));
|
||||||
$isValid = false;
|
$isValid = false;
|
||||||
} else {
|
} else {
|
||||||
$mins = floatval($data['etc']['sp_limit_value']) * $multiplier;
|
$mins = floatval($data['etc']['sp_limit_value']) * $multiplier;
|
||||||
if ($mins > 1440) {
|
if ($mins > 1440) {
|
||||||
$element->addError("Limit cannot be more than 24 hrs");
|
$element->addError(_("Limit cannot be more than 24 hrs"));
|
||||||
$isValid = false;
|
$isValid = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$element = $this->getElement("sp_limit_value");
|
$element = $this->getElement("sp_limit_value");
|
||||||
if ($data['etc']['sp_limit_value'] == "" || floatval($data['etc']['sp_limit_value']) <= 0) {
|
if ($data['etc']['sp_limit_value'] == "" || floatval($data['etc']['sp_limit_value']) <= 0) {
|
||||||
$element->addError("Limit cannot be empty or smaller than 0");
|
$element->addError(_("Limit cannot be empty or smaller than 0"));
|
||||||
$isValid = false;
|
$isValid = false;
|
||||||
} elseif (!ctype_digit($data['etc']['sp_limit_value'])) {
|
} elseif (!ctype_digit($data['etc']['sp_limit_value'])) {
|
||||||
$element->addError("The value should be an integer");
|
$element->addError(_("The value should be an integer"));
|
||||||
$isValid = false;
|
$isValid = false;
|
||||||
} elseif (intval($data['etc']['sp_limit_value']) > 500) {
|
} elseif (intval($data['etc']['sp_limit_value']) > 500) {
|
||||||
$element->addError("500 is the max item limit value you can set");
|
$element->addError(_("500 is the max item limit value you can set"));
|
||||||
$isValid = false;
|
$isValid = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -456,19 +487,19 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
|
||||||
$element = $this->getElement("sp_criteria_field_".$rowKey."_".$key);
|
$element = $this->getElement("sp_criteria_field_".$rowKey."_".$key);
|
||||||
// check for not selected select box
|
// check for not selected select box
|
||||||
if ($d['sp_criteria_field'] == "0" || $d['sp_criteria_modifier'] == "0") {
|
if ($d['sp_criteria_field'] == "0" || $d['sp_criteria_modifier'] == "0") {
|
||||||
$element->addError("You must select Criteria and Modifier");
|
$element->addError(_("You must select Criteria and Modifier"));
|
||||||
$isValid = false;
|
$isValid = false;
|
||||||
} else {
|
} else {
|
||||||
$column = CcFilesPeer::getTableMap()->getColumnByPhpName($criteria2PeerMap[$d['sp_criteria_field']]);
|
$column = CcFilesPeer::getTableMap()->getColumnByPhpName($criteria2PeerMap[$d['sp_criteria_field']]);
|
||||||
// validation on type of column
|
// validation on type of column
|
||||||
if ($d['sp_criteria_field'] == 'length') {
|
if ($d['sp_criteria_field'] == 'length') {
|
||||||
if (!preg_match("/^(\d{2}):(\d{2}):(\d{2})/", $d['sp_criteria_value'])) {
|
if (!preg_match("/^(\d{2}):(\d{2}):(\d{2})/", $d['sp_criteria_value'])) {
|
||||||
$element->addError("'Length' should be in '00:00:00' format");
|
$element->addError(_("'Length' should be in '00:00:00' format"));
|
||||||
$isValid = false;
|
$isValid = false;
|
||||||
}
|
}
|
||||||
} elseif ($column->getType() == PropelColumnTypes::TIMESTAMP) {
|
} elseif ($column->getType() == PropelColumnTypes::TIMESTAMP) {
|
||||||
if (!preg_match("/(\d{4})-(\d{2})-(\d{2})/", $d['sp_criteria_value'])) {
|
if (!preg_match("/(\d{4})-(\d{2})-(\d{2})/", $d['sp_criteria_value'])) {
|
||||||
$element->addError("The value should be in timestamp format(eg. 0000-00-00 or 00-00-00 00:00:00");
|
$element->addError(_("The value should be in timestamp format(eg. 0000-00-00 or 00-00-00 00:00:00)"));
|
||||||
$isValid = false;
|
$isValid = false;
|
||||||
} else {
|
} else {
|
||||||
$result = Application_Common_DateHelper::checkDateTimeRangeForSQL($d['sp_criteria_value']);
|
$result = Application_Common_DateHelper::checkDateTimeRangeForSQL($d['sp_criteria_value']);
|
||||||
|
@ -481,7 +512,7 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
|
||||||
|
|
||||||
if (isset($d['sp_criteria_extra'])) {
|
if (isset($d['sp_criteria_extra'])) {
|
||||||
if (!preg_match("/(\d{4})-(\d{2})-(\d{2})/", $d['sp_criteria_extra'])) {
|
if (!preg_match("/(\d{4})-(\d{2})-(\d{2})/", $d['sp_criteria_extra'])) {
|
||||||
$element->addError("The value should be in timestamp format(eg. 0000-00-00 or 00-00-00 00:00:00");
|
$element->addError(_("The value should be in timestamp format(eg. 0000-00-00 or 00-00-00 00:00:00)"));
|
||||||
$isValid = false;
|
$isValid = false;
|
||||||
} else {
|
} else {
|
||||||
$result = Application_Common_DateHelper::checkDateTimeRangeForSQL($d['sp_criteria_extra']);
|
$result = Application_Common_DateHelper::checkDateTimeRangeForSQL($d['sp_criteria_extra']);
|
||||||
|
@ -495,24 +526,24 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
|
||||||
} elseif ($column->getType() == PropelColumnTypes::INTEGER &&
|
} elseif ($column->getType() == PropelColumnTypes::INTEGER &&
|
||||||
$d['sp_criteria_field'] != 'owner_id') {
|
$d['sp_criteria_field'] != 'owner_id') {
|
||||||
if (!is_numeric($d['sp_criteria_value'])) {
|
if (!is_numeric($d['sp_criteria_value'])) {
|
||||||
$element->addError("The value has to be numeric");
|
$element->addError(_("The value has to be numeric"));
|
||||||
$isValid = false;
|
$isValid = false;
|
||||||
}
|
}
|
||||||
// length check
|
// length check
|
||||||
if (intval($d['sp_criteria_value']) >= pow(2,31)) {
|
if (intval($d['sp_criteria_value']) >= pow(2,31)) {
|
||||||
$element->addError("The value should be less then 2147483648");
|
$element->addError(_("The value should be less then 2147483648"));
|
||||||
$isValid = false;
|
$isValid = false;
|
||||||
}
|
}
|
||||||
} elseif ($column->getType() == PropelColumnTypes::VARCHAR) {
|
} elseif ($column->getType() == PropelColumnTypes::VARCHAR) {
|
||||||
if (strlen($d['sp_criteria_value']) > $column->getSize()) {
|
if (strlen($d['sp_criteria_value']) > $column->getSize()) {
|
||||||
$element->addError("The value should be less ".$column->getSize()." characters");
|
$element->addError(sprintf(_("The value should be less than %s characters"), $column->getSize()));
|
||||||
$isValid = false;
|
$isValid = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($d['sp_criteria_value'] == "") {
|
if ($d['sp_criteria_value'] == "") {
|
||||||
$element->addError("Value cannot be empty");
|
$element->addError(_("Value cannot be empty"));
|
||||||
$isValid = false;
|
$isValid = false;
|
||||||
}
|
}
|
||||||
}//end foreach
|
}//end foreach
|
||||||
|
|
|
@ -13,7 +13,7 @@ class Application_Form_SoundcloudPreferences extends Zend_Form_SubForm
|
||||||
|
|
||||||
//enable soundcloud uploads option
|
//enable soundcloud uploads option
|
||||||
$this->addElement('checkbox', 'UploadToSoundcloudOption', array(
|
$this->addElement('checkbox', 'UploadToSoundcloudOption', array(
|
||||||
'label' => 'Enable SoundCloud Upload',
|
'label' => _('Enable SoundCloud Upload'),
|
||||||
'required' => false,
|
'required' => false,
|
||||||
'value' => Application_Model_Preference::GetUploadToSoundcloudOption(),
|
'value' => Application_Model_Preference::GetUploadToSoundcloudOption(),
|
||||||
'decorators' => array(
|
'decorators' => array(
|
||||||
|
@ -23,7 +23,7 @@ class Application_Form_SoundcloudPreferences extends Zend_Form_SubForm
|
||||||
|
|
||||||
//enable downloadable for soundcloud
|
//enable downloadable for soundcloud
|
||||||
$this->addElement('checkbox', 'SoundCloudDownloadbleOption', array(
|
$this->addElement('checkbox', 'SoundCloudDownloadbleOption', array(
|
||||||
'label' => 'Automatically Mark Files "Downloadable" on SoundCloud',
|
'label' => _('Automatically Mark Files "Downloadable" on SoundCloud'),
|
||||||
'required' => false,
|
'required' => false,
|
||||||
'value' => Application_Model_Preference::GetSoundCloudDownloadbleOption(),
|
'value' => Application_Model_Preference::GetSoundCloudDownloadbleOption(),
|
||||||
'decorators' => array(
|
'decorators' => array(
|
||||||
|
@ -34,7 +34,7 @@ class Application_Form_SoundcloudPreferences extends Zend_Form_SubForm
|
||||||
//SoundCloud Username
|
//SoundCloud Username
|
||||||
$this->addElement('text', 'SoundCloudUser', array(
|
$this->addElement('text', 'SoundCloudUser', array(
|
||||||
'class' => 'input_text',
|
'class' => 'input_text',
|
||||||
'label' => 'SoundCloud Email',
|
'label' => _('SoundCloud Email'),
|
||||||
'filters' => array('StringTrim'),
|
'filters' => array('StringTrim'),
|
||||||
'autocomplete' => 'off',
|
'autocomplete' => 'off',
|
||||||
'value' => Application_Model_Preference::GetSoundCloudUser(),
|
'value' => Application_Model_Preference::GetSoundCloudUser(),
|
||||||
|
@ -54,7 +54,7 @@ class Application_Form_SoundcloudPreferences extends Zend_Form_SubForm
|
||||||
//SoundCloud Password
|
//SoundCloud Password
|
||||||
$this->addElement('password', 'SoundCloudPassword', array(
|
$this->addElement('password', 'SoundCloudPassword', array(
|
||||||
'class' => 'input_text',
|
'class' => 'input_text',
|
||||||
'label' => 'SoundCloud Password',
|
'label' => _('SoundCloud Password'),
|
||||||
'filters' => array('StringTrim'),
|
'filters' => array('StringTrim'),
|
||||||
'autocomplete' => 'off',
|
'autocomplete' => 'off',
|
||||||
'value' => Application_Model_Preference::GetSoundCloudPassword(),
|
'value' => Application_Model_Preference::GetSoundCloudPassword(),
|
||||||
|
@ -74,7 +74,7 @@ class Application_Form_SoundcloudPreferences extends Zend_Form_SubForm
|
||||||
|
|
||||||
// Add the description element
|
// Add the description element
|
||||||
$this->addElement('textarea', 'SoundCloudTags', array(
|
$this->addElement('textarea', 'SoundCloudTags', array(
|
||||||
'label' => 'SoundCloud Tags: (separate tags with spaces)',
|
'label' => _('SoundCloud Tags: (separate tags with spaces)'),
|
||||||
'required' => false,
|
'required' => false,
|
||||||
'class' => 'input_text_area',
|
'class' => 'input_text_area',
|
||||||
'value' => Application_Model_Preference::GetSoundCloudTags(),
|
'value' => Application_Model_Preference::GetSoundCloudTags(),
|
||||||
|
@ -86,7 +86,7 @@ class Application_Form_SoundcloudPreferences extends Zend_Form_SubForm
|
||||||
//SoundCloud default genre
|
//SoundCloud default genre
|
||||||
$this->addElement('text', 'SoundCloudGenre', array(
|
$this->addElement('text', 'SoundCloudGenre', array(
|
||||||
'class' => 'input_text',
|
'class' => 'input_text',
|
||||||
'label' => 'Default Genre:',
|
'label' => _('Default Genre:'),
|
||||||
'required' => false,
|
'required' => false,
|
||||||
'filters' => array('StringTrim'),
|
'filters' => array('StringTrim'),
|
||||||
'value' => Application_Model_Preference::GetSoundCloudGenre(),
|
'value' => Application_Model_Preference::GetSoundCloudGenre(),
|
||||||
|
@ -96,23 +96,23 @@ class Application_Form_SoundcloudPreferences extends Zend_Form_SubForm
|
||||||
));
|
));
|
||||||
|
|
||||||
$select = new Zend_Form_Element_Select('SoundCloudTrackType');
|
$select = new Zend_Form_Element_Select('SoundCloudTrackType');
|
||||||
$select->setLabel('Default Track Type:');
|
$select->setLabel(_('Default Track Type:'));
|
||||||
$select->setAttrib('class', 'input_select');
|
$select->setAttrib('class', 'input_select');
|
||||||
$select->setMultiOptions(array(
|
$select->setMultiOptions(array(
|
||||||
"" => "",
|
"" => "",
|
||||||
"original" => "Original",
|
"original" => _("Original"),
|
||||||
"remix" => "Remix",
|
"remix" => _("Remix"),
|
||||||
"live" => "Live",
|
"live" => _("Live"),
|
||||||
"recording" => "Recording",
|
"recording" => _("Recording"),
|
||||||
"spoken" => "Spoken",
|
"spoken" => _("Spoken"),
|
||||||
"podcast" => "Podcast",
|
"podcast" => _("Podcast"),
|
||||||
"demo" => "Demo",
|
"demo" => _("Demo"),
|
||||||
"in progress" => "Work in progress",
|
"in progress" => _("Work in progress"),
|
||||||
"stem" => "Stem",
|
"stem" => _("Stem"),
|
||||||
"loop" => "Loop",
|
"loop" => _("Loop"),
|
||||||
"sound effect" => "Sound Effect",
|
"sound effect" => _("Sound Effect"),
|
||||||
"sample" => "One Shot Sample",
|
"sample" => _("One Shot Sample"),
|
||||||
"other" => "Other"
|
"other" => _("Other")
|
||||||
));
|
));
|
||||||
$select->setRequired(false);
|
$select->setRequired(false);
|
||||||
$select->setValue(Application_Model_Preference::GetSoundCloudTrackType());
|
$select->setValue(Application_Model_Preference::GetSoundCloudTrackType());
|
||||||
|
@ -120,18 +120,18 @@ class Application_Form_SoundcloudPreferences extends Zend_Form_SubForm
|
||||||
$this->addElement($select);
|
$this->addElement($select);
|
||||||
|
|
||||||
$select = new Zend_Form_Element_Select('SoundCloudLicense');
|
$select = new Zend_Form_Element_Select('SoundCloudLicense');
|
||||||
$select->setLabel('Default License:');
|
$select->setLabel(_('Default License:'));
|
||||||
$select->setAttrib('class', 'input_select');
|
$select->setAttrib('class', 'input_select');
|
||||||
$select->setMultiOptions(array(
|
$select->setMultiOptions(array(
|
||||||
"" => "",
|
"" => "",
|
||||||
"no-rights-reserved" => "The work is in the public domain",
|
"no-rights-reserved" => _("The work is in the public domain"),
|
||||||
"all-rights-reserved" => "All rights are reserved",
|
"all-rights-reserved" => _("All rights are reserved"),
|
||||||
"cc-by" => "Creative Commons Attribution",
|
"cc-by" => _("Creative Commons Attribution"),
|
||||||
"cc-by-nc" => "Creative Commons Attribution Noncommercial",
|
"cc-by-nc" => _("Creative Commons Attribution Noncommercial"),
|
||||||
"cc-by-nd" => "Creative Commons Attribution No Derivative Works",
|
"cc-by-nd" => _("Creative Commons Attribution No Derivative Works"),
|
||||||
"cc-by-sa" => "Creative Commons Attribution Share Alike",
|
"cc-by-sa" => _("Creative Commons Attribution Share Alike"),
|
||||||
"cc-by-nc-nd" => "Creative Commons Attribution Noncommercial Non Derivate Works",
|
"cc-by-nc-nd" => _("Creative Commons Attribution Noncommercial Non Derivate Works"),
|
||||||
"cc-by-nc-sa" => "Creative Commons Attribution Noncommercial Share Alike"
|
"cc-by-nc-sa" => _("Creative Commons Attribution Noncommercial Share Alike")
|
||||||
));
|
));
|
||||||
$select->setRequired(false);
|
$select->setRequired(false);
|
||||||
$select->setValue(Application_Model_Preference::GetSoundCloudLicense());
|
$select->setValue(Application_Model_Preference::GetSoundCloudLicense());
|
||||||
|
|
|
@ -19,7 +19,7 @@ class Application_Form_StreamSetting extends Zend_Form
|
||||||
$setting = $this->setting;
|
$setting = $this->setting;
|
||||||
if (Application_Model_Preference::GetPlanLevel() == 'disabled') {
|
if (Application_Model_Preference::GetPlanLevel() == 'disabled') {
|
||||||
$output_sound_device = new Zend_Form_Element_Checkbox('output_sound_device');
|
$output_sound_device = new Zend_Form_Element_Checkbox('output_sound_device');
|
||||||
$output_sound_device->setLabel('Hardware Audio Output')
|
$output_sound_device->setLabel(_('Hardware Audio Output'))
|
||||||
->setRequired(false)
|
->setRequired(false)
|
||||||
->setValue(($setting['output_sound_device'] == "true")?1:0)
|
->setValue(($setting['output_sound_device'] == "true")?1:0)
|
||||||
->setDecorators(array('ViewHelper'));
|
->setDecorators(array('ViewHelper'));
|
||||||
|
@ -30,7 +30,7 @@ class Application_Form_StreamSetting extends Zend_Form
|
||||||
|
|
||||||
$output_types = array("ALSA"=>"ALSA", "AO"=>"AO", "OSS"=>"OSS", "Portaudio"=>"Portaudio", "Pulseaudio"=>"Pulseaudio");
|
$output_types = array("ALSA"=>"ALSA", "AO"=>"AO", "OSS"=>"OSS", "Portaudio"=>"Portaudio", "Pulseaudio"=>"Pulseaudio");
|
||||||
$output_type = new Zend_Form_Element_Select('output_sound_device_type');
|
$output_type = new Zend_Form_Element_Select('output_sound_device_type');
|
||||||
$output_type->setLabel("Output Type")
|
$output_type->setLabel(_("Output Type"))
|
||||||
->setMultiOptions($output_types)
|
->setMultiOptions($output_types)
|
||||||
->setValue($setting['output_sound_device_type'])
|
->setValue($setting['output_sound_device_type'])
|
||||||
->setDecorators(array('ViewHelper'));
|
->setDecorators(array('ViewHelper'));
|
||||||
|
@ -41,7 +41,7 @@ class Application_Form_StreamSetting extends Zend_Form
|
||||||
}
|
}
|
||||||
|
|
||||||
$icecast_vorbis_metadata = new Zend_Form_Element_Checkbox('icecast_vorbis_metadata');
|
$icecast_vorbis_metadata = new Zend_Form_Element_Checkbox('icecast_vorbis_metadata');
|
||||||
$icecast_vorbis_metadata->setLabel('Icecast Vorbis Metadata')
|
$icecast_vorbis_metadata->setLabel(_('Icecast Vorbis Metadata'))
|
||||||
->setRequired(false)
|
->setRequired(false)
|
||||||
->setValue(($setting['icecast_vorbis_metadata'] == "true")?1:0)
|
->setValue(($setting['icecast_vorbis_metadata'] == "true")?1:0)
|
||||||
->setDecorators(array('ViewHelper'));
|
->setDecorators(array('ViewHelper'));
|
||||||
|
@ -51,13 +51,32 @@ class Application_Form_StreamSetting extends Zend_Form
|
||||||
$this->addElement($icecast_vorbis_metadata);
|
$this->addElement($icecast_vorbis_metadata);
|
||||||
|
|
||||||
$stream_format = new Zend_Form_Element_Radio('streamFormat');
|
$stream_format = new Zend_Form_Element_Radio('streamFormat');
|
||||||
$stream_format->setLabel('Stream Label:');
|
$stream_format->setLabel(_('Stream Label:'));
|
||||||
$stream_format->setMultiOptions(array("Artist - Title",
|
$stream_format->setMultiOptions(array(_("Artist - Title"),
|
||||||
"Show - Artist - Title",
|
_("Show - Artist - Title"),
|
||||||
"Station name - Show name"));
|
_("Station name - Show name")));
|
||||||
$stream_format->setValue(Application_Model_Preference::GetStreamLabelFormat());
|
$stream_format->setValue(Application_Model_Preference::GetStreamLabelFormat());
|
||||||
$stream_format->setDecorators(array('ViewHelper'));
|
$stream_format->setDecorators(array('ViewHelper'));
|
||||||
$this->addElement($stream_format);
|
$this->addElement($stream_format);
|
||||||
|
|
||||||
|
$offAirMeta = new Zend_Form_Element_Text('offAirMeta');
|
||||||
|
$offAirMeta->setLabel(_('Off Air Metadata'))
|
||||||
|
->setValue(Application_Model_StreamSetting::getOffAirMeta())
|
||||||
|
->setDecorators(array('ViewHelper'));
|
||||||
|
$this->addElement($offAirMeta);
|
||||||
|
|
||||||
|
$enable_replay_gain = new Zend_Form_Element_Checkbox("enableReplayGain");
|
||||||
|
$enable_replay_gain->setLabel(_("Enable Replay Gain"))
|
||||||
|
->setValue(Application_Model_Preference::GetEnableReplayGain())
|
||||||
|
->setDecorators(array('ViewHelper'));
|
||||||
|
$this->addElement($enable_replay_gain);
|
||||||
|
|
||||||
|
$replay_gain = new Zend_Form_Element_Hidden("replayGainModifier");
|
||||||
|
$replay_gain->setLabel(_("Replay Gain Modifier"))
|
||||||
|
->setValue(Application_Model_Preference::getReplayGainModifier())
|
||||||
|
->setAttribs(array('style' => "border: 0; color: #f6931f; font-weight: bold;"))
|
||||||
|
->setDecorators(array('ViewHelper'));
|
||||||
|
$this->addElement($replay_gain);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function isValid($data)
|
public function isValid($data)
|
||||||
|
|
|
@ -45,7 +45,7 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm
|
||||||
$disable_all = Application_Model_Preference::GetEnableStreamConf() == "false";
|
$disable_all = Application_Model_Preference::GetEnableStreamConf() == "false";
|
||||||
|
|
||||||
$enable = new Zend_Form_Element_Checkbox('enable');
|
$enable = new Zend_Form_Element_Checkbox('enable');
|
||||||
$enable->setLabel('Enabled:')
|
$enable->setLabel(_('Enabled:'))
|
||||||
->setValue($setting[$prefix.'_enable'] == 'true' ? 1 : 0)
|
->setValue($setting[$prefix.'_enable'] == 'true' ? 1 : 0)
|
||||||
->setDecorators(array('ViewHelper'));
|
->setDecorators(array('ViewHelper'));
|
||||||
if ($disable_all) {
|
if ($disable_all) {
|
||||||
|
@ -54,7 +54,7 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm
|
||||||
$this->addElement($enable);
|
$this->addElement($enable);
|
||||||
|
|
||||||
$type = new Zend_Form_Element_Select('type');
|
$type = new Zend_Form_Element_Select('type');
|
||||||
$type->setLabel("Stream Type:")
|
$type->setLabel(_("Stream Type:"))
|
||||||
->setMultiOptions($stream_types)
|
->setMultiOptions($stream_types)
|
||||||
->setValue(isset($setting[$prefix.'_type'])?$setting[$prefix.'_type']:0)
|
->setValue(isset($setting[$prefix.'_type'])?$setting[$prefix.'_type']:0)
|
||||||
->setDecorators(array('ViewHelper'));
|
->setDecorators(array('ViewHelper'));
|
||||||
|
@ -64,7 +64,7 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm
|
||||||
$this->addElement($type);
|
$this->addElement($type);
|
||||||
|
|
||||||
$bitrate = new Zend_Form_Element_Select('bitrate');
|
$bitrate = new Zend_Form_Element_Select('bitrate');
|
||||||
$bitrate->setLabel("Bit Rate:")
|
$bitrate->setLabel(_("Bit Rate:"))
|
||||||
->setMultiOptions($stream_bitrates)
|
->setMultiOptions($stream_bitrates)
|
||||||
->setValue(isset($setting[$prefix.'_bitrate'])?$setting[$prefix.'_bitrate']:0)
|
->setValue(isset($setting[$prefix.'_bitrate'])?$setting[$prefix.'_bitrate']:0)
|
||||||
->setDecorators(array('ViewHelper'));
|
->setDecorators(array('ViewHelper'));
|
||||||
|
@ -74,7 +74,7 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm
|
||||||
$this->addElement($bitrate);
|
$this->addElement($bitrate);
|
||||||
|
|
||||||
$output = new Zend_Form_Element_Select('output');
|
$output = new Zend_Form_Element_Select('output');
|
||||||
$output->setLabel("Service Type:")
|
$output->setLabel(_("Service Type:"))
|
||||||
->setMultiOptions(array("icecast"=>"Icecast", "shoutcast"=>"SHOUTcast"))
|
->setMultiOptions(array("icecast"=>"Icecast", "shoutcast"=>"SHOUTcast"))
|
||||||
->setValue(isset($setting[$prefix.'_output'])?$setting[$prefix.'_output']:"icecast")
|
->setValue(isset($setting[$prefix.'_output'])?$setting[$prefix.'_output']:"icecast")
|
||||||
->setDecorators(array('ViewHelper'));
|
->setDecorators(array('ViewHelper'));
|
||||||
|
@ -84,8 +84,8 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm
|
||||||
$this->addElement($output);
|
$this->addElement($output);
|
||||||
|
|
||||||
$channels = new Zend_Form_Element_Select('channels');
|
$channels = new Zend_Form_Element_Select('channels');
|
||||||
$channels->setLabel("Channels:")
|
$channels->setLabel(_("Channels:"))
|
||||||
->setMultiOptions(array("mono"=>"1 - Mono", "stereo"=>"2 - Stereo"))
|
->setMultiOptions(array("mono"=>_("1 - Mono"), "stereo"=>_("2 - Stereo")))
|
||||||
->setValue(isset($setting[$prefix.'_channels']) ? $setting[$prefix.'_channels'] : "stereo")
|
->setValue(isset($setting[$prefix.'_channels']) ? $setting[$prefix.'_channels'] : "stereo")
|
||||||
->setDecorators(array('ViewHelper'));
|
->setDecorators(array('ViewHelper'));
|
||||||
if ($disable_all) {
|
if ($disable_all) {
|
||||||
|
@ -94,10 +94,10 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm
|
||||||
$this->addElement($channels);
|
$this->addElement($channels);
|
||||||
|
|
||||||
$host = new Zend_Form_Element_Text('host');
|
$host = new Zend_Form_Element_Text('host');
|
||||||
$host->setLabel("Server")
|
$host->setLabel(_("Server"))
|
||||||
->setValue(isset($setting[$prefix.'_host'])?$setting[$prefix.'_host']:"")
|
->setValue(isset($setting[$prefix.'_host'])?$setting[$prefix.'_host']:"")
|
||||||
->setValidators(array(
|
->setValidators(array(
|
||||||
array('regex', false, array('/^[0-9a-zA-Z-_.]+$/', 'messages' => 'Invalid character entered'))))
|
array('regex', false, array('/^[0-9a-zA-Z-_.]+$/', 'messages' => _('Invalid character entered')))))
|
||||||
->setDecorators(array('ViewHelper'));
|
->setDecorators(array('ViewHelper'));
|
||||||
if ($disable_all) {
|
if ($disable_all) {
|
||||||
$host->setAttrib("disabled", "disabled");
|
$host->setAttrib("disabled", "disabled");
|
||||||
|
@ -106,10 +106,10 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm
|
||||||
$this->addElement($host);
|
$this->addElement($host);
|
||||||
|
|
||||||
$port = new Zend_Form_Element_Text('port');
|
$port = new Zend_Form_Element_Text('port');
|
||||||
$port->setLabel("Port")
|
$port->setLabel(_("Port"))
|
||||||
->setValue(isset($setting[$prefix.'_port'])?$setting[$prefix.'_port']:"")
|
->setValue(isset($setting[$prefix.'_port'])?$setting[$prefix.'_port']:"")
|
||||||
->setValidators(array(new Zend_Validate_Between(array('min'=>0, 'max'=>99999))))
|
->setValidators(array(new Zend_Validate_Between(array('min'=>0, 'max'=>99999))))
|
||||||
->addValidator('regex', false, array('pattern'=>'/^[0-9]+$/', 'messages'=>array('regexNotMatch'=>'Only numbers are allowed.')))
|
->addValidator('regex', false, array('pattern'=>'/^[0-9]+$/', 'messages'=>array('regexNotMatch'=>_('Only numbers are allowed.'))))
|
||||||
->setDecorators(array('ViewHelper'));
|
->setDecorators(array('ViewHelper'));
|
||||||
if ($disable_all) {
|
if ($disable_all) {
|
||||||
$port->setAttrib("disabled", "disabled");
|
$port->setAttrib("disabled", "disabled");
|
||||||
|
@ -117,10 +117,10 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm
|
||||||
$this->addElement($port);
|
$this->addElement($port);
|
||||||
|
|
||||||
$pass = new Zend_Form_Element_Text('pass');
|
$pass = new Zend_Form_Element_Text('pass');
|
||||||
$pass->setLabel("Password")
|
$pass->setLabel(_("Password"))
|
||||||
->setValue(isset($setting[$prefix.'_pass'])?$setting[$prefix.'_pass']:"")
|
->setValue(isset($setting[$prefix.'_pass'])?$setting[$prefix.'_pass']:"")
|
||||||
->setValidators(array(
|
->setValidators(array(
|
||||||
array('regex', false, array('/^[^ &<>]+$/', 'messages' => 'Invalid character entered'))))
|
array('regex', false, array('/^[^ &<>]+$/', 'messages' => _('Invalid character entered')))))
|
||||||
->setDecorators(array('ViewHelper'));
|
->setDecorators(array('ViewHelper'));
|
||||||
if ($disable_all) {
|
if ($disable_all) {
|
||||||
$pass->setAttrib("disabled", "disabled");
|
$pass->setAttrib("disabled", "disabled");
|
||||||
|
@ -129,7 +129,7 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm
|
||||||
$this->addElement($pass);
|
$this->addElement($pass);
|
||||||
|
|
||||||
$genre = new Zend_Form_Element_Text('genre');
|
$genre = new Zend_Form_Element_Text('genre');
|
||||||
$genre->setLabel("Genre")
|
$genre->setLabel(_("Genre"))
|
||||||
->setValue(isset($setting[$prefix.'_genre'])?$setting[$prefix.'_genre']:"")
|
->setValue(isset($setting[$prefix.'_genre'])?$setting[$prefix.'_genre']:"")
|
||||||
->setDecorators(array('ViewHelper'));
|
->setDecorators(array('ViewHelper'));
|
||||||
if ($disable_all) {
|
if ($disable_all) {
|
||||||
|
@ -138,10 +138,10 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm
|
||||||
$this->addElement($genre);
|
$this->addElement($genre);
|
||||||
|
|
||||||
$url = new Zend_Form_Element_Text('url');
|
$url = new Zend_Form_Element_Text('url');
|
||||||
$url->setLabel("URL")
|
$url->setLabel(_("URL"))
|
||||||
->setValue(isset($setting[$prefix.'_url'])?$setting[$prefix.'_url']:"")
|
->setValue(isset($setting[$prefix.'_url'])?$setting[$prefix.'_url']:"")
|
||||||
->setValidators(array(
|
->setValidators(array(
|
||||||
array('regex', false, array('/^[0-9a-zA-Z\-_.:\/]+$/', 'messages' => 'Invalid character entered'))))
|
array('regex', false, array('/^[0-9a-zA-Z\-_.:\/]+$/', 'messages' => _('Invalid character entered')))))
|
||||||
->setDecorators(array('ViewHelper'));
|
->setDecorators(array('ViewHelper'));
|
||||||
if ($disable_all) {
|
if ($disable_all) {
|
||||||
$url->setAttrib("disabled", "disabled");
|
$url->setAttrib("disabled", "disabled");
|
||||||
|
@ -150,7 +150,7 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm
|
||||||
$this->addElement($url);
|
$this->addElement($url);
|
||||||
|
|
||||||
$name = new Zend_Form_Element_Text('name');
|
$name = new Zend_Form_Element_Text('name');
|
||||||
$name->setLabel("Name")
|
$name->setLabel(_("Name"))
|
||||||
->setValue(isset($setting[$prefix.'_name'])?$setting[$prefix.'_name']:"")
|
->setValue(isset($setting[$prefix.'_name'])?$setting[$prefix.'_name']:"")
|
||||||
->setDecorators(array('ViewHelper'));
|
->setDecorators(array('ViewHelper'));
|
||||||
if ($disable_all) {
|
if ($disable_all) {
|
||||||
|
@ -159,7 +159,7 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm
|
||||||
$this->addElement($name);
|
$this->addElement($name);
|
||||||
|
|
||||||
$description = new Zend_Form_Element_Text('description');
|
$description = new Zend_Form_Element_Text('description');
|
||||||
$description->setLabel("Description")
|
$description->setLabel(_("Description"))
|
||||||
->setValue(isset($setting[$prefix.'_description'])?$setting[$prefix.'_description']:"")
|
->setValue(isset($setting[$prefix.'_description'])?$setting[$prefix.'_description']:"")
|
||||||
->setDecorators(array('ViewHelper'));
|
->setDecorators(array('ViewHelper'));
|
||||||
if ($disable_all) {
|
if ($disable_all) {
|
||||||
|
@ -168,10 +168,10 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm
|
||||||
$this->addElement($description);
|
$this->addElement($description);
|
||||||
|
|
||||||
$mount = new Zend_Form_Element_Text('mount');
|
$mount = new Zend_Form_Element_Text('mount');
|
||||||
$mount->setLabel("Mount Point")
|
$mount->setLabel(_("Mount Point"))
|
||||||
->setValue(isset($setting[$prefix.'_mount'])?$setting[$prefix.'_mount']:"")
|
->setValue(isset($setting[$prefix.'_mount'])?$setting[$prefix.'_mount']:"")
|
||||||
->setValidators(array(
|
->setValidators(array(
|
||||||
array('regex', false, array('/^[^ &<>]+$/', 'messages' => 'Invalid character entered'))))
|
array('regex', false, array('/^[^ &<>]+$/', 'messages' => _('Invalid character entered')))))
|
||||||
->setDecorators(array('ViewHelper'));
|
->setDecorators(array('ViewHelper'));
|
||||||
if ($disable_all) {
|
if ($disable_all) {
|
||||||
$mount->setAttrib("disabled", "disabled");
|
$mount->setAttrib("disabled", "disabled");
|
||||||
|
@ -180,10 +180,10 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm
|
||||||
$this->addElement($mount);
|
$this->addElement($mount);
|
||||||
|
|
||||||
$user = new Zend_Form_Element_Text('user');
|
$user = new Zend_Form_Element_Text('user');
|
||||||
$user->setLabel("Username")
|
$user->setLabel(_("Username"))
|
||||||
->setValue(isset($setting[$prefix.'_user'])?$setting[$prefix.'_user']:"")
|
->setValue(isset($setting[$prefix.'_user'])?$setting[$prefix.'_user']:"")
|
||||||
->setValidators(array(
|
->setValidators(array(
|
||||||
array('regex', false, array('/^[^ &<>]+$/', 'messages' => 'Invalid character entered'))))
|
array('regex', false, array('/^[^ &<>]+$/', 'messages' => _('Invalid character entered')))))
|
||||||
->setDecorators(array('ViewHelper'));
|
->setDecorators(array('ViewHelper'));
|
||||||
if ($disable_all) {
|
if ($disable_all) {
|
||||||
$user->setAttrib("disabled", "disabled");
|
$user->setAttrib("disabled", "disabled");
|
||||||
|
@ -191,7 +191,31 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm
|
||||||
$user->setAttrib('alt', 'regular_text');
|
$user->setAttrib('alt', 'regular_text');
|
||||||
$this->addElement($user);
|
$this->addElement($user);
|
||||||
|
|
||||||
$liquidsopa_error_msg = '<div class="stream-status status-info"><h3>Getting information from the server...</h3></div>';
|
$adminUser = new Zend_Form_Element_Text('admin_user');
|
||||||
|
$adminUser->setLabel(_("Admin User"))
|
||||||
|
->setValue(Application_Model_StreamSetting::getAdminUser($prefix))
|
||||||
|
->setValidators(array(
|
||||||
|
array('regex', false, array('/^[^ &<>]+$/', 'messages' => _('Invalid character entered')))))
|
||||||
|
->setDecorators(array('ViewHelper'));
|
||||||
|
if ($disable_all) {
|
||||||
|
$adminUser->setAttrib("disabled", "disabled");
|
||||||
|
}
|
||||||
|
$adminUser->setAttrib('alt', 'regular_text');
|
||||||
|
$this->addElement($adminUser);
|
||||||
|
|
||||||
|
$adminPass = new Zend_Form_Element_Text('admin_pass');
|
||||||
|
$adminPass->setLabel(_("Admin Password"))
|
||||||
|
->setValue(Application_Model_StreamSetting::getAdminPass($prefix))
|
||||||
|
->setValidators(array(
|
||||||
|
array('regex', false, array('/^[^ &<>]+$/', 'messages' => _('Invalid character entered')))))
|
||||||
|
->setDecorators(array('ViewHelper'));
|
||||||
|
if ($disable_all) {
|
||||||
|
$adminPass->setAttrib("disabled", "disabled");
|
||||||
|
}
|
||||||
|
$adminPass->setAttrib('alt', 'regular_text');
|
||||||
|
$this->addElement($adminPass);
|
||||||
|
|
||||||
|
$liquidsopa_error_msg = '<div class="stream-status status-info"><h3>'._('Getting information from the server...').'</h3></div>';
|
||||||
|
|
||||||
$this->setDecorators(array(
|
$this->setDecorators(array(
|
||||||
array('ViewScript', array('viewScript' => 'form/stream-setting-form.phtml', "stream_number"=>$stream_number, "enabled"=>$enable->getValue(), "liquidsoap_error_msg"=>$liquidsopa_error_msg))
|
array('ViewScript', array('viewScript' => 'form/stream-setting-form.phtml', "stream_number"=>$stream_number, "enabled"=>$enable->getValue(), "liquidsoap_error_msg"=>$liquidsopa_error_msg))
|
||||||
|
@ -205,18 +229,18 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm
|
||||||
if ($f_data['enable'] == 1) {
|
if ($f_data['enable'] == 1) {
|
||||||
if ($f_data['host'] == '') {
|
if ($f_data['host'] == '') {
|
||||||
$element = $this->getElement("host");
|
$element = $this->getElement("host");
|
||||||
$element->addError("Server cannot be empty.");
|
$element->addError(_("Server cannot be empty."));
|
||||||
$isValid = false;
|
$isValid = false;
|
||||||
}
|
}
|
||||||
if ($f_data['port'] == '') {
|
if ($f_data['port'] == '') {
|
||||||
$element = $this->getElement("port");
|
$element = $this->getElement("port");
|
||||||
$element->addError("Port cannot be empty.");
|
$element->addError(_("Port cannot be empty."));
|
||||||
$isValid = false;
|
$isValid = false;
|
||||||
}
|
}
|
||||||
if ($f_data['output'] == 'icecast') {
|
if ($f_data['output'] == 'icecast') {
|
||||||
if ($f_data['mount'] == '') {
|
if ($f_data['mount'] == '') {
|
||||||
$element = $this->getElement("mount");
|
$element = $this->getElement("mount");
|
||||||
$element->addError("Mount cannot be empty with Icecast server.");
|
$element->addError(_("Mount cannot be empty with Icecast server."));
|
||||||
$isValid = false;
|
$isValid = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,7 @@ class Application_Form_SupportSettings extends Zend_Form
|
||||||
public function init()
|
public function init()
|
||||||
{
|
{
|
||||||
$country_list = Application_Model_Preference::GetCountryList();
|
$country_list = Application_Model_Preference::GetCountryList();
|
||||||
|
$notEmptyValidator = Application_Form_Helper_ValidationTypes::overrideNotEmptyValidator();
|
||||||
|
|
||||||
$this->setDecorators(array(
|
$this->setDecorators(array(
|
||||||
array('ViewScript', array('viewScript' => 'form/support-setting.phtml')),
|
array('ViewScript', array('viewScript' => 'form/support-setting.phtml')),
|
||||||
|
@ -16,10 +17,10 @@ class Application_Form_SupportSettings extends Zend_Form
|
||||||
//Station name
|
//Station name
|
||||||
$this->addElement('text', 'stationName', array(
|
$this->addElement('text', 'stationName', array(
|
||||||
'class' => 'input_text',
|
'class' => 'input_text',
|
||||||
'label' => 'Station Name',
|
'label' => _('Station Name'),
|
||||||
'required' => true,
|
'required' => true,
|
||||||
'filters' => array('StringTrim'),
|
'filters' => array('StringTrim'),
|
||||||
'validator' => array('NotEmpty'),
|
'validators' => array($notEmptyValidator),
|
||||||
'value' => Application_Model_Preference::GetStationName(),
|
'value' => Application_Model_Preference::GetStationName(),
|
||||||
'decorators' => array(
|
'decorators' => array(
|
||||||
'ViewHelper'
|
'ViewHelper'
|
||||||
|
@ -29,7 +30,7 @@ class Application_Form_SupportSettings extends Zend_Form
|
||||||
// Phone number
|
// Phone number
|
||||||
$this->addElement('text', 'Phone', array(
|
$this->addElement('text', 'Phone', array(
|
||||||
'class' => 'input_text',
|
'class' => 'input_text',
|
||||||
'label' => 'Phone:',
|
'label' => _('Phone:'),
|
||||||
'required' => false,
|
'required' => false,
|
||||||
'filters' => array('StringTrim'),
|
'filters' => array('StringTrim'),
|
||||||
'value' => Application_Model_Preference::GetPhone(),
|
'value' => Application_Model_Preference::GetPhone(),
|
||||||
|
@ -41,7 +42,7 @@ class Application_Form_SupportSettings extends Zend_Form
|
||||||
//Email
|
//Email
|
||||||
$this->addElement('text', 'Email', array(
|
$this->addElement('text', 'Email', array(
|
||||||
'class' => 'input_text',
|
'class' => 'input_text',
|
||||||
'label' => 'Email:',
|
'label' => _('Email:'),
|
||||||
'required' => false,
|
'required' => false,
|
||||||
'filters' => array('StringTrim'),
|
'filters' => array('StringTrim'),
|
||||||
'value' => Application_Model_Preference::GetEmail(),
|
'value' => Application_Model_Preference::GetEmail(),
|
||||||
|
@ -52,7 +53,7 @@ class Application_Form_SupportSettings extends Zend_Form
|
||||||
|
|
||||||
// Station Web Site
|
// Station Web Site
|
||||||
$this->addElement('text', 'StationWebSite', array(
|
$this->addElement('text', 'StationWebSite', array(
|
||||||
'label' => 'Station Web Site:',
|
'label' => _('Station Web Site:'),
|
||||||
'required' => false,
|
'required' => false,
|
||||||
'class' => 'input_text',
|
'class' => 'input_text',
|
||||||
'value' => Application_Model_Preference::GetStationWebSite(),
|
'value' => Application_Model_Preference::GetStationWebSite(),
|
||||||
|
@ -63,7 +64,7 @@ class Application_Form_SupportSettings extends Zend_Form
|
||||||
|
|
||||||
// county list dropdown
|
// county list dropdown
|
||||||
$this->addElement('select', 'Country', array(
|
$this->addElement('select', 'Country', array(
|
||||||
'label' => 'Country:',
|
'label' => _('Country:'),
|
||||||
'required' => false,
|
'required' => false,
|
||||||
'value' => Application_Model_Preference::GetStationCountry(),
|
'value' => Application_Model_Preference::GetStationCountry(),
|
||||||
'multiOptions' => $country_list,
|
'multiOptions' => $country_list,
|
||||||
|
@ -74,7 +75,7 @@ class Application_Form_SupportSettings extends Zend_Form
|
||||||
|
|
||||||
// Station city
|
// Station city
|
||||||
$this->addElement('text', 'City', array(
|
$this->addElement('text', 'City', array(
|
||||||
'label' => 'City:',
|
'label' => _('City:'),
|
||||||
'required' => false,
|
'required' => false,
|
||||||
'class' => 'input_text',
|
'class' => 'input_text',
|
||||||
'value' => Application_Model_Preference::GetStationCity(),
|
'value' => Application_Model_Preference::GetStationCity(),
|
||||||
|
@ -86,7 +87,7 @@ class Application_Form_SupportSettings extends Zend_Form
|
||||||
// Station Description
|
// Station Description
|
||||||
$description = new Zend_Form_Element_Textarea('Description');
|
$description = new Zend_Form_Element_Textarea('Description');
|
||||||
$description->class = 'input_text_area';
|
$description->class = 'input_text_area';
|
||||||
$description->setLabel('Station Description:')
|
$description->setLabel(_('Station Description:'))
|
||||||
->setRequired(false)
|
->setRequired(false)
|
||||||
->setValue(Application_Model_Preference::GetStationDescription())
|
->setValue(Application_Model_Preference::GetStationDescription())
|
||||||
->setDecorators(array('ViewHelper'))
|
->setDecorators(array('ViewHelper'))
|
||||||
|
@ -96,7 +97,7 @@ class Application_Form_SupportSettings extends Zend_Form
|
||||||
|
|
||||||
// Station Logo
|
// Station Logo
|
||||||
$upload = new Zend_Form_Element_File('Logo');
|
$upload = new Zend_Form_Element_File('Logo');
|
||||||
$upload->setLabel('Station Logo:')
|
$upload->setLabel(_('Station Logo:'))
|
||||||
->setRequired(false)
|
->setRequired(false)
|
||||||
->setDecorators(array('File'))
|
->setDecorators(array('File'))
|
||||||
->addValidator('Count', false, 1)
|
->addValidator('Count', false, 1)
|
||||||
|
@ -107,7 +108,7 @@ class Application_Form_SupportSettings extends Zend_Form
|
||||||
|
|
||||||
//enable support feedback
|
//enable support feedback
|
||||||
$this->addElement('checkbox', 'SupportFeedback', array(
|
$this->addElement('checkbox', 'SupportFeedback', array(
|
||||||
'label' => 'Send support feedback',
|
'label' => _('Send support feedback'),
|
||||||
'required' => false,
|
'required' => false,
|
||||||
'value' => Application_Model_Preference::GetSupportFeedback(),
|
'value' => Application_Model_Preference::GetSupportFeedback(),
|
||||||
'decorators' => array(
|
'decorators' => array(
|
||||||
|
@ -117,7 +118,7 @@ class Application_Form_SupportSettings extends Zend_Form
|
||||||
|
|
||||||
// checkbox for publicise
|
// checkbox for publicise
|
||||||
$checkboxPublicise = new Zend_Form_Element_Checkbox("Publicise");
|
$checkboxPublicise = new Zend_Form_Element_Checkbox("Publicise");
|
||||||
$checkboxPublicise->setLabel('Promote my station on Sourcefabric.org')
|
$checkboxPublicise->setLabel(_('Promote my station on Sourcefabric.org'))
|
||||||
->setRequired(false)
|
->setRequired(false)
|
||||||
->setDecorators(array('ViewHelper'))
|
->setDecorators(array('ViewHelper'))
|
||||||
->setValue(Application_Model_Preference::GetPublicise());
|
->setValue(Application_Model_Preference::GetPublicise());
|
||||||
|
@ -128,15 +129,18 @@ class Application_Form_SupportSettings extends Zend_Form
|
||||||
|
|
||||||
// checkbox for privacy policy
|
// checkbox for privacy policy
|
||||||
$checkboxPrivacy = new Zend_Form_Element_Checkbox("Privacy");
|
$checkboxPrivacy = new Zend_Form_Element_Checkbox("Privacy");
|
||||||
$checkboxPrivacy->setLabel("By checking this box, I agree to Sourcefabric's <a id=\"link_to_privacy\" href=\"http://www.sourcefabric.org/en/about/policy/\" onclick=\"window.open(this.href); return false;\">privacy policy</a>.")
|
$checkboxPrivacy->setLabel(
|
||||||
|
sprintf(_("By checking this box, I agree to Sourcefabric's %sprivacy policy%s."),
|
||||||
|
"<a id='link_to_privacy' href='http://www.sourcefabric.org/en/about/policy/' onclick='window.open(this.href); return false;'>",
|
||||||
|
"</a>"))
|
||||||
->setDecorators(array('ViewHelper'));
|
->setDecorators(array('ViewHelper'));
|
||||||
$this->addElement($checkboxPrivacy);
|
$this->addElement($checkboxPrivacy);
|
||||||
|
|
||||||
// submit button
|
// submit button
|
||||||
$submit = new Zend_Form_Element_Submit("submit");
|
$submit = new Zend_Form_Element_Submit("submit");
|
||||||
$submit->class = 'ui-button ui-state-default right-floated';
|
$submit->class = 'btn right-floated';
|
||||||
$submit->setIgnore(true)
|
$submit->setIgnore(true)
|
||||||
->setLabel("Save")
|
->setLabel(_("Save"))
|
||||||
->setDecorators(array('ViewHelper'));
|
->setDecorators(array('ViewHelper'));
|
||||||
$this->addElement($submit);
|
$this->addElement($submit);
|
||||||
}
|
}
|
||||||
|
@ -145,13 +149,13 @@ class Application_Form_SupportSettings extends Zend_Form
|
||||||
public function isValid ($data)
|
public function isValid ($data)
|
||||||
{
|
{
|
||||||
$isValid = parent::isValid($data);
|
$isValid = parent::isValid($data);
|
||||||
if (isset($data["Privacy"])) {
|
if (isset($data["Privacy"])) {
|
||||||
$checkPrivacy = $this->getElement('Privacy');
|
$checkPrivacy = $this->getElement('Privacy');
|
||||||
if ($data["SupportFeedback"] == "1" && $data["Privacy"] != "1") {
|
if ($data["SupportFeedback"] == "1" && $data["Privacy"] != "1") {
|
||||||
$checkPrivacy->addError("You have to agree to privacy policy.");
|
$checkPrivacy->addError(_("You have to agree to privacy policy."));
|
||||||
$isValid = false;
|
$isValid = false;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return $isValid;
|
return $isValid;
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,7 @@ class Application_Form_WatchedDirPreferences extends Zend_Form_SubForm
|
||||||
|
|
||||||
$this->addElement('text', 'storageFolder', array(
|
$this->addElement('text', 'storageFolder', array(
|
||||||
'class' => 'input_text',
|
'class' => 'input_text',
|
||||||
'label' => 'Import Folder:',
|
'label' => _('Import Folder:'),
|
||||||
'required' => false,
|
'required' => false,
|
||||||
'filters' => array('StringTrim'),
|
'filters' => array('StringTrim'),
|
||||||
'value' => '',
|
'value' => '',
|
||||||
|
@ -22,7 +22,7 @@ class Application_Form_WatchedDirPreferences extends Zend_Form_SubForm
|
||||||
|
|
||||||
$this->addElement('text', 'watchedFolder', array(
|
$this->addElement('text', 'watchedFolder', array(
|
||||||
'class' => 'input_text',
|
'class' => 'input_text',
|
||||||
'label' => 'Watched Folders:',
|
'label' => _('Watched Folders:'),
|
||||||
'required' => false,
|
'required' => false,
|
||||||
'filters' => array('StringTrim'),
|
'filters' => array('StringTrim'),
|
||||||
'value' => '',
|
'value' => '',
|
||||||
|
@ -37,7 +37,7 @@ class Application_Form_WatchedDirPreferences extends Zend_Form_SubForm
|
||||||
$element = $this->getElement($p_form_element_id);
|
$element = $this->getElement($p_form_element_id);
|
||||||
|
|
||||||
if (!is_dir($element->getValue())) {
|
if (!is_dir($element->getValue())) {
|
||||||
$element->setErrors(array('Not a valid Directory'));
|
$element->setErrors(array(_('Not a valid Directory')));
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -7,9 +7,7 @@ class ConditionalNotEmpty extends Zend_Validate_Abstract
|
||||||
{
|
{
|
||||||
const KEY_IS_EMPTY = 'keyIsEmpty';
|
const KEY_IS_EMPTY = 'keyIsEmpty';
|
||||||
|
|
||||||
protected $_messageTemplates = array(
|
protected $_messageTemplates;
|
||||||
self::KEY_IS_EMPTY => 'Value is required and can\'t be empty'
|
|
||||||
);
|
|
||||||
|
|
||||||
protected $_fieldValues;
|
protected $_fieldValues;
|
||||||
|
|
||||||
|
@ -24,6 +22,9 @@ class ConditionalNotEmpty extends Zend_Validate_Abstract
|
||||||
public function __construct($fieldValues)
|
public function __construct($fieldValues)
|
||||||
{
|
{
|
||||||
$this->_fieldValues = $fieldValues;
|
$this->_fieldValues = $fieldValues;
|
||||||
|
$this->_messageTemplates = array(
|
||||||
|
self::KEY_IS_EMPTY => _("Value is required and can't be empty")
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
96
airtime_mvc/application/forms/helpers/ValidationTypes.php
Normal file
96
airtime_mvc/application/forms/helpers/ValidationTypes.php
Normal file
|
@ -0,0 +1,96 @@
|
||||||
|
<?php
|
||||||
|
Class Application_Form_Helper_ValidationTypes {
|
||||||
|
|
||||||
|
public static function overrideNotEmptyValidator()
|
||||||
|
{
|
||||||
|
$validator = new Zend_Validate_NotEmpty();
|
||||||
|
$validator->setMessage(
|
||||||
|
_("Value is required and can't be empty"),
|
||||||
|
Zend_Validate_NotEmpty::IS_EMPTY
|
||||||
|
);
|
||||||
|
|
||||||
|
return $validator;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function overrideEmailAddressValidator()
|
||||||
|
{
|
||||||
|
$validator = new Zend_Validate_EmailAddress();
|
||||||
|
$validator->setMessage(
|
||||||
|
_("'%value%' is no valid email address in the basic format local-part@hostname"),
|
||||||
|
Zend_Validate_EmailAddress::INVALID_FORMAT
|
||||||
|
);
|
||||||
|
|
||||||
|
return $validator;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function overrrideDateValidator($p_format)
|
||||||
|
{
|
||||||
|
$validator = new Zend_Validate_Date();
|
||||||
|
|
||||||
|
$validator->setFormat($p_format);
|
||||||
|
|
||||||
|
$validator->setMessage(
|
||||||
|
_("'%value%' does not fit the date format '%format%'"),
|
||||||
|
Zend_Validate_Date::FALSEFORMAT
|
||||||
|
);
|
||||||
|
|
||||||
|
return $validator;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function overrideRegexValidator($p_pattern, $p_msg)
|
||||||
|
{
|
||||||
|
$validator = new Zend_Validate_Regex($p_pattern);
|
||||||
|
|
||||||
|
$validator->setMessage(
|
||||||
|
$p_msg,
|
||||||
|
Zend_Validate_Regex::NOT_MATCH
|
||||||
|
);
|
||||||
|
|
||||||
|
return $validator;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function overrideStringLengthValidator($p_min, $p_max)
|
||||||
|
{
|
||||||
|
$validator = new Zend_Validate_StringLength();
|
||||||
|
$validator->setMin($p_min);
|
||||||
|
$validator->setMax($p_max);
|
||||||
|
|
||||||
|
$validator->setMessage(
|
||||||
|
_("'%value%' is less than %min% characters long"),
|
||||||
|
Zend_Validate_StringLength::TOO_SHORT
|
||||||
|
);
|
||||||
|
|
||||||
|
$validator->setMessage(
|
||||||
|
_("'%value%' is more than %max% characters long"),
|
||||||
|
Zend_Validate_StringLength::TOO_LONG
|
||||||
|
);
|
||||||
|
|
||||||
|
return $validator;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function overrideBetweenValidator($p_min, $p_max)
|
||||||
|
{
|
||||||
|
$validator = new Zend_Validate_Between($p_min, $p_max, true);
|
||||||
|
|
||||||
|
$validator->setMessage(
|
||||||
|
_("'%value%' is not between '%min%' and '%max%', inclusively"),
|
||||||
|
Zend_Validate_Between::NOT_BETWEEN
|
||||||
|
);
|
||||||
|
|
||||||
|
return $validator;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function overridePasswordIdenticalValidator($p_matchAgainst)
|
||||||
|
{
|
||||||
|
$validator = new Zend_Validate_Identical();
|
||||||
|
$validator->setToken($p_matchAgainst);
|
||||||
|
|
||||||
|
$validator->setMessage(
|
||||||
|
_("Passwords do not match"),
|
||||||
|
Zend_Validate_Identical::NOT_SAME
|
||||||
|
);
|
||||||
|
|
||||||
|
return $validator;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -2,9 +2,9 @@
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||||
<title>Audio Player</title>
|
<title><?php echo _("Audio Player")?></title>
|
||||||
<?php echo $this->headScript() ?>
|
|
||||||
<?php echo $this->headLink() ?>
|
<?php echo $this->headLink() ?>
|
||||||
|
<?php echo $this->headScript() ?>
|
||||||
<?php echo isset($this->google_analytics)?$this->google_analytics:"" ?>
|
<?php echo isset($this->google_analytics)?$this->google_analytics:"" ?>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
|
@ -2,9 +2,9 @@
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||||
<title>Live stream</title>
|
<title><?php echo _("Live stream") ?></title>
|
||||||
<?php echo $this->headScript() ?>
|
|
||||||
<?php echo $this->headLink() ?>
|
<?php echo $this->headLink() ?>
|
||||||
|
<?php echo $this->headScript() ?>
|
||||||
<?php echo isset($this->google_analytics)?$this->google_analytics:"" ?>
|
<?php echo isset($this->google_analytics)?$this->google_analytics:"" ?>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
|
@ -3,9 +3,10 @@
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||||
<?php echo $this->headTitle() ?>
|
<?php echo $this->headTitle() ?>
|
||||||
<?php echo $this->headScript() ?>
|
|
||||||
<?php echo $this->headLink() ?>
|
<?php echo $this->headLink() ?>
|
||||||
|
<?php echo $this->headScript() ?>
|
||||||
<?php echo isset($this->google_analytics)?$this->google_analytics:"" ?>
|
<?php echo isset($this->google_analytics)?$this->google_analytics:"" ?>
|
||||||
|
<?php $baseUrl = Application_Common_OsPath::getBaseDir(); ?>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
|
@ -22,7 +23,9 @@
|
||||||
$this->navigation()->menu()->setPartial($partial); ?>
|
$this->navigation()->menu()->setPartial($partial); ?>
|
||||||
<div class="personal-block solo">
|
<div class="personal-block solo">
|
||||||
<ul>
|
<ul>
|
||||||
<li><span class="name"><?php echo $this->loggedInAs()?></span> | <a href="/Login/logout">Logout</a></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>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||||
<?php echo $this->headTitle() ?>
|
<?php echo $this->headTitle() ?>
|
||||||
<?php echo $this->headScript() ?>
|
|
||||||
<?php echo $this->headLink() ?>
|
<?php echo $this->headLink() ?>
|
||||||
|
<?php echo $this->headScript() ?>
|
||||||
<?php echo isset($this->google_analytics)?$this->google_analytics:"" ?>
|
<?php echo isset($this->google_analytics)?$this->google_analytics:"" ?>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
@ -13,8 +13,9 @@
|
||||||
<?php echo $this->layout()->content ?>
|
<?php echo $this->layout()->content ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="footer">
|
<div class="footer">
|
||||||
Airtime Copyright © Sourcefabric o.p.s. All rights reserved.<br/>
|
<?php echo sprintf(_("Airtime Copyright ©Sourcefabric o.p.s. All rights reserved.%s"
|
||||||
Maintained and distributed under GNU GPL v.3 by <a href="http://www.sourcefabric.org"> Sourcefabric o.p.s </a>
|
."Maintained and distributed under GNU GPL v.3 by %sSourcefabric o.p.s%s"),
|
||||||
|
"<br>", "<a href='http://www.sourcefabric.org'>" ,"</a>");?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|
|
@ -30,10 +30,10 @@ class Application_Model_Auth
|
||||||
$e_link_port = $_SERVER['SERVER_PORT'];
|
$e_link_port = $_SERVER['SERVER_PORT'];
|
||||||
$e_link_path = $view->url(array('user_id' => $user->getDbId(), 'token' => $token), 'password-change');
|
$e_link_path = $view->url(array('user_id' => $user->getDbId(), 'token' => $token), 'password-change');
|
||||||
|
|
||||||
$message = "Hi {$user->getDbLogin()}, \n\nClick this link to reset your password: ";
|
$message = sprintf(_("Hi %s, \n\nClick this link to reset your password: "), $user->getDbLogin());
|
||||||
$message .= "{$e_link_protocol}://{$e_link_base}:{$e_link_port}{$e_link_path}";
|
$message .= "{$e_link_protocol}://{$e_link_base}:{$e_link_port}{$e_link_path}";
|
||||||
|
|
||||||
$success = Application_Model_Email::send('Airtime Password Reset', $message, $user->getDbEmail());
|
$success = Application_Model_Email::send(_('Airtime Password Reset'), $message, $user->getDbEmail());
|
||||||
|
|
||||||
return $success;
|
return $success;
|
||||||
}
|
}
|
||||||
|
|
|
@ -395,12 +395,13 @@ SQL;
|
||||||
{
|
{
|
||||||
$file = CcFilesQuery::create()->findPK($p_item, $this->con);
|
$file = CcFilesQuery::create()->findPK($p_item, $this->con);
|
||||||
|
|
||||||
if (isset($file) && $file->getDbFileExists()) {
|
if (isset($file) && $file->visible()) {
|
||||||
$entry = $this->blockItem;
|
$entry = $this->blockItem;
|
||||||
$entry["id"] = $file->getDbId();
|
$entry["id"] = $file->getDbId();
|
||||||
$entry["pos"] = $pos;
|
$entry["pos"] = $pos;
|
||||||
$entry["cliplength"] = $file->getDbLength();
|
$entry["cliplength"] = $file->getDbLength();
|
||||||
$entry["cueout"] = $file->getDbLength();
|
$entry["cueout"] = $file->getDbCueout();
|
||||||
|
$entry["cuein"] = $file->getDbCuein();
|
||||||
|
|
||||||
return $entry;
|
return $entry;
|
||||||
} else {
|
} else {
|
||||||
|
@ -410,11 +411,7 @@ SQL;
|
||||||
|
|
||||||
public function isStatic()
|
public function isStatic()
|
||||||
{
|
{
|
||||||
if ($this->block->getDbType() == "static") {
|
return $this->block->getDbType() == "static";
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -760,7 +757,7 @@ SQL;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (is_null($cueIn) && is_null($cueOut)) {
|
if (is_null($cueIn) && is_null($cueOut)) {
|
||||||
$errArray["error"] = "Cue in and cue out are null.";
|
$errArray["error"] = _("Cue in and cue out are null.");
|
||||||
|
|
||||||
return $errArray;
|
return $errArray;
|
||||||
}
|
}
|
||||||
|
@ -795,7 +792,7 @@ SQL;
|
||||||
);
|
);
|
||||||
$result = Application_Common_Database::prepareAndExecute($sql, $params, 'column');
|
$result = Application_Common_Database::prepareAndExecute($sql, $params, 'column');
|
||||||
if ($result) {
|
if ($result) {
|
||||||
$errArray["error"] = "Can't set cue out to be greater than file length.";
|
$errArray["error"] = _("Can't set cue out to be greater than file length.");
|
||||||
return $errArray;
|
return $errArray;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -806,7 +803,7 @@ SQL;
|
||||||
);
|
);
|
||||||
$result = Application_Common_Database::prepareAndExecute($sql, $params, 'column');
|
$result = Application_Common_Database::prepareAndExecute($sql, $params, 'column');
|
||||||
if ($result) {
|
if ($result) {
|
||||||
$errArray["error"] = "Can't set cue in to be larger than cue out.";
|
$errArray["error"] = _("Can't set cue in to be larger than cue out.");
|
||||||
return $errArray;
|
return $errArray;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -827,7 +824,7 @@ SQL;
|
||||||
);
|
);
|
||||||
$result = Application_Common_Database::prepareAndExecute($sql, $params, 'column');
|
$result = Application_Common_Database::prepareAndExecute($sql, $params, 'column');
|
||||||
if ($result) {
|
if ($result) {
|
||||||
$errArray["error"] = "Can't set cue in to be larger than cue out.";
|
$errArray["error"] = _("Can't set cue in to be larger than cue out.");
|
||||||
return $errArray;
|
return $errArray;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -851,7 +848,7 @@ SQL;
|
||||||
);
|
);
|
||||||
$result = Application_Common_Database::prepareAndExecute($sql, $params, 'column');
|
$result = Application_Common_Database::prepareAndExecute($sql, $params, 'column');
|
||||||
if ($result) {
|
if ($result) {
|
||||||
$errArray["error"] = "Can't set cue out to be greater than file length.";
|
$errArray["error"] = _("Can't set cue out to be greater than file length.");
|
||||||
return $errArray;
|
return $errArray;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -862,7 +859,7 @@ SQL;
|
||||||
);
|
);
|
||||||
$result = Application_Common_Database::prepareAndExecute($sql, $params, 'column');
|
$result = Application_Common_Database::prepareAndExecute($sql, $params, 'column');
|
||||||
if ($result) {
|
if ($result) {
|
||||||
$errArray["error"] = "Can't set cue out to be smaller than cue in.";
|
$errArray["error"] = _("Can't set cue out to be smaller than cue in.");
|
||||||
return $errArray;
|
return $errArray;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -943,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);
|
||||||
}
|
}
|
||||||
|
@ -1210,32 +1206,32 @@ SQL;
|
||||||
public function getCriteria()
|
public function getCriteria()
|
||||||
{
|
{
|
||||||
$criteriaOptions = array(
|
$criteriaOptions = array(
|
||||||
0 => "Select criteria",
|
0 => _("Select criteria"),
|
||||||
"album_title" => "Album",
|
"album_title" => _("Album"),
|
||||||
"bit_rate" => "Bit Rate (Kbps)",
|
"bit_rate" => _("Bit Rate (Kbps)"),
|
||||||
"bpm" => "BPM",
|
"bpm" => _("BPM"),
|
||||||
"composer" => "Composer",
|
"composer" => _("Composer"),
|
||||||
"conductor" => "Conductor",
|
"conductor" => _("Conductor"),
|
||||||
"copyright" => "Copyright",
|
"copyright" => _("Copyright"),
|
||||||
"artist_name" => "Creator",
|
"artist_name" => _("Creator"),
|
||||||
"encoded_by" => "Encoded By",
|
"encoded_by" => _("Encoded By"),
|
||||||
"genre" => "Genre",
|
"genre" => _("Genre"),
|
||||||
"isrc_number" => "ISRC",
|
"isrc_number" => _("ISRC"),
|
||||||
"label" => "Label",
|
"label" => _("Label"),
|
||||||
"language" => "Language",
|
"language" => _("Language"),
|
||||||
"mtime" => "Last Modified",
|
"mtime" => _("Last Modified"),
|
||||||
"lptime" => "Last Played",
|
"lptime" => _("Last Played"),
|
||||||
"length" => "Length",
|
"length" => _("Length"),
|
||||||
"mime" => "Mime",
|
"mime" => _("Mime"),
|
||||||
"mood" => "Mood",
|
"mood" => _("Mood"),
|
||||||
"owner_id" => "Owner",
|
"owner_id" => _("Owner"),
|
||||||
"replay_gain" => "Replay Gain",
|
"replay_gain" => _("Replay Gain"),
|
||||||
"sample_rate" => "Sample Rate (kHz)",
|
"sample_rate" => _("Sample Rate (kHz)"),
|
||||||
"track_title" => "Title",
|
"track_title" => _("Title"),
|
||||||
"track_number" => "Track Number",
|
"track_number" => _("Track Number"),
|
||||||
"utime" => "Uploaded",
|
"utime" => _("Uploaded"),
|
||||||
"info_url" => "Website",
|
"info_url" => _("Website"),
|
||||||
"year" => "Year"
|
"year" => _("Year")
|
||||||
);
|
);
|
||||||
|
|
||||||
// Load criteria from db
|
// Load criteria from db
|
||||||
|
@ -1363,6 +1359,7 @@ SQL;
|
||||||
|
|
||||||
// check if file exists
|
// check if file exists
|
||||||
$qry->add("file_exists", "true", Criteria::EQUAL);
|
$qry->add("file_exists", "true", Criteria::EQUAL);
|
||||||
|
$qry->add("hidden", "false", Criteria::EQUAL);
|
||||||
$qry->addAscendingOrderByColumn('random()');
|
$qry->addAscendingOrderByColumn('random()');
|
||||||
}
|
}
|
||||||
// construct limit restriction
|
// construct limit restriction
|
||||||
|
|
35
airtime_mvc/application/models/Locale.php
Normal file
35
airtime_mvc/application/models/Locale.php
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
class Application_Model_Locale
|
||||||
|
{
|
||||||
|
public static function getLocales()
|
||||||
|
{
|
||||||
|
$con = Propel::getConnection();
|
||||||
|
$sql = "SELECT * FROM cc_locale";
|
||||||
|
$res = $con->query($sql)->fetchAll();
|
||||||
|
$out = array();
|
||||||
|
foreach ($res as $r) {
|
||||||
|
$out[$r["locale_code"]] = $r["locale_lang"];
|
||||||
|
}
|
||||||
|
|
||||||
|
return $out;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function configureLocalization($locale = null)
|
||||||
|
{
|
||||||
|
$codeset = 'UTF-8';
|
||||||
|
if (is_null($locale)) {
|
||||||
|
$lang = Application_Model_Preference::GetLocale().'.'.$codeset;
|
||||||
|
} else {
|
||||||
|
$lang = $locale.'.'.$codeset;
|
||||||
|
}
|
||||||
|
putenv("LC_ALL=$lang");
|
||||||
|
putenv("LANG=$lang");
|
||||||
|
$res = setlocale(LC_MESSAGES, $lang);
|
||||||
|
|
||||||
|
$domain = 'airtime';
|
||||||
|
bindtextdomain($domain, '/usr/share/airtime/locale');
|
||||||
|
textdomain($domain);
|
||||||
|
bind_textdomain_codeset($domain, $codeset);
|
||||||
|
}
|
||||||
|
}
|
|
@ -157,15 +157,15 @@ SQL;
|
||||||
$diff = strlen($dir) - strlen($p_path);
|
$diff = strlen($dir) - strlen($p_path);
|
||||||
if ($diff == 0) {
|
if ($diff == 0) {
|
||||||
if ($dir == $p_path) {
|
if ($dir == $p_path) {
|
||||||
throw new NestedDirectoryException("'$p_path' is already watched.");
|
throw new NestedDirectoryException(sprintf(_("%s is already watched."), $p_path));
|
||||||
}
|
}
|
||||||
} elseif ($diff > 0) {
|
} elseif ($diff > 0) {
|
||||||
if (self::isAncestorDir($p_path, $dir)) {
|
if (self::isAncestorDir($p_path, $dir)) {
|
||||||
throw new NestedDirectoryException("'$p_path' contains nested watched directory: '$dir'");
|
throw new NestedDirectoryException(sprintf(_("%s contains nested watched directory: %s"), $p_path, $dir));
|
||||||
}
|
}
|
||||||
} else { /* diff < 0*/
|
} else { /* diff < 0*/
|
||||||
if (self::isAncestorDir($dir, $p_path)) {
|
if (self::isAncestorDir($dir, $p_path)) {
|
||||||
throw new NestedDirectoryException("'$p_path' is nested within existing watched directory: '$dir'");
|
throw new NestedDirectoryException(sprintf(_("%s is nested within existing watched directory: %s"), $p_path, $dir));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -186,7 +186,7 @@ SQL;
|
||||||
public static function addDir($p_path, $p_type, $userAddedWatchedDir=true, $nestedWatch=false)
|
public static function addDir($p_path, $p_type, $userAddedWatchedDir=true, $nestedWatch=false)
|
||||||
{
|
{
|
||||||
if (!is_dir($p_path)) {
|
if (!is_dir($p_path)) {
|
||||||
return array("code"=>2, "error"=>"'$p_path' is not a valid directory.");
|
return array("code"=>2, "error"=>sprintf(_("%s is not a valid directory."), $p_path));
|
||||||
}
|
}
|
||||||
$real_path = Application_Common_OsPath::normpath($p_path)."/";
|
$real_path = Application_Common_OsPath::normpath($p_path)."/";
|
||||||
if ($real_path != "/") {
|
if ($real_path != "/") {
|
||||||
|
@ -227,7 +227,8 @@ SQL;
|
||||||
|
|
||||||
return array("code"=>1, "error"=>"$msg");
|
return array("code"=>1, "error"=>"$msg");
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
return array("code"=>1, "error"=>"'$p_path' is already set as the current storage dir or in the watched folders list");
|
return array("code"=>1,
|
||||||
|
"error"=>sprintf(_("%s is already set as the current storage dir or in the watched folders list"), $p_path));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -246,50 +247,49 @@ SQL;
|
||||||
{
|
{
|
||||||
$res = self::addDir($p_path, "watched", $userAddedWatchedDir, $nestedWatch);
|
$res = self::addDir($p_path, "watched", $userAddedWatchedDir, $nestedWatch);
|
||||||
|
|
||||||
if ($res['code'] == 0) {
|
if ($res['code'] != 0) { return $res; }
|
||||||
|
|
||||||
//convert "linked" files (Airtime <= 1.8.2) to watched files.
|
//convert "linked" files (Airtime <= 1.8.2) to watched files.
|
||||||
$propel_link_dir = CcMusicDirsQuery::create()
|
$propel_link_dir = CcMusicDirsQuery::create()
|
||||||
->filterByType('link')
|
->filterByType('link')
|
||||||
|
->findOne();
|
||||||
|
|
||||||
|
//see if any linked files exist.
|
||||||
|
if (isset($propel_link_dir)) {
|
||||||
|
|
||||||
|
//newly added watched directory object
|
||||||
|
$propel_new_watch = CcMusicDirsQuery::create()
|
||||||
|
->filterByDirectory(Application_Common_OsPath::normpath($p_path)."/")
|
||||||
->findOne();
|
->findOne();
|
||||||
|
|
||||||
//see if any linked files exist.
|
//any files of the deprecated "link" type.
|
||||||
if (isset($propel_link_dir)) {
|
$link_files = CcFilesQuery::create()
|
||||||
|
->setFormatter(ModelCriteria::FORMAT_ON_DEMAND)
|
||||||
|
->filterByDbDirectory($propel_link_dir->getId())
|
||||||
|
->find();
|
||||||
|
|
||||||
//newly added watched directory object
|
$newly_watched_dir = $propel_new_watch->getDirectory();
|
||||||
$propel_new_watch = CcMusicDirsQuery::create()
|
|
||||||
->filterByDirectory(Application_Common_OsPath::normpath($p_path)."/")
|
|
||||||
->findOne();
|
|
||||||
|
|
||||||
//any files of the deprecated "link" type.
|
foreach ($link_files as $link_file) {
|
||||||
$link_files = CcFilesQuery::create()
|
$link_filepath = $link_file->getDbFilepath();
|
||||||
->setFormatter(ModelCriteria::FORMAT_ON_DEMAND)
|
|
||||||
->filterByDbDirectory($propel_link_dir->getId())
|
|
||||||
->find();
|
|
||||||
|
|
||||||
$newly_watched_dir = $propel_new_watch->getDirectory();
|
//convert "link" file into a watched file.
|
||||||
|
if ((strlen($newly_watched_dir) < strlen($link_filepath)) && (substr($link_filepath, 0, strlen($newly_watched_dir)) === $newly_watched_dir)) {
|
||||||
|
|
||||||
foreach ($link_files as $link_file) {
|
//get the filepath path not including the watched directory.
|
||||||
$link_filepath = $link_file->getDbFilepath();
|
$sub_link_filepath = substr($link_filepath, strlen($newly_watched_dir));
|
||||||
|
|
||||||
//convert "link" file into a watched file.
|
$link_file->setDbDirectory($propel_new_watch->getId());
|
||||||
if ((strlen($newly_watched_dir) < strlen($link_filepath)) && (substr($link_filepath, 0, strlen($newly_watched_dir)) === $newly_watched_dir)) {
|
$link_file->setDbFilepath($sub_link_filepath);
|
||||||
|
$link_file->save();
|
||||||
//get the filepath path not including the watched directory.
|
|
||||||
$sub_link_filepath = substr($link_filepath, strlen($newly_watched_dir));
|
|
||||||
|
|
||||||
$link_file->setDbDirectory($propel_new_watch->getId());
|
|
||||||
$link_file->setDbFilepath($sub_link_filepath);
|
|
||||||
$link_file->save();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$data = array();
|
|
||||||
$data["directory"] = $p_path;
|
|
||||||
Application_Model_RabbitMq::SendMessageToMediaMonitor("new_watch", $data);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$data = array();
|
||||||
|
$data["directory"] = $p_path;
|
||||||
|
Application_Model_RabbitMq::SendMessageToMediaMonitor("new_watch", $data);
|
||||||
|
|
||||||
return $res;
|
return $res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -360,7 +360,7 @@ SQL;
|
||||||
// path should always ends with trailing '/'
|
// path should always ends with trailing '/'
|
||||||
$p_dir = Application_Common_OsPath::normpath($p_dir)."/";
|
$p_dir = Application_Common_OsPath::normpath($p_dir)."/";
|
||||||
if (!is_dir($p_dir)) {
|
if (!is_dir($p_dir)) {
|
||||||
return array("code"=>2, "error"=>"'$p_dir' is not a valid directory.");
|
return array("code"=>2, "error"=>sprintf(_("%s is not a valid directory."), $p_dir));
|
||||||
} elseif (Application_Model_Preference::GetImportTimestamp()+10 > time()) {
|
} elseif (Application_Model_Preference::GetImportTimestamp()+10 > time()) {
|
||||||
return array("code"=>3, "error"=>"Airtime is currently importing files. Please wait until this is complete before changing the storage directory.");
|
return array("code"=>3, "error"=>"Airtime is currently importing files. Please wait until this is complete before changing the storage directory.");
|
||||||
}
|
}
|
||||||
|
@ -377,7 +377,8 @@ SQL;
|
||||||
|
|
||||||
return array("code"=>0);
|
return array("code"=>0);
|
||||||
} else {
|
} else {
|
||||||
return array("code"=>1, "error"=>"'$p_dir' is already set as the current storage dir or in the watched folders list.");
|
return array("code"=>1,
|
||||||
|
"error"=>sprintf(_("%s is already set as the current storage dir or in the watched folders list."), $p_dir));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -420,7 +421,7 @@ SQL;
|
||||||
}
|
}
|
||||||
$dir = Application_Model_MusicDir::getDirByPath($p_dir);
|
$dir = Application_Model_MusicDir::getDirByPath($p_dir);
|
||||||
if (is_null($dir)) {
|
if (is_null($dir)) {
|
||||||
return array("code"=>1, "error"=>"'$p_dir' doesn't exist in the watched list.");
|
return array("code"=>1, "error"=>sprintf(_("%s doesn't exist in the watched list."), $p_dir));
|
||||||
} else {
|
} else {
|
||||||
$dir->remove($userAddedWatchedDir);
|
$dir->remove($userAddedWatchedDir);
|
||||||
$data = array();
|
$data = array();
|
||||||
|
@ -445,4 +446,16 @@ SQL;
|
||||||
return array($mus_dir->getDirectory(), trim($fp));
|
return array($mus_dir->getDirectory(), trim($fp));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function unhideFiles()
|
||||||
|
{
|
||||||
|
$files = $this->_dir->getCcFiless();
|
||||||
|
$hid = 0;
|
||||||
|
foreach ($files as $file) {
|
||||||
|
$hid++;
|
||||||
|
$file->setDbHidden(false);
|
||||||
|
$file->save();
|
||||||
|
}
|
||||||
|
Logging::info("unhide '$hid' files");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -387,13 +387,19 @@ SQL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($obj)) {
|
if (isset($obj)) {
|
||||||
if (($obj instanceof CcFiles && $obj->getDbFileExists()) || $obj instanceof CcWebstream || $obj instanceof CcBlock) {
|
if (($obj instanceof CcFiles && $obj->visible())
|
||||||
$entry = $this->plItem;
|
|| $obj instanceof CcWebstream ||
|
||||||
$entry["id"] = $obj->getDbId();
|
$obj instanceof CcBlock) {
|
||||||
$entry["pos"] = $pos;
|
|
||||||
|
$entry = $this->plItem;
|
||||||
|
$entry["id"] = $obj->getDbId();
|
||||||
|
$entry["pos"] = $pos;
|
||||||
$entry["cliplength"] = $obj->getDbLength();
|
$entry["cliplength"] = $obj->getDbLength();
|
||||||
$entry["cueout"] = $obj->getDbLength();
|
if ($obj instanceof CcFiles && $obj) {
|
||||||
$entry["ftype"] = $objType;
|
$entry["cuein"] = $obj->getDbCuein();
|
||||||
|
$entry["cueout"] = $obj->getDbCueout();
|
||||||
|
}
|
||||||
|
$entry["ftype"] = $objType;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $entry;
|
return $entry;
|
||||||
|
@ -643,7 +649,6 @@ SQL;
|
||||||
}
|
}
|
||||||
|
|
||||||
$clipLength = $row->getDbCliplength();
|
$clipLength = $row->getDbCliplength();
|
||||||
|
|
||||||
if (!is_null($fadeIn)) {
|
if (!is_null($fadeIn)) {
|
||||||
|
|
||||||
$sql = "SELECT :fadein::INTERVAL > INTERVAL '{$clipLength}'";
|
$sql = "SELECT :fadein::INTERVAL > INTERVAL '{$clipLength}'";
|
||||||
|
@ -662,8 +667,6 @@ SQL;
|
||||||
}
|
}
|
||||||
$row->setDbFadeout($fadeOut);
|
$row->setDbFadeout($fadeOut);
|
||||||
}
|
}
|
||||||
|
|
||||||
$row->save($this->con);
|
|
||||||
$this->pl->setDbMtime(new DateTime("now", new DateTimeZone("UTC")));
|
$this->pl->setDbMtime(new DateTime("now", new DateTimeZone("UTC")));
|
||||||
$this->pl->save($this->con);
|
$this->pl->save($this->con);
|
||||||
|
|
||||||
|
@ -687,7 +690,6 @@ SQL;
|
||||||
|
|
||||||
$this->changeFadeInfo($row->getDbId(), $fadein, null);
|
$this->changeFadeInfo($row->getDbId(), $fadein, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($fadeout)) {
|
if (isset($fadeout)) {
|
||||||
Logging::info("Setting playlist fade out {$fadeout}");
|
Logging::info("Setting playlist fade out {$fadeout}");
|
||||||
$row = CcPlaylistcontentsQuery::create()
|
$row = CcPlaylistcontentsQuery::create()
|
||||||
|
@ -718,7 +720,7 @@ SQL;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (is_null($cueIn) && is_null($cueOut)) {
|
if (is_null($cueIn) && is_null($cueOut)) {
|
||||||
$errArray["error"] = "Cue in and cue out are null.";
|
$errArray["error"] = _("Cue in and cue out are null.");
|
||||||
|
|
||||||
return $errArray;
|
return $errArray;
|
||||||
}
|
}
|
||||||
|
@ -748,14 +750,14 @@ SQL;
|
||||||
|
|
||||||
$sql = "SELECT :cueIn::INTERVAL > :cueOut::INTERVAL";
|
$sql = "SELECT :cueIn::INTERVAL > :cueOut::INTERVAL";
|
||||||
if (Application_Common_Database::prepareAndExecute($sql, array(':cueIn'=>$cueIn, ':cueOut'=>$cueOut), 'column')) {
|
if (Application_Common_Database::prepareAndExecute($sql, array(':cueIn'=>$cueIn, ':cueOut'=>$cueOut), 'column')) {
|
||||||
$errArray["error"] = "Can't set cue in to be larger than cue out.";
|
$errArray["error"] = _("Can't set cue in to be larger than cue out.");
|
||||||
|
|
||||||
return $errArray;
|
return $errArray;
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = "SELECT :cueOut::INTERVAL > :origLength::INTERVAL";
|
$sql = "SELECT :cueOut::INTERVAL > :origLength::INTERVAL";
|
||||||
if (Application_Common_Database::prepareAndExecute($sql, array(':cueOut'=>$cueOut, ':origLength'=>$origLength), 'column')) {
|
if (Application_Common_Database::prepareAndExecute($sql, array(':cueOut'=>$cueOut, ':origLength'=>$origLength), 'column')) {
|
||||||
$errArray["error"] = "Can't set cue out to be greater than file length.";
|
$errArray["error"] = _("Can't set cue out to be greater than file length.");
|
||||||
|
|
||||||
return $errArray;
|
return $errArray;
|
||||||
}
|
}
|
||||||
|
@ -771,7 +773,7 @@ SQL;
|
||||||
|
|
||||||
$sql = "SELECT :cueIn::INTERVAL > :oldCueOut::INTERVAL";
|
$sql = "SELECT :cueIn::INTERVAL > :oldCueOut::INTERVAL";
|
||||||
if (Application_Common_Database::prepareAndExecute($sql, array(':cueIn'=>$cueIn, ':oldCueOut'=>$oldCueOut), 'column')) {
|
if (Application_Common_Database::prepareAndExecute($sql, array(':cueIn'=>$cueIn, ':oldCueOut'=>$oldCueOut), 'column')) {
|
||||||
$errArray["error"] = "Can't set cue in to be larger than cue out.";
|
$errArray["error"] = _("Can't set cue in to be larger than cue out.");
|
||||||
|
|
||||||
return $errArray;
|
return $errArray;
|
||||||
}
|
}
|
||||||
|
@ -789,14 +791,14 @@ SQL;
|
||||||
|
|
||||||
$sql = "SELECT :cueOut::INTERVAL < :oldCueIn::INTERVAL";
|
$sql = "SELECT :cueOut::INTERVAL < :oldCueIn::INTERVAL";
|
||||||
if (Application_Common_Database::prepareAndExecute($sql, array(':cueOut'=>$cueOut, ':oldCueIn'=>$oldCueIn), 'column')) {
|
if (Application_Common_Database::prepareAndExecute($sql, array(':cueOut'=>$cueOut, ':oldCueIn'=>$oldCueIn), 'column')) {
|
||||||
$errArray["error"] = "Can't set cue out to be smaller than cue in.";
|
$errArray["error"] = _("Can't set cue out to be smaller than cue in.");
|
||||||
|
|
||||||
return $errArray;
|
return $errArray;
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = "SELECT :cueOut::INTERVAL > :origLength::INTERVAL";
|
$sql = "SELECT :cueOut::INTERVAL > :origLength::INTERVAL";
|
||||||
if (Application_Common_Database::prepareAndExecute($sql, array(':cueOut'=>$cueOut, ':origLength'=>$origLength), 'column')) {
|
if (Application_Common_Database::prepareAndExecute($sql, array(':cueOut'=>$cueOut, ':origLength'=>$origLength), 'column')) {
|
||||||
$errArray["error"] = "Can't set cue out to be greater than file length.";
|
$errArray["error"] = _("Can't set cue out to be greater than file length.");
|
||||||
|
|
||||||
return $errArray;
|
return $errArray;
|
||||||
}
|
}
|
||||||
|
@ -867,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);
|
||||||
}
|
}
|
||||||
|
@ -931,6 +932,29 @@ SQL;
|
||||||
CcPlaylistcontentsQuery::create()->findByDbPlaylistId($this->id)->delete();
|
CcPlaylistcontentsQuery::create()->findByDbPlaylistId($this->id)->delete();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function shuffle()
|
||||||
|
{
|
||||||
|
$sql = <<<SQL
|
||||||
|
SELECT max(position) from cc_playlistcontents WHERE playlist_id=:p1
|
||||||
|
SQL;
|
||||||
|
$out = Application_Common_Database::prepareAndExecute($sql, array("p1"=>$this->id));
|
||||||
|
$maxPosition = $out[0]['max'];
|
||||||
|
|
||||||
|
$map = range(0, $maxPosition);
|
||||||
|
shuffle($map);
|
||||||
|
|
||||||
|
$currentPos = implode(',', array_keys($map));
|
||||||
|
$sql = "UPDATE cc_playlistcontents SET position = CASE position ";
|
||||||
|
foreach ($map as $current => $after) {
|
||||||
|
$sql .= sprintf("WHEN %d THEN %d ", $current, $after);
|
||||||
|
}
|
||||||
|
$sql .= "END WHERE position IN ($currentPos) and playlist_id=:p1";
|
||||||
|
|
||||||
|
Application_Common_Database::prepareAndExecute($sql, array("p1"=>$this->id));
|
||||||
|
$result['result'] = 0;
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
} // class Playlist
|
} // class Playlist
|
||||||
|
|
||||||
class PlaylistNotFoundException extends Exception {}
|
class PlaylistNotFoundException extends Exception {}
|
||||||
|
|
|
@ -3,7 +3,12 @@
|
||||||
class Application_Model_Preference
|
class Application_Model_Preference
|
||||||
{
|
{
|
||||||
|
|
||||||
private static function setValue($key, $value, $isUserValue = false)
|
/**
|
||||||
|
*
|
||||||
|
* @param integer $userId is not null when we are setting a locale for a specific user
|
||||||
|
* @param boolean $isUserValue is true when we are setting a value for the current user
|
||||||
|
*/
|
||||||
|
private static function setValue($key, $value, $isUserValue = false, $userId = null)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
//called from a daemon process
|
//called from a daemon process
|
||||||
|
@ -22,9 +27,12 @@ class Application_Model_Preference
|
||||||
$paramMap[':key'] = $key;
|
$paramMap[':key'] = $key;
|
||||||
|
|
||||||
//For user specific preference, check if id matches as well
|
//For user specific preference, check if id matches as well
|
||||||
if ($isUserValue) {
|
if ($isUserValue && is_null($userId)) {
|
||||||
$sql .= " AND subjid = :id";
|
$sql .= " AND subjid = :id";
|
||||||
$paramMap[':id'] = $id;
|
$paramMap[':id'] = $id;
|
||||||
|
} else if (!is_null($userId)) {
|
||||||
|
$sql .= " AND subjid= :id";
|
||||||
|
$paramMap[':id'] = $userId;
|
||||||
}
|
}
|
||||||
|
|
||||||
$result = Application_Common_Database::prepareAndExecute($sql, $paramMap, 'column');
|
$result = Application_Common_Database::prepareAndExecute($sql, $paramMap, 'column');
|
||||||
|
@ -42,7 +50,11 @@ class Application_Model_Preference
|
||||||
$sql = "UPDATE cc_pref"
|
$sql = "UPDATE cc_pref"
|
||||||
. " SET valstr = :value"
|
. " SET valstr = :value"
|
||||||
. " WHERE keystr = :key AND subjid = :id";
|
. " WHERE keystr = :key AND subjid = :id";
|
||||||
$paramMap[':id'] = $id;
|
if (is_null($userId)) {
|
||||||
|
$paramMap[':id'] = $id;
|
||||||
|
} else {
|
||||||
|
$paramMap[':id'] = $userId;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// result not found
|
// result not found
|
||||||
|
@ -54,7 +66,11 @@ class Application_Model_Preference
|
||||||
// user pref
|
// user pref
|
||||||
$sql = "INSERT INTO cc_pref (subjid, keystr, valstr)"
|
$sql = "INSERT INTO cc_pref (subjid, keystr, valstr)"
|
||||||
." VALUES (:id, :key, :value)";
|
." VALUES (:id, :key, :value)";
|
||||||
$paramMap[':id'] = $id;
|
if (is_null($userId)) {
|
||||||
|
$paramMap[':id'] = $id;
|
||||||
|
} else {
|
||||||
|
$paramMap[':id'] = $userId;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$paramMap[':key'] = $key;
|
$paramMap[':key'] = $key;
|
||||||
|
@ -418,17 +434,80 @@ class Application_Model_Preference
|
||||||
return self::getValue("description");
|
return self::getValue("description");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function SetTimezone($timezone)
|
public static function SetDefaultTimezone($timezone)
|
||||||
{
|
{
|
||||||
self::setValue("timezone", $timezone);
|
self::setValue("timezone", $timezone);
|
||||||
date_default_timezone_set($timezone);
|
date_default_timezone_set($timezone);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function GetTimezone()
|
public static function GetDefaultTimezone()
|
||||||
{
|
{
|
||||||
return self::getValue("timezone");
|
return self::getValue("timezone");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function SetUserTimezone($userId, $timezone = null)
|
||||||
|
{
|
||||||
|
// When a new user is created they will get the default timezone
|
||||||
|
// setting which the admin sets on preferences page
|
||||||
|
if (is_null($timezone)) {
|
||||||
|
$timezone = self::GetDefaultTimezone();
|
||||||
|
}
|
||||||
|
self::setValue("user_timezone", $timezone, true, $userId);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function GetUserTimezone($id)
|
||||||
|
{
|
||||||
|
return self::getValue("user_timezone", true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function GetTimezone()
|
||||||
|
{
|
||||||
|
$auth = Zend_Auth::getInstance();
|
||||||
|
if ($auth->hasIdentity()) {
|
||||||
|
$id = $auth->getIdentity()->id;
|
||||||
|
return self::GetUserTimezone($id);
|
||||||
|
} else {
|
||||||
|
return self::GetDefaultTimezone();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// This is the language setting on preferences page
|
||||||
|
public static function SetDefaultLocale($locale)
|
||||||
|
{
|
||||||
|
self::setValue("locale", $locale);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function GetDefaultLocale()
|
||||||
|
{
|
||||||
|
return self::getValue("locale");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function GetUserLocale($id)
|
||||||
|
{
|
||||||
|
return self::getValue("user_locale", true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function SetUserLocale($userId, $locale = null)
|
||||||
|
{
|
||||||
|
// When a new user is created they will get the default locale
|
||||||
|
// setting which the admin sets on preferences page
|
||||||
|
if (is_null($locale)) {
|
||||||
|
$locale = self::GetDefaultLocale();
|
||||||
|
}
|
||||||
|
self::setValue("user_locale", $locale, true, $userId);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function GetLocale()
|
||||||
|
{
|
||||||
|
$auth = Zend_Auth::getInstance();
|
||||||
|
if ($auth->hasIdentity()) {
|
||||||
|
$id = $auth->getIdentity()->id;
|
||||||
|
return self::GetUserLocale($id);
|
||||||
|
} else {
|
||||||
|
return self::GetDefaultLocale();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static function SetStationLogo($imagePath)
|
public static function SetStationLogo($imagePath)
|
||||||
{
|
{
|
||||||
if (!empty($imagePath)) {
|
if (!empty($imagePath)) {
|
||||||
|
@ -456,7 +535,7 @@ class Application_Model_Preference
|
||||||
$sql = "SELECT * FROM cc_country";
|
$sql = "SELECT * FROM cc_country";
|
||||||
$res = $con->query($sql)->fetchAll();
|
$res = $con->query($sql)->fetchAll();
|
||||||
$out = array();
|
$out = array();
|
||||||
$out[""] = "Select Country";
|
$out[""] = _("Select Country");
|
||||||
foreach ($res as $r) {
|
foreach ($res as $r) {
|
||||||
$out[$r["isocode"]] = $r["name"];
|
$out[$r["isocode"]] = $r["name"];
|
||||||
}
|
}
|
||||||
|
@ -500,6 +579,7 @@ class Application_Model_Preference
|
||||||
} else {
|
} else {
|
||||||
$outputArray['NUM_SOUNDCLOUD_TRACKS_UPLOADED'] = NULL;
|
$outputArray['NUM_SOUNDCLOUD_TRACKS_UPLOADED'] = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
$outputArray['STATION_NAME'] = self::GetStationName();
|
$outputArray['STATION_NAME'] = self::GetStationName();
|
||||||
$outputArray['PHONE'] = self::GetPhone();
|
$outputArray['PHONE'] = self::GetPhone();
|
||||||
$outputArray['EMAIL'] = self::GetEmail();
|
$outputArray['EMAIL'] = self::GetEmail();
|
||||||
|
@ -1166,4 +1246,27 @@ class Application_Model_Preference
|
||||||
$data = self::getValue("nowplaying_screen", true);
|
$data = self::getValue("nowplaying_screen", true);
|
||||||
return ($data != "") ? unserialize($data) : null;
|
return ($data != "") ? unserialize($data) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function SetEnableReplayGain($value) {
|
||||||
|
self::setValue("enable_replay_gain", $value, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function GetEnableReplayGain() {
|
||||||
|
return self::getValue("enable_replay_gain", false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getReplayGainModifier(){
|
||||||
|
$rg_modifier = self::getValue("replay_gain_modifier");
|
||||||
|
|
||||||
|
if ($rg_modifier === "") {
|
||||||
|
return "0";
|
||||||
|
}
|
||||||
|
|
||||||
|
return $rg_modifier;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function setReplayGainModifier($rg_modifier)
|
||||||
|
{
|
||||||
|
self::setValue("replay_gain_modifier", $rg_modifier, true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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"],
|
||||||
|
|
|
@ -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);
|
||||||
}
|
}
|
||||||
|
@ -680,6 +674,13 @@ SQL;
|
||||||
$same_hour = $start_hour == $end_hour;
|
$same_hour = $start_hour == $end_hour;
|
||||||
$independent_event = !$same_hour;
|
$independent_event = !$same_hour;
|
||||||
|
|
||||||
|
$replay_gain = is_null($item["replay_gain"]) ? "0": $item["replay_gain"];
|
||||||
|
$replay_gain += Application_Model_Preference::getReplayGainModifier();
|
||||||
|
|
||||||
|
if ( !Application_Model_Preference::GetEnableReplayGain() ) {
|
||||||
|
$replay_gain = 0;
|
||||||
|
}
|
||||||
|
|
||||||
$schedule_item = array(
|
$schedule_item = array(
|
||||||
'id' => $media_id,
|
'id' => $media_id,
|
||||||
'type' => 'file',
|
'type' => 'file',
|
||||||
|
@ -692,7 +693,7 @@ SQL;
|
||||||
'start' => $start,
|
'start' => $start,
|
||||||
'end' => $end,
|
'end' => $end,
|
||||||
'show_name' => $item["show_name"],
|
'show_name' => $item["show_name"],
|
||||||
'replay_gain' => is_null($item["replay_gain"]) ? "0": $item["replay_gain"],
|
'replay_gain' => $replay_gain,
|
||||||
'independent_event' => $independent_event,
|
'independent_event' => $independent_event,
|
||||||
);
|
);
|
||||||
self::appendScheduleItem($data, $start, $schedule_item);
|
self::appendScheduleItem($data, $start, $schedule_item);
|
||||||
|
@ -762,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". */
|
||||||
|
@ -911,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');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -79,12 +79,12 @@ class Application_Model_Scheduler
|
||||||
|
|
||||||
//an item has been deleted
|
//an item has been deleted
|
||||||
if (count($schedIds) !== count($schedItems)) {
|
if (count($schedIds) !== count($schedItems)) {
|
||||||
throw new OutDatedScheduleException("The schedule you're viewing is out of date! (sched mismatch)");
|
throw new OutDatedScheduleException(_("The schedule you're viewing is out of date! (sched mismatch)"));
|
||||||
}
|
}
|
||||||
|
|
||||||
//a show has been deleted
|
//a show has been deleted
|
||||||
if (count($instanceIds) !== count($showInstances)) {
|
if (count($instanceIds) !== count($showInstances)) {
|
||||||
throw new OutDatedScheduleException("The schedule you're viewing is out of date! (instance mismatch)");
|
throw new OutDatedScheduleException(_("The schedule you're viewing is out of date! (instance mismatch)"));
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($schedItems as $schedItem) {
|
foreach ($schedItems as $schedItem) {
|
||||||
|
@ -92,7 +92,7 @@ class Application_Model_Scheduler
|
||||||
$instance = $schedItem->getCcShowInstances($this->con);
|
$instance = $schedItem->getCcShowInstances($this->con);
|
||||||
|
|
||||||
if (intval($schedInfo[$id]) !== $instance->getDbId()) {
|
if (intval($schedInfo[$id]) !== $instance->getDbId()) {
|
||||||
throw new OutDatedScheduleException("The schedule you're viewing is out of date!");
|
throw new OutDatedScheduleException(_("The schedule you're viewing is out of date!"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -102,24 +102,24 @@ class Application_Model_Scheduler
|
||||||
$show = $instance->getCcShow($this->con);
|
$show = $instance->getCcShow($this->con);
|
||||||
|
|
||||||
if ($this->checkUserPermissions && $this->user->canSchedule($show->getDbId()) === false) {
|
if ($this->checkUserPermissions && $this->user->canSchedule($show->getDbId()) === false) {
|
||||||
throw new Exception("You are not allowed to schedule show {$show->getDbName()}.");
|
throw new Exception(sprintf(_("You are not allowed to schedule show %s."), $show->getDbName()));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($instance->getDbRecord()) {
|
if ($instance->getDbRecord()) {
|
||||||
throw new Exception("You cannot add files to recording shows.");
|
throw new Exception(_("You cannot add files to recording shows."));
|
||||||
}
|
}
|
||||||
|
|
||||||
$showEndEpoch = floatval($instance->getDbEnds("U.u"));
|
$showEndEpoch = floatval($instance->getDbEnds("U.u"));
|
||||||
|
|
||||||
if ($showEndEpoch < $nowEpoch) {
|
if ($showEndEpoch < $nowEpoch) {
|
||||||
throw new OutDatedScheduleException("The show {$show->getDbName()} is over and cannot be scheduled.");
|
throw new OutDatedScheduleException(sprintf(_("The show %s is over and cannot be scheduled."), $show->getDbName()));
|
||||||
}
|
}
|
||||||
|
|
||||||
$ts = intval($instanceInfo[$id]);
|
$ts = intval($instanceInfo[$id]);
|
||||||
$lastSchedTs = intval($instance->getDbLastScheduled("U")) ? : 0;
|
$lastSchedTs = intval($instance->getDbLastScheduled("U")) ? : 0;
|
||||||
if ($ts < $lastSchedTs) {
|
if ($ts < $lastSchedTs) {
|
||||||
Logging::info("ts {$ts} last sched {$lastSchedTs}");
|
Logging::info("ts {$ts} last sched {$lastSchedTs}");
|
||||||
throw new OutDatedScheduleException("The show {$show->getDbName()} has been previously updated!");
|
throw new OutDatedScheduleException(sprintf(_("The show %s has been previously updated!"), $show->getDbName()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -137,13 +137,14 @@ class Application_Model_Scheduler
|
||||||
if ($type === "audioclip") {
|
if ($type === "audioclip") {
|
||||||
$file = CcFilesQuery::create()->findPK($id, $this->con);
|
$file = CcFilesQuery::create()->findPK($id, $this->con);
|
||||||
|
|
||||||
if (is_null($file) || !$file->getDbFileExists()) {
|
if (is_null($file) || !$file->visible()) {
|
||||||
throw new Exception("A selected File does not exist!");
|
throw new Exception(_("A selected File does not exist!"));
|
||||||
} else {
|
} else {
|
||||||
$data = $this->fileInfo;
|
$data = $this->fileInfo;
|
||||||
$data["id"] = $id;
|
$data["id"] = $id;
|
||||||
$data["cliplength"] = $file->getDbLength();
|
$data["cliplength"] = $file->getDbLength();
|
||||||
$data["cueout"] = $file->getDbLength();
|
$data["cuein"] = $file->getDbCuein();
|
||||||
|
$data["cueout"] = $file->getDbCueout();
|
||||||
|
|
||||||
$defaultFade = Application_Model_Preference::GetDefaultFade();
|
$defaultFade = Application_Model_Preference::GetDefaultFade();
|
||||||
if (isset($defaultFade)) {
|
if (isset($defaultFade)) {
|
||||||
|
@ -196,7 +197,7 @@ class Application_Model_Scheduler
|
||||||
foreach ($dynamicFiles as $f) {
|
foreach ($dynamicFiles as $f) {
|
||||||
$fileId = $f['id'];
|
$fileId = $f['id'];
|
||||||
$file = CcFilesQuery::create()->findPk($fileId);
|
$file = CcFilesQuery::create()->findPk($fileId);
|
||||||
if (isset($file) && $file->getDbFileExists()) {
|
if (isset($file) && $file->visible()) {
|
||||||
$data["id"] = $file->getDbId();
|
$data["id"] = $file->getDbId();
|
||||||
$data["cliplength"] = $file->getDbLength();
|
$data["cliplength"] = $file->getDbLength();
|
||||||
$data["cuein"] = "00:00:00";
|
$data["cuein"] = "00:00:00";
|
||||||
|
@ -218,8 +219,8 @@ class Application_Model_Scheduler
|
||||||
//need to return
|
//need to return
|
||||||
$stream = CcWebstreamQuery::create()->findPK($id, $this->con);
|
$stream = CcWebstreamQuery::create()->findPK($id, $this->con);
|
||||||
|
|
||||||
if (is_null($stream) /* || !$file->getDbFileExists() */) {
|
if (is_null($stream) /* || !$file->visible() */) {
|
||||||
throw new Exception("A selected File does not exist!");
|
throw new Exception(_("A selected File does not exist!"));
|
||||||
} else {
|
} else {
|
||||||
$data = $this->fileInfo;
|
$data = $this->fileInfo;
|
||||||
$data["id"] = $id;
|
$data["id"] = $id;
|
||||||
|
@ -254,7 +255,7 @@ class Application_Model_Scheduler
|
||||||
foreach ($dynamicFiles as $f) {
|
foreach ($dynamicFiles as $f) {
|
||||||
$fileId = $f['id'];
|
$fileId = $f['id'];
|
||||||
$file = CcFilesQuery::create()->findPk($fileId);
|
$file = CcFilesQuery::create()->findPk($fileId);
|
||||||
if (isset($file) && $file->getDbFileExists()) {
|
if (isset($file) && $file->visible()) {
|
||||||
$data["id"] = $file->getDbId();
|
$data["id"] = $file->getDbId();
|
||||||
$data["cliplength"] = $file->getDbLength();
|
$data["cliplength"] = $file->getDbLength();
|
||||||
$data["cuein"] = "00:00:00";
|
$data["cuein"] = "00:00:00";
|
||||||
|
@ -343,7 +344,7 @@ class Application_Model_Scheduler
|
||||||
|
|
||||||
$instance = CcShowInstancesQuery::create()->findPK($showInstance, $this->con);
|
$instance = CcShowInstancesQuery::create()->findPK($showInstance, $this->con);
|
||||||
if (is_null($instance)) {
|
if (is_null($instance)) {
|
||||||
throw new OutDatedScheduleException("The schedule you're viewing is out of date!");
|
throw new OutDatedScheduleException(_("The schedule you're viewing is out of date!"));
|
||||||
}
|
}
|
||||||
|
|
||||||
$itemStartDT = $instance->getDbStarts(null);
|
$itemStartDT = $instance->getDbStarts(null);
|
||||||
|
|
|
@ -177,7 +177,7 @@ SQL;
|
||||||
$con = Propel::getConnection();
|
$con = Propel::getConnection();
|
||||||
|
|
||||||
if ($deltaDay > 0) {
|
if ($deltaDay > 0) {
|
||||||
return "Shows can have a max length of 24 hours.";
|
return _("Shows can have a max length of 24 hours.");
|
||||||
}
|
}
|
||||||
|
|
||||||
$utc = new DateTimeZone("UTC");
|
$utc = new DateTimeZone("UTC");
|
||||||
|
@ -208,7 +208,7 @@ SQL;
|
||||||
$newEndsDateTime = Application_Model_ShowInstance::addDeltas($endsDateTime, $deltaDay, $deltaMin);
|
$newEndsDateTime = Application_Model_ShowInstance::addDeltas($endsDateTime, $deltaDay, $deltaMin);
|
||||||
|
|
||||||
if ($newEndsDateTime->getTimestamp() < $nowDateTime->getTimestamp()) {
|
if ($newEndsDateTime->getTimestamp() < $nowDateTime->getTimestamp()) {
|
||||||
return "End date/time cannot be in the past";
|
return _("End date/time cannot be in the past");
|
||||||
}
|
}
|
||||||
|
|
||||||
//convert our new starts/ends to UTC.
|
//convert our new starts/ends to UTC.
|
||||||
|
@ -219,8 +219,8 @@ SQL;
|
||||||
$newStartsDateTime, $newEndsDateTime, true, $si->getDbId());
|
$newStartsDateTime, $newEndsDateTime, true, $si->getDbId());
|
||||||
|
|
||||||
if ($overlapping) {
|
if ($overlapping) {
|
||||||
return "Cannot schedule overlapping shows.\nNote: Resizing a repeating show ".
|
return _("Cannot schedule overlapping shows.\nNote: Resizing a repeating show ".
|
||||||
"affects all of its repeats.";
|
"affects all of its repeats.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1802,6 +1802,8 @@ SQL;
|
||||||
$options["show_empty"] = (array_key_exists($show['instance_id'],
|
$options["show_empty"] = (array_key_exists($show['instance_id'],
|
||||||
$content_count)) ? 0 : 1;
|
$content_count)) ? 0 : 1;
|
||||||
|
|
||||||
|
$options["show_partial_filled"] = $showInstance->showPartialFilled();
|
||||||
|
|
||||||
$events[] = &self::makeFullCalendarEvent($show, $options,
|
$events[] = &self::makeFullCalendarEvent($show, $options,
|
||||||
$startsDT, $endsDT, $startsEpochStr, $endsEpochStr);
|
$startsDT, $endsDT, $startsEpochStr, $endsEpochStr);
|
||||||
}
|
}
|
||||||
|
@ -1905,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;
|
||||||
|
@ -1951,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
|
||||||
|
|
|
@ -195,7 +195,7 @@ class Application_Model_ShowBuilder
|
||||||
$dt->setTimezone(new DateTimeZone($this->timezone));
|
$dt->setTimezone(new DateTimeZone($this->timezone));
|
||||||
$time = $dt->format("Y-m-d H:i");
|
$time = $dt->format("Y-m-d H:i");
|
||||||
|
|
||||||
$row["rebroadcast_title"] = "Rebroadcast of {$name} from {$time}";
|
$row["rebroadcast_title"] = sprintf(_("Rebroadcast of %s from %s"), $name, $time);
|
||||||
} elseif (intval($p_item["si_record"]) === 1) {
|
} elseif (intval($p_item["si_record"]) === 1) {
|
||||||
$row["record"] = true;
|
$row["record"] = true;
|
||||||
|
|
||||||
|
@ -269,6 +269,7 @@ class Application_Model_ShowBuilder
|
||||||
|
|
||||||
$cue_out = Application_Common_DateHelper::calculateLengthInSeconds($p_item['cue_out']);
|
$cue_out = Application_Common_DateHelper::calculateLengthInSeconds($p_item['cue_out']);
|
||||||
$cue_in = Application_Common_DateHelper::calculateLengthInSeconds($p_item['cue_in']);
|
$cue_in = Application_Common_DateHelper::calculateLengthInSeconds($p_item['cue_in']);
|
||||||
|
|
||||||
$run_time = $cue_out-$cue_in;
|
$run_time = $cue_out-$cue_in;
|
||||||
|
|
||||||
$formatter = new LengthFormatter(Application_Common_DateHelper::ConvertMSToHHMMSSmm($run_time*1000));
|
$formatter = new LengthFormatter(Application_Common_DateHelper::ConvertMSToHHMMSSmm($run_time*1000));
|
||||||
|
|
|
@ -242,7 +242,7 @@ SQL;
|
||||||
public function moveShow($deltaDay, $deltaMin)
|
public function moveShow($deltaDay, $deltaMin)
|
||||||
{
|
{
|
||||||
if ($this->getShow()->isRepeating()) {
|
if ($this->getShow()->isRepeating()) {
|
||||||
return "Can't drag and drop repeating shows";
|
return _("Can't drag and drop repeating shows");
|
||||||
}
|
}
|
||||||
|
|
||||||
$today_timestamp = time();
|
$today_timestamp = time();
|
||||||
|
@ -250,7 +250,7 @@ SQL;
|
||||||
$endsDateTime = new DateTime($this->getShowInstanceEnd(), new DateTimeZone("UTC"));
|
$endsDateTime = new DateTime($this->getShowInstanceEnd(), new DateTimeZone("UTC"));
|
||||||
|
|
||||||
if ($today_timestamp > $startsDateTime->getTimestamp()) {
|
if ($today_timestamp > $startsDateTime->getTimestamp()) {
|
||||||
return "Can't move a past show";
|
return _("Can't move a past show");
|
||||||
}
|
}
|
||||||
|
|
||||||
//the user is moving the show on the calendar from the perspective of local time.
|
//the user is moving the show on the calendar from the perspective of local time.
|
||||||
|
@ -267,13 +267,13 @@ SQL;
|
||||||
$newEndsDateTime->setTimezone(new DateTimeZone("UTC"));
|
$newEndsDateTime->setTimezone(new DateTimeZone("UTC"));
|
||||||
|
|
||||||
if ($today_timestamp > $newStartsDateTime->getTimestamp()) {
|
if ($today_timestamp > $newStartsDateTime->getTimestamp()) {
|
||||||
return "Can't move show into past";
|
return _("Can't move show into past");
|
||||||
}
|
}
|
||||||
|
|
||||||
//check if show is overlapping
|
//check if show is overlapping
|
||||||
$overlapping = Application_Model_Schedule::checkOverlappingShows($newStartsDateTime, $newEndsDateTime, true, $this->getShowInstanceId());
|
$overlapping = Application_Model_Schedule::checkOverlappingShows($newStartsDateTime, $newEndsDateTime, true, $this->getShowInstanceId());
|
||||||
if ($overlapping) {
|
if ($overlapping) {
|
||||||
return "Cannot schedule overlapping shows";
|
return _("Cannot schedule overlapping shows");
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->isRecorded()) {
|
if ($this->isRecorded()) {
|
||||||
|
@ -287,7 +287,7 @@ SQL;
|
||||||
->find();
|
->find();
|
||||||
|
|
||||||
if (count($rebroadcasts) > 0) {
|
if (count($rebroadcasts) > 0) {
|
||||||
return "Can't move a recorded show less than 1 hour before its rebroadcasts.";
|
return _("Can't move a recorded show less than 1 hour before its rebroadcasts.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -300,14 +300,14 @@ SQL;
|
||||||
catch (Exception $e) {
|
catch (Exception $e) {
|
||||||
$this->_showInstance->delete();
|
$this->_showInstance->delete();
|
||||||
|
|
||||||
return "Show was deleted because recorded show does not exist!";
|
return _("Show was deleted because recorded show does not exist!");
|
||||||
}
|
}
|
||||||
|
|
||||||
$recordEndDateTime = new DateTime($recordedShow->getShowInstanceEnd(), new DateTimeZone("UTC"));
|
$recordEndDateTime = new DateTime($recordedShow->getShowInstanceEnd(), new DateTimeZone("UTC"));
|
||||||
$newRecordEndDateTime = self::addDeltas($recordEndDateTime, 0, 60);
|
$newRecordEndDateTime = self::addDeltas($recordEndDateTime, 0, 60);
|
||||||
|
|
||||||
if ($newStartsDateTime->getTimestamp() < $newRecordEndDateTime->getTimestamp()) {
|
if ($newStartsDateTime->getTimestamp() < $newRecordEndDateTime->getTimestamp()) {
|
||||||
return "Must wait 1 hour to rebroadcast.";
|
return _("Must wait 1 hour to rebroadcast.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -339,7 +339,7 @@ SQL;
|
||||||
$ends = $this->getShowInstanceEnd();
|
$ends = $this->getShowInstanceEnd();
|
||||||
|
|
||||||
if (strtotime($today_timestamp) > strtotime($starts)) {
|
if (strtotime($today_timestamp) > strtotime($starts)) {
|
||||||
return "can't resize a past show";
|
return _("can't resize a past show");
|
||||||
}
|
}
|
||||||
|
|
||||||
//$sql = "SELECT timestamp '{$ends}' + interval '{$deltaDay} days' + interval '{$hours}:{$mins}'";
|
//$sql = "SELECT timestamp '{$ends}' + interval '{$deltaDay} days' + interval '{$hours}:{$mins}'";
|
||||||
|
@ -361,7 +361,7 @@ SQL;
|
||||||
|
|
||||||
if (count($overlap) > 0) {
|
if (count($overlap) > 0) {
|
||||||
// TODO : fix ghetto error handling -- RG
|
// TODO : fix ghetto error handling -- RG
|
||||||
return "Should not overlap shows";
|
return _("Should not overlap shows");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//with overbooking no longer need to check already scheduled content still fits.
|
//with overbooking no longer need to check already scheduled content still fits.
|
||||||
|
@ -687,6 +687,22 @@ SQL;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function showPartialFilled()
|
||||||
|
{
|
||||||
|
$sql = <<<SQL
|
||||||
|
SELECT time_filled > '00:00:00'
|
||||||
|
AND time_filled < ends - starts
|
||||||
|
AND file_id IS null AS partial_filled
|
||||||
|
FROM cc_show_instances
|
||||||
|
WHERE id = :instance_id
|
||||||
|
SQL;
|
||||||
|
|
||||||
|
$res = Application_Common_Database::prepareAndExecute($sql,
|
||||||
|
array(':instance_id' => $this->_instanceId), 'all');
|
||||||
|
|
||||||
|
return $res[0]["partial_filled"];
|
||||||
|
}
|
||||||
|
|
||||||
public function showEmpty()
|
public function showEmpty()
|
||||||
{
|
{
|
||||||
$sql = <<<SQL
|
$sql = <<<SQL
|
||||||
|
@ -730,7 +746,8 @@ FROM (
|
||||||
LEFT JOIN cc_files AS f ON f.id = s.file_id
|
LEFT JOIN cc_files AS f ON f.id = s.file_id
|
||||||
WHERE s.instance_id = :instance_id1
|
WHERE s.instance_id = :instance_id1
|
||||||
AND s.playout_status >= 0
|
AND s.playout_status >= 0
|
||||||
AND s.file_id IS NOT NULL)
|
AND s.file_id IS NOT NULL
|
||||||
|
AND f.hidden = 'false')
|
||||||
UNION
|
UNION
|
||||||
(SELECT s.starts,
|
(SELECT s.starts,
|
||||||
1::INTEGER as type,
|
1::INTEGER as type,
|
||||||
|
|
|
@ -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']);
|
||||||
|
|
|
@ -48,7 +48,9 @@ class Application_Model_StoredFile
|
||||||
"language" => "DbLanguage",
|
"language" => "DbLanguage",
|
||||||
"replay_gain" => "DbReplayGain",
|
"replay_gain" => "DbReplayGain",
|
||||||
"directory" => "DbDirectory",
|
"directory" => "DbDirectory",
|
||||||
"owner_id" => "DbOwnerId"
|
"owner_id" => "DbOwnerId",
|
||||||
|
"cuein" => "DbCueIn",
|
||||||
|
"cueout" => "DbCueOut",
|
||||||
);
|
);
|
||||||
|
|
||||||
public function getId()
|
public function getId()
|
||||||
|
@ -127,9 +129,15 @@ class Application_Model_StoredFile
|
||||||
|
|
||||||
# Translate metadata attributes from media monitor (MDATA_KEY_*)
|
# Translate metadata attributes from media monitor (MDATA_KEY_*)
|
||||||
# to their counterparts in constants.php (usually the column names)
|
# to their counterparts in constants.php (usually the column names)
|
||||||
|
$track_length = $p_md['MDATA_KEY_DURATION'];
|
||||||
|
$track_length_in_sec = Application_Common_DateHelper::calculateLengthInSeconds($track_length);
|
||||||
foreach ($p_md as $mdConst => $mdValue) {
|
foreach ($p_md as $mdConst => $mdValue) {
|
||||||
if (defined($mdConst)) {
|
if (defined($mdConst)) {
|
||||||
|
if ($mdConst == "MDATA_KEY_CUE_OUT" && $mdValue == '0.0') {
|
||||||
|
$mdValue = $track_length_in_sec;
|
||||||
|
}
|
||||||
$dbMd[constant($mdConst)] = $mdValue;
|
$dbMd[constant($mdConst)] = $mdValue;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
Logging::warn("using metadata that is not defined.
|
Logging::warn("using metadata that is not defined.
|
||||||
[$mdConst] => [$mdValue]");
|
[$mdConst] => [$mdValue]");
|
||||||
|
@ -177,7 +185,7 @@ class Application_Model_StoredFile
|
||||||
$this->_file->setDbOwnerId( $owner->getDbId() );
|
$this->_file->setDbOwnerId( $owner->getDbId() );
|
||||||
} else {
|
} else {
|
||||||
Logging::info("Could not find suitable owner for file
|
Logging::info("Could not find suitable owner for file
|
||||||
'".$p_md['MDATA_KEY_FILEPATH']."'");
|
'".$p_md['filepath']."'");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
# We don't want to process owner_id in bulk because we already
|
# We don't want to process owner_id in bulk because we already
|
||||||
|
@ -359,8 +367,9 @@ SQL;
|
||||||
Application_Model_RabbitMq::SendMessageToMediaMonitor("file_delete", $data);
|
Application_Model_RabbitMq::SendMessageToMediaMonitor("file_delete", $data);
|
||||||
}
|
}
|
||||||
|
|
||||||
// set file_exists flag to false
|
|
||||||
$this->_file->setDbFileExists(false);
|
// set hidden flag to true
|
||||||
|
$this->_file->setDbHidden(true);
|
||||||
$this->_file->save();
|
$this->_file->save();
|
||||||
|
|
||||||
// need to explicitly update any playlist's and block's length
|
// need to explicitly update any playlist's and block's length
|
||||||
|
@ -495,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'];
|
||||||
|
@ -523,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)
|
||||||
|
@ -624,6 +633,7 @@ SQL;
|
||||||
return $res;
|
return $res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static function getLibraryColumns()
|
public static function getLibraryColumns()
|
||||||
{
|
{
|
||||||
return array("id", "track_title", "artist_name", "album_title",
|
return array("id", "track_title", "artist_name", "album_title",
|
||||||
|
@ -634,9 +644,10 @@ SQL;
|
||||||
"conductor", "replay_gain", "lptime" );
|
"conductor", "replay_gain", "lptime" );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static function searchLibraryFiles($datatables)
|
public static function searchLibraryFiles($datatables)
|
||||||
{
|
{
|
||||||
|
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||||
|
|
||||||
$con = Propel::getConnection(CcFilesPeer::DATABASE_NAME);
|
$con = Propel::getConnection(CcFilesPeer::DATABASE_NAME);
|
||||||
|
|
||||||
$displayColumns = self::getLibraryColumns();
|
$displayColumns = self::getLibraryColumns();
|
||||||
|
@ -706,6 +717,11 @@ SQL;
|
||||||
$blSelect[] = "NULL::VARCHAR AS ".$key;
|
$blSelect[] = "NULL::VARCHAR AS ".$key;
|
||||||
$fileSelect[] = $key;
|
$fileSelect[] = $key;
|
||||||
$streamSelect[] = "url AS ".$key;
|
$streamSelect[] = "url AS ".$key;
|
||||||
|
} else if ($key == "mime") {
|
||||||
|
$plSelect[] = "NULL::VARCHAR AS ".$key;
|
||||||
|
$blSelect[] = "NULL::VARCHAR AS ".$key;
|
||||||
|
$fileSelect[] = $key;
|
||||||
|
$streamSelect[] = $key;
|
||||||
} else {
|
} else {
|
||||||
$plSelect[] = "NULL::text AS ".$key;
|
$plSelect[] = "NULL::text AS ".$key;
|
||||||
$blSelect[] = "NULL::text AS ".$key;
|
$blSelect[] = "NULL::text AS ".$key;
|
||||||
|
@ -723,7 +739,7 @@ SQL;
|
||||||
|
|
||||||
$plTable = "({$plSelect} FROM cc_playlist AS PL LEFT JOIN cc_subjs AS sub ON (sub.id = PL.creator_id))";
|
$plTable = "({$plSelect} FROM cc_playlist AS PL LEFT JOIN cc_subjs AS sub ON (sub.id = PL.creator_id))";
|
||||||
$blTable = "({$blSelect} FROM cc_block AS BL LEFT JOIN cc_subjs AS sub ON (sub.id = BL.creator_id))";
|
$blTable = "({$blSelect} FROM cc_block AS BL LEFT JOIN cc_subjs AS sub ON (sub.id = BL.creator_id))";
|
||||||
$fileTable = "({$fileSelect} FROM cc_files AS FILES LEFT JOIN cc_subjs AS sub ON (sub.id = FILES.owner_id) WHERE file_exists = 'TRUE')";
|
$fileTable = "({$fileSelect} FROM cc_files AS FILES LEFT JOIN cc_subjs AS sub ON (sub.id = FILES.owner_id) WHERE file_exists = 'TRUE' AND hidden='FALSE')";
|
||||||
//$fileTable = "({$fileSelect} FROM cc_files AS FILES WHERE file_exists = 'TRUE')";
|
//$fileTable = "({$fileSelect} FROM cc_files AS FILES WHERE file_exists = 'TRUE')";
|
||||||
$streamTable = "({$streamSelect} FROM cc_webstream AS ws LEFT JOIN cc_subjs AS sub ON (sub.id = ws.creator_id))";
|
$streamTable = "({$streamSelect} FROM cc_webstream AS ws LEFT JOIN cc_subjs AS sub ON (sub.id = ws.creator_id))";
|
||||||
$unionTable = "({$plTable} UNION {$blTable} UNION {$fileTable} UNION {$streamTable}) AS RESULTS";
|
$unionTable = "({$plTable} UNION {$blTable} UNION {$fileTable} UNION {$streamTable}) AS RESULTS";
|
||||||
|
@ -791,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="/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="/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="/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="/css/images/icon_smart-block.png">';
|
$row['image'] = '<img title="'._("Smart Block").'" src="'.$baseUrl.'css/images/icon_smart-block.png">';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -850,7 +866,7 @@ SQL;
|
||||||
|
|
||||||
closedir($dir);
|
closedir($dir);
|
||||||
} else
|
} else
|
||||||
die('{"jsonrpc" : "2.0", "error" : {"code": 100, "message": "Failed to open temp directory."}, "id" : "id"}');
|
die('{"jsonrpc" : "2.0", "error" : {"code": 100, "message": _("Failed to open temp directory.")}, "id" : "id"}');
|
||||||
|
|
||||||
// Look for the content type header
|
// Look for the content type header
|
||||||
if (isset($_SERVER["HTTP_CONTENT_TYPE"]))
|
if (isset($_SERVER["HTTP_CONTENT_TYPE"]))
|
||||||
|
@ -877,14 +893,14 @@ SQL;
|
||||||
while ($buff = fread($in, 4096))
|
while ($buff = fread($in, 4096))
|
||||||
fwrite($out, $buff);
|
fwrite($out, $buff);
|
||||||
} else
|
} else
|
||||||
die('{"jsonrpc" : "2.0", "error" : {"code": 101, "message": "Failed to open input stream."}, "id" : "id"}');
|
die('{"jsonrpc" : "2.0", "error" : {"code": 101, "message": _("Failed to open input stream.")}, "id" : "id"}');
|
||||||
|
|
||||||
fclose($out);
|
fclose($out);
|
||||||
unlink($_FILES['file']['tmp_name']);
|
unlink($_FILES['file']['tmp_name']);
|
||||||
} else
|
} else
|
||||||
die('{"jsonrpc" : "2.0", "error" : {"code": 102, "message": "Failed to open output stream."}, "id" : "id"}');
|
die('{"jsonrpc" : "2.0", "error" : {"code": 102, "message": _("Failed to open output stream.")}, "id" : "id"}');
|
||||||
} else
|
} else
|
||||||
die('{"jsonrpc" : "2.0", "error" : {"code": 103, "message": "Failed to move uploaded file."}, "id" : "id"}');
|
die('{"jsonrpc" : "2.0", "error" : {"code": 103, "message": _("Failed to move uploaded file.")}, "id" : "id"}');
|
||||||
} else {
|
} else {
|
||||||
// Open temp file
|
// Open temp file
|
||||||
$out = fopen($tempFilePath, $chunk == 0 ? "wb" : "ab");
|
$out = fopen($tempFilePath, $chunk == 0 ? "wb" : "ab");
|
||||||
|
@ -896,11 +912,11 @@ SQL;
|
||||||
while ($buff = fread($in, 4096))
|
while ($buff = fread($in, 4096))
|
||||||
fwrite($out, $buff);
|
fwrite($out, $buff);
|
||||||
} else
|
} else
|
||||||
die('{"jsonrpc" : "2.0", "error" : {"code": 101, "message": "Failed to open input stream."}, "id" : "id"}');
|
die('{"jsonrpc" : "2.0", "error" : {"code": 101, "message": _("Failed to open input stream.")}, "id" : "id"}');
|
||||||
|
|
||||||
fclose($out);
|
fclose($out);
|
||||||
} else
|
} else
|
||||||
die('{"jsonrpc" : "2.0", "error" : {"code": 102, "message": "Failed to open output stream."}, "id" : "id"}');
|
die('{"jsonrpc" : "2.0", "error" : {"code": 102, "message": _("Failed to open output stream.")}, "id" : "id"}');
|
||||||
}
|
}
|
||||||
|
|
||||||
return $tempFilePath;
|
return $tempFilePath;
|
||||||
|
@ -931,7 +947,7 @@ SQL;
|
||||||
if (!mkdir($stor."/organize", 0777)) {
|
if (!mkdir($stor."/organize", 0777)) {
|
||||||
return array(
|
return array(
|
||||||
"code" => 109,
|
"code" => 109,
|
||||||
"message" => "Failed to create 'organize' directory.");
|
"message" => _("Failed to create 'organize' directory."));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -944,17 +960,17 @@ SQL;
|
||||||
$freeSpace = disk_free_space($stor);
|
$freeSpace = disk_free_space($stor);
|
||||||
|
|
||||||
return array("code" => 107,
|
return array("code" => 107,
|
||||||
"message" => "The file was not uploaded, there is
|
"message" => sprintf(_("The file was not uploaded, there is "
|
||||||
".$freeSpace."MB of disk space left and the file you are
|
."%s MB of disk space left and the file you are "
|
||||||
uploading has a size of ".$fileSize."MB.");
|
."uploading has a size of %s MB."), $freeSpace, $fileSize));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if liquidsoap can play this file
|
// Check if liquidsoap can play this file
|
||||||
if (!self::liquidsoapFilePlayabilityTest($audio_file)) {
|
if (!self::liquidsoapFilePlayabilityTest($audio_file)) {
|
||||||
return array(
|
return array(
|
||||||
"code" => 110,
|
"code" => 110,
|
||||||
"message" => "This file appears to be corrupted and will not
|
"message" => _("This file appears to be corrupted and will not "
|
||||||
be added to media library.");
|
."be added to media library."));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Did all the checks for real, now trying to copy
|
// Did all the checks for real, now trying to copy
|
||||||
|
@ -989,10 +1005,9 @@ SQL;
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
"code" => 108,
|
"code" => 108,
|
||||||
"message" => "
|
"message" => _("The file was not uploaded, this error can occur if the computer "
|
||||||
The file was not uploaded, this error can occur if the computer
|
."hard drive does not have enough disk space or the stor "
|
||||||
hard drive does not have enough disk space or the stor
|
."directory does not have correct write permissions."));
|
||||||
directory does not have correct write permissions.");
|
|
||||||
}
|
}
|
||||||
// Now that we successfully added this file, we will add another tag
|
// Now that we successfully added this file, we will add another tag
|
||||||
// file that will identify the user that owns it
|
// file that will identify the user that owns it
|
||||||
|
@ -1039,6 +1054,10 @@ FROM CC_FILES AS f
|
||||||
WHERE f.directory = :dir_id
|
WHERE f.directory = :dir_id
|
||||||
SQL;
|
SQL;
|
||||||
|
|
||||||
|
# TODO : the option $all is deprecated now and is always true.
|
||||||
|
# refactor code where it's still being passed
|
||||||
|
$all = true;
|
||||||
|
|
||||||
if (!$all) {
|
if (!$all) {
|
||||||
$sql .= " AND f.file_exists = 'TRUE'";
|
$sql .= " AND f.file_exists = 'TRUE'";
|
||||||
}
|
}
|
||||||
|
@ -1171,16 +1190,25 @@ SQL;
|
||||||
$this->_file->setDbFileExists($flag)
|
$this->_file->setDbFileExists($flag)
|
||||||
->save();
|
->save();
|
||||||
}
|
}
|
||||||
|
public function setFileHiddenFlag($flag)
|
||||||
|
{
|
||||||
|
$this->_file->setDbHidden($flag)
|
||||||
|
->save();
|
||||||
|
}
|
||||||
public function setSoundCloudUploadTime($time)
|
public function setSoundCloudUploadTime($time)
|
||||||
{
|
{
|
||||||
$this->_file->setDbSoundCloundUploadTime($time)
|
$this->_file->setDbSoundCloundUploadTime($time)
|
||||||
->save();
|
->save();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getFileExistsFlag()
|
|
||||||
{
|
// This method seems to be unsued everywhere so I've commented it out
|
||||||
return $this->_file->getDbFileExists();
|
// If it's absence does not have any effect then it will be completely
|
||||||
}
|
// removed soon
|
||||||
|
//public function getFileExistsFlag()
|
||||||
|
//{
|
||||||
|
//return $this->_file->getDbFileExists();
|
||||||
|
//}
|
||||||
|
|
||||||
public function getFileOwnerId()
|
public function getFileOwnerId()
|
||||||
{
|
{
|
||||||
|
@ -1190,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)) {
|
||||||
|
|
|
@ -163,7 +163,7 @@ class Application_Model_StreamSetting
|
||||||
$con = Propel::getConnection();
|
$con = Propel::getConnection();
|
||||||
$sql = "SELECT *"
|
$sql = "SELECT *"
|
||||||
." FROM cc_stream_setting"
|
." FROM cc_stream_setting"
|
||||||
." WHERE keyname not like '%_error'";
|
." WHERE keyname not like '%_error' AND keyname not like '%_admin_%'";
|
||||||
|
|
||||||
$rows = $con->query($sql)->fetchAll();
|
$rows = $con->query($sql)->fetchAll();
|
||||||
|
|
||||||
|
@ -433,4 +433,37 @@ class Application_Model_StreamSetting
|
||||||
{
|
{
|
||||||
return self::getValue("dj_live_stream_mp");
|
return self::getValue("dj_live_stream_mp");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function getAdminUser($stream){
|
||||||
|
return self::getValue($stream."_admin_user");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function setAdminUser($stream, $v){
|
||||||
|
self::setValue($stream."_admin_user", $v, "string");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getAdminPass($stream){
|
||||||
|
return self::getValue($stream."_admin_pass");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function setAdminPass($stream, $v){
|
||||||
|
self::setValue($stream."_admin_pass", $v, "string");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getOffAirMeta(){
|
||||||
|
return self::getValue("off_air_meta");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function setOffAirMeta($offAirMeta){
|
||||||
|
self::setValue("off_air_meta", $offAirMeta, "string");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function GetAllListenerStatErrors(){
|
||||||
|
$sql = "SELECT * FROM cc_stream_setting WHERE keyname like :p1";
|
||||||
|
return Application_Common_Database::prepareAndExecute($sql, array(':p1'=>'%_listener_stat_error'));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function SetListenerStatError($key, $v) {
|
||||||
|
self::setValue($key, $v, 'string');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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'];
|
||||||
|
|
||||||
|
|
|
@ -154,12 +154,12 @@ class Application_Model_Webstream implements Application_Model_LibraryEditable
|
||||||
|
|
||||||
if ($totalMinutes == 0) {
|
if ($totalMinutes == 0) {
|
||||||
$valid['length'][0] = false;
|
$valid['length'][0] = false;
|
||||||
$valid['length'][1] = 'Length needs to be greater than 0 minutes';
|
$valid['length'][1] = _('Length needs to be greater than 0 minutes');
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$valid['length'][0] = false;
|
$valid['length'][0] = false;
|
||||||
$valid['length'][1] = 'Length should be of form "00h 00m"';
|
$valid['length'][1] = _('Length should be of form "00h 00m"');
|
||||||
}
|
}
|
||||||
|
|
||||||
$url = $parameters["url"];
|
$url = $parameters["url"];
|
||||||
|
@ -172,16 +172,16 @@ class Application_Model_Webstream implements Application_Model_LibraryEditable
|
||||||
$mediaUrl = null;
|
$mediaUrl = null;
|
||||||
if ($result == 0) {
|
if ($result == 0) {
|
||||||
$valid['url'][0] = false;
|
$valid['url'][0] = false;
|
||||||
$valid['url'][1] = 'URL should be of form "http://domain"';
|
$valid['url'][1] = _('URL should be of form "http://domain"');
|
||||||
} elseif (strlen($url) > 512) {
|
} elseif (strlen($url) > 512) {
|
||||||
$valid['url'][0] = false;
|
$valid['url'][0] = false;
|
||||||
$valid['url'][1] = 'URL should be 512 characters or less';
|
$valid['url'][1] = _('URL should be 512 characters or less');
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
list($mime, $content_length_found) = self::discoverStreamMime($url);
|
list($mime, $content_length_found) = self::discoverStreamMime($url);
|
||||||
if (is_null($mime)) {
|
if (is_null($mime)) {
|
||||||
throw new Exception("No MIME type found for webstream.");
|
throw new Exception(_("No MIME type found for webstream."));
|
||||||
}
|
}
|
||||||
$mediaUrl = self::getMediaUrl($url, $mime, $content_length_found);
|
$mediaUrl = self::getMediaUrl($url, $mime, $content_length_found);
|
||||||
|
|
||||||
|
@ -197,7 +197,7 @@ class Application_Model_Webstream implements Application_Model_LibraryEditable
|
||||||
$name = $parameters["name"];
|
$name = $parameters["name"];
|
||||||
if (strlen($name) == 0) {
|
if (strlen($name) == 0) {
|
||||||
$valid['name'][0] = false;
|
$valid['name'][0] = false;
|
||||||
$valid['name'][1] = 'Webstream name cannot be empty';
|
$valid['name'][1] = _('Webstream name cannot be empty');
|
||||||
}
|
}
|
||||||
|
|
||||||
$id = $parameters["id"];
|
$id = $parameters["id"];
|
||||||
|
@ -266,7 +266,7 @@ class Application_Model_Webstream implements Application_Model_LibraryEditable
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new Exception("Could not parse XSPF playlist");
|
throw new Exception(_("Could not parse XSPF playlist"));
|
||||||
}
|
}
|
||||||
|
|
||||||
private static function getPlsUrl($url)
|
private static function getPlsUrl($url)
|
||||||
|
@ -278,7 +278,7 @@ class Application_Model_Webstream implements Application_Model_LibraryEditable
|
||||||
return $ini["playlist"]["File1"];
|
return $ini["playlist"]["File1"];
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new Exception("Could not parse PLS playlist");
|
throw new Exception(_("Could not parse PLS playlist"));
|
||||||
}
|
}
|
||||||
|
|
||||||
private static function getM3uUrl($url)
|
private static function getM3uUrl($url)
|
||||||
|
@ -297,7 +297,7 @@ class Application_Model_Webstream implements Application_Model_LibraryEditable
|
||||||
return $lines[0];
|
return $lines[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new Exception("Could not parse M3U playlist");
|
throw new Exception(_("Could not parse M3U playlist"));
|
||||||
}
|
}
|
||||||
|
|
||||||
private static function getMediaUrl($url, $mime, $content_length_found)
|
private static function getMediaUrl($url, $mime, $content_length_found)
|
||||||
|
@ -311,11 +311,11 @@ class Application_Model_Webstream implements Application_Model_LibraryEditable
|
||||||
$media_url = self::getPlsUrl($url);
|
$media_url = self::getPlsUrl($url);
|
||||||
} elseif (preg_match("/(mpeg|ogg|audio\/aacp)/", $mime)) {
|
} elseif (preg_match("/(mpeg|ogg|audio\/aacp)/", $mime)) {
|
||||||
if ($content_length_found) {
|
if ($content_length_found) {
|
||||||
throw new Exception("Invalid webstream - This appears to be a file download.");
|
throw new Exception(_("Invalid webstream - This appears to be a file download."));
|
||||||
}
|
}
|
||||||
$media_url = $url;
|
$media_url = $url;
|
||||||
} else {
|
} else {
|
||||||
throw new Exception("Unrecognized stream type: $mime");
|
throw new Exception(sprintf(_("Unrecognized stream type: %s"), $mime));
|
||||||
}
|
}
|
||||||
|
|
||||||
return $media_url;
|
return $media_url;
|
||||||
|
|
|
@ -41,6 +41,11 @@ class CcFiles extends BaseCcFiles {
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// returns true if the file exists and is not hidden
|
||||||
|
public function visible() {
|
||||||
|
return $this->getDbFileExists() && !$this->getDbHidden();
|
||||||
|
}
|
||||||
|
|
||||||
public function reassignTo($user)
|
public function reassignTo($user)
|
||||||
{
|
{
|
||||||
$this->setDbOwnerId( $user->getDbId() );
|
$this->setDbOwnerId( $user->getDbId() );
|
||||||
|
|
18
airtime_mvc/application/models/airtime/CcLocale.php
Normal file
18
airtime_mvc/application/models/airtime/CcLocale.php
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Skeleton subclass for representing a row from the 'cc_locale' table.
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* You should add additional methods to this class to meet the
|
||||||
|
* application requirements. This class will only be generated as
|
||||||
|
* long as it does not already exist in the output directory.
|
||||||
|
*
|
||||||
|
* @package propel.generator.airtime
|
||||||
|
*/
|
||||||
|
class CcLocale extends BaseCcLocale {
|
||||||
|
|
||||||
|
} // CcLocale
|
18
airtime_mvc/application/models/airtime/CcLocalePeer.php
Normal file
18
airtime_mvc/application/models/airtime/CcLocalePeer.php
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Skeleton subclass for performing query and update operations on the 'cc_locale' table.
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* You should add additional methods to this class to meet the
|
||||||
|
* application requirements. This class will only be generated as
|
||||||
|
* long as it does not already exist in the output directory.
|
||||||
|
*
|
||||||
|
* @package propel.generator.airtime
|
||||||
|
*/
|
||||||
|
class CcLocalePeer extends BaseCcLocalePeer {
|
||||||
|
|
||||||
|
} // CcLocalePeer
|
18
airtime_mvc/application/models/airtime/CcLocaleQuery.php
Normal file
18
airtime_mvc/application/models/airtime/CcLocaleQuery.php
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Skeleton subclass for performing query and update operations on the 'cc_locale' table.
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* You should add additional methods to this class to meet the
|
||||||
|
* application requirements. This class will only be generated as
|
||||||
|
* long as it does not already exist in the output directory.
|
||||||
|
*
|
||||||
|
* @package propel.generator.airtime
|
||||||
|
*/
|
||||||
|
class CcLocaleQuery extends BaseCcLocaleQuery {
|
||||||
|
|
||||||
|
} // CcLocaleQuery
|
|
@ -89,9 +89,9 @@ class CcPlaylist extends BaseCcPlaylist {
|
||||||
{
|
{
|
||||||
$sql = <<<SQL
|
$sql = <<<SQL
|
||||||
SELECT SUM(cliplength) FROM cc_playlistcontents as pc
|
SELECT SUM(cliplength) FROM cc_playlistcontents as pc
|
||||||
JOIN cc_files as f ON pc.file_id = f.id
|
LEFT JOIN cc_files as f ON pc.file_id = f.id
|
||||||
WHERE PLAYLIST_ID = :p1
|
WHERE PLAYLIST_ID = :p1
|
||||||
AND f.file_exists = true
|
AND f.file_exists is NUll or f.file_exists = true
|
||||||
SQL;
|
SQL;
|
||||||
$stmt = $con->prepare($sql);
|
$stmt = $con->prepare($sql);
|
||||||
$stmt->bindValue(':p1', $this->getDbId());
|
$stmt->bindValue(':p1', $this->getDbId());
|
||||||
|
|
|
@ -68,6 +68,7 @@ class CcPlaylistcontents extends BaseCcPlaylistcontents {
|
||||||
$this->fadein = $dt->format('H:i:s').".".$microsecond;
|
$this->fadein = $dt->format('H:i:s').".".$microsecond;
|
||||||
}
|
}
|
||||||
$this->modifiedColumns[] = CcPlaylistcontentsPeer::FADEIN;
|
$this->modifiedColumns[] = CcPlaylistcontentsPeer::FADEIN;
|
||||||
|
$this->save();
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
} // setDbFadein()
|
} // setDbFadein()
|
||||||
|
@ -105,6 +106,7 @@ class CcPlaylistcontents extends BaseCcPlaylistcontents {
|
||||||
$this->fadeout = $dt->format('H:i:s').".".$microsecond;
|
$this->fadeout = $dt->format('H:i:s').".".$microsecond;
|
||||||
}
|
}
|
||||||
$this->modifiedColumns[] = CcPlaylistcontentsPeer::FADEOUT;
|
$this->modifiedColumns[] = CcPlaylistcontentsPeer::FADEOUT;
|
||||||
|
$this->save();
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
} // setDbFadeout()
|
} // setDbFadeout()
|
||||||
|
|
|
@ -102,6 +102,9 @@ class CcFilesTableMap extends TableMap {
|
||||||
$this->addColumn('SOUNDCLOUD_UPLOAD_TIME', 'DbSoundCloundUploadTime', 'TIMESTAMP', false, 6, null);
|
$this->addColumn('SOUNDCLOUD_UPLOAD_TIME', 'DbSoundCloundUploadTime', 'TIMESTAMP', false, 6, null);
|
||||||
$this->addColumn('REPLAY_GAIN', 'DbReplayGain', 'NUMERIC', false, null, null);
|
$this->addColumn('REPLAY_GAIN', 'DbReplayGain', 'NUMERIC', false, null, null);
|
||||||
$this->addForeignKey('OWNER_ID', 'DbOwnerId', 'INTEGER', 'cc_subjs', 'ID', false, null, null);
|
$this->addForeignKey('OWNER_ID', 'DbOwnerId', 'INTEGER', 'cc_subjs', 'ID', false, null, null);
|
||||||
|
$this->addColumn('CUEIN', 'DbCuein', 'VARCHAR', false, null, '00:00:00');
|
||||||
|
$this->addColumn('CUEOUT', 'DbCueout', 'VARCHAR', false, null, '00:00:00');
|
||||||
|
$this->addColumn('HIDDEN', 'DbHidden', 'BOOLEAN', false, null, false);
|
||||||
// validators
|
// validators
|
||||||
} // initialize()
|
} // initialize()
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,54 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class defines the structure of the 'cc_locale' table.
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* This map class is used by Propel to do runtime db structure discovery.
|
||||||
|
* For example, the createSelectSql() method checks the type of a given column used in an
|
||||||
|
* ORDER BY clause to know whether it needs to apply SQL to make the ORDER BY case-insensitive
|
||||||
|
* (i.e. if it's a text column type).
|
||||||
|
*
|
||||||
|
* @package propel.generator.airtime.map
|
||||||
|
*/
|
||||||
|
class CcLocaleTableMap extends TableMap {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The (dot-path) name of this class
|
||||||
|
*/
|
||||||
|
const CLASS_NAME = 'airtime.map.CcLocaleTableMap';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initialize the table attributes, columns and validators
|
||||||
|
* Relations are not initialized by this method since they are lazy loaded
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
* @throws PropelException
|
||||||
|
*/
|
||||||
|
public function initialize()
|
||||||
|
{
|
||||||
|
// attributes
|
||||||
|
$this->setName('cc_locale');
|
||||||
|
$this->setPhpName('CcLocale');
|
||||||
|
$this->setClassname('CcLocale');
|
||||||
|
$this->setPackage('airtime');
|
||||||
|
$this->setUseIdGenerator(true);
|
||||||
|
$this->setPrimaryKeyMethodInfo('cc_locale_id_seq');
|
||||||
|
// columns
|
||||||
|
$this->addPrimaryKey('ID', 'DbId', 'INTEGER', true, null, null);
|
||||||
|
$this->addColumn('LOCALE_CODE', 'DbLocaleCode', 'VARCHAR', true, 16, null);
|
||||||
|
$this->addColumn('LOCALE_LANG', 'DbLocaleLang', 'VARCHAR', true, 128, null);
|
||||||
|
// validators
|
||||||
|
} // initialize()
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Build the RelationMap objects for this table relationships
|
||||||
|
*/
|
||||||
|
public function buildRelations()
|
||||||
|
{
|
||||||
|
} // buildRelations()
|
||||||
|
|
||||||
|
} // CcLocaleTableMap
|
|
@ -416,6 +416,27 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
|
||||||
*/
|
*/
|
||||||
protected $owner_id;
|
protected $owner_id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The value for the cuein field.
|
||||||
|
* Note: this column has a database default value of: '00:00:00'
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $cuein;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The value for the cueout field.
|
||||||
|
* Note: this column has a database default value of: '00:00:00'
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $cueout;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The value for the hidden field.
|
||||||
|
* Note: this column has a database default value of: false
|
||||||
|
* @var boolean
|
||||||
|
*/
|
||||||
|
protected $hidden;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var CcSubjs
|
* @var CcSubjs
|
||||||
*/
|
*/
|
||||||
|
@ -481,6 +502,9 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
|
||||||
$this->currentlyaccessing = 0;
|
$this->currentlyaccessing = 0;
|
||||||
$this->length = '00:00:00';
|
$this->length = '00:00:00';
|
||||||
$this->file_exists = true;
|
$this->file_exists = true;
|
||||||
|
$this->cuein = '00:00:00';
|
||||||
|
$this->cueout = '00:00:00';
|
||||||
|
$this->hidden = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1225,6 +1249,36 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
|
||||||
return $this->owner_id;
|
return $this->owner_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the [cuein] column value.
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getDbCuein()
|
||||||
|
{
|
||||||
|
return $this->cuein;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the [cueout] column value.
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getDbCueout()
|
||||||
|
{
|
||||||
|
return $this->cueout;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the [hidden] column value.
|
||||||
|
*
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
|
public function getDbHidden()
|
||||||
|
{
|
||||||
|
return $this->hidden;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the value of [id] column.
|
* Set the value of [id] column.
|
||||||
*
|
*
|
||||||
|
@ -2633,6 +2687,66 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
|
||||||
return $this;
|
return $this;
|
||||||
} // setDbOwnerId()
|
} // setDbOwnerId()
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the value of [cuein] column.
|
||||||
|
*
|
||||||
|
* @param string $v new value
|
||||||
|
* @return CcFiles The current object (for fluent API support)
|
||||||
|
*/
|
||||||
|
public function setDbCuein($v)
|
||||||
|
{
|
||||||
|
if ($v !== null) {
|
||||||
|
$v = (string) $v;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($this->cuein !== $v || $this->isNew()) {
|
||||||
|
$this->cuein = $v;
|
||||||
|
$this->modifiedColumns[] = CcFilesPeer::CUEIN;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
} // setDbCuein()
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the value of [cueout] column.
|
||||||
|
*
|
||||||
|
* @param string $v new value
|
||||||
|
* @return CcFiles The current object (for fluent API support)
|
||||||
|
*/
|
||||||
|
public function setDbCueout($v)
|
||||||
|
{
|
||||||
|
if ($v !== null) {
|
||||||
|
$v = (string) $v;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($this->cueout !== $v || $this->isNew()) {
|
||||||
|
$this->cueout = $v;
|
||||||
|
$this->modifiedColumns[] = CcFilesPeer::CUEOUT;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
} // setDbCueout()
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the value of [hidden] column.
|
||||||
|
*
|
||||||
|
* @param boolean $v new value
|
||||||
|
* @return CcFiles The current object (for fluent API support)
|
||||||
|
*/
|
||||||
|
public function setDbHidden($v)
|
||||||
|
{
|
||||||
|
if ($v !== null) {
|
||||||
|
$v = (boolean) $v;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($this->hidden !== $v || $this->isNew()) {
|
||||||
|
$this->hidden = $v;
|
||||||
|
$this->modifiedColumns[] = CcFilesPeer::HIDDEN;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
} // setDbHidden()
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Indicates whether the columns in this object are only set to default values.
|
* Indicates whether the columns in this object are only set to default values.
|
||||||
*
|
*
|
||||||
|
@ -2675,6 +2789,18 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($this->cuein !== '00:00:00') {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($this->cueout !== '00:00:00') {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($this->hidden !== false) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// otherwise, everything was equal, so return TRUE
|
// otherwise, everything was equal, so return TRUE
|
||||||
return true;
|
return true;
|
||||||
} // hasOnlyDefaultValues()
|
} // hasOnlyDefaultValues()
|
||||||
|
@ -2761,6 +2887,9 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
|
||||||
$this->soundcloud_upload_time = ($row[$startcol + 61] !== null) ? (string) $row[$startcol + 61] : null;
|
$this->soundcloud_upload_time = ($row[$startcol + 61] !== null) ? (string) $row[$startcol + 61] : null;
|
||||||
$this->replay_gain = ($row[$startcol + 62] !== null) ? (string) $row[$startcol + 62] : null;
|
$this->replay_gain = ($row[$startcol + 62] !== null) ? (string) $row[$startcol + 62] : null;
|
||||||
$this->owner_id = ($row[$startcol + 63] !== null) ? (int) $row[$startcol + 63] : null;
|
$this->owner_id = ($row[$startcol + 63] !== null) ? (int) $row[$startcol + 63] : null;
|
||||||
|
$this->cuein = ($row[$startcol + 64] !== null) ? (string) $row[$startcol + 64] : null;
|
||||||
|
$this->cueout = ($row[$startcol + 65] !== null) ? (string) $row[$startcol + 65] : null;
|
||||||
|
$this->hidden = ($row[$startcol + 66] !== null) ? (boolean) $row[$startcol + 66] : null;
|
||||||
$this->resetModified();
|
$this->resetModified();
|
||||||
|
|
||||||
$this->setNew(false);
|
$this->setNew(false);
|
||||||
|
@ -2769,7 +2898,7 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
|
||||||
$this->ensureConsistency();
|
$this->ensureConsistency();
|
||||||
}
|
}
|
||||||
|
|
||||||
return $startcol + 64; // 64 = CcFilesPeer::NUM_COLUMNS - CcFilesPeer::NUM_LAZY_LOAD_COLUMNS).
|
return $startcol + 67; // 67 = CcFilesPeer::NUM_COLUMNS - CcFilesPeer::NUM_LAZY_LOAD_COLUMNS).
|
||||||
|
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
throw new PropelException("Error populating CcFiles object", $e);
|
throw new PropelException("Error populating CcFiles object", $e);
|
||||||
|
@ -3394,6 +3523,15 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
|
||||||
case 63:
|
case 63:
|
||||||
return $this->getDbOwnerId();
|
return $this->getDbOwnerId();
|
||||||
break;
|
break;
|
||||||
|
case 64:
|
||||||
|
return $this->getDbCuein();
|
||||||
|
break;
|
||||||
|
case 65:
|
||||||
|
return $this->getDbCueout();
|
||||||
|
break;
|
||||||
|
case 66:
|
||||||
|
return $this->getDbHidden();
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
return null;
|
return null;
|
||||||
break;
|
break;
|
||||||
|
@ -3482,6 +3620,9 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
|
||||||
$keys[61] => $this->getDbSoundCloundUploadTime(),
|
$keys[61] => $this->getDbSoundCloundUploadTime(),
|
||||||
$keys[62] => $this->getDbReplayGain(),
|
$keys[62] => $this->getDbReplayGain(),
|
||||||
$keys[63] => $this->getDbOwnerId(),
|
$keys[63] => $this->getDbOwnerId(),
|
||||||
|
$keys[64] => $this->getDbCuein(),
|
||||||
|
$keys[65] => $this->getDbCueout(),
|
||||||
|
$keys[66] => $this->getDbHidden(),
|
||||||
);
|
);
|
||||||
if ($includeForeignObjects) {
|
if ($includeForeignObjects) {
|
||||||
if (null !== $this->aFkOwner) {
|
if (null !== $this->aFkOwner) {
|
||||||
|
@ -3716,6 +3857,15 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
|
||||||
case 63:
|
case 63:
|
||||||
$this->setDbOwnerId($value);
|
$this->setDbOwnerId($value);
|
||||||
break;
|
break;
|
||||||
|
case 64:
|
||||||
|
$this->setDbCuein($value);
|
||||||
|
break;
|
||||||
|
case 65:
|
||||||
|
$this->setDbCueout($value);
|
||||||
|
break;
|
||||||
|
case 66:
|
||||||
|
$this->setDbHidden($value);
|
||||||
|
break;
|
||||||
} // switch()
|
} // switch()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3804,6 +3954,9 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
|
||||||
if (array_key_exists($keys[61], $arr)) $this->setDbSoundCloundUploadTime($arr[$keys[61]]);
|
if (array_key_exists($keys[61], $arr)) $this->setDbSoundCloundUploadTime($arr[$keys[61]]);
|
||||||
if (array_key_exists($keys[62], $arr)) $this->setDbReplayGain($arr[$keys[62]]);
|
if (array_key_exists($keys[62], $arr)) $this->setDbReplayGain($arr[$keys[62]]);
|
||||||
if (array_key_exists($keys[63], $arr)) $this->setDbOwnerId($arr[$keys[63]]);
|
if (array_key_exists($keys[63], $arr)) $this->setDbOwnerId($arr[$keys[63]]);
|
||||||
|
if (array_key_exists($keys[64], $arr)) $this->setDbCuein($arr[$keys[64]]);
|
||||||
|
if (array_key_exists($keys[65], $arr)) $this->setDbCueout($arr[$keys[65]]);
|
||||||
|
if (array_key_exists($keys[66], $arr)) $this->setDbHidden($arr[$keys[66]]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -3879,6 +4032,9 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
|
||||||
if ($this->isColumnModified(CcFilesPeer::SOUNDCLOUD_UPLOAD_TIME)) $criteria->add(CcFilesPeer::SOUNDCLOUD_UPLOAD_TIME, $this->soundcloud_upload_time);
|
if ($this->isColumnModified(CcFilesPeer::SOUNDCLOUD_UPLOAD_TIME)) $criteria->add(CcFilesPeer::SOUNDCLOUD_UPLOAD_TIME, $this->soundcloud_upload_time);
|
||||||
if ($this->isColumnModified(CcFilesPeer::REPLAY_GAIN)) $criteria->add(CcFilesPeer::REPLAY_GAIN, $this->replay_gain);
|
if ($this->isColumnModified(CcFilesPeer::REPLAY_GAIN)) $criteria->add(CcFilesPeer::REPLAY_GAIN, $this->replay_gain);
|
||||||
if ($this->isColumnModified(CcFilesPeer::OWNER_ID)) $criteria->add(CcFilesPeer::OWNER_ID, $this->owner_id);
|
if ($this->isColumnModified(CcFilesPeer::OWNER_ID)) $criteria->add(CcFilesPeer::OWNER_ID, $this->owner_id);
|
||||||
|
if ($this->isColumnModified(CcFilesPeer::CUEIN)) $criteria->add(CcFilesPeer::CUEIN, $this->cuein);
|
||||||
|
if ($this->isColumnModified(CcFilesPeer::CUEOUT)) $criteria->add(CcFilesPeer::CUEOUT, $this->cueout);
|
||||||
|
if ($this->isColumnModified(CcFilesPeer::HIDDEN)) $criteria->add(CcFilesPeer::HIDDEN, $this->hidden);
|
||||||
|
|
||||||
return $criteria;
|
return $criteria;
|
||||||
}
|
}
|
||||||
|
@ -4003,6 +4159,9 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
|
||||||
$copyObj->setDbSoundCloundUploadTime($this->soundcloud_upload_time);
|
$copyObj->setDbSoundCloundUploadTime($this->soundcloud_upload_time);
|
||||||
$copyObj->setDbReplayGain($this->replay_gain);
|
$copyObj->setDbReplayGain($this->replay_gain);
|
||||||
$copyObj->setDbOwnerId($this->owner_id);
|
$copyObj->setDbOwnerId($this->owner_id);
|
||||||
|
$copyObj->setDbCuein($this->cuein);
|
||||||
|
$copyObj->setDbCueout($this->cueout);
|
||||||
|
$copyObj->setDbHidden($this->hidden);
|
||||||
|
|
||||||
if ($deepCopy) {
|
if ($deepCopy) {
|
||||||
// important: temporarily setNew(false) because this affects the behavior of
|
// important: temporarily setNew(false) because this affects the behavior of
|
||||||
|
@ -4905,6 +5064,9 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
|
||||||
$this->soundcloud_upload_time = null;
|
$this->soundcloud_upload_time = null;
|
||||||
$this->replay_gain = null;
|
$this->replay_gain = null;
|
||||||
$this->owner_id = null;
|
$this->owner_id = null;
|
||||||
|
$this->cuein = null;
|
||||||
|
$this->cueout = null;
|
||||||
|
$this->hidden = null;
|
||||||
$this->alreadyInSave = false;
|
$this->alreadyInSave = false;
|
||||||
$this->alreadyInValidation = false;
|
$this->alreadyInValidation = false;
|
||||||
$this->clearAllReferences();
|
$this->clearAllReferences();
|
||||||
|
|
|
@ -26,7 +26,7 @@ abstract class BaseCcFilesPeer {
|
||||||
const TM_CLASS = 'CcFilesTableMap';
|
const TM_CLASS = 'CcFilesTableMap';
|
||||||
|
|
||||||
/** The total number of columns. */
|
/** The total number of columns. */
|
||||||
const NUM_COLUMNS = 64;
|
const NUM_COLUMNS = 67;
|
||||||
|
|
||||||
/** The number of lazy-loaded columns. */
|
/** The number of lazy-loaded columns. */
|
||||||
const NUM_LAZY_LOAD_COLUMNS = 0;
|
const NUM_LAZY_LOAD_COLUMNS = 0;
|
||||||
|
@ -223,6 +223,15 @@ abstract class BaseCcFilesPeer {
|
||||||
/** the column name for the OWNER_ID field */
|
/** the column name for the OWNER_ID field */
|
||||||
const OWNER_ID = 'cc_files.OWNER_ID';
|
const OWNER_ID = 'cc_files.OWNER_ID';
|
||||||
|
|
||||||
|
/** the column name for the CUEIN field */
|
||||||
|
const CUEIN = 'cc_files.CUEIN';
|
||||||
|
|
||||||
|
/** the column name for the CUEOUT field */
|
||||||
|
const CUEOUT = 'cc_files.CUEOUT';
|
||||||
|
|
||||||
|
/** the column name for the HIDDEN field */
|
||||||
|
const HIDDEN = 'cc_files.HIDDEN';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An identiy map to hold any loaded instances of CcFiles objects.
|
* An identiy map to hold any loaded instances of CcFiles objects.
|
||||||
* This must be public so that other peer classes can access this when hydrating from JOIN
|
* This must be public so that other peer classes can access this when hydrating from JOIN
|
||||||
|
@ -239,12 +248,12 @@ abstract class BaseCcFilesPeer {
|
||||||
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
|
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
|
||||||
*/
|
*/
|
||||||
private static $fieldNames = array (
|
private static $fieldNames = array (
|
||||||
BasePeer::TYPE_PHPNAME => array ('DbId', 'DbName', 'DbMime', 'DbFtype', 'DbDirectory', 'DbFilepath', 'DbState', 'DbCurrentlyaccessing', 'DbEditedby', 'DbMtime', 'DbUtime', 'DbLPtime', 'DbMd5', 'DbTrackTitle', 'DbArtistName', 'DbBitRate', 'DbSampleRate', 'DbFormat', 'DbLength', 'DbAlbumTitle', 'DbGenre', 'DbComments', 'DbYear', 'DbTrackNumber', 'DbChannels', 'DbUrl', 'DbBpm', 'DbRating', 'DbEncodedBy', 'DbDiscNumber', 'DbMood', 'DbLabel', 'DbComposer', 'DbEncoder', 'DbChecksum', 'DbLyrics', 'DbOrchestra', 'DbConductor', 'DbLyricist', 'DbOriginalLyricist', 'DbRadioStationName', 'DbInfoUrl', 'DbArtistUrl', 'DbAudioSourceUrl', 'DbRadioStationUrl', 'DbBuyThisUrl', 'DbIsrcNumber', 'DbCatalogNumber', 'DbOriginalArtist', 'DbCopyright', 'DbReportDatetime', 'DbReportLocation', 'DbReportOrganization', 'DbSubject', 'DbContributor', 'DbLanguage', 'DbFileExists', 'DbSoundcloudId', 'DbSoundcloudErrorCode', 'DbSoundcloudErrorMsg', 'DbSoundcloudLinkToFile', 'DbSoundCloundUploadTime', 'DbReplayGain', 'DbOwnerId', ),
|
BasePeer::TYPE_PHPNAME => array ('DbId', 'DbName', 'DbMime', 'DbFtype', 'DbDirectory', 'DbFilepath', 'DbState', 'DbCurrentlyaccessing', 'DbEditedby', 'DbMtime', 'DbUtime', 'DbLPtime', 'DbMd5', 'DbTrackTitle', 'DbArtistName', 'DbBitRate', 'DbSampleRate', 'DbFormat', 'DbLength', 'DbAlbumTitle', 'DbGenre', 'DbComments', 'DbYear', 'DbTrackNumber', 'DbChannels', 'DbUrl', 'DbBpm', 'DbRating', 'DbEncodedBy', 'DbDiscNumber', 'DbMood', 'DbLabel', 'DbComposer', 'DbEncoder', 'DbChecksum', 'DbLyrics', 'DbOrchestra', 'DbConductor', 'DbLyricist', 'DbOriginalLyricist', 'DbRadioStationName', 'DbInfoUrl', 'DbArtistUrl', 'DbAudioSourceUrl', 'DbRadioStationUrl', 'DbBuyThisUrl', 'DbIsrcNumber', 'DbCatalogNumber', 'DbOriginalArtist', 'DbCopyright', 'DbReportDatetime', 'DbReportLocation', 'DbReportOrganization', 'DbSubject', 'DbContributor', 'DbLanguage', 'DbFileExists', 'DbSoundcloudId', 'DbSoundcloudErrorCode', 'DbSoundcloudErrorMsg', 'DbSoundcloudLinkToFile', 'DbSoundCloundUploadTime', 'DbReplayGain', 'DbOwnerId', 'DbCuein', 'DbCueout', 'DbHidden', ),
|
||||||
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbName', 'dbMime', 'dbFtype', 'dbDirectory', 'dbFilepath', 'dbState', 'dbCurrentlyaccessing', 'dbEditedby', 'dbMtime', 'dbUtime', 'dbLPtime', 'dbMd5', 'dbTrackTitle', 'dbArtistName', 'dbBitRate', 'dbSampleRate', 'dbFormat', 'dbLength', 'dbAlbumTitle', 'dbGenre', 'dbComments', 'dbYear', 'dbTrackNumber', 'dbChannels', 'dbUrl', 'dbBpm', 'dbRating', 'dbEncodedBy', 'dbDiscNumber', 'dbMood', 'dbLabel', 'dbComposer', 'dbEncoder', 'dbChecksum', 'dbLyrics', 'dbOrchestra', 'dbConductor', 'dbLyricist', 'dbOriginalLyricist', 'dbRadioStationName', 'dbInfoUrl', 'dbArtistUrl', 'dbAudioSourceUrl', 'dbRadioStationUrl', 'dbBuyThisUrl', 'dbIsrcNumber', 'dbCatalogNumber', 'dbOriginalArtist', 'dbCopyright', 'dbReportDatetime', 'dbReportLocation', 'dbReportOrganization', 'dbSubject', 'dbContributor', 'dbLanguage', 'dbFileExists', 'dbSoundcloudId', 'dbSoundcloudErrorCode', 'dbSoundcloudErrorMsg', 'dbSoundcloudLinkToFile', 'dbSoundCloundUploadTime', 'dbReplayGain', 'dbOwnerId', ),
|
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbName', 'dbMime', 'dbFtype', 'dbDirectory', 'dbFilepath', 'dbState', 'dbCurrentlyaccessing', 'dbEditedby', 'dbMtime', 'dbUtime', 'dbLPtime', 'dbMd5', 'dbTrackTitle', 'dbArtistName', 'dbBitRate', 'dbSampleRate', 'dbFormat', 'dbLength', 'dbAlbumTitle', 'dbGenre', 'dbComments', 'dbYear', 'dbTrackNumber', 'dbChannels', 'dbUrl', 'dbBpm', 'dbRating', 'dbEncodedBy', 'dbDiscNumber', 'dbMood', 'dbLabel', 'dbComposer', 'dbEncoder', 'dbChecksum', 'dbLyrics', 'dbOrchestra', 'dbConductor', 'dbLyricist', 'dbOriginalLyricist', 'dbRadioStationName', 'dbInfoUrl', 'dbArtistUrl', 'dbAudioSourceUrl', 'dbRadioStationUrl', 'dbBuyThisUrl', 'dbIsrcNumber', 'dbCatalogNumber', 'dbOriginalArtist', 'dbCopyright', 'dbReportDatetime', 'dbReportLocation', 'dbReportOrganization', 'dbSubject', 'dbContributor', 'dbLanguage', 'dbFileExists', 'dbSoundcloudId', 'dbSoundcloudErrorCode', 'dbSoundcloudErrorMsg', 'dbSoundcloudLinkToFile', 'dbSoundCloundUploadTime', 'dbReplayGain', 'dbOwnerId', 'dbCuein', 'dbCueout', 'dbHidden', ),
|
||||||
BasePeer::TYPE_COLNAME => array (self::ID, self::NAME, self::MIME, self::FTYPE, self::DIRECTORY, self::FILEPATH, self::STATE, self::CURRENTLYACCESSING, self::EDITEDBY, self::MTIME, self::UTIME, self::LPTIME, self::MD5, self::TRACK_TITLE, self::ARTIST_NAME, self::BIT_RATE, self::SAMPLE_RATE, self::FORMAT, self::LENGTH, self::ALBUM_TITLE, self::GENRE, self::COMMENTS, self::YEAR, self::TRACK_NUMBER, self::CHANNELS, self::URL, self::BPM, self::RATING, self::ENCODED_BY, self::DISC_NUMBER, self::MOOD, self::LABEL, self::COMPOSER, self::ENCODER, self::CHECKSUM, self::LYRICS, self::ORCHESTRA, self::CONDUCTOR, self::LYRICIST, self::ORIGINAL_LYRICIST, self::RADIO_STATION_NAME, self::INFO_URL, self::ARTIST_URL, self::AUDIO_SOURCE_URL, self::RADIO_STATION_URL, self::BUY_THIS_URL, self::ISRC_NUMBER, self::CATALOG_NUMBER, self::ORIGINAL_ARTIST, self::COPYRIGHT, self::REPORT_DATETIME, self::REPORT_LOCATION, self::REPORT_ORGANIZATION, self::SUBJECT, self::CONTRIBUTOR, self::LANGUAGE, self::FILE_EXISTS, self::SOUNDCLOUD_ID, self::SOUNDCLOUD_ERROR_CODE, self::SOUNDCLOUD_ERROR_MSG, self::SOUNDCLOUD_LINK_TO_FILE, self::SOUNDCLOUD_UPLOAD_TIME, self::REPLAY_GAIN, self::OWNER_ID, ),
|
BasePeer::TYPE_COLNAME => array (self::ID, self::NAME, self::MIME, self::FTYPE, self::DIRECTORY, self::FILEPATH, self::STATE, self::CURRENTLYACCESSING, self::EDITEDBY, self::MTIME, self::UTIME, self::LPTIME, self::MD5, self::TRACK_TITLE, self::ARTIST_NAME, self::BIT_RATE, self::SAMPLE_RATE, self::FORMAT, self::LENGTH, self::ALBUM_TITLE, self::GENRE, self::COMMENTS, self::YEAR, self::TRACK_NUMBER, self::CHANNELS, self::URL, self::BPM, self::RATING, self::ENCODED_BY, self::DISC_NUMBER, self::MOOD, self::LABEL, self::COMPOSER, self::ENCODER, self::CHECKSUM, self::LYRICS, self::ORCHESTRA, self::CONDUCTOR, self::LYRICIST, self::ORIGINAL_LYRICIST, self::RADIO_STATION_NAME, self::INFO_URL, self::ARTIST_URL, self::AUDIO_SOURCE_URL, self::RADIO_STATION_URL, self::BUY_THIS_URL, self::ISRC_NUMBER, self::CATALOG_NUMBER, self::ORIGINAL_ARTIST, self::COPYRIGHT, self::REPORT_DATETIME, self::REPORT_LOCATION, self::REPORT_ORGANIZATION, self::SUBJECT, self::CONTRIBUTOR, self::LANGUAGE, self::FILE_EXISTS, self::SOUNDCLOUD_ID, self::SOUNDCLOUD_ERROR_CODE, self::SOUNDCLOUD_ERROR_MSG, self::SOUNDCLOUD_LINK_TO_FILE, self::SOUNDCLOUD_UPLOAD_TIME, self::REPLAY_GAIN, self::OWNER_ID, self::CUEIN, self::CUEOUT, self::HIDDEN, ),
|
||||||
BasePeer::TYPE_RAW_COLNAME => array ('ID', 'NAME', 'MIME', 'FTYPE', 'DIRECTORY', 'FILEPATH', 'STATE', 'CURRENTLYACCESSING', 'EDITEDBY', 'MTIME', 'UTIME', 'LPTIME', 'MD5', 'TRACK_TITLE', 'ARTIST_NAME', 'BIT_RATE', 'SAMPLE_RATE', 'FORMAT', 'LENGTH', 'ALBUM_TITLE', 'GENRE', 'COMMENTS', 'YEAR', 'TRACK_NUMBER', 'CHANNELS', 'URL', 'BPM', 'RATING', 'ENCODED_BY', 'DISC_NUMBER', 'MOOD', 'LABEL', 'COMPOSER', 'ENCODER', 'CHECKSUM', 'LYRICS', 'ORCHESTRA', 'CONDUCTOR', 'LYRICIST', 'ORIGINAL_LYRICIST', 'RADIO_STATION_NAME', 'INFO_URL', 'ARTIST_URL', 'AUDIO_SOURCE_URL', 'RADIO_STATION_URL', 'BUY_THIS_URL', 'ISRC_NUMBER', 'CATALOG_NUMBER', 'ORIGINAL_ARTIST', 'COPYRIGHT', 'REPORT_DATETIME', 'REPORT_LOCATION', 'REPORT_ORGANIZATION', 'SUBJECT', 'CONTRIBUTOR', 'LANGUAGE', 'FILE_EXISTS', 'SOUNDCLOUD_ID', 'SOUNDCLOUD_ERROR_CODE', 'SOUNDCLOUD_ERROR_MSG', 'SOUNDCLOUD_LINK_TO_FILE', 'SOUNDCLOUD_UPLOAD_TIME', 'REPLAY_GAIN', 'OWNER_ID', ),
|
BasePeer::TYPE_RAW_COLNAME => array ('ID', 'NAME', 'MIME', 'FTYPE', 'DIRECTORY', 'FILEPATH', 'STATE', 'CURRENTLYACCESSING', 'EDITEDBY', 'MTIME', 'UTIME', 'LPTIME', 'MD5', 'TRACK_TITLE', 'ARTIST_NAME', 'BIT_RATE', 'SAMPLE_RATE', 'FORMAT', 'LENGTH', 'ALBUM_TITLE', 'GENRE', 'COMMENTS', 'YEAR', 'TRACK_NUMBER', 'CHANNELS', 'URL', 'BPM', 'RATING', 'ENCODED_BY', 'DISC_NUMBER', 'MOOD', 'LABEL', 'COMPOSER', 'ENCODER', 'CHECKSUM', 'LYRICS', 'ORCHESTRA', 'CONDUCTOR', 'LYRICIST', 'ORIGINAL_LYRICIST', 'RADIO_STATION_NAME', 'INFO_URL', 'ARTIST_URL', 'AUDIO_SOURCE_URL', 'RADIO_STATION_URL', 'BUY_THIS_URL', 'ISRC_NUMBER', 'CATALOG_NUMBER', 'ORIGINAL_ARTIST', 'COPYRIGHT', 'REPORT_DATETIME', 'REPORT_LOCATION', 'REPORT_ORGANIZATION', 'SUBJECT', 'CONTRIBUTOR', 'LANGUAGE', 'FILE_EXISTS', 'SOUNDCLOUD_ID', 'SOUNDCLOUD_ERROR_CODE', 'SOUNDCLOUD_ERROR_MSG', 'SOUNDCLOUD_LINK_TO_FILE', 'SOUNDCLOUD_UPLOAD_TIME', 'REPLAY_GAIN', 'OWNER_ID', 'CUEIN', 'CUEOUT', 'HIDDEN', ),
|
||||||
BasePeer::TYPE_FIELDNAME => array ('id', 'name', 'mime', 'ftype', 'directory', 'filepath', 'state', 'currentlyaccessing', 'editedby', 'mtime', 'utime', 'lptime', 'md5', 'track_title', 'artist_name', 'bit_rate', 'sample_rate', 'format', 'length', 'album_title', 'genre', 'comments', 'year', 'track_number', 'channels', 'url', 'bpm', 'rating', 'encoded_by', 'disc_number', 'mood', 'label', 'composer', 'encoder', 'checksum', 'lyrics', 'orchestra', 'conductor', 'lyricist', 'original_lyricist', 'radio_station_name', 'info_url', 'artist_url', 'audio_source_url', 'radio_station_url', 'buy_this_url', 'isrc_number', 'catalog_number', 'original_artist', 'copyright', 'report_datetime', 'report_location', 'report_organization', 'subject', 'contributor', 'language', 'file_exists', 'soundcloud_id', 'soundcloud_error_code', 'soundcloud_error_msg', 'soundcloud_link_to_file', 'soundcloud_upload_time', 'replay_gain', 'owner_id', ),
|
BasePeer::TYPE_FIELDNAME => array ('id', 'name', 'mime', 'ftype', 'directory', 'filepath', 'state', 'currentlyaccessing', 'editedby', 'mtime', 'utime', 'lptime', 'md5', 'track_title', 'artist_name', 'bit_rate', 'sample_rate', 'format', 'length', 'album_title', 'genre', 'comments', 'year', 'track_number', 'channels', 'url', 'bpm', 'rating', 'encoded_by', 'disc_number', 'mood', 'label', 'composer', 'encoder', 'checksum', 'lyrics', 'orchestra', 'conductor', 'lyricist', 'original_lyricist', 'radio_station_name', 'info_url', 'artist_url', 'audio_source_url', 'radio_station_url', 'buy_this_url', 'isrc_number', 'catalog_number', 'original_artist', 'copyright', 'report_datetime', 'report_location', 'report_organization', 'subject', 'contributor', 'language', 'file_exists', 'soundcloud_id', 'soundcloud_error_code', 'soundcloud_error_msg', 'soundcloud_link_to_file', 'soundcloud_upload_time', 'replay_gain', 'owner_id', 'cuein', 'cueout', 'hidden', ),
|
||||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, )
|
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, )
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -254,12 +263,12 @@ abstract class BaseCcFilesPeer {
|
||||||
* e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
|
* e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
|
||||||
*/
|
*/
|
||||||
private static $fieldKeys = array (
|
private static $fieldKeys = array (
|
||||||
BasePeer::TYPE_PHPNAME => array ('DbId' => 0, 'DbName' => 1, 'DbMime' => 2, 'DbFtype' => 3, 'DbDirectory' => 4, 'DbFilepath' => 5, 'DbState' => 6, 'DbCurrentlyaccessing' => 7, 'DbEditedby' => 8, 'DbMtime' => 9, 'DbUtime' => 10, 'DbLPtime' => 11, 'DbMd5' => 12, 'DbTrackTitle' => 13, 'DbArtistName' => 14, 'DbBitRate' => 15, 'DbSampleRate' => 16, 'DbFormat' => 17, 'DbLength' => 18, 'DbAlbumTitle' => 19, 'DbGenre' => 20, 'DbComments' => 21, 'DbYear' => 22, 'DbTrackNumber' => 23, 'DbChannels' => 24, 'DbUrl' => 25, 'DbBpm' => 26, 'DbRating' => 27, 'DbEncodedBy' => 28, 'DbDiscNumber' => 29, 'DbMood' => 30, 'DbLabel' => 31, 'DbComposer' => 32, 'DbEncoder' => 33, 'DbChecksum' => 34, 'DbLyrics' => 35, 'DbOrchestra' => 36, 'DbConductor' => 37, 'DbLyricist' => 38, 'DbOriginalLyricist' => 39, 'DbRadioStationName' => 40, 'DbInfoUrl' => 41, 'DbArtistUrl' => 42, 'DbAudioSourceUrl' => 43, 'DbRadioStationUrl' => 44, 'DbBuyThisUrl' => 45, 'DbIsrcNumber' => 46, 'DbCatalogNumber' => 47, 'DbOriginalArtist' => 48, 'DbCopyright' => 49, 'DbReportDatetime' => 50, 'DbReportLocation' => 51, 'DbReportOrganization' => 52, 'DbSubject' => 53, 'DbContributor' => 54, 'DbLanguage' => 55, 'DbFileExists' => 56, 'DbSoundcloudId' => 57, 'DbSoundcloudErrorCode' => 58, 'DbSoundcloudErrorMsg' => 59, 'DbSoundcloudLinkToFile' => 60, 'DbSoundCloundUploadTime' => 61, 'DbReplayGain' => 62, 'DbOwnerId' => 63, ),
|
BasePeer::TYPE_PHPNAME => array ('DbId' => 0, 'DbName' => 1, 'DbMime' => 2, 'DbFtype' => 3, 'DbDirectory' => 4, 'DbFilepath' => 5, 'DbState' => 6, 'DbCurrentlyaccessing' => 7, 'DbEditedby' => 8, 'DbMtime' => 9, 'DbUtime' => 10, 'DbLPtime' => 11, 'DbMd5' => 12, 'DbTrackTitle' => 13, 'DbArtistName' => 14, 'DbBitRate' => 15, 'DbSampleRate' => 16, 'DbFormat' => 17, 'DbLength' => 18, 'DbAlbumTitle' => 19, 'DbGenre' => 20, 'DbComments' => 21, 'DbYear' => 22, 'DbTrackNumber' => 23, 'DbChannels' => 24, 'DbUrl' => 25, 'DbBpm' => 26, 'DbRating' => 27, 'DbEncodedBy' => 28, 'DbDiscNumber' => 29, 'DbMood' => 30, 'DbLabel' => 31, 'DbComposer' => 32, 'DbEncoder' => 33, 'DbChecksum' => 34, 'DbLyrics' => 35, 'DbOrchestra' => 36, 'DbConductor' => 37, 'DbLyricist' => 38, 'DbOriginalLyricist' => 39, 'DbRadioStationName' => 40, 'DbInfoUrl' => 41, 'DbArtistUrl' => 42, 'DbAudioSourceUrl' => 43, 'DbRadioStationUrl' => 44, 'DbBuyThisUrl' => 45, 'DbIsrcNumber' => 46, 'DbCatalogNumber' => 47, 'DbOriginalArtist' => 48, 'DbCopyright' => 49, 'DbReportDatetime' => 50, 'DbReportLocation' => 51, 'DbReportOrganization' => 52, 'DbSubject' => 53, 'DbContributor' => 54, 'DbLanguage' => 55, 'DbFileExists' => 56, 'DbSoundcloudId' => 57, 'DbSoundcloudErrorCode' => 58, 'DbSoundcloudErrorMsg' => 59, 'DbSoundcloudLinkToFile' => 60, 'DbSoundCloundUploadTime' => 61, 'DbReplayGain' => 62, 'DbOwnerId' => 63, 'DbCuein' => 64, 'DbCueout' => 65, 'DbHidden' => 66, ),
|
||||||
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbName' => 1, 'dbMime' => 2, 'dbFtype' => 3, 'dbDirectory' => 4, 'dbFilepath' => 5, 'dbState' => 6, 'dbCurrentlyaccessing' => 7, 'dbEditedby' => 8, 'dbMtime' => 9, 'dbUtime' => 10, 'dbLPtime' => 11, 'dbMd5' => 12, 'dbTrackTitle' => 13, 'dbArtistName' => 14, 'dbBitRate' => 15, 'dbSampleRate' => 16, 'dbFormat' => 17, 'dbLength' => 18, 'dbAlbumTitle' => 19, 'dbGenre' => 20, 'dbComments' => 21, 'dbYear' => 22, 'dbTrackNumber' => 23, 'dbChannels' => 24, 'dbUrl' => 25, 'dbBpm' => 26, 'dbRating' => 27, 'dbEncodedBy' => 28, 'dbDiscNumber' => 29, 'dbMood' => 30, 'dbLabel' => 31, 'dbComposer' => 32, 'dbEncoder' => 33, 'dbChecksum' => 34, 'dbLyrics' => 35, 'dbOrchestra' => 36, 'dbConductor' => 37, 'dbLyricist' => 38, 'dbOriginalLyricist' => 39, 'dbRadioStationName' => 40, 'dbInfoUrl' => 41, 'dbArtistUrl' => 42, 'dbAudioSourceUrl' => 43, 'dbRadioStationUrl' => 44, 'dbBuyThisUrl' => 45, 'dbIsrcNumber' => 46, 'dbCatalogNumber' => 47, 'dbOriginalArtist' => 48, 'dbCopyright' => 49, 'dbReportDatetime' => 50, 'dbReportLocation' => 51, 'dbReportOrganization' => 52, 'dbSubject' => 53, 'dbContributor' => 54, 'dbLanguage' => 55, 'dbFileExists' => 56, 'dbSoundcloudId' => 57, 'dbSoundcloudErrorCode' => 58, 'dbSoundcloudErrorMsg' => 59, 'dbSoundcloudLinkToFile' => 60, 'dbSoundCloundUploadTime' => 61, 'dbReplayGain' => 62, 'dbOwnerId' => 63, ),
|
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbName' => 1, 'dbMime' => 2, 'dbFtype' => 3, 'dbDirectory' => 4, 'dbFilepath' => 5, 'dbState' => 6, 'dbCurrentlyaccessing' => 7, 'dbEditedby' => 8, 'dbMtime' => 9, 'dbUtime' => 10, 'dbLPtime' => 11, 'dbMd5' => 12, 'dbTrackTitle' => 13, 'dbArtistName' => 14, 'dbBitRate' => 15, 'dbSampleRate' => 16, 'dbFormat' => 17, 'dbLength' => 18, 'dbAlbumTitle' => 19, 'dbGenre' => 20, 'dbComments' => 21, 'dbYear' => 22, 'dbTrackNumber' => 23, 'dbChannels' => 24, 'dbUrl' => 25, 'dbBpm' => 26, 'dbRating' => 27, 'dbEncodedBy' => 28, 'dbDiscNumber' => 29, 'dbMood' => 30, 'dbLabel' => 31, 'dbComposer' => 32, 'dbEncoder' => 33, 'dbChecksum' => 34, 'dbLyrics' => 35, 'dbOrchestra' => 36, 'dbConductor' => 37, 'dbLyricist' => 38, 'dbOriginalLyricist' => 39, 'dbRadioStationName' => 40, 'dbInfoUrl' => 41, 'dbArtistUrl' => 42, 'dbAudioSourceUrl' => 43, 'dbRadioStationUrl' => 44, 'dbBuyThisUrl' => 45, 'dbIsrcNumber' => 46, 'dbCatalogNumber' => 47, 'dbOriginalArtist' => 48, 'dbCopyright' => 49, 'dbReportDatetime' => 50, 'dbReportLocation' => 51, 'dbReportOrganization' => 52, 'dbSubject' => 53, 'dbContributor' => 54, 'dbLanguage' => 55, 'dbFileExists' => 56, 'dbSoundcloudId' => 57, 'dbSoundcloudErrorCode' => 58, 'dbSoundcloudErrorMsg' => 59, 'dbSoundcloudLinkToFile' => 60, 'dbSoundCloundUploadTime' => 61, 'dbReplayGain' => 62, 'dbOwnerId' => 63, 'dbCuein' => 64, 'dbCueout' => 65, 'dbHidden' => 66, ),
|
||||||
BasePeer::TYPE_COLNAME => array (self::ID => 0, self::NAME => 1, self::MIME => 2, self::FTYPE => 3, self::DIRECTORY => 4, self::FILEPATH => 5, self::STATE => 6, self::CURRENTLYACCESSING => 7, self::EDITEDBY => 8, self::MTIME => 9, self::UTIME => 10, self::LPTIME => 11, self::MD5 => 12, self::TRACK_TITLE => 13, self::ARTIST_NAME => 14, self::BIT_RATE => 15, self::SAMPLE_RATE => 16, self::FORMAT => 17, self::LENGTH => 18, self::ALBUM_TITLE => 19, self::GENRE => 20, self::COMMENTS => 21, self::YEAR => 22, self::TRACK_NUMBER => 23, self::CHANNELS => 24, self::URL => 25, self::BPM => 26, self::RATING => 27, self::ENCODED_BY => 28, self::DISC_NUMBER => 29, self::MOOD => 30, self::LABEL => 31, self::COMPOSER => 32, self::ENCODER => 33, self::CHECKSUM => 34, self::LYRICS => 35, self::ORCHESTRA => 36, self::CONDUCTOR => 37, self::LYRICIST => 38, self::ORIGINAL_LYRICIST => 39, self::RADIO_STATION_NAME => 40, self::INFO_URL => 41, self::ARTIST_URL => 42, self::AUDIO_SOURCE_URL => 43, self::RADIO_STATION_URL => 44, self::BUY_THIS_URL => 45, self::ISRC_NUMBER => 46, self::CATALOG_NUMBER => 47, self::ORIGINAL_ARTIST => 48, self::COPYRIGHT => 49, self::REPORT_DATETIME => 50, self::REPORT_LOCATION => 51, self::REPORT_ORGANIZATION => 52, self::SUBJECT => 53, self::CONTRIBUTOR => 54, self::LANGUAGE => 55, self::FILE_EXISTS => 56, self::SOUNDCLOUD_ID => 57, self::SOUNDCLOUD_ERROR_CODE => 58, self::SOUNDCLOUD_ERROR_MSG => 59, self::SOUNDCLOUD_LINK_TO_FILE => 60, self::SOUNDCLOUD_UPLOAD_TIME => 61, self::REPLAY_GAIN => 62, self::OWNER_ID => 63, ),
|
BasePeer::TYPE_COLNAME => array (self::ID => 0, self::NAME => 1, self::MIME => 2, self::FTYPE => 3, self::DIRECTORY => 4, self::FILEPATH => 5, self::STATE => 6, self::CURRENTLYACCESSING => 7, self::EDITEDBY => 8, self::MTIME => 9, self::UTIME => 10, self::LPTIME => 11, self::MD5 => 12, self::TRACK_TITLE => 13, self::ARTIST_NAME => 14, self::BIT_RATE => 15, self::SAMPLE_RATE => 16, self::FORMAT => 17, self::LENGTH => 18, self::ALBUM_TITLE => 19, self::GENRE => 20, self::COMMENTS => 21, self::YEAR => 22, self::TRACK_NUMBER => 23, self::CHANNELS => 24, self::URL => 25, self::BPM => 26, self::RATING => 27, self::ENCODED_BY => 28, self::DISC_NUMBER => 29, self::MOOD => 30, self::LABEL => 31, self::COMPOSER => 32, self::ENCODER => 33, self::CHECKSUM => 34, self::LYRICS => 35, self::ORCHESTRA => 36, self::CONDUCTOR => 37, self::LYRICIST => 38, self::ORIGINAL_LYRICIST => 39, self::RADIO_STATION_NAME => 40, self::INFO_URL => 41, self::ARTIST_URL => 42, self::AUDIO_SOURCE_URL => 43, self::RADIO_STATION_URL => 44, self::BUY_THIS_URL => 45, self::ISRC_NUMBER => 46, self::CATALOG_NUMBER => 47, self::ORIGINAL_ARTIST => 48, self::COPYRIGHT => 49, self::REPORT_DATETIME => 50, self::REPORT_LOCATION => 51, self::REPORT_ORGANIZATION => 52, self::SUBJECT => 53, self::CONTRIBUTOR => 54, self::LANGUAGE => 55, self::FILE_EXISTS => 56, self::SOUNDCLOUD_ID => 57, self::SOUNDCLOUD_ERROR_CODE => 58, self::SOUNDCLOUD_ERROR_MSG => 59, self::SOUNDCLOUD_LINK_TO_FILE => 60, self::SOUNDCLOUD_UPLOAD_TIME => 61, self::REPLAY_GAIN => 62, self::OWNER_ID => 63, self::CUEIN => 64, self::CUEOUT => 65, self::HIDDEN => 66, ),
|
||||||
BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'NAME' => 1, 'MIME' => 2, 'FTYPE' => 3, 'DIRECTORY' => 4, 'FILEPATH' => 5, 'STATE' => 6, 'CURRENTLYACCESSING' => 7, 'EDITEDBY' => 8, 'MTIME' => 9, 'UTIME' => 10, 'LPTIME' => 11, 'MD5' => 12, 'TRACK_TITLE' => 13, 'ARTIST_NAME' => 14, 'BIT_RATE' => 15, 'SAMPLE_RATE' => 16, 'FORMAT' => 17, 'LENGTH' => 18, 'ALBUM_TITLE' => 19, 'GENRE' => 20, 'COMMENTS' => 21, 'YEAR' => 22, 'TRACK_NUMBER' => 23, 'CHANNELS' => 24, 'URL' => 25, 'BPM' => 26, 'RATING' => 27, 'ENCODED_BY' => 28, 'DISC_NUMBER' => 29, 'MOOD' => 30, 'LABEL' => 31, 'COMPOSER' => 32, 'ENCODER' => 33, 'CHECKSUM' => 34, 'LYRICS' => 35, 'ORCHESTRA' => 36, 'CONDUCTOR' => 37, 'LYRICIST' => 38, 'ORIGINAL_LYRICIST' => 39, 'RADIO_STATION_NAME' => 40, 'INFO_URL' => 41, 'ARTIST_URL' => 42, 'AUDIO_SOURCE_URL' => 43, 'RADIO_STATION_URL' => 44, 'BUY_THIS_URL' => 45, 'ISRC_NUMBER' => 46, 'CATALOG_NUMBER' => 47, 'ORIGINAL_ARTIST' => 48, 'COPYRIGHT' => 49, 'REPORT_DATETIME' => 50, 'REPORT_LOCATION' => 51, 'REPORT_ORGANIZATION' => 52, 'SUBJECT' => 53, 'CONTRIBUTOR' => 54, 'LANGUAGE' => 55, 'FILE_EXISTS' => 56, 'SOUNDCLOUD_ID' => 57, 'SOUNDCLOUD_ERROR_CODE' => 58, 'SOUNDCLOUD_ERROR_MSG' => 59, 'SOUNDCLOUD_LINK_TO_FILE' => 60, 'SOUNDCLOUD_UPLOAD_TIME' => 61, 'REPLAY_GAIN' => 62, 'OWNER_ID' => 63, ),
|
BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'NAME' => 1, 'MIME' => 2, 'FTYPE' => 3, 'DIRECTORY' => 4, 'FILEPATH' => 5, 'STATE' => 6, 'CURRENTLYACCESSING' => 7, 'EDITEDBY' => 8, 'MTIME' => 9, 'UTIME' => 10, 'LPTIME' => 11, 'MD5' => 12, 'TRACK_TITLE' => 13, 'ARTIST_NAME' => 14, 'BIT_RATE' => 15, 'SAMPLE_RATE' => 16, 'FORMAT' => 17, 'LENGTH' => 18, 'ALBUM_TITLE' => 19, 'GENRE' => 20, 'COMMENTS' => 21, 'YEAR' => 22, 'TRACK_NUMBER' => 23, 'CHANNELS' => 24, 'URL' => 25, 'BPM' => 26, 'RATING' => 27, 'ENCODED_BY' => 28, 'DISC_NUMBER' => 29, 'MOOD' => 30, 'LABEL' => 31, 'COMPOSER' => 32, 'ENCODER' => 33, 'CHECKSUM' => 34, 'LYRICS' => 35, 'ORCHESTRA' => 36, 'CONDUCTOR' => 37, 'LYRICIST' => 38, 'ORIGINAL_LYRICIST' => 39, 'RADIO_STATION_NAME' => 40, 'INFO_URL' => 41, 'ARTIST_URL' => 42, 'AUDIO_SOURCE_URL' => 43, 'RADIO_STATION_URL' => 44, 'BUY_THIS_URL' => 45, 'ISRC_NUMBER' => 46, 'CATALOG_NUMBER' => 47, 'ORIGINAL_ARTIST' => 48, 'COPYRIGHT' => 49, 'REPORT_DATETIME' => 50, 'REPORT_LOCATION' => 51, 'REPORT_ORGANIZATION' => 52, 'SUBJECT' => 53, 'CONTRIBUTOR' => 54, 'LANGUAGE' => 55, 'FILE_EXISTS' => 56, 'SOUNDCLOUD_ID' => 57, 'SOUNDCLOUD_ERROR_CODE' => 58, 'SOUNDCLOUD_ERROR_MSG' => 59, 'SOUNDCLOUD_LINK_TO_FILE' => 60, 'SOUNDCLOUD_UPLOAD_TIME' => 61, 'REPLAY_GAIN' => 62, 'OWNER_ID' => 63, 'CUEIN' => 64, 'CUEOUT' => 65, 'HIDDEN' => 66, ),
|
||||||
BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'name' => 1, 'mime' => 2, 'ftype' => 3, 'directory' => 4, 'filepath' => 5, 'state' => 6, 'currentlyaccessing' => 7, 'editedby' => 8, 'mtime' => 9, 'utime' => 10, 'lptime' => 11, 'md5' => 12, 'track_title' => 13, 'artist_name' => 14, 'bit_rate' => 15, 'sample_rate' => 16, 'format' => 17, 'length' => 18, 'album_title' => 19, 'genre' => 20, 'comments' => 21, 'year' => 22, 'track_number' => 23, 'channels' => 24, 'url' => 25, 'bpm' => 26, 'rating' => 27, 'encoded_by' => 28, 'disc_number' => 29, 'mood' => 30, 'label' => 31, 'composer' => 32, 'encoder' => 33, 'checksum' => 34, 'lyrics' => 35, 'orchestra' => 36, 'conductor' => 37, 'lyricist' => 38, 'original_lyricist' => 39, 'radio_station_name' => 40, 'info_url' => 41, 'artist_url' => 42, 'audio_source_url' => 43, 'radio_station_url' => 44, 'buy_this_url' => 45, 'isrc_number' => 46, 'catalog_number' => 47, 'original_artist' => 48, 'copyright' => 49, 'report_datetime' => 50, 'report_location' => 51, 'report_organization' => 52, 'subject' => 53, 'contributor' => 54, 'language' => 55, 'file_exists' => 56, 'soundcloud_id' => 57, 'soundcloud_error_code' => 58, 'soundcloud_error_msg' => 59, 'soundcloud_link_to_file' => 60, 'soundcloud_upload_time' => 61, 'replay_gain' => 62, 'owner_id' => 63, ),
|
BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'name' => 1, 'mime' => 2, 'ftype' => 3, 'directory' => 4, 'filepath' => 5, 'state' => 6, 'currentlyaccessing' => 7, 'editedby' => 8, 'mtime' => 9, 'utime' => 10, 'lptime' => 11, 'md5' => 12, 'track_title' => 13, 'artist_name' => 14, 'bit_rate' => 15, 'sample_rate' => 16, 'format' => 17, 'length' => 18, 'album_title' => 19, 'genre' => 20, 'comments' => 21, 'year' => 22, 'track_number' => 23, 'channels' => 24, 'url' => 25, 'bpm' => 26, 'rating' => 27, 'encoded_by' => 28, 'disc_number' => 29, 'mood' => 30, 'label' => 31, 'composer' => 32, 'encoder' => 33, 'checksum' => 34, 'lyrics' => 35, 'orchestra' => 36, 'conductor' => 37, 'lyricist' => 38, 'original_lyricist' => 39, 'radio_station_name' => 40, 'info_url' => 41, 'artist_url' => 42, 'audio_source_url' => 43, 'radio_station_url' => 44, 'buy_this_url' => 45, 'isrc_number' => 46, 'catalog_number' => 47, 'original_artist' => 48, 'copyright' => 49, 'report_datetime' => 50, 'report_location' => 51, 'report_organization' => 52, 'subject' => 53, 'contributor' => 54, 'language' => 55, 'file_exists' => 56, 'soundcloud_id' => 57, 'soundcloud_error_code' => 58, 'soundcloud_error_msg' => 59, 'soundcloud_link_to_file' => 60, 'soundcloud_upload_time' => 61, 'replay_gain' => 62, 'owner_id' => 63, 'cuein' => 64, 'cueout' => 65, 'hidden' => 66, ),
|
||||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, )
|
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, )
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -395,6 +404,9 @@ abstract class BaseCcFilesPeer {
|
||||||
$criteria->addSelectColumn(CcFilesPeer::SOUNDCLOUD_UPLOAD_TIME);
|
$criteria->addSelectColumn(CcFilesPeer::SOUNDCLOUD_UPLOAD_TIME);
|
||||||
$criteria->addSelectColumn(CcFilesPeer::REPLAY_GAIN);
|
$criteria->addSelectColumn(CcFilesPeer::REPLAY_GAIN);
|
||||||
$criteria->addSelectColumn(CcFilesPeer::OWNER_ID);
|
$criteria->addSelectColumn(CcFilesPeer::OWNER_ID);
|
||||||
|
$criteria->addSelectColumn(CcFilesPeer::CUEIN);
|
||||||
|
$criteria->addSelectColumn(CcFilesPeer::CUEOUT);
|
||||||
|
$criteria->addSelectColumn(CcFilesPeer::HIDDEN);
|
||||||
} else {
|
} else {
|
||||||
$criteria->addSelectColumn($alias . '.ID');
|
$criteria->addSelectColumn($alias . '.ID');
|
||||||
$criteria->addSelectColumn($alias . '.NAME');
|
$criteria->addSelectColumn($alias . '.NAME');
|
||||||
|
@ -460,6 +472,9 @@ abstract class BaseCcFilesPeer {
|
||||||
$criteria->addSelectColumn($alias . '.SOUNDCLOUD_UPLOAD_TIME');
|
$criteria->addSelectColumn($alias . '.SOUNDCLOUD_UPLOAD_TIME');
|
||||||
$criteria->addSelectColumn($alias . '.REPLAY_GAIN');
|
$criteria->addSelectColumn($alias . '.REPLAY_GAIN');
|
||||||
$criteria->addSelectColumn($alias . '.OWNER_ID');
|
$criteria->addSelectColumn($alias . '.OWNER_ID');
|
||||||
|
$criteria->addSelectColumn($alias . '.CUEIN');
|
||||||
|
$criteria->addSelectColumn($alias . '.CUEOUT');
|
||||||
|
$criteria->addSelectColumn($alias . '.HIDDEN');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -70,6 +70,9 @@
|
||||||
* @method CcFilesQuery orderByDbSoundCloundUploadTime($order = Criteria::ASC) Order by the soundcloud_upload_time column
|
* @method CcFilesQuery orderByDbSoundCloundUploadTime($order = Criteria::ASC) Order by the soundcloud_upload_time column
|
||||||
* @method CcFilesQuery orderByDbReplayGain($order = Criteria::ASC) Order by the replay_gain column
|
* @method CcFilesQuery orderByDbReplayGain($order = Criteria::ASC) Order by the replay_gain column
|
||||||
* @method CcFilesQuery orderByDbOwnerId($order = Criteria::ASC) Order by the owner_id column
|
* @method CcFilesQuery orderByDbOwnerId($order = Criteria::ASC) Order by the owner_id column
|
||||||
|
* @method CcFilesQuery orderByDbCuein($order = Criteria::ASC) Order by the cuein column
|
||||||
|
* @method CcFilesQuery orderByDbCueout($order = Criteria::ASC) Order by the cueout column
|
||||||
|
* @method CcFilesQuery orderByDbHidden($order = Criteria::ASC) Order by the hidden column
|
||||||
*
|
*
|
||||||
* @method CcFilesQuery groupByDbId() Group by the id column
|
* @method CcFilesQuery groupByDbId() Group by the id column
|
||||||
* @method CcFilesQuery groupByDbName() Group by the name column
|
* @method CcFilesQuery groupByDbName() Group by the name column
|
||||||
|
@ -135,6 +138,9 @@
|
||||||
* @method CcFilesQuery groupByDbSoundCloundUploadTime() Group by the soundcloud_upload_time column
|
* @method CcFilesQuery groupByDbSoundCloundUploadTime() Group by the soundcloud_upload_time column
|
||||||
* @method CcFilesQuery groupByDbReplayGain() Group by the replay_gain column
|
* @method CcFilesQuery groupByDbReplayGain() Group by the replay_gain column
|
||||||
* @method CcFilesQuery groupByDbOwnerId() Group by the owner_id column
|
* @method CcFilesQuery groupByDbOwnerId() Group by the owner_id column
|
||||||
|
* @method CcFilesQuery groupByDbCuein() Group by the cuein column
|
||||||
|
* @method CcFilesQuery groupByDbCueout() Group by the cueout column
|
||||||
|
* @method CcFilesQuery groupByDbHidden() Group by the hidden column
|
||||||
*
|
*
|
||||||
* @method CcFilesQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
|
* @method CcFilesQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
|
||||||
* @method CcFilesQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
|
* @method CcFilesQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
|
||||||
|
@ -235,6 +241,9 @@
|
||||||
* @method CcFiles findOneByDbSoundCloundUploadTime(string $soundcloud_upload_time) Return the first CcFiles filtered by the soundcloud_upload_time column
|
* @method CcFiles findOneByDbSoundCloundUploadTime(string $soundcloud_upload_time) Return the first CcFiles filtered by the soundcloud_upload_time column
|
||||||
* @method CcFiles findOneByDbReplayGain(string $replay_gain) Return the first CcFiles filtered by the replay_gain column
|
* @method CcFiles findOneByDbReplayGain(string $replay_gain) Return the first CcFiles filtered by the replay_gain column
|
||||||
* @method CcFiles findOneByDbOwnerId(int $owner_id) Return the first CcFiles filtered by the owner_id column
|
* @method CcFiles findOneByDbOwnerId(int $owner_id) Return the first CcFiles filtered by the owner_id column
|
||||||
|
* @method CcFiles findOneByDbCuein(string $cuein) Return the first CcFiles filtered by the cuein column
|
||||||
|
* @method CcFiles findOneByDbCueout(string $cueout) Return the first CcFiles filtered by the cueout column
|
||||||
|
* @method CcFiles findOneByDbHidden(boolean $hidden) Return the first CcFiles filtered by the hidden column
|
||||||
*
|
*
|
||||||
* @method array findByDbId(int $id) Return CcFiles objects filtered by the id column
|
* @method array findByDbId(int $id) Return CcFiles objects filtered by the id column
|
||||||
* @method array findByDbName(string $name) Return CcFiles objects filtered by the name column
|
* @method array findByDbName(string $name) Return CcFiles objects filtered by the name column
|
||||||
|
@ -300,6 +309,9 @@
|
||||||
* @method array findByDbSoundCloundUploadTime(string $soundcloud_upload_time) Return CcFiles objects filtered by the soundcloud_upload_time column
|
* @method array findByDbSoundCloundUploadTime(string $soundcloud_upload_time) Return CcFiles objects filtered by the soundcloud_upload_time column
|
||||||
* @method array findByDbReplayGain(string $replay_gain) Return CcFiles objects filtered by the replay_gain column
|
* @method array findByDbReplayGain(string $replay_gain) Return CcFiles objects filtered by the replay_gain column
|
||||||
* @method array findByDbOwnerId(int $owner_id) Return CcFiles objects filtered by the owner_id column
|
* @method array findByDbOwnerId(int $owner_id) Return CcFiles objects filtered by the owner_id column
|
||||||
|
* @method array findByDbCuein(string $cuein) Return CcFiles objects filtered by the cuein column
|
||||||
|
* @method array findByDbCueout(string $cueout) Return CcFiles objects filtered by the cueout column
|
||||||
|
* @method array findByDbHidden(boolean $hidden) Return CcFiles objects filtered by the hidden column
|
||||||
*
|
*
|
||||||
* @package propel.generator.airtime.om
|
* @package propel.generator.airtime.om
|
||||||
*/
|
*/
|
||||||
|
@ -1951,6 +1963,67 @@ abstract class BaseCcFilesQuery extends ModelCriteria
|
||||||
return $this->addUsingAlias(CcFilesPeer::OWNER_ID, $dbOwnerId, $comparison);
|
return $this->addUsingAlias(CcFilesPeer::OWNER_ID, $dbOwnerId, $comparison);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Filter the query on the cuein column
|
||||||
|
*
|
||||||
|
* @param string $dbCuein The value to use as filter.
|
||||||
|
* Accepts wildcards (* and % trigger a LIKE)
|
||||||
|
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||||
|
*
|
||||||
|
* @return CcFilesQuery The current query, for fluid interface
|
||||||
|
*/
|
||||||
|
public function filterByDbCuein($dbCuein = null, $comparison = null)
|
||||||
|
{
|
||||||
|
if (null === $comparison) {
|
||||||
|
if (is_array($dbCuein)) {
|
||||||
|
$comparison = Criteria::IN;
|
||||||
|
} elseif (preg_match('/[\%\*]/', $dbCuein)) {
|
||||||
|
$dbCuein = str_replace('*', '%', $dbCuein);
|
||||||
|
$comparison = Criteria::LIKE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $this->addUsingAlias(CcFilesPeer::CUEIN, $dbCuein, $comparison);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Filter the query on the cueout column
|
||||||
|
*
|
||||||
|
* @param string $dbCueout The value to use as filter.
|
||||||
|
* Accepts wildcards (* and % trigger a LIKE)
|
||||||
|
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||||
|
*
|
||||||
|
* @return CcFilesQuery The current query, for fluid interface
|
||||||
|
*/
|
||||||
|
public function filterByDbCueout($dbCueout = null, $comparison = null)
|
||||||
|
{
|
||||||
|
if (null === $comparison) {
|
||||||
|
if (is_array($dbCueout)) {
|
||||||
|
$comparison = Criteria::IN;
|
||||||
|
} elseif (preg_match('/[\%\*]/', $dbCueout)) {
|
||||||
|
$dbCueout = str_replace('*', '%', $dbCueout);
|
||||||
|
$comparison = Criteria::LIKE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $this->addUsingAlias(CcFilesPeer::CUEOUT, $dbCueout, $comparison);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Filter the query on the hidden column
|
||||||
|
*
|
||||||
|
* @param boolean|string $dbHidden The value to use as filter.
|
||||||
|
* Accepts strings ('false', 'off', '-', 'no', 'n', and '0' are false, the rest is true)
|
||||||
|
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||||
|
*
|
||||||
|
* @return CcFilesQuery The current query, for fluid interface
|
||||||
|
*/
|
||||||
|
public function filterByDbHidden($dbHidden = null, $comparison = null)
|
||||||
|
{
|
||||||
|
if (is_string($dbHidden)) {
|
||||||
|
$hidden = in_array(strtolower($dbHidden), array('false', 'off', '-', 'no', 'n', '0')) ? false : true;
|
||||||
|
}
|
||||||
|
return $this->addUsingAlias(CcFilesPeer::HIDDEN, $dbHidden, $comparison);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Filter the query by a related CcSubjs object
|
* Filter the query by a related CcSubjs object
|
||||||
*
|
*
|
||||||
|
|
764
airtime_mvc/application/models/airtime/om/BaseCcLocale.php
Normal file
764
airtime_mvc/application/models/airtime/om/BaseCcLocale.php
Normal file
|
@ -0,0 +1,764 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Base class that represents a row from the 'cc_locale' table.
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @package propel.generator.airtime.om
|
||||||
|
*/
|
||||||
|
abstract class BaseCcLocale extends BaseObject implements Persistent
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Peer class name
|
||||||
|
*/
|
||||||
|
const PEER = 'CcLocalePeer';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Peer class.
|
||||||
|
* Instance provides a convenient way of calling static methods on a class
|
||||||
|
* that calling code may not be able to identify.
|
||||||
|
* @var CcLocalePeer
|
||||||
|
*/
|
||||||
|
protected static $peer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The value for the id field.
|
||||||
|
* @var int
|
||||||
|
*/
|
||||||
|
protected $id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The value for the locale_code field.
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $locale_code;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The value for the locale_lang field.
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $locale_lang;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Flag to prevent endless save loop, if this object is referenced
|
||||||
|
* by another object which falls in this transaction.
|
||||||
|
* @var boolean
|
||||||
|
*/
|
||||||
|
protected $alreadyInSave = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Flag to prevent endless validation loop, if this object is referenced
|
||||||
|
* by another object which falls in this transaction.
|
||||||
|
* @var boolean
|
||||||
|
*/
|
||||||
|
protected $alreadyInValidation = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the [id] column value.
|
||||||
|
*
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
|
public function getDbId()
|
||||||
|
{
|
||||||
|
return $this->id;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the [locale_code] column value.
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getDbLocaleCode()
|
||||||
|
{
|
||||||
|
return $this->locale_code;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the [locale_lang] column value.
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getDbLocaleLang()
|
||||||
|
{
|
||||||
|
return $this->locale_lang;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the value of [id] column.
|
||||||
|
*
|
||||||
|
* @param int $v new value
|
||||||
|
* @return CcLocale The current object (for fluent API support)
|
||||||
|
*/
|
||||||
|
public function setDbId($v)
|
||||||
|
{
|
||||||
|
if ($v !== null) {
|
||||||
|
$v = (int) $v;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($this->id !== $v) {
|
||||||
|
$this->id = $v;
|
||||||
|
$this->modifiedColumns[] = CcLocalePeer::ID;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
} // setDbId()
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the value of [locale_code] column.
|
||||||
|
*
|
||||||
|
* @param string $v new value
|
||||||
|
* @return CcLocale The current object (for fluent API support)
|
||||||
|
*/
|
||||||
|
public function setDbLocaleCode($v)
|
||||||
|
{
|
||||||
|
if ($v !== null) {
|
||||||
|
$v = (string) $v;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($this->locale_code !== $v) {
|
||||||
|
$this->locale_code = $v;
|
||||||
|
$this->modifiedColumns[] = CcLocalePeer::LOCALE_CODE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
} // setDbLocaleCode()
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the value of [locale_lang] column.
|
||||||
|
*
|
||||||
|
* @param string $v new value
|
||||||
|
* @return CcLocale The current object (for fluent API support)
|
||||||
|
*/
|
||||||
|
public function setDbLocaleLang($v)
|
||||||
|
{
|
||||||
|
if ($v !== null) {
|
||||||
|
$v = (string) $v;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($this->locale_lang !== $v) {
|
||||||
|
$this->locale_lang = $v;
|
||||||
|
$this->modifiedColumns[] = CcLocalePeer::LOCALE_LANG;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
} // setDbLocaleLang()
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Indicates whether the columns in this object are only set to default values.
|
||||||
|
*
|
||||||
|
* This method can be used in conjunction with isModified() to indicate whether an object is both
|
||||||
|
* modified _and_ has some values set which are non-default.
|
||||||
|
*
|
||||||
|
* @return boolean Whether the columns in this object are only been set with default values.
|
||||||
|
*/
|
||||||
|
public function hasOnlyDefaultValues()
|
||||||
|
{
|
||||||
|
// otherwise, everything was equal, so return TRUE
|
||||||
|
return true;
|
||||||
|
} // hasOnlyDefaultValues()
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Hydrates (populates) the object variables with values from the database resultset.
|
||||||
|
*
|
||||||
|
* An offset (0-based "start column") is specified so that objects can be hydrated
|
||||||
|
* with a subset of the columns in the resultset rows. This is needed, for example,
|
||||||
|
* for results of JOIN queries where the resultset row includes columns from two or
|
||||||
|
* more tables.
|
||||||
|
*
|
||||||
|
* @param array $row The row returned by PDOStatement->fetch(PDO::FETCH_NUM)
|
||||||
|
* @param int $startcol 0-based offset column which indicates which restultset column to start with.
|
||||||
|
* @param boolean $rehydrate Whether this object is being re-hydrated from the database.
|
||||||
|
* @return int next starting column
|
||||||
|
* @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
|
||||||
|
*/
|
||||||
|
public function hydrate($row, $startcol = 0, $rehydrate = false)
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
|
||||||
|
$this->id = ($row[$startcol + 0] !== null) ? (int) $row[$startcol + 0] : null;
|
||||||
|
$this->locale_code = ($row[$startcol + 1] !== null) ? (string) $row[$startcol + 1] : null;
|
||||||
|
$this->locale_lang = ($row[$startcol + 2] !== null) ? (string) $row[$startcol + 2] : null;
|
||||||
|
$this->resetModified();
|
||||||
|
|
||||||
|
$this->setNew(false);
|
||||||
|
|
||||||
|
if ($rehydrate) {
|
||||||
|
$this->ensureConsistency();
|
||||||
|
}
|
||||||
|
|
||||||
|
return $startcol + 3; // 3 = CcLocalePeer::NUM_COLUMNS - CcLocalePeer::NUM_LAZY_LOAD_COLUMNS).
|
||||||
|
|
||||||
|
} catch (Exception $e) {
|
||||||
|
throw new PropelException("Error populating CcLocale object", $e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks and repairs the internal consistency of the object.
|
||||||
|
*
|
||||||
|
* This method is executed after an already-instantiated object is re-hydrated
|
||||||
|
* from the database. It exists to check any foreign keys to make sure that
|
||||||
|
* the objects related to the current object are correct based on foreign key.
|
||||||
|
*
|
||||||
|
* You can override this method in the stub class, but you should always invoke
|
||||||
|
* the base method from the overridden method (i.e. parent::ensureConsistency()),
|
||||||
|
* in case your model changes.
|
||||||
|
*
|
||||||
|
* @throws PropelException
|
||||||
|
*/
|
||||||
|
public function ensureConsistency()
|
||||||
|
{
|
||||||
|
|
||||||
|
} // ensureConsistency
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reloads this object from datastore based on primary key and (optionally) resets all associated objects.
|
||||||
|
*
|
||||||
|
* This will only work if the object has been saved and has a valid primary key set.
|
||||||
|
*
|
||||||
|
* @param boolean $deep (optional) Whether to also de-associated any related objects.
|
||||||
|
* @param PropelPDO $con (optional) The PropelPDO connection to use.
|
||||||
|
* @return void
|
||||||
|
* @throws PropelException - if this object is deleted, unsaved or doesn't have pk match in db
|
||||||
|
*/
|
||||||
|
public function reload($deep = false, PropelPDO $con = null)
|
||||||
|
{
|
||||||
|
if ($this->isDeleted()) {
|
||||||
|
throw new PropelException("Cannot reload a deleted object.");
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($this->isNew()) {
|
||||||
|
throw new PropelException("Cannot reload an unsaved object.");
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($con === null) {
|
||||||
|
$con = Propel::getConnection(CcLocalePeer::DATABASE_NAME, Propel::CONNECTION_READ);
|
||||||
|
}
|
||||||
|
|
||||||
|
// We don't need to alter the object instance pool; we're just modifying this instance
|
||||||
|
// already in the pool.
|
||||||
|
|
||||||
|
$stmt = CcLocalePeer::doSelectStmt($this->buildPkeyCriteria(), $con);
|
||||||
|
$row = $stmt->fetch(PDO::FETCH_NUM);
|
||||||
|
$stmt->closeCursor();
|
||||||
|
if (!$row) {
|
||||||
|
throw new PropelException('Cannot find matching row in the database to reload object values.');
|
||||||
|
}
|
||||||
|
$this->hydrate($row, 0, true); // rehydrate
|
||||||
|
|
||||||
|
if ($deep) { // also de-associate any related objects?
|
||||||
|
|
||||||
|
} // if (deep)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Removes this object from datastore and sets delete attribute.
|
||||||
|
*
|
||||||
|
* @param PropelPDO $con
|
||||||
|
* @return void
|
||||||
|
* @throws PropelException
|
||||||
|
* @see BaseObject::setDeleted()
|
||||||
|
* @see BaseObject::isDeleted()
|
||||||
|
*/
|
||||||
|
public function delete(PropelPDO $con = null)
|
||||||
|
{
|
||||||
|
if ($this->isDeleted()) {
|
||||||
|
throw new PropelException("This object has already been deleted.");
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($con === null) {
|
||||||
|
$con = Propel::getConnection(CcLocalePeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
|
||||||
|
}
|
||||||
|
|
||||||
|
$con->beginTransaction();
|
||||||
|
try {
|
||||||
|
$ret = $this->preDelete($con);
|
||||||
|
if ($ret) {
|
||||||
|
CcLocaleQuery::create()
|
||||||
|
->filterByPrimaryKey($this->getPrimaryKey())
|
||||||
|
->delete($con);
|
||||||
|
$this->postDelete($con);
|
||||||
|
$con->commit();
|
||||||
|
$this->setDeleted(true);
|
||||||
|
} else {
|
||||||
|
$con->commit();
|
||||||
|
}
|
||||||
|
} catch (PropelException $e) {
|
||||||
|
$con->rollBack();
|
||||||
|
throw $e;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Persists this object to the database.
|
||||||
|
*
|
||||||
|
* If the object is new, it inserts it; otherwise an update is performed.
|
||||||
|
* All modified related objects will also be persisted in the doSave()
|
||||||
|
* method. This method wraps all precipitate database operations in a
|
||||||
|
* single transaction.
|
||||||
|
*
|
||||||
|
* @param PropelPDO $con
|
||||||
|
* @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
|
||||||
|
* @throws PropelException
|
||||||
|
* @see doSave()
|
||||||
|
*/
|
||||||
|
public function save(PropelPDO $con = null)
|
||||||
|
{
|
||||||
|
if ($this->isDeleted()) {
|
||||||
|
throw new PropelException("You cannot save an object that has been deleted.");
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($con === null) {
|
||||||
|
$con = Propel::getConnection(CcLocalePeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
|
||||||
|
}
|
||||||
|
|
||||||
|
$con->beginTransaction();
|
||||||
|
$isInsert = $this->isNew();
|
||||||
|
try {
|
||||||
|
$ret = $this->preSave($con);
|
||||||
|
if ($isInsert) {
|
||||||
|
$ret = $ret && $this->preInsert($con);
|
||||||
|
} else {
|
||||||
|
$ret = $ret && $this->preUpdate($con);
|
||||||
|
}
|
||||||
|
if ($ret) {
|
||||||
|
$affectedRows = $this->doSave($con);
|
||||||
|
if ($isInsert) {
|
||||||
|
$this->postInsert($con);
|
||||||
|
} else {
|
||||||
|
$this->postUpdate($con);
|
||||||
|
}
|
||||||
|
$this->postSave($con);
|
||||||
|
CcLocalePeer::addInstanceToPool($this);
|
||||||
|
} else {
|
||||||
|
$affectedRows = 0;
|
||||||
|
}
|
||||||
|
$con->commit();
|
||||||
|
return $affectedRows;
|
||||||
|
} catch (PropelException $e) {
|
||||||
|
$con->rollBack();
|
||||||
|
throw $e;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Performs the work of inserting or updating the row in the database.
|
||||||
|
*
|
||||||
|
* If the object is new, it inserts it; otherwise an update is performed.
|
||||||
|
* All related objects are also updated in this method.
|
||||||
|
*
|
||||||
|
* @param PropelPDO $con
|
||||||
|
* @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
|
||||||
|
* @throws PropelException
|
||||||
|
* @see save()
|
||||||
|
*/
|
||||||
|
protected function doSave(PropelPDO $con)
|
||||||
|
{
|
||||||
|
$affectedRows = 0; // initialize var to track total num of affected rows
|
||||||
|
if (!$this->alreadyInSave) {
|
||||||
|
$this->alreadyInSave = true;
|
||||||
|
|
||||||
|
if ($this->isNew() ) {
|
||||||
|
$this->modifiedColumns[] = CcLocalePeer::ID;
|
||||||
|
}
|
||||||
|
|
||||||
|
// If this object has been modified, then save it to the database.
|
||||||
|
if ($this->isModified()) {
|
||||||
|
if ($this->isNew()) {
|
||||||
|
$criteria = $this->buildCriteria();
|
||||||
|
if ($criteria->keyContainsValue(CcLocalePeer::ID) ) {
|
||||||
|
throw new PropelException('Cannot insert a value for auto-increment primary key ('.CcLocalePeer::ID.')');
|
||||||
|
}
|
||||||
|
|
||||||
|
$pk = BasePeer::doInsert($criteria, $con);
|
||||||
|
$affectedRows = 1;
|
||||||
|
$this->setDbId($pk); //[IMV] update autoincrement primary key
|
||||||
|
$this->setNew(false);
|
||||||
|
} else {
|
||||||
|
$affectedRows = CcLocalePeer::doUpdate($this, $con);
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->resetModified(); // [HL] After being saved an object is no longer 'modified'
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->alreadyInSave = false;
|
||||||
|
|
||||||
|
}
|
||||||
|
return $affectedRows;
|
||||||
|
} // doSave()
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Array of ValidationFailed objects.
|
||||||
|
* @var array ValidationFailed[]
|
||||||
|
*/
|
||||||
|
protected $validationFailures = array();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets any ValidationFailed objects that resulted from last call to validate().
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @return array ValidationFailed[]
|
||||||
|
* @see validate()
|
||||||
|
*/
|
||||||
|
public function getValidationFailures()
|
||||||
|
{
|
||||||
|
return $this->validationFailures;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Validates the objects modified field values and all objects related to this table.
|
||||||
|
*
|
||||||
|
* If $columns is either a column name or an array of column names
|
||||||
|
* only those columns are validated.
|
||||||
|
*
|
||||||
|
* @param mixed $columns Column name or an array of column names.
|
||||||
|
* @return boolean Whether all columns pass validation.
|
||||||
|
* @see doValidate()
|
||||||
|
* @see getValidationFailures()
|
||||||
|
*/
|
||||||
|
public function validate($columns = null)
|
||||||
|
{
|
||||||
|
$res = $this->doValidate($columns);
|
||||||
|
if ($res === true) {
|
||||||
|
$this->validationFailures = array();
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
$this->validationFailures = $res;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This function performs the validation work for complex object models.
|
||||||
|
*
|
||||||
|
* In addition to checking the current object, all related objects will
|
||||||
|
* also be validated. If all pass then <code>true</code> is returned; otherwise
|
||||||
|
* an aggreagated array of ValidationFailed objects will be returned.
|
||||||
|
*
|
||||||
|
* @param array $columns Array of column names to validate.
|
||||||
|
* @return mixed <code>true</code> if all validations pass; array of <code>ValidationFailed</code> objets otherwise.
|
||||||
|
*/
|
||||||
|
protected function doValidate($columns = null)
|
||||||
|
{
|
||||||
|
if (!$this->alreadyInValidation) {
|
||||||
|
$this->alreadyInValidation = true;
|
||||||
|
$retval = null;
|
||||||
|
|
||||||
|
$failureMap = array();
|
||||||
|
|
||||||
|
|
||||||
|
if (($retval = CcLocalePeer::doValidate($this, $columns)) !== true) {
|
||||||
|
$failureMap = array_merge($failureMap, $retval);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$this->alreadyInValidation = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return (!empty($failureMap) ? $failureMap : true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieves a field from the object by name passed in as a string.
|
||||||
|
*
|
||||||
|
* @param string $name name
|
||||||
|
* @param string $type The type of fieldname the $name is of:
|
||||||
|
* one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME
|
||||||
|
* BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM
|
||||||
|
* @return mixed Value of field.
|
||||||
|
*/
|
||||||
|
public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
|
||||||
|
{
|
||||||
|
$pos = CcLocalePeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
|
||||||
|
$field = $this->getByPosition($pos);
|
||||||
|
return $field;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieves a field from the object by Position as specified in the xml schema.
|
||||||
|
* Zero-based.
|
||||||
|
*
|
||||||
|
* @param int $pos position in xml schema
|
||||||
|
* @return mixed Value of field at $pos
|
||||||
|
*/
|
||||||
|
public function getByPosition($pos)
|
||||||
|
{
|
||||||
|
switch($pos) {
|
||||||
|
case 0:
|
||||||
|
return $this->getDbId();
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
return $this->getDbLocaleCode();
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
return $this->getDbLocaleLang();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return null;
|
||||||
|
break;
|
||||||
|
} // switch()
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Exports the object as an array.
|
||||||
|
*
|
||||||
|
* You can specify the key type of the array by passing one of the class
|
||||||
|
* type constants.
|
||||||
|
*
|
||||||
|
* @param string $keyType (optional) One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME,
|
||||||
|
* BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM.
|
||||||
|
* Defaults to BasePeer::TYPE_PHPNAME.
|
||||||
|
* @param boolean $includeLazyLoadColumns (optional) Whether to include lazy loaded columns. Defaults to TRUE.
|
||||||
|
*
|
||||||
|
* @return array an associative array containing the field names (as keys) and field values
|
||||||
|
*/
|
||||||
|
public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true)
|
||||||
|
{
|
||||||
|
$keys = CcLocalePeer::getFieldNames($keyType);
|
||||||
|
$result = array(
|
||||||
|
$keys[0] => $this->getDbId(),
|
||||||
|
$keys[1] => $this->getDbLocaleCode(),
|
||||||
|
$keys[2] => $this->getDbLocaleLang(),
|
||||||
|
);
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets a field from the object by name passed in as a string.
|
||||||
|
*
|
||||||
|
* @param string $name peer name
|
||||||
|
* @param mixed $value field value
|
||||||
|
* @param string $type The type of fieldname the $name is of:
|
||||||
|
* one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME
|
||||||
|
* BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
|
||||||
|
{
|
||||||
|
$pos = CcLocalePeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
|
||||||
|
return $this->setByPosition($pos, $value);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets a field from the object by Position as specified in the xml schema.
|
||||||
|
* Zero-based.
|
||||||
|
*
|
||||||
|
* @param int $pos position in xml schema
|
||||||
|
* @param mixed $value field value
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function setByPosition($pos, $value)
|
||||||
|
{
|
||||||
|
switch($pos) {
|
||||||
|
case 0:
|
||||||
|
$this->setDbId($value);
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
$this->setDbLocaleCode($value);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
$this->setDbLocaleLang($value);
|
||||||
|
break;
|
||||||
|
} // switch()
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Populates the object using an array.
|
||||||
|
*
|
||||||
|
* This is particularly useful when populating an object from one of the
|
||||||
|
* request arrays (e.g. $_POST). This method goes through the column
|
||||||
|
* names, checking to see whether a matching key exists in populated
|
||||||
|
* array. If so the setByName() method is called for that column.
|
||||||
|
*
|
||||||
|
* You can specify the key type of the array by additionally passing one
|
||||||
|
* of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME,
|
||||||
|
* BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM.
|
||||||
|
* The default key type is the column's phpname (e.g. 'AuthorId')
|
||||||
|
*
|
||||||
|
* @param array $arr An array to populate the object from.
|
||||||
|
* @param string $keyType The type of keys the array uses.
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
|
||||||
|
{
|
||||||
|
$keys = CcLocalePeer::getFieldNames($keyType);
|
||||||
|
|
||||||
|
if (array_key_exists($keys[0], $arr)) $this->setDbId($arr[$keys[0]]);
|
||||||
|
if (array_key_exists($keys[1], $arr)) $this->setDbLocaleCode($arr[$keys[1]]);
|
||||||
|
if (array_key_exists($keys[2], $arr)) $this->setDbLocaleLang($arr[$keys[2]]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Build a Criteria object containing the values of all modified columns in this object.
|
||||||
|
*
|
||||||
|
* @return Criteria The Criteria object containing all modified values.
|
||||||
|
*/
|
||||||
|
public function buildCriteria()
|
||||||
|
{
|
||||||
|
$criteria = new Criteria(CcLocalePeer::DATABASE_NAME);
|
||||||
|
|
||||||
|
if ($this->isColumnModified(CcLocalePeer::ID)) $criteria->add(CcLocalePeer::ID, $this->id);
|
||||||
|
if ($this->isColumnModified(CcLocalePeer::LOCALE_CODE)) $criteria->add(CcLocalePeer::LOCALE_CODE, $this->locale_code);
|
||||||
|
if ($this->isColumnModified(CcLocalePeer::LOCALE_LANG)) $criteria->add(CcLocalePeer::LOCALE_LANG, $this->locale_lang);
|
||||||
|
|
||||||
|
return $criteria;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Builds a Criteria object containing the primary key for this object.
|
||||||
|
*
|
||||||
|
* Unlike buildCriteria() this method includes the primary key values regardless
|
||||||
|
* of whether or not they have been modified.
|
||||||
|
*
|
||||||
|
* @return Criteria The Criteria object containing value(s) for primary key(s).
|
||||||
|
*/
|
||||||
|
public function buildPkeyCriteria()
|
||||||
|
{
|
||||||
|
$criteria = new Criteria(CcLocalePeer::DATABASE_NAME);
|
||||||
|
$criteria->add(CcLocalePeer::ID, $this->id);
|
||||||
|
|
||||||
|
return $criteria;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the primary key for this object (row).
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
|
public function getPrimaryKey()
|
||||||
|
{
|
||||||
|
return $this->getDbId();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generic method to set the primary key (id column).
|
||||||
|
*
|
||||||
|
* @param int $key Primary key.
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function setPrimaryKey($key)
|
||||||
|
{
|
||||||
|
$this->setDbId($key);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns true if the primary key for this object is null.
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
|
public function isPrimaryKeyNull()
|
||||||
|
{
|
||||||
|
return null === $this->getDbId();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets contents of passed object to values from current object.
|
||||||
|
*
|
||||||
|
* If desired, this method can also make copies of all associated (fkey referrers)
|
||||||
|
* objects.
|
||||||
|
*
|
||||||
|
* @param object $copyObj An object of CcLocale (or compatible) type.
|
||||||
|
* @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
|
||||||
|
* @throws PropelException
|
||||||
|
*/
|
||||||
|
public function copyInto($copyObj, $deepCopy = false)
|
||||||
|
{
|
||||||
|
$copyObj->setDbLocaleCode($this->locale_code);
|
||||||
|
$copyObj->setDbLocaleLang($this->locale_lang);
|
||||||
|
|
||||||
|
$copyObj->setNew(true);
|
||||||
|
$copyObj->setDbId(NULL); // this is a auto-increment column, so set to default value
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Makes a copy of this object that will be inserted as a new row in table when saved.
|
||||||
|
* It creates a new object filling in the simple attributes, but skipping any primary
|
||||||
|
* keys that are defined for the table.
|
||||||
|
*
|
||||||
|
* If desired, this method can also make copies of all associated (fkey referrers)
|
||||||
|
* objects.
|
||||||
|
*
|
||||||
|
* @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
|
||||||
|
* @return CcLocale Clone of current object.
|
||||||
|
* @throws PropelException
|
||||||
|
*/
|
||||||
|
public function copy($deepCopy = false)
|
||||||
|
{
|
||||||
|
// we use get_class(), because this might be a subclass
|
||||||
|
$clazz = get_class($this);
|
||||||
|
$copyObj = new $clazz();
|
||||||
|
$this->copyInto($copyObj, $deepCopy);
|
||||||
|
return $copyObj;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a peer instance associated with this om.
|
||||||
|
*
|
||||||
|
* Since Peer classes are not to have any instance attributes, this method returns the
|
||||||
|
* same instance for all member of this class. The method could therefore
|
||||||
|
* be static, but this would prevent one from overriding the behavior.
|
||||||
|
*
|
||||||
|
* @return CcLocalePeer
|
||||||
|
*/
|
||||||
|
public function getPeer()
|
||||||
|
{
|
||||||
|
if (self::$peer === null) {
|
||||||
|
self::$peer = new CcLocalePeer();
|
||||||
|
}
|
||||||
|
return self::$peer;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Clears the current object and sets all attributes to their default values
|
||||||
|
*/
|
||||||
|
public function clear()
|
||||||
|
{
|
||||||
|
$this->id = null;
|
||||||
|
$this->locale_code = null;
|
||||||
|
$this->locale_lang = null;
|
||||||
|
$this->alreadyInSave = false;
|
||||||
|
$this->alreadyInValidation = false;
|
||||||
|
$this->clearAllReferences();
|
||||||
|
$this->resetModified();
|
||||||
|
$this->setNew(true);
|
||||||
|
$this->setDeleted(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Resets all collections of referencing foreign keys.
|
||||||
|
*
|
||||||
|
* This method is a user-space workaround for PHP's inability to garbage collect objects
|
||||||
|
* with circular references. This is currently necessary when using Propel in certain
|
||||||
|
* daemon or large-volumne/high-memory operations.
|
||||||
|
*
|
||||||
|
* @param boolean $deep Whether to also clear the references on all associated objects.
|
||||||
|
*/
|
||||||
|
public function clearAllReferences($deep = false)
|
||||||
|
{
|
||||||
|
if ($deep) {
|
||||||
|
} // if ($deep)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Catches calls to virtual methods
|
||||||
|
*/
|
||||||
|
public function __call($name, $params)
|
||||||
|
{
|
||||||
|
if (preg_match('/get(\w+)/', $name, $matches)) {
|
||||||
|
$virtualColumn = $matches[1];
|
||||||
|
if ($this->hasVirtualColumn($virtualColumn)) {
|
||||||
|
return $this->getVirtualColumn($virtualColumn);
|
||||||
|
}
|
||||||
|
// no lcfirst in php<5.3...
|
||||||
|
$virtualColumn[0] = strtolower($virtualColumn[0]);
|
||||||
|
if ($this->hasVirtualColumn($virtualColumn)) {
|
||||||
|
return $this->getVirtualColumn($virtualColumn);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
throw new PropelException('Call to undefined method: ' . $name);
|
||||||
|
}
|
||||||
|
|
||||||
|
} // BaseCcLocale
|
744
airtime_mvc/application/models/airtime/om/BaseCcLocalePeer.php
Normal file
744
airtime_mvc/application/models/airtime/om/BaseCcLocalePeer.php
Normal file
|
@ -0,0 +1,744 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Base static class for performing query and update operations on the 'cc_locale' table.
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @package propel.generator.airtime.om
|
||||||
|
*/
|
||||||
|
abstract class BaseCcLocalePeer {
|
||||||
|
|
||||||
|
/** the default database name for this class */
|
||||||
|
const DATABASE_NAME = 'airtime';
|
||||||
|
|
||||||
|
/** the table name for this class */
|
||||||
|
const TABLE_NAME = 'cc_locale';
|
||||||
|
|
||||||
|
/** the related Propel class for this table */
|
||||||
|
const OM_CLASS = 'CcLocale';
|
||||||
|
|
||||||
|
/** A class that can be returned by this peer. */
|
||||||
|
const CLASS_DEFAULT = 'airtime.CcLocale';
|
||||||
|
|
||||||
|
/** the related TableMap class for this table */
|
||||||
|
const TM_CLASS = 'CcLocaleTableMap';
|
||||||
|
|
||||||
|
/** The total number of columns. */
|
||||||
|
const NUM_COLUMNS = 3;
|
||||||
|
|
||||||
|
/** The number of lazy-loaded columns. */
|
||||||
|
const NUM_LAZY_LOAD_COLUMNS = 0;
|
||||||
|
|
||||||
|
/** the column name for the ID field */
|
||||||
|
const ID = 'cc_locale.ID';
|
||||||
|
|
||||||
|
/** the column name for the LOCALE_CODE field */
|
||||||
|
const LOCALE_CODE = 'cc_locale.LOCALE_CODE';
|
||||||
|
|
||||||
|
/** the column name for the LOCALE_LANG field */
|
||||||
|
const LOCALE_LANG = 'cc_locale.LOCALE_LANG';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An identiy map to hold any loaded instances of CcLocale objects.
|
||||||
|
* This must be public so that other peer classes can access this when hydrating from JOIN
|
||||||
|
* queries.
|
||||||
|
* @var array CcLocale[]
|
||||||
|
*/
|
||||||
|
public static $instances = array();
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* holds an array of fieldnames
|
||||||
|
*
|
||||||
|
* first dimension keys are the type constants
|
||||||
|
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
|
||||||
|
*/
|
||||||
|
private static $fieldNames = array (
|
||||||
|
BasePeer::TYPE_PHPNAME => array ('DbId', 'DbLocaleCode', 'DbLocaleLang', ),
|
||||||
|
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbLocaleCode', 'dbLocaleLang', ),
|
||||||
|
BasePeer::TYPE_COLNAME => array (self::ID, self::LOCALE_CODE, self::LOCALE_LANG, ),
|
||||||
|
BasePeer::TYPE_RAW_COLNAME => array ('ID', 'LOCALE_CODE', 'LOCALE_LANG', ),
|
||||||
|
BasePeer::TYPE_FIELDNAME => array ('id', 'locale_code', 'locale_lang', ),
|
||||||
|
BasePeer::TYPE_NUM => array (0, 1, 2, )
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* holds an array of keys for quick access to the fieldnames array
|
||||||
|
*
|
||||||
|
* first dimension keys are the type constants
|
||||||
|
* e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
|
||||||
|
*/
|
||||||
|
private static $fieldKeys = array (
|
||||||
|
BasePeer::TYPE_PHPNAME => array ('DbId' => 0, 'DbLocaleCode' => 1, 'DbLocaleLang' => 2, ),
|
||||||
|
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbLocaleCode' => 1, 'dbLocaleLang' => 2, ),
|
||||||
|
BasePeer::TYPE_COLNAME => array (self::ID => 0, self::LOCALE_CODE => 1, self::LOCALE_LANG => 2, ),
|
||||||
|
BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'LOCALE_CODE' => 1, 'LOCALE_LANG' => 2, ),
|
||||||
|
BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'locale_code' => 1, 'locale_lang' => 2, ),
|
||||||
|
BasePeer::TYPE_NUM => array (0, 1, 2, )
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Translates a fieldname to another type
|
||||||
|
*
|
||||||
|
* @param string $name field name
|
||||||
|
* @param string $fromType One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME
|
||||||
|
* BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM
|
||||||
|
* @param string $toType One of the class type constants
|
||||||
|
* @return string translated name of the field.
|
||||||
|
* @throws PropelException - if the specified name could not be found in the fieldname mappings.
|
||||||
|
*/
|
||||||
|
static public function translateFieldName($name, $fromType, $toType)
|
||||||
|
{
|
||||||
|
$toNames = self::getFieldNames($toType);
|
||||||
|
$key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
|
||||||
|
if ($key === null) {
|
||||||
|
throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
|
||||||
|
}
|
||||||
|
return $toNames[$key];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns an array of field names.
|
||||||
|
*
|
||||||
|
* @param string $type The type of fieldnames to return:
|
||||||
|
* One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME
|
||||||
|
* BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM
|
||||||
|
* @return array A list of field names
|
||||||
|
*/
|
||||||
|
|
||||||
|
static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
|
||||||
|
{
|
||||||
|
if (!array_key_exists($type, self::$fieldNames)) {
|
||||||
|
throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. ' . $type . ' was given.');
|
||||||
|
}
|
||||||
|
return self::$fieldNames[$type];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convenience method which changes table.column to alias.column.
|
||||||
|
*
|
||||||
|
* Using this method you can maintain SQL abstraction while using column aliases.
|
||||||
|
* <code>
|
||||||
|
* $c->addAlias("alias1", TablePeer::TABLE_NAME);
|
||||||
|
* $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
|
||||||
|
* </code>
|
||||||
|
* @param string $alias The alias for the current table.
|
||||||
|
* @param string $column The column name for current table. (i.e. CcLocalePeer::COLUMN_NAME).
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public static function alias($alias, $column)
|
||||||
|
{
|
||||||
|
return str_replace(CcLocalePeer::TABLE_NAME.'.', $alias.'.', $column);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add all the columns needed to create a new object.
|
||||||
|
*
|
||||||
|
* Note: any columns that were marked with lazyLoad="true" in the
|
||||||
|
* XML schema will not be added to the select list and only loaded
|
||||||
|
* on demand.
|
||||||
|
*
|
||||||
|
* @param Criteria $criteria object containing the columns to add.
|
||||||
|
* @param string $alias optional table alias
|
||||||
|
* @throws PropelException Any exceptions caught during processing will be
|
||||||
|
* rethrown wrapped into a PropelException.
|
||||||
|
*/
|
||||||
|
public static function addSelectColumns(Criteria $criteria, $alias = null)
|
||||||
|
{
|
||||||
|
if (null === $alias) {
|
||||||
|
$criteria->addSelectColumn(CcLocalePeer::ID);
|
||||||
|
$criteria->addSelectColumn(CcLocalePeer::LOCALE_CODE);
|
||||||
|
$criteria->addSelectColumn(CcLocalePeer::LOCALE_LANG);
|
||||||
|
} else {
|
||||||
|
$criteria->addSelectColumn($alias . '.ID');
|
||||||
|
$criteria->addSelectColumn($alias . '.LOCALE_CODE');
|
||||||
|
$criteria->addSelectColumn($alias . '.LOCALE_LANG');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the number of rows matching criteria.
|
||||||
|
*
|
||||||
|
* @param Criteria $criteria
|
||||||
|
* @param boolean $distinct Whether to select only distinct columns; deprecated: use Criteria->setDistinct() instead.
|
||||||
|
* @param PropelPDO $con
|
||||||
|
* @return int Number of matching rows.
|
||||||
|
*/
|
||||||
|
public static function doCount(Criteria $criteria, $distinct = false, PropelPDO $con = null)
|
||||||
|
{
|
||||||
|
// we may modify criteria, so copy it first
|
||||||
|
$criteria = clone $criteria;
|
||||||
|
|
||||||
|
// We need to set the primary table name, since in the case that there are no WHERE columns
|
||||||
|
// it will be impossible for the BasePeer::createSelectSql() method to determine which
|
||||||
|
// tables go into the FROM clause.
|
||||||
|
$criteria->setPrimaryTableName(CcLocalePeer::TABLE_NAME);
|
||||||
|
|
||||||
|
if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
|
||||||
|
$criteria->setDistinct();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$criteria->hasSelectClause()) {
|
||||||
|
CcLocalePeer::addSelectColumns($criteria);
|
||||||
|
}
|
||||||
|
|
||||||
|
$criteria->clearOrderByColumns(); // ORDER BY won't ever affect the count
|
||||||
|
$criteria->setDbName(self::DATABASE_NAME); // Set the correct dbName
|
||||||
|
|
||||||
|
if ($con === null) {
|
||||||
|
$con = Propel::getConnection(CcLocalePeer::DATABASE_NAME, Propel::CONNECTION_READ);
|
||||||
|
}
|
||||||
|
// BasePeer returns a PDOStatement
|
||||||
|
$stmt = BasePeer::doCount($criteria, $con);
|
||||||
|
|
||||||
|
if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
|
||||||
|
$count = (int) $row[0];
|
||||||
|
} else {
|
||||||
|
$count = 0; // no rows returned; we infer that means 0 matches.
|
||||||
|
}
|
||||||
|
$stmt->closeCursor();
|
||||||
|
return $count;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Method to select one object from the DB.
|
||||||
|
*
|
||||||
|
* @param Criteria $criteria object used to create the SELECT statement.
|
||||||
|
* @param PropelPDO $con
|
||||||
|
* @return CcLocale
|
||||||
|
* @throws PropelException Any exceptions caught during processing will be
|
||||||
|
* rethrown wrapped into a PropelException.
|
||||||
|
*/
|
||||||
|
public static function doSelectOne(Criteria $criteria, PropelPDO $con = null)
|
||||||
|
{
|
||||||
|
$critcopy = clone $criteria;
|
||||||
|
$critcopy->setLimit(1);
|
||||||
|
$objects = CcLocalePeer::doSelect($critcopy, $con);
|
||||||
|
if ($objects) {
|
||||||
|
return $objects[0];
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Method to do selects.
|
||||||
|
*
|
||||||
|
* @param Criteria $criteria The Criteria object used to build the SELECT statement.
|
||||||
|
* @param PropelPDO $con
|
||||||
|
* @return array Array of selected Objects
|
||||||
|
* @throws PropelException Any exceptions caught during processing will be
|
||||||
|
* rethrown wrapped into a PropelException.
|
||||||
|
*/
|
||||||
|
public static function doSelect(Criteria $criteria, PropelPDO $con = null)
|
||||||
|
{
|
||||||
|
return CcLocalePeer::populateObjects(CcLocalePeer::doSelectStmt($criteria, $con));
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Prepares the Criteria object and uses the parent doSelect() method to execute a PDOStatement.
|
||||||
|
*
|
||||||
|
* Use this method directly if you want to work with an executed statement durirectly (for example
|
||||||
|
* to perform your own object hydration).
|
||||||
|
*
|
||||||
|
* @param Criteria $criteria The Criteria object used to build the SELECT statement.
|
||||||
|
* @param PropelPDO $con The connection to use
|
||||||
|
* @throws PropelException Any exceptions caught during processing will be
|
||||||
|
* rethrown wrapped into a PropelException.
|
||||||
|
* @return PDOStatement The executed PDOStatement object.
|
||||||
|
* @see BasePeer::doSelect()
|
||||||
|
*/
|
||||||
|
public static function doSelectStmt(Criteria $criteria, PropelPDO $con = null)
|
||||||
|
{
|
||||||
|
if ($con === null) {
|
||||||
|
$con = Propel::getConnection(CcLocalePeer::DATABASE_NAME, Propel::CONNECTION_READ);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$criteria->hasSelectClause()) {
|
||||||
|
$criteria = clone $criteria;
|
||||||
|
CcLocalePeer::addSelectColumns($criteria);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set the correct dbName
|
||||||
|
$criteria->setDbName(self::DATABASE_NAME);
|
||||||
|
|
||||||
|
// BasePeer returns a PDOStatement
|
||||||
|
return BasePeer::doSelect($criteria, $con);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Adds an object to the instance pool.
|
||||||
|
*
|
||||||
|
* Propel keeps cached copies of objects in an instance pool when they are retrieved
|
||||||
|
* from the database. In some cases -- especially when you override doSelect*()
|
||||||
|
* methods in your stub classes -- you may need to explicitly add objects
|
||||||
|
* to the cache in order to ensure that the same objects are always returned by doSelect*()
|
||||||
|
* and retrieveByPK*() calls.
|
||||||
|
*
|
||||||
|
* @param CcLocale $value A CcLocale object.
|
||||||
|
* @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally).
|
||||||
|
*/
|
||||||
|
public static function addInstanceToPool(CcLocale $obj, $key = null)
|
||||||
|
{
|
||||||
|
if (Propel::isInstancePoolingEnabled()) {
|
||||||
|
if ($key === null) {
|
||||||
|
$key = (string) $obj->getDbId();
|
||||||
|
} // if key === null
|
||||||
|
self::$instances[$key] = $obj;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Removes an object from the instance pool.
|
||||||
|
*
|
||||||
|
* Propel keeps cached copies of objects in an instance pool when they are retrieved
|
||||||
|
* from the database. In some cases -- especially when you override doDelete
|
||||||
|
* methods in your stub classes -- you may need to explicitly remove objects
|
||||||
|
* from the cache in order to prevent returning objects that no longer exist.
|
||||||
|
*
|
||||||
|
* @param mixed $value A CcLocale object or a primary key value.
|
||||||
|
*/
|
||||||
|
public static function removeInstanceFromPool($value)
|
||||||
|
{
|
||||||
|
if (Propel::isInstancePoolingEnabled() && $value !== null) {
|
||||||
|
if (is_object($value) && $value instanceof CcLocale) {
|
||||||
|
$key = (string) $value->getDbId();
|
||||||
|
} elseif (is_scalar($value)) {
|
||||||
|
// assume we've been passed a primary key
|
||||||
|
$key = (string) $value;
|
||||||
|
} else {
|
||||||
|
$e = new PropelException("Invalid value passed to removeInstanceFromPool(). Expected primary key or CcLocale object; got " . (is_object($value) ? get_class($value) . ' object.' : var_export($value,true)));
|
||||||
|
throw $e;
|
||||||
|
}
|
||||||
|
|
||||||
|
unset(self::$instances[$key]);
|
||||||
|
}
|
||||||
|
} // removeInstanceFromPool()
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieves a string version of the primary key from the DB resultset row that can be used to uniquely identify a row in this table.
|
||||||
|
*
|
||||||
|
* For tables with a single-column primary key, that simple pkey value will be returned. For tables with
|
||||||
|
* a multi-column primary key, a serialize()d version of the primary key will be returned.
|
||||||
|
*
|
||||||
|
* @param string $key The key (@see getPrimaryKeyHash()) for this instance.
|
||||||
|
* @return CcLocale Found object or NULL if 1) no instance exists for specified key or 2) instance pooling has been disabled.
|
||||||
|
* @see getPrimaryKeyHash()
|
||||||
|
*/
|
||||||
|
public static function getInstanceFromPool($key)
|
||||||
|
{
|
||||||
|
if (Propel::isInstancePoolingEnabled()) {
|
||||||
|
if (isset(self::$instances[$key])) {
|
||||||
|
return self::$instances[$key];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null; // just to be explicit
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Clear the instance pool.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public static function clearInstancePool()
|
||||||
|
{
|
||||||
|
self::$instances = array();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method to invalidate the instance pool of all tables related to cc_locale
|
||||||
|
* by a foreign key with ON DELETE CASCADE
|
||||||
|
*/
|
||||||
|
public static function clearRelatedInstancePool()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieves a string version of the primary key from the DB resultset row that can be used to uniquely identify a row in this table.
|
||||||
|
*
|
||||||
|
* For tables with a single-column primary key, that simple pkey value will be returned. For tables with
|
||||||
|
* a multi-column primary key, a serialize()d version of the primary key will be returned.
|
||||||
|
*
|
||||||
|
* @param array $row PropelPDO resultset row.
|
||||||
|
* @param int $startcol The 0-based offset for reading from the resultset row.
|
||||||
|
* @return string A string version of PK or NULL if the components of primary key in result array are all null.
|
||||||
|
*/
|
||||||
|
public static function getPrimaryKeyHashFromRow($row, $startcol = 0)
|
||||||
|
{
|
||||||
|
// If the PK cannot be derived from the row, return NULL.
|
||||||
|
if ($row[$startcol] === null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return (string) $row[$startcol];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieves the primary key from the DB resultset row
|
||||||
|
* For tables with a single-column primary key, that simple pkey value will be returned. For tables with
|
||||||
|
* a multi-column primary key, an array of the primary key columns will be returned.
|
||||||
|
*
|
||||||
|
* @param array $row PropelPDO resultset row.
|
||||||
|
* @param int $startcol The 0-based offset for reading from the resultset row.
|
||||||
|
* @return mixed The primary key of the row
|
||||||
|
*/
|
||||||
|
public static function getPrimaryKeyFromRow($row, $startcol = 0)
|
||||||
|
{
|
||||||
|
return (int) $row[$startcol];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The returned array will contain objects of the default type or
|
||||||
|
* objects that inherit from the default.
|
||||||
|
*
|
||||||
|
* @throws PropelException Any exceptions caught during processing will be
|
||||||
|
* rethrown wrapped into a PropelException.
|
||||||
|
*/
|
||||||
|
public static function populateObjects(PDOStatement $stmt)
|
||||||
|
{
|
||||||
|
$results = array();
|
||||||
|
|
||||||
|
// set the class once to avoid overhead in the loop
|
||||||
|
$cls = CcLocalePeer::getOMClass(false);
|
||||||
|
// populate the object(s)
|
||||||
|
while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
|
||||||
|
$key = CcLocalePeer::getPrimaryKeyHashFromRow($row, 0);
|
||||||
|
if (null !== ($obj = CcLocalePeer::getInstanceFromPool($key))) {
|
||||||
|
// We no longer rehydrate the object, since this can cause data loss.
|
||||||
|
// See http://www.propelorm.org/ticket/509
|
||||||
|
// $obj->hydrate($row, 0, true); // rehydrate
|
||||||
|
$results[] = $obj;
|
||||||
|
} else {
|
||||||
|
$obj = new $cls();
|
||||||
|
$obj->hydrate($row);
|
||||||
|
$results[] = $obj;
|
||||||
|
CcLocalePeer::addInstanceToPool($obj, $key);
|
||||||
|
} // if key exists
|
||||||
|
}
|
||||||
|
$stmt->closeCursor();
|
||||||
|
return $results;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Populates an object of the default type or an object that inherit from the default.
|
||||||
|
*
|
||||||
|
* @param array $row PropelPDO resultset row.
|
||||||
|
* @param int $startcol The 0-based offset for reading from the resultset row.
|
||||||
|
* @throws PropelException Any exceptions caught during processing will be
|
||||||
|
* rethrown wrapped into a PropelException.
|
||||||
|
* @return array (CcLocale object, last column rank)
|
||||||
|
*/
|
||||||
|
public static function populateObject($row, $startcol = 0)
|
||||||
|
{
|
||||||
|
$key = CcLocalePeer::getPrimaryKeyHashFromRow($row, $startcol);
|
||||||
|
if (null !== ($obj = CcLocalePeer::getInstanceFromPool($key))) {
|
||||||
|
// We no longer rehydrate the object, since this can cause data loss.
|
||||||
|
// See http://www.propelorm.org/ticket/509
|
||||||
|
// $obj->hydrate($row, $startcol, true); // rehydrate
|
||||||
|
$col = $startcol + CcLocalePeer::NUM_COLUMNS;
|
||||||
|
} else {
|
||||||
|
$cls = CcLocalePeer::OM_CLASS;
|
||||||
|
$obj = new $cls();
|
||||||
|
$col = $obj->hydrate($row, $startcol);
|
||||||
|
CcLocalePeer::addInstanceToPool($obj, $key);
|
||||||
|
}
|
||||||
|
return array($obj, $col);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Returns the TableMap related to this peer.
|
||||||
|
* This method is not needed for general use but a specific application could have a need.
|
||||||
|
* @return TableMap
|
||||||
|
* @throws PropelException Any exceptions caught during processing will be
|
||||||
|
* rethrown wrapped into a PropelException.
|
||||||
|
*/
|
||||||
|
public static function getTableMap()
|
||||||
|
{
|
||||||
|
return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add a TableMap instance to the database for this peer class.
|
||||||
|
*/
|
||||||
|
public static function buildTableMap()
|
||||||
|
{
|
||||||
|
$dbMap = Propel::getDatabaseMap(BaseCcLocalePeer::DATABASE_NAME);
|
||||||
|
if (!$dbMap->hasTable(BaseCcLocalePeer::TABLE_NAME))
|
||||||
|
{
|
||||||
|
$dbMap->addTableObject(new CcLocaleTableMap());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The class that the Peer will make instances of.
|
||||||
|
*
|
||||||
|
* If $withPrefix is true, the returned path
|
||||||
|
* uses a dot-path notation which is tranalted into a path
|
||||||
|
* relative to a location on the PHP include_path.
|
||||||
|
* (e.g. path.to.MyClass -> 'path/to/MyClass.php')
|
||||||
|
*
|
||||||
|
* @param boolean $withPrefix Whether or not to return the path with the class name
|
||||||
|
* @return string path.to.ClassName
|
||||||
|
*/
|
||||||
|
public static function getOMClass($withPrefix = true)
|
||||||
|
{
|
||||||
|
return $withPrefix ? CcLocalePeer::CLASS_DEFAULT : CcLocalePeer::OM_CLASS;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method perform an INSERT on the database, given a CcLocale or Criteria object.
|
||||||
|
*
|
||||||
|
* @param mixed $values Criteria or CcLocale object containing data that is used to create the INSERT statement.
|
||||||
|
* @param PropelPDO $con the PropelPDO connection to use
|
||||||
|
* @return mixed The new primary key.
|
||||||
|
* @throws PropelException Any exceptions caught during processing will be
|
||||||
|
* rethrown wrapped into a PropelException.
|
||||||
|
*/
|
||||||
|
public static function doInsert($values, PropelPDO $con = null)
|
||||||
|
{
|
||||||
|
if ($con === null) {
|
||||||
|
$con = Propel::getConnection(CcLocalePeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($values instanceof Criteria) {
|
||||||
|
$criteria = clone $values; // rename for clarity
|
||||||
|
} else {
|
||||||
|
$criteria = $values->buildCriteria(); // build Criteria from CcLocale object
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($criteria->containsKey(CcLocalePeer::ID) && $criteria->keyContainsValue(CcLocalePeer::ID) ) {
|
||||||
|
throw new PropelException('Cannot insert a value for auto-increment primary key ('.CcLocalePeer::ID.')');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Set the correct dbName
|
||||||
|
$criteria->setDbName(self::DATABASE_NAME);
|
||||||
|
|
||||||
|
try {
|
||||||
|
// use transaction because $criteria could contain info
|
||||||
|
// for more than one table (I guess, conceivably)
|
||||||
|
$con->beginTransaction();
|
||||||
|
$pk = BasePeer::doInsert($criteria, $con);
|
||||||
|
$con->commit();
|
||||||
|
} catch(PropelException $e) {
|
||||||
|
$con->rollBack();
|
||||||
|
throw $e;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $pk;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method perform an UPDATE on the database, given a CcLocale or Criteria object.
|
||||||
|
*
|
||||||
|
* @param mixed $values Criteria or CcLocale object containing data that is used to create the UPDATE statement.
|
||||||
|
* @param PropelPDO $con The connection to use (specify PropelPDO connection object to exert more control over transactions).
|
||||||
|
* @return int The number of affected rows (if supported by underlying database driver).
|
||||||
|
* @throws PropelException Any exceptions caught during processing will be
|
||||||
|
* rethrown wrapped into a PropelException.
|
||||||
|
*/
|
||||||
|
public static function doUpdate($values, PropelPDO $con = null)
|
||||||
|
{
|
||||||
|
if ($con === null) {
|
||||||
|
$con = Propel::getConnection(CcLocalePeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
|
||||||
|
}
|
||||||
|
|
||||||
|
$selectCriteria = new Criteria(self::DATABASE_NAME);
|
||||||
|
|
||||||
|
if ($values instanceof Criteria) {
|
||||||
|
$criteria = clone $values; // rename for clarity
|
||||||
|
|
||||||
|
$comparison = $criteria->getComparison(CcLocalePeer::ID);
|
||||||
|
$value = $criteria->remove(CcLocalePeer::ID);
|
||||||
|
if ($value) {
|
||||||
|
$selectCriteria->add(CcLocalePeer::ID, $value, $comparison);
|
||||||
|
} else {
|
||||||
|
$selectCriteria->setPrimaryTableName(CcLocalePeer::TABLE_NAME);
|
||||||
|
}
|
||||||
|
|
||||||
|
} else { // $values is CcLocale object
|
||||||
|
$criteria = $values->buildCriteria(); // gets full criteria
|
||||||
|
$selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
|
||||||
|
}
|
||||||
|
|
||||||
|
// set the correct dbName
|
||||||
|
$criteria->setDbName(self::DATABASE_NAME);
|
||||||
|
|
||||||
|
return BasePeer::doUpdate($selectCriteria, $criteria, $con);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method to DELETE all rows from the cc_locale table.
|
||||||
|
*
|
||||||
|
* @return int The number of affected rows (if supported by underlying database driver).
|
||||||
|
*/
|
||||||
|
public static function doDeleteAll($con = null)
|
||||||
|
{
|
||||||
|
if ($con === null) {
|
||||||
|
$con = Propel::getConnection(CcLocalePeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
|
||||||
|
}
|
||||||
|
$affectedRows = 0; // initialize var to track total num of affected rows
|
||||||
|
try {
|
||||||
|
// use transaction because $criteria could contain info
|
||||||
|
// for more than one table or we could emulating ON DELETE CASCADE, etc.
|
||||||
|
$con->beginTransaction();
|
||||||
|
$affectedRows += BasePeer::doDeleteAll(CcLocalePeer::TABLE_NAME, $con, CcLocalePeer::DATABASE_NAME);
|
||||||
|
// Because this db requires some delete cascade/set null emulation, we have to
|
||||||
|
// clear the cached instance *after* the emulation has happened (since
|
||||||
|
// instances get re-added by the select statement contained therein).
|
||||||
|
CcLocalePeer::clearInstancePool();
|
||||||
|
CcLocalePeer::clearRelatedInstancePool();
|
||||||
|
$con->commit();
|
||||||
|
return $affectedRows;
|
||||||
|
} catch (PropelException $e) {
|
||||||
|
$con->rollBack();
|
||||||
|
throw $e;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method perform a DELETE on the database, given a CcLocale or Criteria object OR a primary key value.
|
||||||
|
*
|
||||||
|
* @param mixed $values Criteria or CcLocale object or primary key or array of primary keys
|
||||||
|
* which is used to create the DELETE statement
|
||||||
|
* @param PropelPDO $con the connection to use
|
||||||
|
* @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
|
||||||
|
* if supported by native driver or if emulated using Propel.
|
||||||
|
* @throws PropelException Any exceptions caught during processing will be
|
||||||
|
* rethrown wrapped into a PropelException.
|
||||||
|
*/
|
||||||
|
public static function doDelete($values, PropelPDO $con = null)
|
||||||
|
{
|
||||||
|
if ($con === null) {
|
||||||
|
$con = Propel::getConnection(CcLocalePeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($values instanceof Criteria) {
|
||||||
|
// invalidate the cache for all objects of this type, since we have no
|
||||||
|
// way of knowing (without running a query) what objects should be invalidated
|
||||||
|
// from the cache based on this Criteria.
|
||||||
|
CcLocalePeer::clearInstancePool();
|
||||||
|
// rename for clarity
|
||||||
|
$criteria = clone $values;
|
||||||
|
} elseif ($values instanceof CcLocale) { // it's a model object
|
||||||
|
// invalidate the cache for this single object
|
||||||
|
CcLocalePeer::removeInstanceFromPool($values);
|
||||||
|
// create criteria based on pk values
|
||||||
|
$criteria = $values->buildPkeyCriteria();
|
||||||
|
} else { // it's a primary key, or an array of pks
|
||||||
|
$criteria = new Criteria(self::DATABASE_NAME);
|
||||||
|
$criteria->add(CcLocalePeer::ID, (array) $values, Criteria::IN);
|
||||||
|
// invalidate the cache for this object(s)
|
||||||
|
foreach ((array) $values as $singleval) {
|
||||||
|
CcLocalePeer::removeInstanceFromPool($singleval);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set the correct dbName
|
||||||
|
$criteria->setDbName(self::DATABASE_NAME);
|
||||||
|
|
||||||
|
$affectedRows = 0; // initialize var to track total num of affected rows
|
||||||
|
|
||||||
|
try {
|
||||||
|
// use transaction because $criteria could contain info
|
||||||
|
// for more than one table or we could emulating ON DELETE CASCADE, etc.
|
||||||
|
$con->beginTransaction();
|
||||||
|
|
||||||
|
$affectedRows += BasePeer::doDelete($criteria, $con);
|
||||||
|
CcLocalePeer::clearRelatedInstancePool();
|
||||||
|
$con->commit();
|
||||||
|
return $affectedRows;
|
||||||
|
} catch (PropelException $e) {
|
||||||
|
$con->rollBack();
|
||||||
|
throw $e;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Validates all modified columns of given CcLocale object.
|
||||||
|
* If parameter $columns is either a single column name or an array of column names
|
||||||
|
* than only those columns are validated.
|
||||||
|
*
|
||||||
|
* NOTICE: This does not apply to primary or foreign keys for now.
|
||||||
|
*
|
||||||
|
* @param CcLocale $obj The object to validate.
|
||||||
|
* @param mixed $cols Column name or array of column names.
|
||||||
|
*
|
||||||
|
* @return mixed TRUE if all columns are valid or the error message of the first invalid column.
|
||||||
|
*/
|
||||||
|
public static function doValidate(CcLocale $obj, $cols = null)
|
||||||
|
{
|
||||||
|
$columns = array();
|
||||||
|
|
||||||
|
if ($cols) {
|
||||||
|
$dbMap = Propel::getDatabaseMap(CcLocalePeer::DATABASE_NAME);
|
||||||
|
$tableMap = $dbMap->getTable(CcLocalePeer::TABLE_NAME);
|
||||||
|
|
||||||
|
if (! is_array($cols)) {
|
||||||
|
$cols = array($cols);
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ($cols as $colName) {
|
||||||
|
if ($tableMap->containsColumn($colName)) {
|
||||||
|
$get = 'get' . $tableMap->getColumn($colName)->getPhpName();
|
||||||
|
$columns[$colName] = $obj->$get();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return BasePeer::doValidate(CcLocalePeer::DATABASE_NAME, CcLocalePeer::TABLE_NAME, $columns);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieve a single object by pkey.
|
||||||
|
*
|
||||||
|
* @param int $pk the primary key.
|
||||||
|
* @param PropelPDO $con the connection to use
|
||||||
|
* @return CcLocale
|
||||||
|
*/
|
||||||
|
public static function retrieveByPK($pk, PropelPDO $con = null)
|
||||||
|
{
|
||||||
|
|
||||||
|
if (null !== ($obj = CcLocalePeer::getInstanceFromPool((string) $pk))) {
|
||||||
|
return $obj;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($con === null) {
|
||||||
|
$con = Propel::getConnection(CcLocalePeer::DATABASE_NAME, Propel::CONNECTION_READ);
|
||||||
|
}
|
||||||
|
|
||||||
|
$criteria = new Criteria(CcLocalePeer::DATABASE_NAME);
|
||||||
|
$criteria->add(CcLocalePeer::ID, $pk);
|
||||||
|
|
||||||
|
$v = CcLocalePeer::doSelect($criteria, $con);
|
||||||
|
|
||||||
|
return !empty($v) > 0 ? $v[0] : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieve multiple objects by pkey.
|
||||||
|
*
|
||||||
|
* @param array $pks List of primary keys
|
||||||
|
* @param PropelPDO $con the connection to use
|
||||||
|
* @throws PropelException Any exceptions caught during processing will be
|
||||||
|
* rethrown wrapped into a PropelException.
|
||||||
|
*/
|
||||||
|
public static function retrieveByPKs($pks, PropelPDO $con = null)
|
||||||
|
{
|
||||||
|
if ($con === null) {
|
||||||
|
$con = Propel::getConnection(CcLocalePeer::DATABASE_NAME, Propel::CONNECTION_READ);
|
||||||
|
}
|
||||||
|
|
||||||
|
$objs = null;
|
||||||
|
if (empty($pks)) {
|
||||||
|
$objs = array();
|
||||||
|
} else {
|
||||||
|
$criteria = new Criteria(CcLocalePeer::DATABASE_NAME);
|
||||||
|
$criteria->add(CcLocalePeer::ID, $pks, Criteria::IN);
|
||||||
|
$objs = CcLocalePeer::doSelect($criteria, $con);
|
||||||
|
}
|
||||||
|
return $objs;
|
||||||
|
}
|
||||||
|
|
||||||
|
} // BaseCcLocalePeer
|
||||||
|
|
||||||
|
// This is the static code needed to register the TableMap for this table with the main Propel class.
|
||||||
|
//
|
||||||
|
BaseCcLocalePeer::buildTableMap();
|
||||||
|
|
217
airtime_mvc/application/models/airtime/om/BaseCcLocaleQuery.php
Normal file
217
airtime_mvc/application/models/airtime/om/BaseCcLocaleQuery.php
Normal file
|
@ -0,0 +1,217 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Base class that represents a query for the 'cc_locale' table.
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @method CcLocaleQuery orderByDbId($order = Criteria::ASC) Order by the id column
|
||||||
|
* @method CcLocaleQuery orderByDbLocaleCode($order = Criteria::ASC) Order by the locale_code column
|
||||||
|
* @method CcLocaleQuery orderByDbLocaleLang($order = Criteria::ASC) Order by the locale_lang column
|
||||||
|
*
|
||||||
|
* @method CcLocaleQuery groupByDbId() Group by the id column
|
||||||
|
* @method CcLocaleQuery groupByDbLocaleCode() Group by the locale_code column
|
||||||
|
* @method CcLocaleQuery groupByDbLocaleLang() Group by the locale_lang column
|
||||||
|
*
|
||||||
|
* @method CcLocaleQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
|
||||||
|
* @method CcLocaleQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
|
||||||
|
* @method CcLocaleQuery innerJoin($relation) Adds a INNER JOIN clause to the query
|
||||||
|
*
|
||||||
|
* @method CcLocale findOne(PropelPDO $con = null) Return the first CcLocale matching the query
|
||||||
|
* @method CcLocale findOneOrCreate(PropelPDO $con = null) Return the first CcLocale matching the query, or a new CcLocale object populated from the query conditions when no match is found
|
||||||
|
*
|
||||||
|
* @method CcLocale findOneByDbId(int $id) Return the first CcLocale filtered by the id column
|
||||||
|
* @method CcLocale findOneByDbLocaleCode(string $locale_code) Return the first CcLocale filtered by the locale_code column
|
||||||
|
* @method CcLocale findOneByDbLocaleLang(string $locale_lang) Return the first CcLocale filtered by the locale_lang column
|
||||||
|
*
|
||||||
|
* @method array findByDbId(int $id) Return CcLocale objects filtered by the id column
|
||||||
|
* @method array findByDbLocaleCode(string $locale_code) Return CcLocale objects filtered by the locale_code column
|
||||||
|
* @method array findByDbLocaleLang(string $locale_lang) Return CcLocale objects filtered by the locale_lang column
|
||||||
|
*
|
||||||
|
* @package propel.generator.airtime.om
|
||||||
|
*/
|
||||||
|
abstract class BaseCcLocaleQuery extends ModelCriteria
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initializes internal state of BaseCcLocaleQuery object.
|
||||||
|
*
|
||||||
|
* @param string $dbName The dabase name
|
||||||
|
* @param string $modelName The phpName of a model, e.g. 'Book'
|
||||||
|
* @param string $modelAlias The alias for the model in this query, e.g. 'b'
|
||||||
|
*/
|
||||||
|
public function __construct($dbName = 'airtime', $modelName = 'CcLocale', $modelAlias = null)
|
||||||
|
{
|
||||||
|
parent::__construct($dbName, $modelName, $modelAlias);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a new CcLocaleQuery object.
|
||||||
|
*
|
||||||
|
* @param string $modelAlias The alias of a model in the query
|
||||||
|
* @param Criteria $criteria Optional Criteria to build the query from
|
||||||
|
*
|
||||||
|
* @return CcLocaleQuery
|
||||||
|
*/
|
||||||
|
public static function create($modelAlias = null, $criteria = null)
|
||||||
|
{
|
||||||
|
if ($criteria instanceof CcLocaleQuery) {
|
||||||
|
return $criteria;
|
||||||
|
}
|
||||||
|
$query = new CcLocaleQuery();
|
||||||
|
if (null !== $modelAlias) {
|
||||||
|
$query->setModelAlias($modelAlias);
|
||||||
|
}
|
||||||
|
if ($criteria instanceof Criteria) {
|
||||||
|
$query->mergeWith($criteria);
|
||||||
|
}
|
||||||
|
return $query;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Find object by primary key
|
||||||
|
* Use instance pooling to avoid a database query if the object exists
|
||||||
|
* <code>
|
||||||
|
* $obj = $c->findPk(12, $con);
|
||||||
|
* </code>
|
||||||
|
* @param mixed $key Primary key to use for the query
|
||||||
|
* @param PropelPDO $con an optional connection object
|
||||||
|
*
|
||||||
|
* @return CcLocale|array|mixed the result, formatted by the current formatter
|
||||||
|
*/
|
||||||
|
public function findPk($key, $con = null)
|
||||||
|
{
|
||||||
|
if ((null !== ($obj = CcLocalePeer::getInstanceFromPool((string) $key))) && $this->getFormatter()->isObjectFormatter()) {
|
||||||
|
// the object is alredy in the instance pool
|
||||||
|
return $obj;
|
||||||
|
} else {
|
||||||
|
// the object has not been requested yet, or the formatter is not an object formatter
|
||||||
|
$criteria = $this->isKeepQuery() ? clone $this : $this;
|
||||||
|
$stmt = $criteria
|
||||||
|
->filterByPrimaryKey($key)
|
||||||
|
->getSelectStatement($con);
|
||||||
|
return $criteria->getFormatter()->init($criteria)->formatOne($stmt);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Find objects by primary key
|
||||||
|
* <code>
|
||||||
|
* $objs = $c->findPks(array(12, 56, 832), $con);
|
||||||
|
* </code>
|
||||||
|
* @param array $keys Primary keys to use for the query
|
||||||
|
* @param PropelPDO $con an optional connection object
|
||||||
|
*
|
||||||
|
* @return PropelObjectCollection|array|mixed the list of results, formatted by the current formatter
|
||||||
|
*/
|
||||||
|
public function findPks($keys, $con = null)
|
||||||
|
{
|
||||||
|
$criteria = $this->isKeepQuery() ? clone $this : $this;
|
||||||
|
return $this
|
||||||
|
->filterByPrimaryKeys($keys)
|
||||||
|
->find($con);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Filter the query by primary key
|
||||||
|
*
|
||||||
|
* @param mixed $key Primary key to use for the query
|
||||||
|
*
|
||||||
|
* @return CcLocaleQuery The current query, for fluid interface
|
||||||
|
*/
|
||||||
|
public function filterByPrimaryKey($key)
|
||||||
|
{
|
||||||
|
return $this->addUsingAlias(CcLocalePeer::ID, $key, Criteria::EQUAL);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Filter the query by a list of primary keys
|
||||||
|
*
|
||||||
|
* @param array $keys The list of primary key to use for the query
|
||||||
|
*
|
||||||
|
* @return CcLocaleQuery The current query, for fluid interface
|
||||||
|
*/
|
||||||
|
public function filterByPrimaryKeys($keys)
|
||||||
|
{
|
||||||
|
return $this->addUsingAlias(CcLocalePeer::ID, $keys, Criteria::IN);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Filter the query on the id column
|
||||||
|
*
|
||||||
|
* @param int|array $dbId The value to use as filter.
|
||||||
|
* Accepts an associative array('min' => $minValue, 'max' => $maxValue)
|
||||||
|
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||||
|
*
|
||||||
|
* @return CcLocaleQuery The current query, for fluid interface
|
||||||
|
*/
|
||||||
|
public function filterByDbId($dbId = null, $comparison = null)
|
||||||
|
{
|
||||||
|
if (is_array($dbId) && null === $comparison) {
|
||||||
|
$comparison = Criteria::IN;
|
||||||
|
}
|
||||||
|
return $this->addUsingAlias(CcLocalePeer::ID, $dbId, $comparison);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Filter the query on the locale_code column
|
||||||
|
*
|
||||||
|
* @param string $dbLocaleCode The value to use as filter.
|
||||||
|
* Accepts wildcards (* and % trigger a LIKE)
|
||||||
|
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||||
|
*
|
||||||
|
* @return CcLocaleQuery The current query, for fluid interface
|
||||||
|
*/
|
||||||
|
public function filterByDbLocaleCode($dbLocaleCode = null, $comparison = null)
|
||||||
|
{
|
||||||
|
if (null === $comparison) {
|
||||||
|
if (is_array($dbLocaleCode)) {
|
||||||
|
$comparison = Criteria::IN;
|
||||||
|
} elseif (preg_match('/[\%\*]/', $dbLocaleCode)) {
|
||||||
|
$dbLocaleCode = str_replace('*', '%', $dbLocaleCode);
|
||||||
|
$comparison = Criteria::LIKE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $this->addUsingAlias(CcLocalePeer::LOCALE_CODE, $dbLocaleCode, $comparison);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Filter the query on the locale_lang column
|
||||||
|
*
|
||||||
|
* @param string $dbLocaleLang The value to use as filter.
|
||||||
|
* Accepts wildcards (* and % trigger a LIKE)
|
||||||
|
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||||
|
*
|
||||||
|
* @return CcLocaleQuery The current query, for fluid interface
|
||||||
|
*/
|
||||||
|
public function filterByDbLocaleLang($dbLocaleLang = null, $comparison = null)
|
||||||
|
{
|
||||||
|
if (null === $comparison) {
|
||||||
|
if (is_array($dbLocaleLang)) {
|
||||||
|
$comparison = Criteria::IN;
|
||||||
|
} elseif (preg_match('/[\%\*]/', $dbLocaleLang)) {
|
||||||
|
$dbLocaleLang = str_replace('*', '%', $dbLocaleLang);
|
||||||
|
$comparison = Criteria::LIKE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $this->addUsingAlias(CcLocalePeer::LOCALE_LANG, $dbLocaleLang, $comparison);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Exclude object from result
|
||||||
|
*
|
||||||
|
* @param CcLocale $ccLocale Object to remove from the list of results
|
||||||
|
*
|
||||||
|
* @return CcLocaleQuery The current query, for fluid interface
|
||||||
|
*/
|
||||||
|
public function prune($ccLocale = null)
|
||||||
|
{
|
||||||
|
if ($ccLocale) {
|
||||||
|
$this->addUsingAlias(CcLocalePeer::ID, $ccLocale->getDbId(), Criteria::NOT_EQUAL);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
} // BaseCcLocaleQuery
|
|
@ -1 +0,0 @@
|
||||||
<br /><br /><center>View script for controller <b>AirtimeRecorder</b> and script/action name <b>index</b></center>
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue