71 $this->links_mode = array(
72 "link_class" => $a_link_class);
81 $a_include_form_tag =
false, $a_form_action =
"", $a_form_id =
"",
82 $a_form_class =
"", $a_form_target =
"_top",
83 $a_button_text =
"", $a_button_class =
"", $a_button_cmd =
"")
86 $this->form_mode = array(
87 "select_name" => $a_select_name,
88 "select_class" => $a_select_class,
89 "include_form_tag" => $a_include_form_tag,
90 "form_action" => $a_form_action,
91 "form_id" => $a_form_id,
92 "form_class" => $a_form_class,
93 "form_target" => $a_form_target,
94 "button_text" => $a_button_text,
95 "button_class" => $a_button_class,
96 "button_cmd" => $a_button_cmd
111 function addItem($a_title, $a_value =
"", $a_link =
"", $a_img =
"", $a_alt =
"", $a_frame =
"",
112 $a_html =
"", $a_prevent_background_click =
false)
114 $this->items[] = array(
"title" => $a_title,
"value" => $a_value,
115 "link" => $a_link,
"img" => $a_img,
"alt" => $a_alt,
"frame" => $a_frame,
116 "html" => $a_html,
"prevent_background_click" => $a_prevent_background_click);
136 $this->listtitle = $a_listtitle;
146 return $this->listtitle;
156 $this->selectionheaderclass = $a_selectionheaderclass;
166 return $this->selectionheaderclass;
176 $this->headericon = $a_headericon;
186 return $this->headericon;
196 $this->nojslinkclass = $a_nojslinkclass;
206 return $this->nojslinkclass;
216 $this->itemlinkclass = $a_itemlinkclass;
226 return $this->itemlinkclass;
256 $this->useimages = $a_useimages;
266 return $this->useimages;
276 $this->access_key = $a_val;
301 $this->on_click = $a_val;
302 $this->on_click_form_id = $a_onclick_form_id;
312 return $this->on_click;
322 $this->selected_value = $a_val;
343 $this->toggle = array(
"el" => $a_el,
"class_on" => $a_on);
365 include_once(
"./Services/YUI/classes/class.ilYuiUtil.php");
368 $this->asynch = $a_val;
388 $this->asynch_url = $a_val;
404 public function getHTML($a_only_cmd_list_asynch =
false)
414 include_once(
"./Services/YUI/classes/class.ilYuiUtil.php");
416 $GLOBALS[
"tpl"]->addJavascript(
"./Services/UIComponent/Overlay/js/ilOverlay.js");
417 $GLOBALS[
"tpl"]->addJavascript(
"./Services/UIComponent/AdvancedSelectionList/js/AdvancedSelectionList.js");
420 "Services/UIComponent/AdvancedSelectionList",
"DEFAULT",
false,
true);
428 $tpl->setCurrentBlock(
"asynch_request");
430 $tpl->parseCurrentBlock();
436 if (isset($item[
"ref_id"]))
438 $sel_arr[$item[
"ref_id"]] = (isset($item[
"title"]))
442 $this->css_row = ($this->css_row !=
"tblrow1_mo")
450 $tpl->setCurrentBlock(
"image");
451 $tpl->setVariable(
"IMG_ITEM", $item[
"img"]);
452 $tpl->setVariable(
"ALT_ITEM", $item[
"alt"]);
453 $tpl->parseCurrentBlock();
457 $tpl->touchBlock(
"no_image");
463 $tpl->setCurrentBlock(
"frame");
464 $tpl->setVariable(
"TARGET_ITEM", $item[
"frame"]);
465 $tpl->parseCurrentBlock();
470 $tpl->setCurrentBlock(
"item_link_class");
472 $tpl->parseCurrentBlock();
475 $tpl->setCurrentBlock(
"item");
480 if ($item[
"prevent_background_click"])
482 $tpl->setVariable(
"ONCLICK_ITEM",
'');
486 $tpl->setVariable(
"ONCLICK_ITEM",
487 'onclick="'.
"return ilAdvancedSelectionList.openTarget('".$item[
"link"].
"','".$item[
"frame"].
"');".
'"');
490 $tpl->setVariable(
"HREF_ITEM",
'href="'.$item[
"link"].
'"');
491 $tpl->setVariable(
"ID_ITEM", $this->
getId().
"_".$item[
"value"]);
496 $tpl->setVariable(
"ONCLICK_ITEM",
497 'onclick="ilAdvancedSelectionList.submitForm(\''.$this->
getId().
'\''.
498 ", '".$this->form_mode[
"select_name"].
"','".$item[
"value"].
"',".
499 "'".$this->on_click_form_id.
"','".$this->form_mode[
"button_cmd"].
"');\"");
504 $tpl->setVariable(
"ONCLICK_ITEM",
505 'onclick="ilAdvancedSelectionList.selectForm(\''.$this->
getId().
'\''.
506 ", '".$this->form_mode[
"select_name"].
"','".$item[
"value"].
"',".
507 "'".$item[
"title"].
"');\"");
510 $tpl->setVariable(
"CSS_ROW", $this->css_row);
511 if ($item[
"html"] ==
"")
513 $tpl->setVariable(
"TXT_ITEM", $item[
"title"]);
517 $tpl->setVariable(
"TXT_ITEM", $item[
"html"]);
520 $tpl->parseCurrentBlock();
524 $tpl->setCurrentBlock(
"cmd_table");
525 $tpl->parseCurrentBlock();
527 if ($a_only_cmd_list_asynch)
529 return $tpl->get(
"cmd_table");
534 $tpl->setCurrentBlock(
"top_img");
538 $tpl->setVariable(
"IMG_DOWN",
542 $tpl->setVariable(
"IMG_DOWN",
551 $tpl->setVariable(
"ALT_SEL_TOP",
"");
552 $tpl->parseCurrentBlock();
558 $tpl->setCurrentBlock(
"hidden_input");
559 $tpl->setVariable(
"HID", $this->
getId());
560 $tpl->parseCurrentBlock();
566 $tpl->setCurrentBlock(
"hidden_input");
567 $tpl->setVariable(
"HID", $this->
getId());
568 $tpl->parseCurrentBlock();
571 $tpl->setCurrentBlock(
"init_hidden_input");
572 $tpl->setVariable(
"H2ID", $this->
getId());
573 $tpl->setVariable(
"HID_NAME", $this->form_mode[
"select_name"]);
575 $tpl->parseCurrentBlock();
579 $tpl->setCurrentBlock(
"js_section");
582 include_once(
"./Services/Accessibility/classes/class.ilAccessKeyGUI.php");
586 $cfg[
"anchor_id"] =
"ilAdvSelListAnchorElement_".$this->getId();
594 $cfg[
"toggle_el"] =
$toggle[
"el"];
595 $cfg[
"toggle_class_on"] =
$toggle[
"class_on"];
598 include_once(
"./Services/JSON/classes/class.ilJsonUtil.php");
604 $tpl->parseCurrentBlock();
615 $tpl->setCurrentBlock(
"no_js_link");
616 $tpl->setVariable(
"LINKS_CLASS", $this->links_mode[
"link_class"]);
617 $tpl->setVariable(
"LINKS_HREF", $item[
"link"]);
618 $tpl->setVariable(
"LINKS_TXT", $item[
"title"]);
619 $tpl->parseCurrentBlock();
620 $tpl->setCurrentBlock(
"no_js_section");
621 $tpl->parseCurrentBlock();
630 $tpl->setCurrentBlock(
"no_js_form_option");
631 $tpl->setVariable(
"FRM_OPTION_TXT", $item[
"title"]);
632 $tpl->setVariable(
"FRM_OPTION_VAL", $item[
"value"]);
635 $tpl->setVariable(
"SELECTED",
' selected="selected" ');
637 $tpl->parseCurrentBlock();
639 if ($this->form_mode[
"include_form_tag"])
641 $tpl->setCurrentBlock(
"no_js_form_begin");
642 $tpl->setVariable(
"FRM_ID", $this->form_mode[
"form_id"]);
643 $tpl->setVariable(
"FRM_CLASS", $this->form_mode[
"form_class"]);
644 $tpl->setVariable(
"FRM_ACTION", $this->form_mode[
"form_action"]);
645 $tpl->setVariable(
"FRM_TARGET", $this->form_mode[
"form_target"]);
646 $tpl->parseCurrentBlock();
647 $tpl->touchBlock(
"no_js_form_end");
649 if ($this->form_mode[
"button_text"])
651 $tpl->setCurrentBlock(
"no_js_form_button");
652 $tpl->setVariable(
"FRM_BT_TXT", $this->form_mode[
"button_text"]);
653 $tpl->setVariable(
"FRM_BT_CLASS", $this->form_mode[
"button_class"]);
654 if ($this->form_mode[
"button_cmd"] !=
"")
656 $tpl->setVariable(
"FRM_BT_CMD",
'name="cmd['.$this->form_mode[
"button_cmd"].
']"');
658 $tpl->parseCurrentBlock();
660 $tpl->setVariable(
"FRM_SELECT_NAME", $this->form_mode[
"select_name"]);
661 $tpl->setVariable(
"FRM_SELECT_CLASS", $this->form_mode[
"select_class"]);
665 include_once(
"./Services/Accessibility/classes/class.ilAccessKeyGUI.php");
669 $tpl->setCurrentBlock(
"no_js_section");
670 $tpl->parseCurrentBlock();