SAAS-841: Default station logo to the Airtime logo

This commit is contained in:
drigato 2015-06-03 11:53:32 -04:00
parent d6ec9e99b5
commit 305cb894c3
3 changed files with 21 additions and 4 deletions

View file

@ -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)

View file

@ -12,7 +12,15 @@
<!-- <button id="logo-remove-btn" value="Remove" class="btn">Remove</button>-->
<div id="Logo-img-container">
<img onError="this.onerror = '';this.style.visibility='hidden';$('#logo-remove-btn').hide();$('[id^=stationLogoRemove]').each(function(i,v){v.style.width=v.style.height=v.style.margin=v.style.padding='0px';});" id="logo-img" onload='resizeImg(this, 450, 450);' src="data:image/png;base64,<?php echo $this->element->getView()->logoImg ?>" />
<?php
$logoImg = $this->element->getView()->logoImg;
if ($logoImg === "airtime_logo.png") {
$src = "airtime_logo.png";
} else {
$src = "data:image/png;base64,".$logoImg;
}
?>
<img onError="this.onerror = '';this.style.visibility='hidden';$('#logo-remove-btn').hide();$('[id^=stationLogoRemove]').each(function(i,v){v.style.width=v.style.height=v.style.margin=v.style.padding='0px';});" id="logo-img" onload='resizeImg(this, 450, 450);' src="<?php echo $src ?>" />
</div>
<?php echo $this->element->getElement('locale')->render() ?>

View file

@ -3,7 +3,9 @@
<div class="bck_cover"></div>
<?php if (!empty($this->stationLogo)) {
<?php if ($this->stationLogo === "airtime_logo.png") {
echo "<a href='#' class='logo'><img src='airtime_logo.png'></a>";
} else {
echo "<a href='#' class='logo' ><img src='data:image/png;base64," . $this->stationLogo . "'></a>";
} ?>