Commit 9184e06d 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 d882635e
...@@ -1976,6 +1976,7 @@ class SetAttribute extends Attribute ...@@ -1976,6 +1976,7 @@ class SetAttribute extends Attribute
protected $valueUnicity = TRUE; protected $valueUnicity = TRUE;
protected $editingValue = FALSE; protected $editingValue = FALSE;
protected $linearRendering = TRUE; protected $linearRendering = TRUE;
protected $size = 4;
/*! \brief The constructor of SetAttribute /*! \brief The constructor of SetAttribute
* *
...@@ -2108,10 +2109,13 @@ class SetAttribute extends Attribute ...@@ -2108,10 +2109,13 @@ class SetAttribute extends Attribute
function renderOnlyFormInput() function renderOnlyFormInput()
{ {
if (($this->size < 15) && ($this->size < count($this->value))) {
$this->size = min(15, count($this->value));
}
$id = $this->getHtmlId(); $id = $this->getHtmlId();
$smarty = get_smarty(); $smarty = get_smarty();
$smarty->assign($id.'_values', $this->getDisplayValues()); $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"':''). ($this->disabled? ' disabled="disabled"':'').
' >'."\n"; ' >'."\n";
$display .= '{html_options options=$'.$id.'_values}'; $display .= '{html_options options=$'.$id.'_values}';
...@@ -2259,6 +2263,11 @@ class SetAttribute extends Attribute ...@@ -2259,6 +2263,11 @@ class SetAttribute extends Attribute
{ {
return in_array($value, $this->value); return in_array($value, $this->value);
} }
function setSize($size)
{
$this->size = $size;
}
} }
/*! \brief This class allow to handle easily a composite attribute /*! \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