3 declare(strict_types=1);
    40         string $a_postvar = 
""    44         $this->
lng = $DIC->language();
    52         $this->width = $a_width;
    62         $this->height = $a_height;
    75         $this->options = $a_options;
    92         if (is_array($a_array)) {
    93             $this->value = $a_array;
   102         return is_array($this->value) ? $this->value : array();
   115         $this->select_all = $a_value;
   120         $this->selected_first = $a_value;
   132         if (count($val) > 0) {
   133             $options = array_map(
function ($k) {
   136             foreach ($val as 
$key => $val2) {
   137                 if (
$key != 0 || $val2 != 
"") {
   138                     if (!in_array((
string) $val2, $options)) {
   157         $tpl = 
new ilTemplate(
"tpl.prop_multi_select.html", 
true, 
true, 
"Services/Form");
   162             if ($this->select_all) {
   164                 $tpl->setCurrentBlock(
"item");
   165                 $tpl->setVariable(
"VAL", 
"");
   167                 $tpl->setVariable(
"IID", $this->
getFieldId());
   168                 $tpl->setVariable(
"TXT_OPTION", 
"<em>" . 
$lng->
txt(
"select_all") . 
"</em>");
   169                 $tpl->setVariable(
"POST_VAR", $this->
getPostVar());
   170                 $tpl->parseCurrentBlock();
   172                 $tpl->setVariable(
"TOGGLE_FIELD_ID", $this->
getFieldId());
   173                 $tpl->setVariable(
"TOGGLE_ALL_ID", $this->
getFieldId() . 
"_all__toggle");
   174                 $tpl->setVariable(
"TOGGLE_ALL_CBOX_ID", $this->
getFieldId() . 
"_");
   177             if ($this->selected_first) {
   179                 $tmp_checked = $tmp_unchecked = array();
   180                 foreach ($options as $option_value => $option_text) {
   181                     if (in_array($option_value, $values)) {
   182                         $tmp_checked[$option_value] = $option_text;
   184                         $tmp_unchecked[$option_value] = $option_text;
   187                 $options = $tmp_checked + $tmp_unchecked;
   189                 unset($tmp_unchecked);
   192             foreach ($options as $option_value => $option_text) {
   193                 $tpl->setCurrentBlock(
"item");
   197                         " disabled=\"disabled\""   200                 if (in_array($option_value, $values)) {
   203                         " checked=\"checked\""   209                 $tpl->setVariable(
"IID", $this->
getFieldId());
   210                 $tpl->setVariable(
"TXT_OPTION", $option_text);
   211                 $tpl->setVariable(
"POST_VAR", $this->
getPostVar());
   212                 $tpl->parseCurrentBlock();
   255         $this->custom_attributes[] = $custom_attribute;
   280         $data = unserialize($a_data);
   282         if (is_array(
$data)) {
 parseCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
 
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
 
setVariable($variable, $value='')
Sets a variable value. 
 
setCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)