Cleaned up preference.php
This commit is contained in:
parent
1304111682
commit
57b59a3290
1 changed files with 12 additions and 41 deletions
|
@ -226,11 +226,7 @@ class Application_Model_Preference
|
||||||
public static function GetDefaultTransitionFade()
|
public static function GetDefaultTransitionFade()
|
||||||
{
|
{
|
||||||
$transition_fade = self::getValue("default_transition_fade");
|
$transition_fade = self::getValue("default_transition_fade");
|
||||||
if ($transition_fade == "") {
|
return ($transition_fade == "") ? "00.000000" : $transition_fade;
|
||||||
$transition_fade = "00.000000";
|
|
||||||
}
|
|
||||||
|
|
||||||
return $transition_fade;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function SetStreamLabelFormat($type)
|
public static function SetStreamLabelFormat($type)
|
||||||
|
@ -332,11 +328,7 @@ class Application_Model_Preference
|
||||||
public static function GetAllow3rdPartyApi()
|
public static function GetAllow3rdPartyApi()
|
||||||
{
|
{
|
||||||
$val = self::getValue("third_party_api");
|
$val = self::getValue("third_party_api");
|
||||||
if (strlen($val) == 0) {
|
return (strlen($val) == 0 ) ? "0" : $val;
|
||||||
return "0";
|
|
||||||
} else {
|
|
||||||
return $val;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function SetPhone($phone)
|
public static function SetPhone($phone)
|
||||||
|
@ -447,6 +439,8 @@ class Application_Model_Preference
|
||||||
$image = @file_get_contents($imagePath);
|
$image = @file_get_contents($imagePath);
|
||||||
$image = base64_encode($image);
|
$image = base64_encode($image);
|
||||||
self::setValue("logoImage", $image);
|
self::setValue("logoImage", $image);
|
||||||
|
} else {
|
||||||
|
Logging::warn("Attempting to set imagePath to empty string");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -786,11 +780,7 @@ class Application_Model_Preference
|
||||||
public static function GetWeekStartDay()
|
public static function GetWeekStartDay()
|
||||||
{
|
{
|
||||||
$val = self::getValue("week_start_day");
|
$val = self::getValue("week_start_day");
|
||||||
if (strlen($val) == 0) {
|
return (strlen($val) == 0) ? "0" : $val;
|
||||||
return "0";
|
|
||||||
} else {
|
|
||||||
return $val;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -808,11 +798,7 @@ class Application_Model_Preference
|
||||||
public static function GetStreamUpdateTimestemp()
|
public static function GetStreamUpdateTimestemp()
|
||||||
{
|
{
|
||||||
$update_time = self::getValue("stream_update_timestamp");
|
$update_time = self::getValue("stream_update_timestamp");
|
||||||
if ($update_time == null) {
|
return ($update_time == null) ? 0 : $update_time;
|
||||||
$update_time = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return $update_time;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function GetClientId()
|
public static function GetClientId()
|
||||||
|
@ -824,6 +810,8 @@ class Application_Model_Preference
|
||||||
{
|
{
|
||||||
if (is_numeric($id)) {
|
if (is_numeric($id)) {
|
||||||
self::setValue("client_id", $id);
|
self::setValue("client_id", $id);
|
||||||
|
} else {
|
||||||
|
Logging::warn("Attempting to set client_id to invalid value: $id");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -894,11 +882,7 @@ class Application_Model_Preference
|
||||||
public static function GetCalendarTimeInterval()
|
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) {
|
return (strlen($val) == 0) ? "30" : $val;
|
||||||
$val = "30";
|
|
||||||
}
|
|
||||||
|
|
||||||
return $val;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function SetDiskQuota($value)
|
public static function SetDiskQuota($value)
|
||||||
|
@ -940,11 +924,7 @@ class Application_Model_Preference
|
||||||
public static function GetSourceStatus($sourcename)
|
public static function GetSourceStatus($sourcename)
|
||||||
{
|
{
|
||||||
$value = self::getValue($sourcename);
|
$value = self::getValue($sourcename);
|
||||||
if ($value == null || $value == "false") {
|
return !($value == null || $value == "false");
|
||||||
return false;
|
|
||||||
} else {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function SetSourceSwitchStatus($sourcename, $status)
|
public static function SetSourceSwitchStatus($sourcename, $status)
|
||||||
|
@ -955,11 +935,7 @@ class Application_Model_Preference
|
||||||
public static function GetSourceSwitchStatus($sourcename)
|
public static function GetSourceSwitchStatus($sourcename)
|
||||||
{
|
{
|
||||||
$value = self::getValue($sourcename."_switch");
|
$value = self::getValue($sourcename."_switch");
|
||||||
if ($value == null || $value == "off") {
|
return ($value == null || $value == "off") ? 'off' : 'on';
|
||||||
return "off";
|
|
||||||
} else {
|
|
||||||
return "on";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function SetMasterDJSourceConnectionURL($value)
|
public static function SetMasterDJSourceConnectionURL($value)
|
||||||
|
@ -1032,12 +1008,7 @@ class Application_Model_Preference
|
||||||
public static function GetEnableSystemEmail()
|
public static function GetEnableSystemEmail()
|
||||||
{
|
{
|
||||||
$v = self::getValue("enable_system_email");
|
$v = self::getValue("enable_system_email");
|
||||||
|
return ($v === "") ? 0 : $v;
|
||||||
if ($v === "") {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return $v;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function SetSystemEmail($value)
|
public static function SetSystemEmail($value)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue