Commit a5cf8c12 authored by Côme Bernigaud's avatar Côme Bernigaud Committed by Benoit Mortier
Browse files

Added a size handling for SelectAttribute

parent 699a1d7d
......@@ -914,7 +914,8 @@ class PasswordAttribute extends StringAttribute
class SelectAttribute extends Attribute
{
protected $choices;
protected $outputs = NULL;
protected $outputs = NULL;
protected $size = 1;
/*! \brief The constructor of SelectAttribute
*
......@@ -1027,6 +1028,9 @@ class SelectAttribute extends Attribute
if ($this->disabled || (count($this->choices) == 0)) {
$display .= 'disabled="disabled" ';
}
if ($this->size > 1) {
$display .= 'size="'.$this->size.'" ';
}
if ($this->submitForm) {
$js = 'document.mainform.submit();';
$display .= 'onChange="javascript:'.htmlentities($js, ENT_COMPAT, 'UTF-8').'"';
......@@ -1058,6 +1062,11 @@ class SelectAttribute extends Attribute
$attributes[$this->getLdapName()]['choices'] = array_combine($this->choices, $outputs);
}
}
function setSize($size)
{
$this->size = $size;
}
}
/*! \brief This class allows to handle a select attribute which allow to choose an object
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment