openrat-cms

# OpenRat Content Management System
git clone http://git.code.weiherhei.de/openrat-cms.git
Log | Files | Refs

Column.class.php (1508B)


      1 <?php
      2 
      3 namespace template_engine\components;
      4 
      5 class ColumnComponent extends Component
      6 {
      7 	public $width;
      8 	public $style;
      9 	public $class;
     10 	public $colspan;
     11 	public $rowspan;
     12 	public $header = false;
     13 	public $title;
     14 	public $url;
     15 	public $action;
     16 	public $id;
     17 	public $name;
     18 
     19 	protected function begin()
     20 	{
     21 	    $styleClasses = array();
     22 		echo '<'.($this->header?'th':'td');
     23 		if	( ! empty($this->width))
     24 			echo ' width="'.$this->htmlvalue($this->width).'"';
     25 		if	( ! empty($this->style))
     26 			echo ' style="'.$this->htmlvalue($this->style).'"';
     27 
     28 		if	( ! empty($this->colspan))
     29 			echo ' colspan="'.$this->htmlvalue($this->colspan).'"';
     30 		if	( ! empty($this->rowspan))
     31 			echo ' rowspan="'.$this->htmlvalue($this->rowspan).'"';
     32 		if	( ! empty($this->rowspan))
     33 			echo ' rowspan="'.$this->htmlvalue($this->rowspan).'"';
     34 		if	( ! empty($this->title))
     35 			echo ' title="'.$this->htmlvalue($this->title).'"';
     36 
     37         if	( ! empty($this->id))
     38         {
     39             echo ' data-name="'.$this->htmlvalue($this->name).'"';
     40             echo ' data-action="'.$this->htmlvalue($this->action).'"';
     41             echo ' data-id="'.$this->htmlvalue($this->id).'"';
     42             $styleClasses[] = 'clickable';
     43         }
     44         if	( ! empty($this->class))
     45             $styleClasses[] = $this->htmlvalue($this->class);
     46 
     47         if  ( sizeof($styleClasses) > 0)
     48             echo ' class="'.implode(' ',$styleClasses).'"';
     49 
     50         echo '>';
     51 	}
     52 	
     53 	
     54 	protected function end()
     55 	{
     56 		echo '</'.($this->header?'th':'td').'>';
     57 	}
     58 	
     59 }
     60 
     61 
     62 ?>