From 305cb894c30314c54f495cfbba7b7bf8de2269dd Mon Sep 17 00:00:00 2001 From: drigato Date: Wed, 3 Jun 2015 11:53:32 -0400 Subject: [PATCH] SAAS-841: Default station logo to the Airtime logo --- airtime_mvc/application/models/Preference.php | 9 ++++++++- .../views/scripts/form/preferences_general.phtml | 10 +++++++++- .../application/views/scripts/index/index.phtml | 6 ++++-- 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/airtime_mvc/application/models/Preference.php b/airtime_mvc/application/models/Preference.php index 541870fde..b3d6d81a8 100644 --- a/airtime_mvc/application/models/Preference.php +++ b/airtime_mvc/application/models/Preference.php @@ -602,7 +602,14 @@ class Application_Model_Preference public static function GetStationLogo() { - return self::getValue("logoImage"); + $logoImage = self::getValue("logoImage"); + if (!empty($logoImage)) { + return $logoImage; + } else { + // We return the Airtime logo if no logo is set in the database. + // airtime_logo.png is stored under the public directory + return "airtime_logo.png"; + } } public static function SetUniqueId($id) diff --git a/airtime_mvc/application/views/scripts/form/preferences_general.phtml b/airtime_mvc/application/views/scripts/form/preferences_general.phtml index b93cb0a86..e21894d95 100644 --- a/airtime_mvc/application/views/scripts/form/preferences_general.phtml +++ b/airtime_mvc/application/views/scripts/form/preferences_general.phtml @@ -12,7 +12,15 @@
- + element->getView()->logoImg; + if ($logoImg === "airtime_logo.png") { + $src = "airtime_logo.png"; + } else { + $src = "data:image/png;base64,".$logoImg; + } + ?> +
element->getElement('locale')->render() ?> diff --git a/airtime_mvc/application/views/scripts/index/index.phtml b/airtime_mvc/application/views/scripts/index/index.phtml index e83bd9ebc..8e1e5e03e 100644 --- a/airtime_mvc/application/views/scripts/index/index.phtml +++ b/airtime_mvc/application/views/scripts/index/index.phtml @@ -3,8 +3,10 @@
- stationLogo)) { - echo ""; + stationLogo === "airtime_logo.png") { + echo ""; + } else { + echo ""; } ?>