alecpl
2008-07-01 e6e5c60aae745a580a2d7fca1e2b7104c3907352
program/include/html.php
@@ -32,7 +32,7 @@
    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;
@@ -415,7 +415,7 @@
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
@@ -441,9 +441,10 @@
            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));
    }
}
@@ -570,7 +571,7 @@
     * @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);
@@ -586,7 +587,7 @@
     *
     * @param array Row attributes
     */
    private function add_row($attr = array())
    public function add_row($attr = array())
    {
        $this->rowindex++;
        $this->colindex = 0;
@@ -602,16 +603,18 @@
     * @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));
        }
@@ -623,7 +626,7 @@
            }
            if ($r < $this->rowindex || count($row->cells)) {
                $tbody .= self::tag('tr', $rows->attrib, $rowcontent);
                $tbody .= self::tag('tr', $row->attrib, $rowcontent);
            }
        }