summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Bruederli <thomas@roundcube.net>2013-10-15 10:41:22 +0200
committerThomas Bruederli <thomas@roundcube.net>2013-10-15 10:41:22 +0200
commitb6085773422923f2aa0c20a36dfde4ace35acf28 (patch)
treeab6f2d4b8740dadd01f8b545a4eefc77636e87a4
parent64c924ea06afa1eec463078a5d05fc908c12d10d (diff)
Add support for additional attributes on <option> entries
-rw-r--r--program/lib/Roundcube/html.php9
1 files changed, 5 insertions, 4 deletions
diff --git a/program/lib/Roundcube/html.php b/program/lib/Roundcube/html.php
index a36711281..5911c04d7 100644
--- a/program/lib/Roundcube/html.php
+++ b/program/lib/Roundcube/html.php
@@ -604,16 +604,17 @@ class html_select extends html
*
* @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 @@ class html_select extends html
$option_content = self::quote($option_content);
}
- $this->content .= self::tag('option', $attr, $option_content);
+ $this->content .= self::tag('option', $attr + $option, $option_content, array('class','style','title','disabled'));
}
return parent::show();