Thomas
2013-10-14 566747af00ae413c942a7c6702e24c044af36f17
program/lib/Roundcube/html.php
@@ -3,7 +3,7 @@
/*
 +-----------------------------------------------------------------------+
 | This file is part of the Roundcube Webmail client                     |
 | Copyright (C) 2005-2011, The Roundcube Dev Team                       |
 | Copyright (C) 2005-2013, The Roundcube Dev Team                       |
 |                                                                       |
 | Licensed under the GNU General Public License version 3 or            |
 | any later version with exceptions for skins & plugins.                |
@@ -32,8 +32,8 @@
    public static $doctype = 'xhtml';
    public static $lc_tags = true;
    public static $common_attrib = array('id','class','style','title','align');
    public static $containers = array('iframe','div','span','p','h1','h2','h3','form','textarea','table','thead','tbody','tr','th','td','style','script');
    public static $common_attrib = array('id','class','style','title','align','unselectable');
    public static $containers = array('iframe','div','span','p','h1','h2','h3','ul','form','textarea','table','thead','tbody','tr','th','td','style','script');
    /**
@@ -358,10 +358,10 @@
    protected $tagname = 'input';
    protected $type = 'text';
    protected $allowed = array(
        'type','name','value','size','tabindex','autocapitalize',
        'type','name','value','size','tabindex','autocapitalize','required',
        'autocomplete','checked','onchange','onclick','disabled','readonly',
        'spellcheck','results','maxlength','src','multiple','placeholder',
        'autofocus',
        'spellcheck','results','maxlength','src','multiple','accept',
        'placeholder','autofocus',
    );
    /**
@@ -604,16 +604,17 @@
     *
     * @param mixed $names  Option name or array with option names
     * @param mixed $values Option value or array with option values
     * @param array $attrib Additional attributes for the option entry
     */
    public function add($names, $values = null)
    public function add($names, $values = null, $attrib = array())
    {
        if (is_array($names)) {
            foreach ($names as $i => $text) {
                $this->options[] = array('text' => $text, 'value' => $values[$i]);
                $this->options[] = array('text' => $text, 'value' => $values[$i]) + $attrib;
            }
        }
        else {
            $this->options[] = array('text' => $names, 'value' => $values);
            $this->options[] = array('text' => $names, 'value' => $values) + $attrib;
        }
    }
@@ -644,7 +645,7 @@
                $option_content = self::quote($option_content);
            }
            $this->content .= self::tag('option', $attr, $option_content);
            $this->content .= self::tag('option', $attr + $option, $option_content, array('value','label','class','style','title','disabled','selected'));
        }
        return parent::show();
@@ -676,8 +677,8 @@
     */
    public function __construct($attrib = array())
    {
        $default_attrib = self::$doctype == 'xhtml' ? array('summary' => '', 'border' => 0) : array();
        $this->attrib = array_merge($attrib, $default_attrib);
        $default_attrib = self::$doctype == 'xhtml' ? array('summary' => '', 'border' => '0') : array();
        $this->attrib   = array_merge($attrib, $default_attrib);
        if (!empty($attrib['tagname']) && $attrib['tagname'] != 'table') {
          $this->tagname = $attrib['tagname'];
@@ -879,7 +880,7 @@
    private function _row_tagname()
    {
        static $row_tagnames = array('table' => 'tr', 'ul' => 'li', '*' => 'div');
        return $row_tagnames[$this->tagname] ?: $row_tagnames['*'];
        return $row_tagnames[$this->tagname] ? $row_tagnames[$this->tagname] : $row_tagnames['*'];
    }
    /**
@@ -888,7 +889,7 @@
    private function _col_tagname()
    {
        static $col_tagnames = array('table' => 'td', '*' => 'span');
        return $col_tagnames[$this->tagname] ?: $col_tagnames['*'];
        return $col_tagnames[$this->tagname] ? $col_tagnames[$this->tagname] : $col_tagnames['*'];
    }
}