]>
Commit | Line | Data |
---|---|---|
abc9b7a9 JP |
1 | <?php |
2 | require_once 'container.lib.php'; | |
3 | ||
4 | class CSS extends Container { | |
5 | protected function paint_head() { | |
6 | if ($this->has_id()) | |
7 | return sprintf("%s {", $this->get_id()); | |
8 | } | |
9 | protected function paint_attributes() { | |
10 | $r = array(); | |
11 | foreach($this->get_attributes() as $k=>$v) { | |
12 | //$k = strtolower($k); | |
13 | $r[] = "$k: $v;"; | |
14 | } | |
15 | return implode('',$r); | |
16 | } | |
17 | protected function paint_foot() { | |
18 | if ($this->has_id()) | |
19 | return sprintf("};"); | |
20 | } | |
21 | function __toString() { | |
22 | return $this->paint_head().$this->paint_attributes().$this->paint_foot(); | |
23 | } | |
24 | } |