24 include_once(
"./Services/Table/interfaces/interface.ilTableFilterItem.php");
25 include_once(
"./Services/Form/classes/class.ilFormPropertyGUI.php");
82 $this->lng = $DIC->language();
83 parent::__construct($a_title, $a_postvar);
96 $this->width = (int) $a_width;
118 $this->height = (int) $a_height;
139 $this->options = $a_options;
159 $this->value = $a_array;
169 return is_array($this->value) ? $this->value : array();
185 $this->select_all = (bool) $a_value;
190 $this->selected_first = (bool) $a_value;
217 $options = array_map(
function ($k) {
221 if ($key != 0 || $val !=
"") {
222 if (!in_array((
string) $val,
$options)) {
240 $tpl =
new ilTemplate(
"tpl.prop_multi_select.html",
true,
true,
"Services/Form");
245 if ($this->select_all) {
247 $tpl->setCurrentBlock(
"item");
248 $tpl->setVariable(
"VAL",
"");
251 $tpl->setVariable(
"TXT_OPTION",
"<em>" .
$lng->txt(
"select_all") .
"</em>");
253 $tpl->parseCurrentBlock();
256 $tpl->setVariable(
"TOGGLE_ALL_ID", $this->
getFieldId() .
"_all__toggle");
257 $tpl->setVariable(
"TOGGLE_ALL_CBOX_ID", $this->
getFieldId() .
"_");
260 if ($this->selected_first) {
262 $tmp_checked = $tmp_unchecked = array();
263 foreach (
$options as $option_value => $option_text) {
264 if (in_array($option_value,
$values)) {
265 $tmp_checked[$option_value] = $option_text;
267 $tmp_unchecked[$option_value] = $option_text;
270 $options = $tmp_checked + $tmp_unchecked;
272 unset($tmp_unchecked);
275 foreach (
$options as $option_value => $option_text) {
276 $tpl->setCurrentBlock(
"item");
280 " disabled=\"disabled\"" 283 if (in_array($option_value,
$values)) {
286 " checked=\"checked\"" 293 $tpl->setVariable(
"TXT_OPTION", $option_text);
295 $tpl->parseCurrentBlock();
319 $a_tpl->setCurrentBlock(
"prop_generic");
320 $a_tpl->setVariable(
"PROP_GENERIC", $this->
render());
321 $a_tpl->parseCurrentBlock();
357 $this->custom_attributes[] = $custom_attribute;
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
Interface for property form input GUI classes that can be used in table filters.
special template class to simplify handling of ITX/PEAR
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled