CC-2807: Remove AIRTIME_VERSION from constants.php and use the value in the database instead

-done
This commit is contained in:
martin 2011-09-23 16:26:19 -04:00
parent e60db9e031
commit cd95170b06
10 changed files with 94 additions and 147 deletions

View file

@ -68,7 +68,7 @@ class Application_Model_Preference
if (isset($defaultNamespace->title)) {
$title = $defaultNamespace->title;
} else {
$title = Application_Model_Preference::GetValue("station_name");
$title = self::GetValue("station_name");
$defaultNamespace->title = $title;
}
if (strlen($title) > 0)
@ -78,7 +78,7 @@ class Application_Model_Preference
}
public static function SetHeadTitle($title, $view){
Application_Model_Preference::SetValue("station_name", $title);
self::SetValue("station_name", $title);
$defaultNamespace = new Zend_Session_Namespace('title_name');
$defaultNamespace->title = $title;
RabbitMq::PushSchedule();
@ -86,101 +86,101 @@ class Application_Model_Preference
//set session variable to new station name so that html title is updated.
//should probably do this in a view helper to keep this controller as minimal as possible.
$view->headTitle()->exchangeArray(array()); //clear headTitle ArrayObject
$view->headTitle(Application_Model_Preference::GetHeadTitle());
$view->headTitle(self::GetHeadTitle());
}
public static function SetShowsPopulatedUntil($timestamp) {
Application_Model_Preference::SetValue("shows_populated_until", $timestamp);
self::SetValue("shows_populated_until", $timestamp);
}
public static function GetShowsPopulatedUntil() {
return Application_Model_Preference::GetValue("shows_populated_until");
return self::GetValue("shows_populated_until");
}
public static function SetDefaultFade($fade) {
Application_Model_Preference::SetValue("default_fade", $fade);
self::SetValue("default_fade", $fade);
}
public static function GetDefaultFade() {
return Application_Model_Preference::GetValue("default_fade");
return self::GetValue("default_fade");
}
public static function SetStreamLabelFormat($type){
Application_Model_Preference::SetValue("stream_label_format", $type);
self::SetValue("stream_label_format", $type);
RabbitMq::PushSchedule();
}
public static function GetStreamLabelFormat(){
return Application_Model_Preference::getValue("stream_label_format");
return self::getValue("stream_label_format");
}
public static function GetStationName(){
return Application_Model_Preference::getValue("station_name");
return self::getValue("station_name");
}
public static function SetDoSoundCloudUpload($upload) {
Application_Model_Preference::SetValue("soundcloud_upload", $upload);
self::SetValue("soundcloud_upload", $upload);
}
public static function GetDoSoundCloudUpload() {
return Application_Model_Preference::GetValue("soundcloud_upload");
return self::GetValue("soundcloud_upload");
}
public static function SetSoundCloudUser($user) {
Application_Model_Preference::SetValue("soundcloud_user", $user);
self::SetValue("soundcloud_user", $user);
}
public static function GetSoundCloudUser() {
return Application_Model_Preference::GetValue("soundcloud_user");
return self::GetValue("soundcloud_user");
}
public static function SetSoundCloudPassword($password) {
if (strlen($password) > 0)
Application_Model_Preference::SetValue("soundcloud_password", $password);
self::SetValue("soundcloud_password", $password);
}
public static function GetSoundCloudPassword() {
return Application_Model_Preference::GetValue("soundcloud_password");
return self::GetValue("soundcloud_password");
}
public static function SetSoundCloudTags($tags) {
Application_Model_Preference::SetValue("soundcloud_tags", $tags);
self::SetValue("soundcloud_tags", $tags);
}
public static function GetSoundCloudTags() {
return Application_Model_Preference::GetValue("soundcloud_tags");
return self::GetValue("soundcloud_tags");
}
public static function SetSoundCloudGenre($genre) {
Application_Model_Preference::SetValue("soundcloud_genre", $genre);
self::SetValue("soundcloud_genre", $genre);
}
public static function GetSoundCloudGenre() {
return Application_Model_Preference::GetValue("soundcloud_genre");
return self::GetValue("soundcloud_genre");
}
public static function SetSoundCloudTrackType($track_type) {
Application_Model_Preference::SetValue("soundcloud_tracktype", $track_type);
self::SetValue("soundcloud_tracktype", $track_type);
}
public static function GetSoundCloudTrackType() {
return Application_Model_Preference::GetValue("soundcloud_tracktype");
return self::GetValue("soundcloud_tracktype");
}
public static function SetSoundCloudLicense($license) {
Application_Model_Preference::SetValue("soundcloud_license", $license);
self::SetValue("soundcloud_license", $license);
}
public static function GetSoundCloudLicense() {
return Application_Model_Preference::GetValue("soundcloud_license");
return self::GetValue("soundcloud_license");
}
public static function SetAllow3rdPartyApi($bool) {
Application_Model_Preference::SetValue("third_party_api", $bool);
self::SetValue("third_party_api", $bool);
}
public static function GetAllow3rdPartyApi() {
$val = Application_Model_Preference::GetValue("third_party_api");
$val = self::GetValue("third_party_api");
if (strlen($val) == 0){
return "0";
} else {
@ -189,101 +189,101 @@ class Application_Model_Preference
}
public static function SetPhone($phone){
Application_Model_Preference::SetValue("phone", $phone);
self::SetValue("phone", $phone);
}
public static function GetPhone(){
return Application_Model_Preference::GetValue("phone");
return self::GetValue("phone");
}
public static function SetEmail($email){
Application_Model_Preference::SetValue("email", $email);
self::SetValue("email", $email);
}
public static function GetEmail(){
return Application_Model_Preference::GetValue("email");
return self::GetValue("email");
}
public static function SetStationWebSite($site){
Application_Model_Preference::SetValue("station_website", $site);
self::SetValue("station_website", $site);
}
public static function GetStationWebSite(){
return Application_Model_Preference::GetValue("station_website");
return self::GetValue("station_website");
}
public static function SetSupportFeedback($feedback){
Application_Model_Preference::SetValue("support_feedback", $feedback);
self::SetValue("support_feedback", $feedback);
}
public static function GetSupportFeedback(){
return Application_Model_Preference::GetValue("support_feedback");
return self::GetValue("support_feedback");
}
public static function SetPublicise($publicise){
Application_Model_Preference::SetValue("publicise", $publicise);
self::SetValue("publicise", $publicise);
}
public static function GetPublicise(){
return Application_Model_Preference::GetValue("publicise");
return self::GetValue("publicise");
}
public static function SetRegistered($registered){
Application_Model_Preference::SetValue("registered", $registered);
self::SetValue("registered", $registered);
}
public static function GetRegistered(){
return Application_Model_Preference::GetValue("registered");
return self::GetValue("registered");
}
public static function SetStationCountry($country){
Application_Model_Preference::SetValue("country", $country);
self::SetValue("country", $country);
}
public static function GetStationCountry(){
return Application_Model_Preference::GetValue("country");
return self::GetValue("country");
}
public static function SetStationCity($city){
Application_Model_Preference::SetValue("city", $city);
self::SetValue("city", $city);
}
public static function GetStationCity(){
return Application_Model_Preference::GetValue("city");
return self::GetValue("city");
}
public static function SetStationDescription($description){
Application_Model_Preference::SetValue("description", $description);
self::SetValue("description", $description);
}
public static function GetStationDescription(){
return Application_Model_Preference::GetValue("description");
return self::GetValue("description");
}
public static function SetTimezone($timezone){
Application_Model_Preference::SetValue("timezone", $timezone);
self::SetValue("timezone", $timezone);
date_default_timezone_set($timezone);
$md = array("timezone" => $timezone);
}
public static function GetTimezone(){
return Application_Model_Preference::GetValue("timezone");
return self::GetValue("timezone");
}
public static function SetStationLogo($imagePath){
if(!empty($imagePath)){
$image = @file_get_contents($imagePath);
$image = base64_encode($image);
Application_Model_Preference::SetValue("logoImage", $image);
self::SetValue("logoImage", $image);
}
}
public static function GetStationLogo(){
return Application_Model_Preference::GetValue("logoImage");
return self::GetValue("logoImage");
}
public static function GetUniqueId(){
return Application_Model_Preference::GetValue("uniqueId");
return self::GetValue("uniqueId");
}
public static function GetCountryList(){
@ -315,13 +315,13 @@ class Application_Model_Preference
$outputArray = array();
$outputArray['STATION_NAME'] = Application_Model_Preference::GetStationName();
$outputArray['PHONE'] = Application_Model_Preference::GetPhone();
$outputArray['EMAIL'] = Application_Model_Preference::GetEmail();
$outputArray['STATION_WEB_SITE'] = Application_Model_Preference::GetStationWebSite();
$outputArray['STATION_COUNTRY'] = Application_Model_Preference::GetStationCountry();
$outputArray['STATION_CITY'] = Application_Model_Preference::GetStationCity();
$outputArray['STATION_DESCRIPTION'] = Application_Model_Preference::GetStationDescription();
$outputArray['STATION_NAME'] = self::GetStationName();
$outputArray['PHONE'] = self::GetPhone();
$outputArray['EMAIL'] = self::GetEmail();
$outputArray['STATION_WEB_SITE'] = self::GetStationWebSite();
$outputArray['STATION_COUNTRY'] = self::GetStationCountry();
$outputArray['STATION_CITY'] = self::GetStationCity();
$outputArray['STATION_DESCRIPTION'] = self::GetStationDescription();
// get web server info
if(isset($systemInfoArray["AIRTIME_VERSION_URL"])){
@ -338,7 +338,7 @@ class Application_Model_Preference
$outputArray['NUM_OF_PLAYLISTS'] = Application_Model_Playlist::getPlaylistCount();
$outputArray['NUM_OF_SCHEDULED_PLAYLISTS'] = Schedule::getSchduledPlaylistCount();
$outputArray['NUM_OF_PAST_SHOWS'] = Application_Model_ShowInstance::GetShowInstanceCount(date("Y-m-d H:i:s"));
$outputArray['UNIQUE_ID'] = Application_Model_Preference::GetUniqueId();
$outputArray['UNIQUE_ID'] = self::GetUniqueId();
$outputArray = array_merge($systemInfoArray, $outputArray);
@ -349,8 +349,8 @@ class Application_Model_Preference
}
}
if($returnArray){
$outputArray['PROMOTE'] = Application_Model_Preference::GetPublicise();
$outputArray['LOGOIMG'] = Application_Model_Preference::GetStationLogo();
$outputArray['PROMOTE'] = self::GetPublicise();
$outputArray['LOGOIMG'] = self::GetStationLogo();
return $outputArray;
}else{
return $outputString;
@ -359,80 +359,84 @@ class Application_Model_Preference
public static function SetRemindMeDate($now){
$weekAfter = mktime(0, 0, 0, date("m") , date("d")+7, date("Y"));
Application_Model_Preference::SetValue("remindme", $weekAfter);
self::SetValue("remindme", $weekAfter);
}
public static function GetRemindMeDate(){
return Application_Model_Preference::GetValue("remindme");
return self::GetValue("remindme");
}
public static function SetImportTimestamp(){
$now = time();
if(Application_Model_Preference::GetImportTimestamp()+5 < $now){
Application_Model_Preference::SetValue("import_timestamp", $now);
if(self::GetImportTimestamp()+5 < $now){
self::SetValue("import_timestamp", $now);
}
}
public static function GetImportTimestamp(){
return Application_Model_Preference::GetValue("import_timestamp");
return self::GetValue("import_timestamp");
}
public static function GetStreamType(){
$st = Application_Model_Preference::GetValue("stream_type");
$st = self::GetValue("stream_type");
return explode(',', $st);
}
public static function GetStreamBitrate(){
$sb = Application_Model_Preference::GetValue("stream_bitrate");
$sb = self::GetValue("stream_bitrate");
return explode(',', $sb);
}
public static function SetPrivacyPolicyCheck($flag){
Application_Model_Preference::SetValue("privacy_policy", $flag);
self::SetValue("privacy_policy", $flag);
}
public static function GetPrivacyPolicyCheck(){
return Application_Model_Preference::GetValue("privacy_policy");
return self::GetValue("privacy_policy");
}
public static function SetNumOfStreams($num){
Application_Model_Preference::SetValue("num_of_streams", intval($num));
self::SetValue("num_of_streams", intval($num));
}
public static function GetNumOfStreams(){
return Application_Model_Preference::GetValue("num_of_streams");
return self::GetValue("num_of_streams");
}
public static function SetMaxBitrate($bitrate){
Application_Model_Preference::SetValue("max_bitrate", intval($bitrate));
self::SetValue("max_bitrate", intval($bitrate));
}
public static function GetMaxBitrate(){
return Application_Model_Preference::GetValue("max_bitrate");
return self::GetValue("max_bitrate");
}
public static function SetPlanLevel($plan){
Application_Model_Preference::SetValue("plan_level", $plan);
self::SetValue("plan_level", $plan);
}
public static function GetPlanLevel(){
return Application_Model_Preference::GetValue("plan_level");
return self::GetValue("plan_level");
}
public static function SetTrialEndingDate($date){
Application_Model_Preference::SetValue("trial_end_date", $date);
self::SetValue("trial_end_date", $date);
}
public static function GetTrialEndingDate(){
return Application_Model_Preference::GetValue("trial_end_date");
return self::GetValue("trial_end_date");
}
public static function SetDisableStreamConf($bool){
Application_Model_Preference::SetValue("disable_stream_conf", $bool);
self::SetValue("disable_stream_conf", $bool);
}
public static function GetDisableStreamConf(){
return Application_Model_Preference::GetValue("disable_stream_conf");
return self::GetValue("disable_stream_conf");
}
public static function GetAirtimeVersion(){
return self::GetValue("system_version");
}
}