コード例 #1
0
 /**
  * Returns the attributes to be rendered.
  * This method overrides the parent's implementation to default to 
  * adding a [] to the name
  * @return ArrayObject attributes to be rendered
  */
 protected function getAttributesToRender()
 {
     $url = $this->getBackImageUrl();
     if (strlen($url)) {
         $this->setStyle(array('background-image' => "url({$url})"));
     }
     $attributes = parent::getAttributesToRender();
     if (($cellSpacing = $this->getCellSpacing()) >= 0) {
         $attributes['cellspacing'] = $cellSpacing;
     } else {
         $attributes['cellspacing'] = '0';
     }
     if (($cellPadding = $this->getCellPadding()) >= 0) {
         $attributes['cellpadding'] = $cellPadding;
     } else {
         $attributes['cellpadding'] = '0';
     }
     $grid = $this->getGridLines();
     if ($grid != 'None') {
         if ($grid == 'Horizontal') {
             $attributes['rules'] = 'rows';
         } else {
             if ($grid == 'Both') {
                 $attributes['rules'] = 'all';
             } else {
                 if ($grid == 'Vertical') {
                     $attributes['rules'] = 'cols';
                 }
             }
         }
         if (!isset($attributes['border'])) {
             $attributes['border'] = '1';
         }
     }
     $align = $this->getHorizontalAlign();
     if ($align != 'NotSet') {
         $attributes['align'] = $align;
     }
     return $attributes;
 }
コード例 #2
0
 /**
  * Returns the attributes to be rendered.
  * @return ArrayObject attributes to be rendered
  */
 protected function getAttributesToRender()
 {
     $attributes = parent::getAttributesToRender();
     if ($this->getRepeatLayout() === 'Table') {
         if (($cellSpacing = $this->getCellSpacing()) >= 0) {
             $attributes['cellspacing'] = $cellSpacing;
         } else {
             $attributes['cellspacing'] = '0';
         }
         if (($cellPadding = $this->getCellPadding()) >= 0) {
             $attributes['cellpadding'] = $cellPadding;
         } else {
             $attributes['cellpadding'] = '0';
         }
         $grid = $this->getGridLines();
         if ($grid != 'None') {
             if ($grid == 'Horizontal') {
                 $attributes['rules'] = 'rows';
             } else {
                 if ($grid == 'Both') {
                     $attributes['rules'] = 'all';
                 } else {
                     if ($grid == 'Vertical') {
                         $attributes['rules'] = 'cols';
                     }
                 }
             }
             if (!isset($attributes['border'])) {
                 $attributes['border'] = '1';
             }
         }
         $align = $this->getHorizontalAlign();
         if ($align != 'NotSet') {
             $attributes['align'] = $align;
         }
     }
     return $attributes;
 }