]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - classes/Design.php
conversation action is readonly
[quix0rs-gnu-social.git] / classes / Design.php
index 4ea176677bdf971c0b97d7afda4e887de5d61263..0927fcda70e729ef70e6fa8c8132d38882a8dba2 100644 (file)
@@ -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); }
@@ -65,21 +69,23 @@ class Design extends Memcached_DataObject
                 __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);
@@ -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;
+        }
+    }
+
 }