parent
dec68649c1
commit
e91c96b90e
|
@ -254,10 +254,10 @@ class PreferenceController extends Zend_Controller_Action
|
|||
}
|
||||
|
||||
// extra info that goes into cc_stream_setting
|
||||
Application_Model_StreamSetting::SetMasterLiveSteamPort($values["master_harbor_input_port"]);
|
||||
Application_Model_StreamSetting::SetMasterLiveSteamMountPoint($values["master_harbor_input_mount_point"]);
|
||||
Application_Model_StreamSetting::SetDJLiveSteamPort($values["dj_harbor_input_port"]);
|
||||
Application_Model_StreamSetting::SetDJLiveSteamMountPoint($values["dj_harbor_input_mount_point"]);
|
||||
Application_Model_StreamSetting::setMasterLiveStreamPort($values["master_harbor_input_port"]);
|
||||
Application_Model_StreamSetting::setMasterLiveStreamMountPoint($values["master_harbor_input_mount_point"]);
|
||||
Application_Model_StreamSetting::setDjLiveStreamPort($values["dj_harbor_input_port"]);
|
||||
Application_Model_StreamSetting::setDjLiveStreamMountPoint($values["dj_harbor_input_mount_point"]);
|
||||
}
|
||||
|
||||
// store stream update timestamp
|
||||
|
|
|
@ -27,7 +27,7 @@ class ShowbuilderController extends Zend_Controller_Action
|
|||
$userType = $user->getType();
|
||||
$this->view->headScript()->appendScript("localStorage.setItem( 'user-type', '$userType' );");
|
||||
|
||||
$data = Application_Model_Preference::GetValue("library_datatable", true);
|
||||
$data = Application_Model_Preference::getValue("library_datatable", true);
|
||||
if ($data != "") {
|
||||
$libraryTable = json_encode(unserialize($data));
|
||||
$this->view->headScript()->appendScript("localStorage.setItem( 'datatables-library', JSON.stringify($libraryTable) );");
|
||||
|
@ -36,7 +36,7 @@ class ShowbuilderController extends Zend_Controller_Action
|
|||
$this->view->headScript()->appendScript("localStorage.setItem( 'datatables-library', '' );");
|
||||
}
|
||||
|
||||
$data = Application_Model_Preference::GetValue("timeline_datatable", true);
|
||||
$data = Application_Model_Preference::getValue("timeline_datatable", true);
|
||||
if ($data != "") {
|
||||
$timelineTable = json_encode(unserialize($data));
|
||||
$this->view->headScript()->appendScript("localStorage.setItem( 'datatables-timeline', JSON.stringify($timelineTable) );");
|
||||
|
@ -130,7 +130,7 @@ class ShowbuilderController extends Zend_Controller_Action
|
|||
$showLib = false;
|
||||
if (!$user->isGuest()) {
|
||||
$disableLib = false;
|
||||
$data = Application_Model_Preference::GetValue("nowplaying_screen", true);
|
||||
$data = Application_Model_Preference::getValue("nowplaying_screen", true);
|
||||
if ($data != "") {
|
||||
$settings = unserialize($data);
|
||||
|
||||
|
|
|
@ -23,12 +23,12 @@ class UsersettingsController extends Zend_Controller_Action
|
|||
$settings = $request->getParam("settings");
|
||||
|
||||
$data = serialize($settings);
|
||||
Application_Model_Preference::SetValue("nowplaying_screen", $data, true);
|
||||
Application_Model_Preference::setValue("nowplaying_screen", $data, true);
|
||||
}
|
||||
|
||||
public function getNowPlayingScreenSettingsAction() {
|
||||
|
||||
$data = Application_Model_Preference::GetValue("nowplaying_screen", true);
|
||||
$data = Application_Model_Preference::getValue("nowplaying_screen", true);
|
||||
if ($data != "") {
|
||||
$this->view->settings = unserialize($data);
|
||||
}
|
||||
|
@ -40,12 +40,12 @@ class UsersettingsController extends Zend_Controller_Action
|
|||
$settings = $request->getParam("settings");
|
||||
|
||||
$data = serialize($settings);
|
||||
Application_Model_Preference::SetValue("library_datatable", $data, true);
|
||||
Application_Model_Preference::setValue("library_datatable", $data, true);
|
||||
}
|
||||
|
||||
public function getLibraryDatatableAction() {
|
||||
|
||||
$data = Application_Model_Preference::GetValue("library_datatable", true);
|
||||
$data = Application_Model_Preference::getValue("library_datatable", true);
|
||||
if ($data != "") {
|
||||
$this->view->settings = unserialize($data);
|
||||
}
|
||||
|
@ -59,7 +59,7 @@ class UsersettingsController extends Zend_Controller_Action
|
|||
$settings = $request->getParam("settings");
|
||||
|
||||
$data = serialize($settings);
|
||||
Application_Model_Preference::SetValue("timeline_datatable", $data, true);
|
||||
Application_Model_Preference::setValue("timeline_datatable", $data, true);
|
||||
|
||||
$end = microtime(true);
|
||||
|
||||
|
@ -71,7 +71,7 @@ class UsersettingsController extends Zend_Controller_Action
|
|||
|
||||
$start = microtime(true);
|
||||
|
||||
$data = Application_Model_Preference::GetValue("timeline_datatable", true);
|
||||
$data = Application_Model_Preference::getValue("timeline_datatable", true);
|
||||
if ($data != "") {
|
||||
$this->view->settings = unserialize($data);
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ class Application_Form_GeneralPreferences extends Zend_Form_SubForm
|
|||
'label' => 'Station Name',
|
||||
'required' => false,
|
||||
'filters' => array('StringTrim'),
|
||||
'value' => Application_Model_Preference::GetValue("station_name"),
|
||||
'value' => Application_Model_Preference::getValue("station_name"),
|
||||
'decorators' => array(
|
||||
'ViewHelper'
|
||||
)
|
||||
|
|
|
@ -83,7 +83,7 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm
|
|||
|
||||
//liquidsoap harbor.input port
|
||||
if (!$isSaas) {
|
||||
$m_port = Application_Model_StreamSetting::GetMasterLiveSteamPort();
|
||||
$m_port = Application_Model_StreamSetting::getMasterLiveStreamPort();
|
||||
$master_dj_port = new Zend_Form_Element_Text('master_harbor_input_port');
|
||||
$master_dj_port->setLabel("Master Source Port")
|
||||
->setValue($m_port)
|
||||
|
@ -92,7 +92,7 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm
|
|||
->setDecorators(array('ViewHelper'));
|
||||
$this->addElement($master_dj_port);
|
||||
|
||||
$m_mount = Application_Model_StreamSetting::GetMasterLiveSteamMountPoint();
|
||||
$m_mount = Application_Model_StreamSetting::getMasterLiveStreamMountPoint();
|
||||
$master_dj_mount = new Zend_Form_Element_Text('master_harbor_input_mount_point');
|
||||
$master_dj_mount->setLabel("Master Source Mount Point")
|
||||
->setValue($m_mount)
|
||||
|
@ -102,7 +102,7 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm
|
|||
$this->addElement($master_dj_mount);
|
||||
|
||||
//liquidsoap harbor.input port
|
||||
$l_port = Application_Model_StreamSetting::GetDJLiveSteamPort();
|
||||
$l_port = Application_Model_StreamSetting::getDjLiveStreamPort();
|
||||
$live_dj_port = new Zend_Form_Element_Text('dj_harbor_input_port');
|
||||
$live_dj_port->setLabel("Show Source Port")
|
||||
->setValue($l_port)
|
||||
|
@ -111,7 +111,7 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm
|
|||
->setDecorators(array('ViewHelper'));
|
||||
$this->addElement($live_dj_port);
|
||||
|
||||
$l_mount = Application_Model_StreamSetting::GetDJLiveSteamMountPoint();
|
||||
$l_mount = Application_Model_StreamSetting::getDjLiveStreamMountPoint();
|
||||
$live_dj_mount = new Zend_Form_Element_Text('dj_harbor_input_mount_point');
|
||||
$live_dj_mount->setLabel("Show Source Mount Point")
|
||||
->setValue($l_mount)
|
||||
|
@ -159,7 +159,7 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm
|
|||
}
|
||||
if($master_harbor_input_port != ""){
|
||||
if(is_numeric($master_harbor_input_port)){
|
||||
if($master_harbor_input_port != Application_Model_StreamSetting::GetMasterLiveSteamPort()){
|
||||
if($master_harbor_input_port != Application_Model_StreamSetting::getMasterLiveStreamPort()){
|
||||
$sock = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
|
||||
$res = socket_bind($sock, 0, $master_harbor_input_port);
|
||||
if(!$res){
|
||||
|
@ -175,7 +175,7 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm
|
|||
}
|
||||
if($dj_harbor_input_port != ""){
|
||||
if(is_numeric($dj_harbor_input_port)){
|
||||
if($dj_harbor_input_port != Application_Model_StreamSetting::GetDJLiveSteamPort()){
|
||||
if($dj_harbor_input_port != Application_Model_StreamSetting::getDjLiveStreamPort()){
|
||||
$sock = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
|
||||
$res = socket_bind($sock, 0, $dj_harbor_input_port);
|
||||
if(!$res){
|
||||
|
|
|
@ -24,7 +24,7 @@ class Application_Form_SupportSettings extends Zend_Form
|
|||
'required' => true,
|
||||
'filters' => array('StringTrim'),
|
||||
'validator' => array('NotEmpty'),
|
||||
'value' => Application_Model_Preference::GetValue("station_name"),
|
||||
'value' => Application_Model_Preference::getValue("station_name"),
|
||||
'decorators' => array(
|
||||
'ViewHelper'
|
||||
)
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
class Application_Model_Preference
|
||||
{
|
||||
|
||||
public static function SetValue($key, $value, $isUserValue = false){
|
||||
public static function setValue($key, $value, $isUserValue = false){
|
||||
try {
|
||||
$con = Propel::getConnection();
|
||||
|
||||
|
@ -72,7 +72,7 @@ class Application_Model_Preference
|
|||
|
||||
}
|
||||
|
||||
public static function GetValue($key, $isUserValue = false){
|
||||
public static function getValue($key, $isUserValue = false){
|
||||
try {
|
||||
$con = Propel::getConnection();
|
||||
|
||||
|
@ -110,7 +110,7 @@ class Application_Model_Preference
|
|||
}
|
||||
|
||||
public static function GetHeadTitle(){
|
||||
$title = self::GetValue("station_name");
|
||||
$title = self::getValue("station_name");
|
||||
$defaultNamespace->title = $title;
|
||||
if (strlen($title) > 0)
|
||||
$title .= " - ";
|
||||
|
@ -119,7 +119,7 @@ class Application_Model_Preference
|
|||
}
|
||||
|
||||
public static function SetHeadTitle($title, $view=null){
|
||||
self::SetValue("station_name", $title);
|
||||
self::setValue("station_name", $title);
|
||||
|
||||
// in case this is called from airtime-saas script
|
||||
if($view !== null){
|
||||
|
@ -143,7 +143,7 @@ class Application_Model_Preference
|
|||
* A row from cc_show_days table
|
||||
*/
|
||||
public static function SetShowsPopulatedUntil($dateTime) {
|
||||
self::SetValue("shows_populated_until", $dateTime->format("Y-m-d H:i:s"));
|
||||
self::setValue("shows_populated_until", $dateTime->format("Y-m-d H:i:s"));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -156,7 +156,7 @@ class Application_Model_Preference
|
|||
* @return DateTime (in UTC Timezone)
|
||||
*/
|
||||
public static function GetShowsPopulatedUntil() {
|
||||
$date = self::GetValue("shows_populated_until");
|
||||
$date = self::getValue("shows_populated_until");
|
||||
|
||||
if ($date == ""){
|
||||
return null;
|
||||
|
@ -166,11 +166,11 @@ class Application_Model_Preference
|
|||
}
|
||||
|
||||
public static function SetDefaultFade($fade) {
|
||||
self::SetValue("default_fade", $fade);
|
||||
self::setValue("default_fade", $fade);
|
||||
}
|
||||
|
||||
public static function GetDefaultFade() {
|
||||
$fade = self::GetValue("default_fade");
|
||||
$fade = self::getValue("default_fade");
|
||||
|
||||
if ($fade === "") {
|
||||
// the default value of the fade is 00.500000
|
||||
|
@ -195,7 +195,7 @@ class Application_Model_Preference
|
|||
}
|
||||
|
||||
public static function SetDefaultTransitionFade($fade) {
|
||||
self::SetValue("default_transition_fade", $fade);
|
||||
self::setValue("default_transition_fade", $fade);
|
||||
|
||||
$eventType = "update_transition_fade";
|
||||
$md = array("transition_fade"=>$fade);
|
||||
|
@ -203,7 +203,7 @@ class Application_Model_Preference
|
|||
}
|
||||
|
||||
public static function GetDefaultTransitionFade() {
|
||||
$transition_fade = self::GetValue("default_transition_fade");
|
||||
$transition_fade = self::getValue("default_transition_fade");
|
||||
if($transition_fade == ""){
|
||||
$transition_fade = "00.000000";
|
||||
}
|
||||
|
@ -211,7 +211,7 @@ class Application_Model_Preference
|
|||
}
|
||||
|
||||
public static function SetStreamLabelFormat($type){
|
||||
self::SetValue("stream_label_format", $type);
|
||||
self::setValue("stream_label_format", $type);
|
||||
|
||||
$eventType = "update_stream_format";
|
||||
$md = array("stream_format"=>$type);
|
||||
|
@ -228,68 +228,68 @@ class Application_Model_Preference
|
|||
}
|
||||
|
||||
public static function SetAutoUploadRecordedShowToSoundcloud($upload) {
|
||||
self::SetValue("soundcloud_auto_upload_recorded_show", $upload);
|
||||
self::setValue("soundcloud_auto_upload_recorded_show", $upload);
|
||||
}
|
||||
|
||||
public static function GetAutoUploadRecordedShowToSoundcloud() {
|
||||
return self::GetValue("soundcloud_auto_upload_recorded_show");
|
||||
return self::getValue("soundcloud_auto_upload_recorded_show");
|
||||
}
|
||||
|
||||
public static function SetSoundCloudUser($user) {
|
||||
self::SetValue("soundcloud_user", $user);
|
||||
self::setValue("soundcloud_user", $user);
|
||||
}
|
||||
|
||||
public static function GetSoundCloudUser() {
|
||||
return self::GetValue("soundcloud_user");
|
||||
return self::getValue("soundcloud_user");
|
||||
}
|
||||
|
||||
public static function SetSoundCloudPassword($password) {
|
||||
if (strlen($password) > 0)
|
||||
self::SetValue("soundcloud_password", $password);
|
||||
self::setValue("soundcloud_password", $password);
|
||||
}
|
||||
|
||||
public static function GetSoundCloudPassword() {
|
||||
return self::GetValue("soundcloud_password");
|
||||
return self::getValue("soundcloud_password");
|
||||
}
|
||||
|
||||
public static function SetSoundCloudTags($tags) {
|
||||
self::SetValue("soundcloud_tags", $tags);
|
||||
self::setValue("soundcloud_tags", $tags);
|
||||
}
|
||||
|
||||
public static function GetSoundCloudTags() {
|
||||
return self::GetValue("soundcloud_tags");
|
||||
return self::getValue("soundcloud_tags");
|
||||
}
|
||||
|
||||
public static function SetSoundCloudGenre($genre) {
|
||||
self::SetValue("soundcloud_genre", $genre);
|
||||
self::setValue("soundcloud_genre", $genre);
|
||||
}
|
||||
|
||||
public static function GetSoundCloudGenre() {
|
||||
return self::GetValue("soundcloud_genre");
|
||||
return self::getValue("soundcloud_genre");
|
||||
}
|
||||
|
||||
public static function SetSoundCloudTrackType($track_type) {
|
||||
self::SetValue("soundcloud_tracktype", $track_type);
|
||||
self::setValue("soundcloud_tracktype", $track_type);
|
||||
}
|
||||
|
||||
public static function GetSoundCloudTrackType() {
|
||||
return self::GetValue("soundcloud_tracktype");
|
||||
return self::getValue("soundcloud_tracktype");
|
||||
}
|
||||
|
||||
public static function SetSoundCloudLicense($license) {
|
||||
self::SetValue("soundcloud_license", $license);
|
||||
self::setValue("soundcloud_license", $license);
|
||||
}
|
||||
|
||||
public static function GetSoundCloudLicense() {
|
||||
return self::GetValue("soundcloud_license");
|
||||
return self::getValue("soundcloud_license");
|
||||
}
|
||||
|
||||
public static function SetAllow3rdPartyApi($bool) {
|
||||
self::SetValue("third_party_api", $bool);
|
||||
self::setValue("third_party_api", $bool);
|
||||
}
|
||||
|
||||
public static function GetAllow3rdPartyApi() {
|
||||
$val = self::GetValue("third_party_api");
|
||||
$val = self::getValue("third_party_api");
|
||||
if (strlen($val) == 0){
|
||||
return "0";
|
||||
} else {
|
||||
|
@ -298,101 +298,101 @@ class Application_Model_Preference
|
|||
}
|
||||
|
||||
public static function SetPhone($phone){
|
||||
self::SetValue("phone", $phone);
|
||||
self::setValue("phone", $phone);
|
||||
}
|
||||
|
||||
public static function GetPhone(){
|
||||
return self::GetValue("phone");
|
||||
return self::getValue("phone");
|
||||
}
|
||||
|
||||
public static function SetEmail($email){
|
||||
self::SetValue("email", $email);
|
||||
self::setValue("email", $email);
|
||||
}
|
||||
|
||||
public static function GetEmail(){
|
||||
return self::GetValue("email");
|
||||
return self::getValue("email");
|
||||
}
|
||||
|
||||
public static function SetStationWebSite($site){
|
||||
self::SetValue("station_website", $site);
|
||||
self::setValue("station_website", $site);
|
||||
}
|
||||
|
||||
public static function GetStationWebSite(){
|
||||
return self::GetValue("station_website");
|
||||
return self::getValue("station_website");
|
||||
}
|
||||
|
||||
public static function SetSupportFeedback($feedback){
|
||||
self::SetValue("support_feedback", $feedback);
|
||||
self::setValue("support_feedback", $feedback);
|
||||
}
|
||||
|
||||
public static function GetSupportFeedback(){
|
||||
return self::GetValue("support_feedback");
|
||||
return self::getValue("support_feedback");
|
||||
}
|
||||
|
||||
public static function SetPublicise($publicise){
|
||||
self::SetValue("publicise", $publicise);
|
||||
self::setValue("publicise", $publicise);
|
||||
}
|
||||
|
||||
public static function GetPublicise(){
|
||||
return self::GetValue("publicise");
|
||||
return self::getValue("publicise");
|
||||
}
|
||||
|
||||
public static function SetRegistered($registered){
|
||||
self::SetValue("registered", $registered);
|
||||
self::setValue("registered", $registered);
|
||||
}
|
||||
|
||||
public static function GetRegistered(){
|
||||
return self::GetValue("registered");
|
||||
return self::getValue("registered");
|
||||
}
|
||||
|
||||
public static function SetStationCountry($country){
|
||||
self::SetValue("country", $country);
|
||||
self::setValue("country", $country);
|
||||
}
|
||||
|
||||
public static function GetStationCountry(){
|
||||
return self::GetValue("country");
|
||||
return self::getValue("country");
|
||||
}
|
||||
|
||||
public static function SetStationCity($city){
|
||||
self::SetValue("city", $city);
|
||||
self::setValue("city", $city);
|
||||
}
|
||||
|
||||
public static function GetStationCity(){
|
||||
return self::GetValue("city");
|
||||
return self::getValue("city");
|
||||
}
|
||||
|
||||
public static function SetStationDescription($description){
|
||||
self::SetValue("description", $description);
|
||||
self::setValue("description", $description);
|
||||
}
|
||||
|
||||
public static function GetStationDescription(){
|
||||
return self::GetValue("description");
|
||||
return self::getValue("description");
|
||||
}
|
||||
|
||||
public static function SetTimezone($timezone){
|
||||
self::SetValue("timezone", $timezone);
|
||||
self::setValue("timezone", $timezone);
|
||||
date_default_timezone_set($timezone);
|
||||
$md = array("timezone" => $timezone);
|
||||
}
|
||||
|
||||
public static function GetTimezone(){
|
||||
return self::GetValue("timezone");
|
||||
return self::getValue("timezone");
|
||||
}
|
||||
|
||||
public static function SetStationLogo($imagePath){
|
||||
if(!empty($imagePath)){
|
||||
$image = @file_get_contents($imagePath);
|
||||
$image = base64_encode($image);
|
||||
self::SetValue("logoImage", $image);
|
||||
self::setValue("logoImage", $image);
|
||||
}
|
||||
}
|
||||
|
||||
public static function GetStationLogo(){
|
||||
return self::GetValue("logoImage");
|
||||
return self::getValue("logoImage");
|
||||
}
|
||||
|
||||
public static function GetUniqueId(){
|
||||
return self::GetValue("uniqueId");
|
||||
return self::getValue("uniqueId");
|
||||
}
|
||||
|
||||
public static function GetCountryList()
|
||||
|
@ -531,64 +531,64 @@ class Application_Model_Preference
|
|||
|
||||
public static function SetRemindMeDate(){
|
||||
$weekAfter = mktime(0, 0, 0, gmdate("m"), gmdate("d")+7, gmdate("Y"));
|
||||
self::SetValue("remindme", $weekAfter);
|
||||
self::setValue("remindme", $weekAfter);
|
||||
}
|
||||
|
||||
public static function GetRemindMeDate(){
|
||||
return self::GetValue("remindme");
|
||||
return self::getValue("remindme");
|
||||
}
|
||||
|
||||
public static function SetImportTimestamp(){
|
||||
$now = time();
|
||||
if(self::GetImportTimestamp()+5 < $now){
|
||||
self::SetValue("import_timestamp", $now);
|
||||
self::setValue("import_timestamp", $now);
|
||||
}
|
||||
}
|
||||
|
||||
public static function GetImportTimestamp(){
|
||||
return self::GetValue("import_timestamp");
|
||||
return self::getValue("import_timestamp");
|
||||
}
|
||||
|
||||
public static function GetStreamType(){
|
||||
$st = self::GetValue("stream_type");
|
||||
$st = self::getValue("stream_type");
|
||||
return explode(',', $st);
|
||||
}
|
||||
|
||||
public static function GetStreamBitrate(){
|
||||
$sb = self::GetValue("stream_bitrate");
|
||||
$sb = self::getValue("stream_bitrate");
|
||||
return explode(',', $sb);
|
||||
}
|
||||
|
||||
public static function SetPrivacyPolicyCheck($flag){
|
||||
self::SetValue("privacy_policy", $flag);
|
||||
self::setValue("privacy_policy", $flag);
|
||||
}
|
||||
|
||||
public static function GetPrivacyPolicyCheck(){
|
||||
return self::GetValue("privacy_policy");
|
||||
return self::getValue("privacy_policy");
|
||||
}
|
||||
|
||||
public static function SetNumOfStreams($num){
|
||||
self::SetValue("num_of_streams", intval($num));
|
||||
self::setValue("num_of_streams", intval($num));
|
||||
}
|
||||
|
||||
public static function GetNumOfStreams(){
|
||||
return self::GetValue("num_of_streams");
|
||||
return self::getValue("num_of_streams");
|
||||
}
|
||||
|
||||
public static function SetMaxBitrate($bitrate){
|
||||
self::SetValue("max_bitrate", intval($bitrate));
|
||||
self::setValue("max_bitrate", intval($bitrate));
|
||||
}
|
||||
|
||||
public static function GetMaxBitrate(){
|
||||
return self::GetValue("max_bitrate");
|
||||
return self::getValue("max_bitrate");
|
||||
}
|
||||
|
||||
public static function SetPlanLevel($plan){
|
||||
self::SetValue("plan_level", $plan);
|
||||
self::setValue("plan_level", $plan);
|
||||
}
|
||||
|
||||
public static function GetPlanLevel(){
|
||||
$plan = self::GetValue("plan_level");
|
||||
$plan = self::getValue("plan_level");
|
||||
if(trim($plan) == ''){
|
||||
$plan = 'disabled';
|
||||
}
|
||||
|
@ -596,36 +596,36 @@ class Application_Model_Preference
|
|||
}
|
||||
|
||||
public static function SetTrialEndingDate($date){
|
||||
self::SetValue("trial_end_date", $date);
|
||||
self::setValue("trial_end_date", $date);
|
||||
}
|
||||
|
||||
public static function GetTrialEndingDate(){
|
||||
return self::GetValue("trial_end_date");
|
||||
return self::getValue("trial_end_date");
|
||||
}
|
||||
|
||||
public static function SetEnableStreamConf($bool){
|
||||
self::SetValue("enable_stream_conf", $bool);
|
||||
self::setValue("enable_stream_conf", $bool);
|
||||
}
|
||||
|
||||
public static function GetEnableStreamConf(){
|
||||
if(self::GetValue("enable_stream_conf") == Null){
|
||||
if(self::getValue("enable_stream_conf") == Null){
|
||||
return "true";
|
||||
}
|
||||
return self::GetValue("enable_stream_conf");
|
||||
return self::getValue("enable_stream_conf");
|
||||
}
|
||||
|
||||
public static function GetAirtimeVersion(){
|
||||
if (defined('APPLICATION_ENV') && APPLICATION_ENV == "development" && function_exists('exec')){
|
||||
$version = exec("git rev-parse --short HEAD 2>/dev/null", $out, $return_code);
|
||||
if ($return_code == 0){
|
||||
return self::GetValue("system_version")."+".$version.":".time();
|
||||
return self::getValue("system_version")."+".$version.":".time();
|
||||
}
|
||||
}
|
||||
return self::GetValue("system_version");
|
||||
return self::getValue("system_version");
|
||||
}
|
||||
|
||||
public static function GetLatestVersion(){
|
||||
$latest = self::GetValue("latest_version");
|
||||
$latest = self::getValue("latest_version");
|
||||
if($latest == null || strlen($latest) == 0) {
|
||||
return self::GetAirtimeVersion();
|
||||
} else {
|
||||
|
@ -636,12 +636,12 @@ class Application_Model_Preference
|
|||
public static function SetLatestVersion($version){
|
||||
$pattern = "/^[0-9]+\.[0-9]+\.[0-9]+/";
|
||||
if(preg_match($pattern, $version)) {
|
||||
self::SetValue("latest_version", $version);
|
||||
self::setValue("latest_version", $version);
|
||||
}
|
||||
}
|
||||
|
||||
public static function GetLatestLink(){
|
||||
$link = self::GetValue("latest_link");
|
||||
$link = self::getValue("latest_link");
|
||||
if($link == null || strlen($link) == 0) {
|
||||
return 'http://airtime.sourcefabric.org';
|
||||
} else {
|
||||
|
@ -654,32 +654,32 @@ class Application_Model_Preference
|
|||
"([a-zA-Z0-9]+\.)*[a-zA-Z0-9]+" .
|
||||
"(/[a-zA-Z0-9\-\.\_\~\:\?\#\[\]\@\!\$\&\'\(\)\*\+\,\;\=]+)*/?$#";
|
||||
if(preg_match($pattern, $link)) {
|
||||
self::SetValue("latest_link", $link);
|
||||
self::setValue("latest_link", $link);
|
||||
}
|
||||
}
|
||||
|
||||
public static function SetUploadToSoundcloudOption($upload) {
|
||||
self::SetValue("soundcloud_upload_option", $upload);
|
||||
self::setValue("soundcloud_upload_option", $upload);
|
||||
}
|
||||
|
||||
public static function GetUploadToSoundcloudOption() {
|
||||
return self::GetValue("soundcloud_upload_option");
|
||||
return self::getValue("soundcloud_upload_option");
|
||||
}
|
||||
|
||||
public static function SetSoundCloudDownloadbleOption($upload) {
|
||||
self::SetValue("soundcloud_downloadable", $upload);
|
||||
self::setValue("soundcloud_downloadable", $upload);
|
||||
}
|
||||
|
||||
public static function GetSoundCloudDownloadbleOption() {
|
||||
return self::GetValue("soundcloud_downloadable");
|
||||
return self::getValue("soundcloud_downloadable");
|
||||
}
|
||||
|
||||
public static function SetWeekStartDay($day) {
|
||||
self::SetValue("week_start_day", $day);
|
||||
self::setValue("week_start_day", $day);
|
||||
}
|
||||
|
||||
public static function GetWeekStartDay() {
|
||||
$val = self::GetValue("week_start_day");
|
||||
$val = self::getValue("week_start_day");
|
||||
if (strlen($val) == 0){
|
||||
return "0";
|
||||
} else {
|
||||
|
@ -692,14 +692,14 @@ class Application_Model_Preference
|
|||
*/
|
||||
public static function SetStreamUpdateTimestamp() {
|
||||
$now = time();
|
||||
self::SetValue("stream_update_timestamp", $now);
|
||||
self::setValue("stream_update_timestamp", $now);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the last timestamp of user updating stream setting
|
||||
*/
|
||||
public static function GetStreamUpdateTimestemp() {
|
||||
$update_time = self::GetValue("stream_update_timestamp");
|
||||
$update_time = self::getValue("stream_update_timestamp");
|
||||
if($update_time == null){
|
||||
$update_time = 0;
|
||||
}
|
||||
|
@ -707,12 +707,12 @@ class Application_Model_Preference
|
|||
}
|
||||
|
||||
public static function GetClientId() {
|
||||
return self::GetValue("client_id");
|
||||
return self::getValue("client_id");
|
||||
}
|
||||
|
||||
public static function SetClientId($id) {
|
||||
if (is_numeric($id)) {
|
||||
self::SetValue("client_id", $id);
|
||||
self::setValue("client_id", $id);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -724,7 +724,7 @@ class Application_Model_Preference
|
|||
* @param $timeScale new time scale
|
||||
*/
|
||||
public static function SetCalendarTimeScale($timeScale) {
|
||||
self::SetValue("calendar_time_scale", $timeScale, true /* user specific */);
|
||||
self::setValue("calendar_time_scale", $timeScale, true /* user specific */);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -732,7 +732,7 @@ class Application_Model_Preference
|
|||
* Defaults to month if no entry exists
|
||||
*/
|
||||
public static function GetCalendarTimeScale() {
|
||||
$val = self::GetValue("calendar_time_scale", true /* user specific */);
|
||||
$val = self::getValue("calendar_time_scale", true /* user specific */);
|
||||
if(strlen($val) == 0) {
|
||||
$val = "month";
|
||||
}
|
||||
|
@ -745,7 +745,7 @@ class Application_Model_Preference
|
|||
* @param $numEntries new number of entries to show
|
||||
*/
|
||||
public static function SetLibraryNumEntries($numEntries) {
|
||||
self::SetValue("library_num_entries", $numEntries, true /* user specific */);
|
||||
self::setValue("library_num_entries", $numEntries, true /* user specific */);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -753,7 +753,7 @@ class Application_Model_Preference
|
|||
* Defaults to 10 if no entry exists
|
||||
*/
|
||||
public static function GetLibraryNumEntries() {
|
||||
$val = self::GetValue("library_num_entries", true /* user specific */);
|
||||
$val = self::getValue("library_num_entries", true /* user specific */);
|
||||
if(strlen($val) == 0) {
|
||||
$val = "10";
|
||||
}
|
||||
|
@ -766,7 +766,7 @@ class Application_Model_Preference
|
|||
* @param $timeInterval new time interval
|
||||
*/
|
||||
public static function SetCalendarTimeInterval($timeInterval) {
|
||||
self::SetValue("calendar_time_interval", $timeInterval, true /* user specific */);
|
||||
self::setValue("calendar_time_interval", $timeInterval, true /* user specific */);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -774,7 +774,7 @@ class Application_Model_Preference
|
|||
* Defaults to 30 min if no entry exists
|
||||
*/
|
||||
public static function GetCalendarTimeInterval() {
|
||||
$val = self::GetValue("calendar_time_interval", true /* user specific */);
|
||||
$val = self::getValue("calendar_time_interval", true /* user specific */);
|
||||
if(strlen($val) == 0) {
|
||||
$val = "30";
|
||||
}
|
||||
|
@ -782,11 +782,11 @@ class Application_Model_Preference
|
|||
}
|
||||
|
||||
public static function SetDiskQuota($value){
|
||||
self::SetValue("disk_quota", $value, false);
|
||||
self::setValue("disk_quota", $value, false);
|
||||
}
|
||||
|
||||
public static function GetDiskQuota(){
|
||||
$val = self::GetValue("disk_quota");
|
||||
$val = self::getValue("disk_quota");
|
||||
if(strlen($val) == 0) {
|
||||
$val = "0";
|
||||
}
|
||||
|
@ -794,27 +794,27 @@ class Application_Model_Preference
|
|||
}
|
||||
|
||||
public static function SetLiveSteamMasterUsername($value){
|
||||
self::SetValue("live_stream_master_username", $value, false);
|
||||
self::setValue("live_stream_master_username", $value, false);
|
||||
}
|
||||
|
||||
public static function GetLiveSteamMasterUsername(){
|
||||
return self::GetValue("live_stream_master_username");
|
||||
return self::getValue("live_stream_master_username");
|
||||
}
|
||||
|
||||
public static function SetLiveSteamMasterPassword($value){
|
||||
self::SetValue("live_stream_master_password", $value, false);
|
||||
self::setValue("live_stream_master_password", $value, false);
|
||||
}
|
||||
|
||||
public static function GetLiveSteamMasterPassword(){
|
||||
return self::GetValue("live_stream_master_password");
|
||||
return self::getValue("live_stream_master_password");
|
||||
}
|
||||
|
||||
public static function SetSourceStatus($sourcename, $status){
|
||||
self::SetValue($sourcename, $status, false);
|
||||
self::setValue($sourcename, $status, false);
|
||||
}
|
||||
|
||||
public static function GetSourceStatus($sourcename){
|
||||
$value = self::GetValue($sourcename);
|
||||
$value = self::getValue($sourcename);
|
||||
if($value == null || $value == "false"){
|
||||
return false;
|
||||
}else{
|
||||
|
@ -823,11 +823,11 @@ class Application_Model_Preference
|
|||
}
|
||||
|
||||
public static function SetSourceSwitchStatus($sourcename, $status){
|
||||
self::SetValue($sourcename."_switch", $status, false);
|
||||
self::setValue($sourcename."_switch", $status, false);
|
||||
}
|
||||
|
||||
public static function GetSourceSwitchStatus($sourcename){
|
||||
$value = self::GetValue($sourcename."_switch");
|
||||
$value = self::getValue($sourcename."_switch");
|
||||
if($value == null || $value == "off"){
|
||||
return "off";
|
||||
}else{
|
||||
|
@ -836,61 +836,61 @@ class Application_Model_Preference
|
|||
}
|
||||
|
||||
public static function SetMasterDJSourceConnectionURL($value){
|
||||
self::SetValue("master_dj_source_connection_url", $value, false);
|
||||
self::setValue("master_dj_source_connection_url", $value, false);
|
||||
}
|
||||
|
||||
public static function GetMasterDJSourceConnectionURL(){
|
||||
return self::GetValue("master_dj_source_connection_url");
|
||||
return self::getValue("master_dj_source_connection_url");
|
||||
}
|
||||
|
||||
public static function SetLiveDJSourceConnectionURL($value){
|
||||
self::SetValue("live_dj_source_connection_url", $value, false);
|
||||
self::setValue("live_dj_source_connection_url", $value, false);
|
||||
}
|
||||
|
||||
public static function GetLiveDJSourceConnectionURL(){
|
||||
return self::GetValue("live_dj_source_connection_url");
|
||||
return self::getValue("live_dj_source_connection_url");
|
||||
}
|
||||
|
||||
/* Source Connection URL override status starts */
|
||||
public static function GetLiveDjConnectionUrlOverride(){
|
||||
return self::GetValue("live_dj_connection_url_override");
|
||||
return self::getValue("live_dj_connection_url_override");
|
||||
}
|
||||
|
||||
public static function SetLiveDjConnectionUrlOverride($value){
|
||||
self::SetValue("live_dj_connection_url_override", $value, false);
|
||||
self::setValue("live_dj_connection_url_override", $value, false);
|
||||
}
|
||||
|
||||
public static function GetMasterDjConnectionUrlOverride(){
|
||||
return self::GetValue("master_dj_connection_url_override");
|
||||
return self::getValue("master_dj_connection_url_override");
|
||||
}
|
||||
|
||||
public static function SetMasterDjConnectionUrlOverride($value){
|
||||
self::SetValue("master_dj_connection_url_override", $value, false);
|
||||
self::setValue("master_dj_connection_url_override", $value, false);
|
||||
}
|
||||
/* Source Connection URL override status ends */
|
||||
|
||||
public static function SetAutoTransition($value){
|
||||
self::SetValue("auto_transition", $value, false);
|
||||
self::setValue("auto_transition", $value, false);
|
||||
}
|
||||
|
||||
public static function GetAutoTransition(){
|
||||
return self::GetValue("auto_transition");
|
||||
return self::getValue("auto_transition");
|
||||
}
|
||||
|
||||
public static function SetAutoSwitch($value){
|
||||
self::SetValue("auto_switch", $value, false);
|
||||
self::setValue("auto_switch", $value, false);
|
||||
}
|
||||
|
||||
public static function GetAutoSwitch(){
|
||||
return self::GetValue("auto_switch");
|
||||
return self::getValue("auto_switch");
|
||||
}
|
||||
|
||||
public static function SetEnableSystemEmail($upload) {
|
||||
self::SetValue("enable_system_email", $upload);
|
||||
self::setValue("enable_system_email", $upload);
|
||||
}
|
||||
|
||||
public static function GetEnableSystemEmail() {
|
||||
$v = self::GetValue("enable_system_email");
|
||||
$v = self::getValue("enable_system_email");
|
||||
|
||||
if ($v === "") {
|
||||
return 0;
|
||||
|
@ -900,51 +900,51 @@ class Application_Model_Preference
|
|||
}
|
||||
|
||||
public static function SetSystemEmail($value) {
|
||||
self::SetValue("system_email", $value, false);
|
||||
self::setValue("system_email", $value, false);
|
||||
}
|
||||
|
||||
public static function GetSystemEmail() {
|
||||
return self::GetValue("system_email");
|
||||
return self::getValue("system_email");
|
||||
}
|
||||
|
||||
public static function SetMailServerConfigured($value) {
|
||||
self::SetValue("mail_server_configured", $value, false);
|
||||
self::setValue("mail_server_configured", $value, false);
|
||||
}
|
||||
|
||||
public static function GetMailServerConfigured() {
|
||||
return self::GetValue("mail_server_configured");
|
||||
return self::getValue("mail_server_configured");
|
||||
}
|
||||
|
||||
public static function SetMailServer($value) {
|
||||
self::SetValue("mail_server", $value, false);
|
||||
self::setValue("mail_server", $value, false);
|
||||
}
|
||||
|
||||
public static function GetMailServer() {
|
||||
return self::GetValue("mail_server");
|
||||
return self::getValue("mail_server");
|
||||
}
|
||||
|
||||
public static function SetMailServerEmailAddress($value) {
|
||||
self::SetValue("mail_server_email_address", $value, false);
|
||||
self::setValue("mail_server_email_address", $value, false);
|
||||
}
|
||||
|
||||
public static function GetMailServerEmailAddress() {
|
||||
return self::GetValue("mail_server_email_address");
|
||||
return self::getValue("mail_server_email_address");
|
||||
}
|
||||
|
||||
public static function SetMailServerPassword($value) {
|
||||
self::SetValue("mail_server_password", $value, false);
|
||||
self::setValue("mail_server_password", $value, false);
|
||||
}
|
||||
|
||||
public static function GetMailServerPassword() {
|
||||
return self::GetValue("mail_server_password");
|
||||
return self::getValue("mail_server_password");
|
||||
}
|
||||
|
||||
public static function SetMailServerPort($value) {
|
||||
self::SetValue("mail_server_port", $value, false);
|
||||
self::setValue("mail_server_port", $value, false);
|
||||
}
|
||||
|
||||
public static function GetMailServerPort() {
|
||||
return self::GetValue("mail_server_port");
|
||||
return self::getValue("mail_server_port");
|
||||
}
|
||||
/* User specific preferences end */
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
class Application_Model_StreamSetting {
|
||||
|
||||
public static function SetValue($key, $value, $type)
|
||||
public static function setValue($key, $value, $type)
|
||||
{
|
||||
global $CC_CONFIG;
|
||||
$con = Propel::getConnection();
|
||||
|
@ -27,7 +27,7 @@ class Application_Model_StreamSetting {
|
|||
return $con->exec($sql);
|
||||
}
|
||||
|
||||
public static function GetValue($key)
|
||||
public static function getValue($key)
|
||||
{
|
||||
global $CC_CONFIG;
|
||||
$con = Propel::getConnection();
|
||||
|
@ -37,14 +37,14 @@ class Application_Model_StreamSetting {
|
|||
." WHERE keyname = '$key'";
|
||||
$result = $con->query($sql)->fetchColumn(0);
|
||||
|
||||
if ($result == 0)
|
||||
if ($result == 0) {
|
||||
return "";
|
||||
else {
|
||||
} else {
|
||||
$sql = "SELECT value FROM cc_stream_setting"
|
||||
." WHERE keyname = '$key'";
|
||||
|
||||
$result = $con->query($sql)->fetchColumn(0);
|
||||
return ($result !== false) ? $result : NULL;
|
||||
return ($result !== false) ? $result : null;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -130,16 +130,24 @@ class Application_Model_StreamSetting {
|
|||
}
|
||||
|
||||
if (!isset($exists["master_live_stream_port"])) {
|
||||
$rows[] = (array("keyname" =>"master_live_stream_port", "value"=>self::GetMasterLiveSteamPort(), "type"=>"integer"));
|
||||
$rows[] = array("keyname" =>"master_live_stream_port",
|
||||
"value"=>self::getMasterLiveStreamPort(),
|
||||
"type"=>"integer");
|
||||
}
|
||||
if (!isset($exists["master_live_stream_mp"])) {
|
||||
$rows[] = (array("keyname" =>"master_live_stream_mp", "value"=>self::GetMasterLiveSteamMountPoint(), "type"=>"string"));
|
||||
$rows[] = array("keyname" =>"master_live_stream_mp",
|
||||
"value"=>self::getMasterLiveStreamMountPoint(),
|
||||
"type"=>"string");
|
||||
}
|
||||
if (!isset($exists["dj_live_stream_port"])) {
|
||||
$rows[] = (array("keyname" =>"dj_live_stream_port", "value"=>self::GetDJLiveSteamPort(), "type"=>"integer"));
|
||||
$rows[] = array("keyname" =>"dj_live_stream_port",
|
||||
"value"=>self::getDjLiveStreamPort(),
|
||||
"type"=>"integer");
|
||||
}
|
||||
if (!isset($exists["dj_live_stream_mp"])) {
|
||||
$rows[] = (array("keyname" =>"dj_live_stream_mp", "value"=>self::GetDJLiveSteamMountPoint(), "type"=>"string"));
|
||||
$rows[] = array("keyname" =>"dj_live_stream_mp",
|
||||
"value"=>self::getDjLiveStreamMountPoint(),
|
||||
"type"=>"string");
|
||||
}
|
||||
return $rows;
|
||||
}
|
||||
|
@ -155,7 +163,7 @@ class Application_Model_StreamSetting {
|
|||
{
|
||||
$con = Propel::getConnection();
|
||||
|
||||
foreach ($data as $key=>$d) {
|
||||
foreach ($data as $key => $d) {
|
||||
if ($key == "output_sound_device" || $key == "icecast_vorbis_metadata") {
|
||||
$v = $d == 1?"true":"false";
|
||||
$sql = "UPDATE cc_stream_setting SET value='$v' WHERE keyname='$key'";
|
||||
|
@ -166,7 +174,7 @@ class Application_Model_StreamSetting {
|
|||
} else if (is_array($d)) {
|
||||
$temp = explode('_', $key);
|
||||
$prefix = $temp[0];
|
||||
foreach ($d as $k=>$v) {
|
||||
foreach ($d as $k => $v) {
|
||||
$keyname = $prefix . "_" . $k;
|
||||
if ($k == 'enable') {
|
||||
$v = $d['enable'] == 1 ? 'true' : 'false';
|
||||
|
@ -233,7 +241,7 @@ class Application_Model_StreamSetting {
|
|||
." WHERE keyname = '$keyname'";
|
||||
$result = $con->query($sql)->fetchColumn(0);
|
||||
|
||||
return ($result !== false) ? $result : NULL;
|
||||
return ($result !== false) ? $result : null;
|
||||
}
|
||||
|
||||
public static function getStreamEnabled($stream_id)
|
||||
|
@ -264,7 +272,8 @@ class Application_Model_StreamSetting {
|
|||
$enabled_stream = self::getEnabledStreamIds();
|
||||
|
||||
foreach ($enabled_stream as $stream) {
|
||||
$keys = "'".$stream."_output', "."'".$stream."_type', "."'".$stream."_bitrate', "."'".$stream."_host'";
|
||||
$keys = "'".$stream."_output', "."'".$stream."_type', "."'"
|
||||
.$stream."_bitrate', "."'".$stream."_host'";
|
||||
|
||||
$sql = "SELECT keyname, value FROM cc_stream_setting"
|
||||
." WHERE keyname IN ($keys)";
|
||||
|
@ -280,35 +289,43 @@ class Application_Model_StreamSetting {
|
|||
return $out;
|
||||
}
|
||||
|
||||
public static function SetMasterLiveSteamPort($value){
|
||||
self::SetValue("master_live_stream_port", $value, "integer");
|
||||
public static function setMasterLiveStreamPort($value)
|
||||
{
|
||||
self::setValue("master_live_stream_port", $value, "integer");
|
||||
}
|
||||
|
||||
public static function GetMasterLiveSteamPort(){
|
||||
return self::GetValue("master_live_stream_port");
|
||||
public static function getMasterLiveStreamPort()
|
||||
{
|
||||
return self::getValue("master_live_stream_port");
|
||||
}
|
||||
|
||||
public static function SetMasterLiveSteamMountPoint($value){
|
||||
self::SetValue("master_live_stream_mp", $value, "string");
|
||||
public static function setMasterLiveStreamMountPoint($value)
|
||||
{
|
||||
self::setValue("master_live_stream_mp", $value, "string");
|
||||
}
|
||||
|
||||
public static function GetMasterLiveSteamMountPoint(){
|
||||
return self::GetValue("master_live_stream_mp");
|
||||
public static function getMasterLiveStreamMountPoint()
|
||||
{
|
||||
return self::getValue("master_live_stream_mp");
|
||||
}
|
||||
|
||||
public static function SetDJLiveSteamPort($value){
|
||||
self::SetValue("dj_live_stream_port", $value, "integer");
|
||||
public static function setDjLiveStreamPort($value)
|
||||
{
|
||||
self::setValue("dj_live_stream_port", $value, "integer");
|
||||
}
|
||||
|
||||
public static function GetDJLiveSteamPort(){
|
||||
return self::GetValue("dj_live_stream_port");
|
||||
public static function getDjLiveStreamPort()
|
||||
{
|
||||
return self::getValue("dj_live_stream_port");
|
||||
}
|
||||
|
||||
public static function SetDJLiveSteamMountPoint($value){
|
||||
self::SetValue("dj_live_stream_mp", $value, "string");
|
||||
public static function setDjLiveStreamMountPoint($value)
|
||||
{
|
||||
self::setValue("dj_live_stream_mp", $value, "string");
|
||||
}
|
||||
|
||||
public static function GetDJLiveSteamMountPoint(){
|
||||
return self::GetValue("dj_live_stream_mp");
|
||||
public static function getDjLiveStreamMountPoint()
|
||||
{
|
||||
return self::getValue("dj_live_stream_mp");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue