/** * Create a new Style * * @param boolean $isSupervisor */ public function __construct($isSupervisor = false) { // Supervisor? $this->_isSupervisor = $isSupervisor; // Initialise values $this->_conditionalStyles = array(); $this->_font = new Style_Font($isSupervisor); $this->_fill = new Style_Fill($isSupervisor); $this->_borders = new Style_Borders($isSupervisor); $this->_alignment = new Style_Alignment($isSupervisor); $this->_numberFormat = new Style_NumberFormat($isSupervisor); $this->_protection = new Style_Protection($isSupervisor); // bind parent if we are a supervisor if ($isSupervisor) { $this->_font->bindParent($this); $this->_fill->bindParent($this); $this->_borders->bindParent($this); $this->_alignment->bindParent($this); $this->_numberFormat->bindParent($this); $this->_protection->bindParent($this); } }
/** * Create CSS style (Style_Alignment) * * @param Style_Alignment $pStyle Style_Alignment * @return array */ private function _createCSSStyleAlignment(Style_Alignment $pStyle) { // Construct CSS $css = array(); // Create CSS $css['vertical-align'] = $this->_mapVAlign($pStyle->getVertical()); if ($textAlign = $this->_mapHAlign($pStyle->getHorizontal())) { $css['text-align'] = $textAlign; } // Return return $css; }