Commit 3264ee80 authored by Côme Chilliet's avatar Côme Chilliet
Browse files

Growing SetAttribute line number until number of values or 15 is reached

parent 6233a9f9
......@@ -1973,6 +1973,7 @@ class SetAttribute extends Attribute
protected $valueUnicity = TRUE;
protected $editingValue = FALSE;
protected $linearRendering = TRUE;
protected $size = 4;
/*! \brief The constructor of SetAttribute
*
......@@ -2105,10 +2106,13 @@ class SetAttribute extends Attribute
function renderOnlyFormInput()
{
if (($this->size < 15) && ($this->size < count($this->value))) {
$this->size = min(15, count($this->value));
}
$id = $this->getHtmlId();
$smarty = get_smarty();
$smarty->assign($id.'_values', $this->getDisplayValues());
$display = '<select multiple="multiple" name="row'.$id.'[]" id="row'.$id.'"'.
$display = '<select multiple="multiple" name="row'.$id.'[]" id="row'.$id.'" size="'.$this->size.'"'.
($this->disabled? ' disabled="disabled"':'').
' >'."\n";
$display .= '{html_options options=$'.$id.'_values}';
......@@ -2256,6 +2260,11 @@ class SetAttribute extends Attribute
{
return in_array($value, $this->value);
}
function setSize($size)
{
$this->size = $size;
}
}
/*! \brief This class allow to handle easily a composite attribute
......
Markdown is supported
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