Factor out default show background colour and fix some style issues

This commit is contained in:
Albert Santoni 2015-08-12 12:55:39 -04:00
parent f63ce23c9f
commit 2a1d09bc08
9 changed files with 49 additions and 20 deletions

View file

@ -67,7 +67,6 @@ class Application_Model_Show
public function getColor()
{
$show = CcShowQuery::create()->findPK($this->_showId);
return $show->getDbColor();
}
@ -111,7 +110,12 @@ class Application_Model_Show
{
$show = CcShowQuery::create()->findPK($this->_showId);
return $show->getDbBackgroundColor();
$color = $show->getDbBackgroundColor();
if (empty($color)) {
return DEFAULT_SHOW_COLOR;
} else {
return $color;
}
}
public function setBackgroundColor($backgroundColor)
@ -1035,8 +1039,10 @@ SQL;
$event["textColor"] = "#".$show["color"];
}
if ($show["background_color"] != "") {
$event["color"] = "#".$show["background_color"];
if (!empty($show["background_color"])) {
$event["color"] = "#" . $show["background_color"];
} else {
$event["color"] = "#" . DEFAULT_SHOW_COLOR;
}
foreach ($options as $key => $value) {

View file

@ -107,7 +107,7 @@ class Application_Model_ShowBuilder
private function getItemColor($p_item, &$row)
{
$defaultColor = "ffffff";
$defaultBackground = "3366cc";
$defaultBackground = DEFAULT_SHOW_COLOR;
$color = $p_item["show_color"];
if ($color === '') {