75 $this->links_mode = array(
76 "link_class" => $a_link_class);
85 $a_include_form_tag =
false, $a_form_action =
"", $a_form_id =
"",
86 $a_form_class =
"", $a_form_target =
"_top",
87 $a_button_text =
"", $a_button_class =
"", $a_button_cmd =
"")
90 $this->form_mode = array(
91 "select_name" => $a_select_name,
92 "select_class" => $a_select_class,
93 "include_form_tag" => $a_include_form_tag,
94 "form_action" => $a_form_action,
95 "form_id" => $a_form_id,
96 "form_class" => $a_form_class,
97 "form_target" => $a_form_target,
98 "button_text" => $a_button_text,
99 "button_class" => $a_button_class,
100 "button_cmd" => $a_button_cmd
115 function addItem($a_title, $a_value =
"", $a_link =
"", $a_img =
"", $a_alt =
"", $a_frame =
"",
116 $a_html =
"", $a_prevent_background_click =
false, $a_onclick =
"", $a_ttip =
"",
117 $a_tt_my =
"right center", $a_tt_at =
"left center", $a_tt_use_htmlspecialchars =
true)
119 $this->items[] = array(
"title" => $a_title,
"value" => $a_value,
120 "link" => $a_link,
"img" => $a_img,
"alt" => $a_alt,
"frame" => $a_frame,
121 "html" => $a_html,
"prevent_background_click" => $a_prevent_background_click,
122 "onclick" => $a_onclick,
"ttip" => $a_ttip,
"tt_my" => $a_tt_my,
"tt_at" => $a_tt_at,
123 "tt_use_htmlspecialchars" => $a_tt_use_htmlspecialchars);
128 $this->items = array();
148 $this->listtitle = $a_listtitle;
158 return $this->listtitle;
168 $this->selectionheaderclass = $a_selectionheaderclass;
178 return $this->selectionheaderclass;
188 $this->sel_head_span_class = $a_val;
198 return $this->sel_head_span_class;
208 $this->headericon = $a_headericon;
218 return $this->headericon;
228 $this->nojslinkclass = $a_nojslinkclass;
238 return $this->nojslinkclass;
248 $this->itemlinkclass = $a_itemlinkclass;
258 return $this->itemlinkclass;
288 $this->useimages = $a_useimages;
298 return $this->useimages;
308 $this->access_key = $a_val;
326 $this->trigger_event = $a_val;
342 $this->auto_hide = $a_val;
365 $this->on_click = $a_val;
366 $this->on_click_form_id = $a_onclick_form_id;
376 return $this->on_click;
386 $this->selected_value = $a_val;
407 $this->toggle = array(
"el" => $a_el,
"class_on" => $a_on);
429 include_once(
"./Services/YUI/classes/class.ilYuiUtil.php");
432 $this->asynch = $a_val;
452 $this->asynch_url = $a_val;
470 $this->select_callback = $a_val;
478 return $this->select_callback;
484 public function getHTML($a_only_cmd_list_asynch =
false)
494 include_once(
"./Services/YUI/classes/class.ilYuiUtil.php");
496 $GLOBALS[
"tpl"]->addJavascript(
"./Services/UIComponent/Overlay/js/ilOverlay.js");
497 $GLOBALS[
"tpl"]->addJavascript(
"./Services/UIComponent/AdvancedSelectionList/js/AdvancedSelectionList.js");
499 "Services/UIComponent/AdvancedSelectionList",
"DEFAULT",
false,
true);
507 $tpl->setCurrentBlock(
"asynch_request");
509 $tpl->parseCurrentBlock();
515 if (isset($item[
"ref_id"]))
517 $sel_arr[$item[
"ref_id"]] = (isset($item[
"title"]))
521 $this->css_row = ($this->css_row !=
"tblrow1_mo")
529 $tpl->setCurrentBlock(
"image");
530 $tpl->setVariable(
"IMG_ITEM", $item[
"img"]);
531 $tpl->setVariable(
"ALT_ITEM", $item[
"alt"]);
532 $tpl->parseCurrentBlock();
536 $tpl->touchBlock(
"no_image");
546 $tpl->setCurrentBlock(
"frame");
547 $tpl->setVariable(
"TARGET_ITEM", $item[
"frame"]);
548 $tpl->parseCurrentBlock();
553 $tpl->setCurrentBlock(
"item_link_class");
555 $tpl->parseCurrentBlock();
558 $tpl->setCurrentBlock(
"href_s");
559 $tpl->setVariable(
"HREF_ITEM",
'href="'.$item[
"link"].
'"');
560 $tpl->setVariable(
"ID_ITEM", $this->
getId().
"_".$item[
"value"]);
561 $tpl->parseCurrentBlock();
563 $tpl->touchBlock(
"href_e");
567 $tpl->setCurrentBlock(
"item");
571 if ($item[
"prevent_background_click"])
573 $tpl->setVariable(
"ONCLICK_ITEM",
'');
577 if ($item[
"onclick"] ==
"")
579 $tpl->setVariable(
"ONCLICK_ITEM",
580 'onclick="'.
"return il.AdvancedSelectionList.openTarget('".$item[
"link"].
"','".$item[
"frame"].
"');".
'"');
584 $tpl->setVariable(
"ONCLICK_ITEM",
585 'onclick="'.
"return ".$item[
"onclick"].
";".
'"');
593 $tpl->setVariable(
"ONCLICK_ITEM",
594 'onclick="return il.AdvancedSelectionList.submitForm(\''.$this->
getId().
'\''.
595 ", '".$this->form_mode[
"select_name"].
"','".$item[
"value"].
"',".
596 "'".$this->on_click_form_id.
"','".$this->form_mode[
"button_cmd"].
"');\"");
601 $tpl->setVariable(
"ONCLICK_ITEM",
602 'onclick="return il.AdvancedSelectionList.selectForm(\''.$this->
getId().
'\''.
603 ", '".$this->form_mode[
"select_name"].
"','".$item[
"value"].
"',".
604 "'".$item[
"title"].
"');\"");
609 $tpl->setVariable(
"ONCLICK_ITEM",
610 'onclick="il.AdvancedSelectionList.clickNop(\''.$this->
getId().
'\''.
611 ", '".$this->form_mode[
"select_name"].
"','".$item[
"value"].
"',".
612 "'".$item[
"title"].
"');\"");
615 $tpl->setVariable(
"CSS_ROW", $this->css_row);
616 if ($item[
"html"] ==
"")
618 $tpl->setVariable(
"TXT_ITEM", $item[
"title"]);
622 $tpl->setVariable(
"TXT_ITEM", $item[
"html"]);
625 $tpl->setVariable(
"ID_ITEM_TR", $this->
getId().
"_".$item[
"value"].
"_tr");
626 if ($item[
"ttip"] !=
"")
628 include_once(
"./Services/UIComponent/Tooltip/classes/class.ilTooltipGUI.php");
630 "", $item[
"tt_my"], $item[
"tt_at"], $item[
"tt_use_htmlspecialchars"]);
633 $tpl->parseCurrentBlock();
636 $tpl->setCurrentBlock(
"js_item");
637 $tpl->setVariable(
"IT_ID", $this->
getId());
638 $tpl->setVariable(
"IT_HID_NAME", $this->form_mode[
"select_name"]);
639 $tpl->setVariable(
"IT_HID_VAL", $item[
"value"]);
640 $tpl->setVariable(
"IT_TITLE", str_replace(
"'",
"\\'", $item[
"title"]));
641 $tpl->parseCurrentBlock();
645 $tpl->setCurrentBlock(
"cmd_table");
646 $tpl->parseCurrentBlock();
648 if ($a_only_cmd_list_asynch)
650 return $tpl->get(
"cmd_table");
655 $tpl->setCurrentBlock(
"top_img");
659 $tpl->setVariable(
"IMG_DOWN",
663 $tpl->setVariable(
"IMG_DOWN",
667 $tpl->setVariable(
"IMG_DOWN",
676 $tpl->setVariable(
"ALT_SEL_TOP",
"");
677 $tpl->parseCurrentBlock();
683 $tpl->setCurrentBlock(
"hidden_input");
684 $tpl->setVariable(
"HID", $this->
getId());
685 $tpl->parseCurrentBlock();
691 $tpl->setCurrentBlock(
"hidden_input");
692 $tpl->setVariable(
"HID", $this->
getId());
693 $tpl->parseCurrentBlock();
696 $tpl->setCurrentBlock(
"init_hidden_input");
697 $tpl->setVariable(
"H2ID", $this->
getId());
698 $tpl->setVariable(
"HID_NAME", $this->form_mode[
"select_name"]);
700 $tpl->parseCurrentBlock();
704 $tpl->setCurrentBlock(
"js_section");
707 include_once(
"./Services/Accessibility/classes/class.ilAccessKeyGUI.php");
718 $cfg[
"anchor_id"] =
"ilAdvSelListAnchorElement_".$this->getId();
726 $cfg[
"toggle_el"] =
$toggle[
"el"];
727 $cfg[
"toggle_class_on"] =
$toggle[
"class_on"];
730 include_once(
"./Services/JSON/classes/class.ilJsonUtil.php");
738 $tpl->setVariable(
"CLASS_SEL_TOP_SPAN",
746 $tpl->parseCurrentBlock();
759 $tpl->setCurrentBlock(
"no_js_link");
760 $tpl->setVariable(
"LINKS_CLASS", $this->links_mode[
"link_class"]);
761 $tpl->setVariable(
"LINKS_HREF", $item[
"link"]);
762 $tpl->setVariable(
"LINKS_TXT", $item[
"title"]);
763 $tpl->parseCurrentBlock();
764 $tpl->setCurrentBlock(
"no_js_section");
765 $tpl->parseCurrentBlock();
774 $tpl->setCurrentBlock(
"no_js_form_option");
775 $tpl->setVariable(
"FRM_OPTION_TXT", $item[
"title"]);
776 $tpl->setVariable(
"FRM_OPTION_VAL", $item[
"value"]);
779 $tpl->setVariable(
"SELECTED",
' selected="selected" ');
781 $tpl->parseCurrentBlock();
783 if ($this->form_mode[
"include_form_tag"])
785 $tpl->setCurrentBlock(
"no_js_form_begin");
786 $tpl->setVariable(
"FRM_ID", $this->form_mode[
"form_id"]);
787 $tpl->setVariable(
"FRM_CLASS", $this->form_mode[
"form_class"]);
788 $tpl->setVariable(
"FRM_ACTION", $this->form_mode[
"form_action"]);
789 $tpl->setVariable(
"FRM_TARGET", $this->form_mode[
"form_target"]);
790 $tpl->parseCurrentBlock();
791 $tpl->touchBlock(
"no_js_form_end");
793 if ($this->form_mode[
"button_text"])
795 $tpl->setCurrentBlock(
"no_js_form_button");
796 $tpl->setVariable(
"FRM_BT_TXT", $this->form_mode[
"button_text"]);
797 $tpl->setVariable(
"FRM_BT_CLASS", $this->form_mode[
"button_class"]);
798 if ($this->form_mode[
"button_cmd"] !=
"")
800 $tpl->setVariable(
"FRM_BT_CMD",
'name="cmd['.$this->form_mode[
"button_cmd"].
']"');
802 $tpl->parseCurrentBlock();
804 $tpl->setVariable(
"FRM_SELECT_NAME", $this->form_mode[
"select_name"]);
805 $tpl->setVariable(
"FRM_SELECT_CLASS", $this->form_mode[
"select_class"]);
809 include_once(
"./Services/Accessibility/classes/class.ilAccessKeyGUI.php");
813 $tpl->setCurrentBlock(
"no_js_section");
814 $tpl->parseCurrentBlock();