exit(1);
}
+define('BACKGROUND_ON', 1);
+define('BACKGROUND_OFF', 2);
+define('BACKGROUND_TILE', 4);
+
/**
* Table Definition for design
*/
public $textcolor; // int(4)
public $linkcolor; // int(4)
public $backgroundimage; // varchar(255)
- public $tile; // tinyint(1)
+ public $disposition; // tinyint(1) default_1
/* Static get */
function staticGet($k,$v=NULL) { return Memcached_DataObject::staticGet('Design',$k,$v); }
__FILE__);
}
- $css = 'html, body { background-color: #' . $bgcolor->hexValue() . '} ' . "\n";
+ $css = 'body { background-color: #' . $bgcolor->hexValue() . ' }' . "\n";
$css .= '#content, #site_nav_local_views .current a { background-color: #';
$css .= $ccolor->hexValue() . '} '."\n";
- $css .= '#aside_primary { background-color: #'. $sbcolor->hexValue() . '} ' . "\n";
- $css .= 'html body { color: #'. $tcolor->hexValue() . '} '. "\n";
- $css .= 'a { color: #' . $lcolor->hexValue() . '} ' . "\n";
+ $css .= '#aside_primary { background-color: #'. $sbcolor->hexValue() . ' }' . "\n";
+ $css .= 'html body { color: #'. $tcolor->hexValue() . ' }'. "\n";
+ $css .= 'a { color: #' . $lcolor->hexValue() . ' }' . "\n";
- if (!empty($this->backgroundimage)) {
+ if (!empty($this->backgroundimage) &&
+ $this->disposition & BACKGROUND_ON) {
- $repeat = ($this->tile) ? 'background-repeat:repeat;' :
+ $repeat = ($this->disposition & BACKGROUND_TILE) ?
+ 'background-repeat:repeat;' :
'background-repeat:no-repeat;';
$css .= 'body { background-image:url(' .
Design::url($this->backgroundimage) .
- '); ' . $repeat . ' }' . "\n";
+ '); ' . $repeat . ' background-attachment:fixed; }' . "\n";
}
$out->element('style', array('type' => 'text/css'), $css);
return 'http://'.$server.$path.$filename;
}
+ function setDisposition($on, $off, $tile)
+ {
+ if ($on) {
+ $this->disposition |= BACKGROUND_ON;
+ } else {
+ $this->disposition &= ~BACKGROUND_ON;
+ }
+
+ if ($off) {
+ $this->disposition |= BACKGROUND_OFF;
+ } else {
+ $this->disposition &= ~BACKGROUND_OFF;
+ }
+
+ if ($tile) {
+ $this->disposition |= BACKGROUND_TILE;
+ } else {
+ $this->disposition &= ~BACKGROUND_TILE;
+ }
+ }
+
}