cssClass = $class; return $this; } // ################################################################### /** * Sets the style information * * @param array Style attributes * * @return fluent interface */ public function setStyle(Array $attributes) { $this->style = $attributes; return $this; } // ################################################################### /** * Returns a string of CSS style attributes * * @return string CSS attributes */ protected function _prepareStyle() { if (empty($this->style) && empty($this->cssClass)) { return; } if ($this->cssClass == ':swap:') { BSFunctions::swap_css_classes(); $class = BSFunctions::$cssClass; } else { $class = $this->cssClass; } $attrs = array(); foreach ($this->style as $prop => $value) { $attrs[] = $prop . ': ' . $value; } $style = implode('; ', $attrs); $string = ''; if ($class) { $string .= ' class="' . $class . '"'; } if ($style) { $string .= ' style="' . $style . '"'; } return $string; } } ?>