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

Added a size handling for SelectAttribute

parent 359cef8a
......@@ -906,7 +906,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
*
......@@ -1014,6 +1015,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').'"';
......@@ -1045,6 +1049,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