summaryrefslogtreecommitdiff
path: root/classes/Design.php
diff options
context:
space:
mode:
authorZach Copley <zach@controlyourself.ca>2009-06-16 21:36:15 -0700
committerZach Copley <zach@controlyourself.ca>2009-06-16 21:36:15 -0700
commit7b7f11942885666bfe1f03dd6f34e36a82a08484 (patch)
treeb60ffe9756aabe1fb7226ddc3045ea3a6cbc8569 /classes/Design.php
parentbea2fa15060e03d818db043122bf9529d2b77662 (diff)
Added background image tile flag to Design
Diffstat (limited to 'classes/Design.php')
-rw-r--r--classes/Design.php19
1 files changed, 10 insertions, 9 deletions
diff --git a/classes/Design.php b/classes/Design.php
index f5c87b489..acc94d196 100644
--- a/classes/Design.php
+++ b/classes/Design.php
@@ -41,6 +41,7 @@ class Design extends Memcached_DataObject
public $textcolor; // int(4)
public $linkcolor; // int(4)
public $backgroundimage; // varchar(255)
+ public $tile; // tinyint(1)
/* Static get */
function staticGet($k,$v=NULL) { return Memcached_DataObject::staticGet('Design',$k,$v); }
@@ -63,23 +64,23 @@ class Design extends Memcached_DataObject
common_log(LOG_ERR, "Unable to create color for design $id.",
__FILE__);
}
-
+
$css = 'html, 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";
-
+
if (!empty($this->backgroundimage)) {
-
- $css .= 'body { background-image:url(' .
- Design::url($this->backgroundimage) .
+
+ $css .= 'body { background-image:url(' .
+ Design::url($this->backgroundimage) .
'); background-repeat:no-repeat; }' . "\n";
}
-
+
$out->element('style', array('type' => 'text/css'), $css);
-
+
}
static function filename($id, $extension, $extra=null)
@@ -97,7 +98,7 @@ class Design extends Memcached_DataObject
return $dir . $filename;
}
-
+
static function url($filename)
{
$path = common_config('background', 'path');
@@ -120,5 +121,5 @@ class Design extends Memcached_DataObject
return 'http://'.$server.$path.$filename;
}
-
+
}