| | |
| | | protected $allowed; |
| | | protected $content; |
| | | |
| | | protected static $common_attrib = array('id','class','style','title','align'); |
| | | public static $common_attrib = array('id','class','style','title','align'); |
| | | public static $containers = array('div','span','p','h1','h2','h3','form','textarea'); |
| | | public static $lc_tags = true; |
| | | |
| | |
| | | class html_textarea extends html |
| | | { |
| | | protected $tagname = 'textarea'; |
| | | protected $allowed_attrib = array('name','rows','cols','wrap'); |
| | | protected $allowed_attrib = array('name','rows','cols','wrap','tabindex'); |
| | | |
| | | /** |
| | | * Get HTML code for this object |
| | |
| | | unset($this->attrib['value']); |
| | | } |
| | | |
| | | if (!empty($value) && !isset($this->attrib['mce_editable'])) { |
| | | if (!empty($value) && !ereg('mce_editor', $this->attrib['class'])) { |
| | | $value = Q($value, 'strict', false); |
| | | } |
| | | |
| | | return self::tag($this->tagname, $this->attrib, $value, array_merge(self::$common_attrib, $this->allowed_attrib)); |
| | | } |
| | | } |
| | |
| | | * @param array Cell attributes |
| | | * @param string Cell content |
| | | */ |
| | | private function add_header($attr, $cont) |
| | | public function add_header($attr, $cont) |
| | | { |
| | | if (is_string($attr)) |
| | | $attr = array('class' => $attr); |
| | |
| | | * |
| | | * @param array Row attributes |
| | | */ |
| | | private function add_row($attr = array()) |
| | | public function add_row($attr = array()) |
| | | { |
| | | $this->rowindex++; |
| | | $this->colindex = 0; |
| | |
| | | * @param array Table attributes |
| | | * @return string The final table HTML code |
| | | */ |
| | | public function show($attr = array()) |
| | | public function show($attrib = null) |
| | | { |
| | | $this->attrib = array_merge($this->attrib, $attr); |
| | | $thead = $tbody = ""; |
| | | if (is_array($attrib)) |
| | | $this->attrib = array_merge($this->attrib, $attrib); |
| | | |
| | | $thead = $tbody = ""; |
| | | |
| | | // include <thead> |
| | | if (!empty($this->header)) { |
| | | $rowcontent = ''; |
| | | foreach ($this->header as $c => $col) { |
| | | $rowcontent .= self::tag('th', $col->attrib, $col->content); |
| | | $rowcontent .= self::tag('td', $col->attrib, $col->content); |
| | | } |
| | | $thead = self::tag('thead', null, self::tag('tr', null, $rowcontent)); |
| | | } |
| | |
| | | } |
| | | |
| | | if ($r < $this->rowindex || count($row->cells)) { |
| | | $tbody .= self::tag('tr', $rows->attrib, $rowcontent); |
| | | $tbody .= self::tag('tr', $row->attrib, $rowcontent); |
| | | } |
| | | } |
| | | |