summaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
authorZach Copley <zach@controlyourself.ca>2009-06-17 02:35:51 -0700
committerZach Copley <zach@controlyourself.ca>2009-06-17 02:35:51 -0700
commit76cbeff33c9659cacbb57943056aabcb1517ca5c (patch)
tree0d26138c7439ec9bc50fad56a6030439d57c4c9e /classes
parentea5d46a94d377675eb06dc57757d0e4c743f8a54 (diff)
Update background image settings to use bitflags
Diffstat (limited to 'classes')
-rw-r--r--classes/Design.php33
-rwxr-xr-xclasses/laconica.ini2
2 files changed, 31 insertions, 4 deletions
diff --git a/classes/Design.php b/classes/Design.php
index 4ea176677..5b28bf014 100644
--- a/classes/Design.php
+++ b/classes/Design.php
@@ -21,6 +21,10 @@ if (!defined('LACONICA')) {
exit(1);
}
+define('BACKGROUND_ON', 1);
+define('BACKGROUND_OFF', 2);
+define('BACKGROUND_TILE', 4);
+
/**
* Table Definition for design
*/
@@ -41,7 +45,7 @@ class Design extends Memcached_DataObject
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); }
@@ -72,9 +76,11 @@ class Design extends Memcached_DataObject
$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(' .
@@ -125,4 +131,25 @@ class Design extends Memcached_DataObject
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;
+ }
+ }
+
}
diff --git a/classes/laconica.ini b/classes/laconica.ini
index 569681984..1a650aba5 100755
--- a/classes/laconica.ini
+++ b/classes/laconica.ini
@@ -46,7 +46,7 @@ sidebarcolor = 1
textcolor = 1
linkcolor = 1
backgroundimage = 2
-tile = 17
+disposition = 17
[design__keys]
id = N