summaryrefslogtreecommitdiff
path: root/program/lib/Roundcube/html.php
diff options
context:
space:
mode:
Diffstat (limited to 'program/lib/Roundcube/html.php')
-rw-r--r--program/lib/Roundcube/html.php70
1 files changed, 19 insertions, 51 deletions
diff --git a/program/lib/Roundcube/html.php b/program/lib/Roundcube/html.php
index a36711281..1a4c3beba 100644
--- a/program/lib/Roundcube/html.php
+++ b/program/lib/Roundcube/html.php
@@ -21,7 +21,7 @@
* Class for HTML code creation
*
* @package Framework
- * @subpackage View
+ * @subpackage HTML
*/
class html
{
@@ -218,7 +218,7 @@ class html
$attr = array('src' => $attr);
}
return self::tag('iframe', $attr, $cont, array_merge(self::$common_attrib,
- array('src','name','width','height','border','frameborder','onload')));
+ array('src','name','width','height','border','frameborder')));
}
/**
@@ -288,7 +288,7 @@ class html
}
// attributes with no value
- if (in_array($key, array('checked', 'multiple', 'disabled', 'selected', 'autofocus'))) {
+ if (in_array($key, array('checked', 'multiple', 'disabled', 'selected'))) {
if ($value) {
$attrib_arr[] = $key . '="' . $key . '"';
}
@@ -350,18 +350,16 @@ class html
/**
* Class to create an HTML input field
*
- * @package Framework
- * @subpackage View
+ * @package HTML
*/
class html_inputfield extends html
{
protected $tagname = 'input';
protected $type = 'text';
protected $allowed = array(
- 'type','name','value','size','tabindex','autocapitalize','required',
+ 'type','name','value','size','tabindex','autocapitalize',
'autocomplete','checked','onchange','onclick','disabled','readonly',
- 'spellcheck','results','maxlength','src','multiple','accept',
- 'placeholder','autofocus',
+ 'spellcheck','results','maxlength','src','multiple','placeholder',
);
/**
@@ -407,8 +405,7 @@ class html_inputfield extends html
/**
* Class to create an HTML password field
*
- * @package Framework
- * @subpackage View
+ * @package HTML
*/
class html_passwordfield extends html_inputfield
{
@@ -418,9 +415,9 @@ class html_passwordfield extends html_inputfield
/**
* Class to create an hidden HTML input field
*
- * @package Framework
- * @subpackage View
+ * @package HTML
*/
+
class html_hiddenfield extends html
{
protected $tagname = 'input';
@@ -468,8 +465,7 @@ class html_hiddenfield extends html
/**
* Class to create HTML radio buttons
*
- * @package Framework
- * @subpackage View
+ * @package HTML
*/
class html_radiobutton extends html_inputfield
{
@@ -499,8 +495,7 @@ class html_radiobutton extends html_inputfield
/**
* Class to create HTML checkboxes
*
- * @package Framework
- * @subpackage View
+ * @package HTML
*/
class html_checkbox extends html_inputfield
{
@@ -530,8 +525,7 @@ class html_checkbox extends html_inputfield
/**
* Class to create an HTML textarea
*
- * @package Framework
- * @subpackage View
+ * @package HTML
*/
class html_textarea extends html
{
@@ -589,8 +583,7 @@ class html_textarea extends html
* print $select->show('CH');
* </pre>
*
- * @package Framework
- * @subpackage View
+ * @package HTML
*/
class html_select extends html
{
@@ -655,8 +648,7 @@ class html_select extends html
/**
* Class to build an HTML table
*
- * @package Framework
- * @subpackage View
+ * @package HTML
*/
class html_table extends html
{
@@ -678,11 +670,6 @@ class html_table extends html
{
$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'];
- $this->allowed = self::$common_attrib;
- }
}
/**
@@ -826,20 +813,19 @@ class html_table extends html
if (!empty($this->header)) {
$rowcontent = '';
foreach ($this->header as $c => $col) {
- $rowcontent .= self::tag($this->_col_tagname(), $col->attrib, $col->content);
+ $rowcontent .= self::tag('td', $col->attrib, $col->content);
}
- $thead = $this->tagname == 'table' ? self::tag('thead', null, self::tag('tr', null, $rowcontent, parent::$common_attrib)) :
- self::tag($this->_row_tagname(), array('class' => 'thead'), $rowcontent, parent::$common_attrib);
+ $thead = self::tag('thead', null, self::tag('tr', null, $rowcontent, parent::$common_attrib));
}
foreach ($this->rows as $r => $row) {
$rowcontent = '';
foreach ($row->cells as $c => $col) {
- $rowcontent .= self::tag($this->_col_tagname(), $col->attrib, $col->content);
+ $rowcontent .= self::tag('td', $col->attrib, $col->content);
}
if ($r < $this->rowindex || count($row->cells)) {
- $tbody .= self::tag($this->_row_tagname(), $row->attrib, $rowcontent, parent::$common_attrib);
+ $tbody .= self::tag('tr', $row->attrib, $rowcontent, parent::$common_attrib);
}
}
@@ -848,7 +834,7 @@ class html_table extends html
}
// add <tbody>
- $this->content = $thead . ($this->tagname == 'table' ? self::tag('tbody', null, $tbody) : $tbody);
+ $this->content = $thead . self::tag('tbody', null, $tbody);
unset($this->attrib['cols'], $this->attrib['rowsonly']);
return parent::show();
@@ -873,22 +859,4 @@ class html_table extends html
$this->rowindex = 0;
}
- /**
- * Getter for the corresponding tag name for table row elements
- */
- private function _row_tagname()
- {
- static $row_tagnames = array('table' => 'tr', 'ul' => 'li', '*' => 'div');
- return $row_tagnames[$this->tagname] ?: $row_tagnames['*'];
- }
-
- /**
- * Getter for the corresponding tag name for table cell elements
- */
- private function _col_tagname()
- {
- static $col_tagnames = array('table' => 'td', '*' => 'span');
- return $col_tagnames[$this->tagname] ?: $col_tagnames['*'];
- }
-
}