83 $this->links_mode = array(
84 "link_class" => $a_link_class);
93 $a_include_form_tag =
false, $a_form_action =
"", $a_form_id =
"",
94 $a_form_class =
"", $a_form_target =
"_top",
95 $a_button_text =
"", $a_button_class =
"", $a_button_cmd =
"")
98 $this->form_mode = array(
99 "select_name" => $a_select_name,
100 "select_class" => $a_select_class,
101 "include_form_tag" => $a_include_form_tag,
102 "form_action" => $a_form_action,
103 "form_id" => $a_form_id,
104 "form_class" => $a_form_class,
105 "form_target" => $a_form_target,
106 "button_text" => $a_button_text,
107 "button_class" => $a_button_class,
108 "button_cmd" => $a_button_cmd
123 function addItem($a_title, $a_value =
"", $a_link =
"", $a_img =
"", $a_alt =
"", $a_frame =
"",
124 $a_html =
"", $a_prevent_background_click =
false, $a_onclick =
"", $a_ttip =
"",
125 $a_tt_my =
"right center", $a_tt_at =
"left center", $a_tt_use_htmlspecialchars =
true)
127 $this->items[] = array(
"title" => $a_title,
"value" => $a_value,
128 "link" => $a_link,
"img" => $a_img,
"alt" => $a_alt,
"frame" => $a_frame,
129 "html" => $a_html,
"prevent_background_click" => $a_prevent_background_click,
130 "onclick" => $a_onclick,
"ttip" => $a_ttip,
"tt_my" => $a_tt_my,
"tt_at" => $a_tt_at,
131 "tt_use_htmlspecialchars" => $a_tt_use_htmlspecialchars);
141 $this->grouped_list = $a_val;
156 $this->items = array();
176 $this->listtitle = $a_listtitle;
186 return $this->listtitle;
198 $this->selectionheaderclass = $a_selectionheaderclass;
208 return $this->selectionheaderclass;
218 $this->style = $a_val;
240 $this->sel_head_span_class = $a_val;
250 return $this->sel_head_span_class;
260 $this->headericon = $a_headericon;
270 return $this->headericon;
280 $this->nojslinkclass = $a_nojslinkclass;
290 return $this->nojslinkclass;
300 $this->itemlinkclass = $a_itemlinkclass;
310 return $this->itemlinkclass;
340 $this->useimages = $a_useimages;
350 return $this->useimages;
360 $this->access_key = $a_val;
378 $this->trigger_event = $a_val;
394 $this->auto_hide = $a_val;
417 $this->on_click = $a_val;
418 $this->on_click_form_id = $a_onclick_form_id;
428 return $this->on_click;
438 $this->selected_value = $a_val;
459 $this->toggle = array(
"el" => $a_el,
"class_on" => $a_on);
481 include_once(
"./Services/YUI/classes/class.ilYuiUtil.php");
484 $this->asynch = $a_val;
504 $this->asynch_url = $a_val;
522 $this->select_callback = $a_val;
530 return $this->select_callback;
540 $this->dd_pullright = $a_val;
556 public function getHTML($a_only_cmd_list_asynch =
false)
571 $GLOBALS[
"tpl"]->addJavascript(
"./Services/UIComponent/AdvancedSelectionList/js/AdvancedSelectionList.js");
574 "Services/UIComponent/AdvancedSelectionList",
"DEFAULT",
false,
true);
582 $tpl->setCurrentBlock(
"asynch_request");
584 $tpl->parseCurrentBlock();
596 if (isset($item[
"ref_id"]))
598 $sel_arr[$item[
"ref_id"]] = (isset($item[
"title"]))
602 $this->css_row = ($this->css_row !=
"tblrow1_mo")
610 $tpl->setCurrentBlock(
"image");
611 $tpl->setVariable(
"IMG_ITEM", $item[
"img"]);
612 $tpl->setVariable(
"ALT_ITEM", $item[
"alt"]);
613 $tpl->parseCurrentBlock();
617 $tpl->touchBlock(
"no_image");
627 $tpl->setCurrentBlock(
"frame");
628 $tpl->setVariable(
"TARGET_ITEM", $item[
"frame"]);
629 $tpl->parseCurrentBlock();
634 $tpl->setCurrentBlock(
"item_link_class");
636 $tpl->parseCurrentBlock();
639 $tpl->setCurrentBlock(
"href_s");
640 $tpl->setVariable(
"HREF_ITEM",
'href="'.$item[
"link"].
'"');
641 $tpl->setVariable(
"ID_ITEM", $this->
getId().
"_".$item[
"value"]);
642 $tpl->parseCurrentBlock();
644 $tpl->touchBlock(
"href_e");
648 $tpl->setCurrentBlock(
"item");
652 if ($item[
"prevent_background_click"])
654 $tpl->setVariable(
"ONCLICK_ITEM",
'');
658 if ($item[
"onclick"] ==
"")
660 $tpl->setVariable(
"ONCLICK_ITEM",
661 'onclick="'.
"return il.AdvancedSelectionList.openTarget('".$item[
"link"].
"','".$item[
"frame"].
"');".
'"');
665 $tpl->setVariable(
"ONCLICK_ITEM",
666 'onclick="'.
"return ".$item[
"onclick"].
";".
'"');
674 $tpl->setVariable(
"ONCLICK_ITEM",
675 'onclick="return il.AdvancedSelectionList.submitForm(\''.$this->
getId().
'\''.
676 ", '".$this->form_mode[
"select_name"].
"','".$item[
"value"].
"',".
677 "'".$this->on_click_form_id.
"','".$this->form_mode[
"button_cmd"].
"');\"");
682 $tpl->setVariable(
"ONCLICK_ITEM",
683 'onclick="return il.AdvancedSelectionList.selectForm(\''.$this->
getId().
'\''.
684 ", '".$this->form_mode[
"select_name"].
"','".$item[
"value"].
"',".
685 "'".$item[
"title"].
"');\"");
690 $tpl->setVariable(
"ONCLICK_ITEM",
691 'onclick="il.AdvancedSelectionList.clickNop(\''.$this->
getId().
'\''.
692 ", '".$this->form_mode[
"select_name"].
"','".$item[
"value"].
"',".
693 "'".$item[
"title"].
"');\"");
696 $tpl->setVariable(
"CSS_ROW", $this->css_row);
697 if ($item[
"html"] ==
"")
699 $tpl->setVariable(
"TXT_ITEM", $item[
"title"]);
703 $tpl->setVariable(
"TXT_ITEM", $item[
"html"]);
706 $tpl->setVariable(
"ID_ITEM_TR", $this->
getId().
"_".$item[
"value"].
"_tr");
707 if ($item[
"ttip"] !=
"")
709 include_once(
"./Services/UIComponent/Tooltip/classes/class.ilTooltipGUI.php");
711 "", $item[
"tt_my"], $item[
"tt_at"], $item[
"tt_use_htmlspecialchars"]);
714 $tpl->parseCurrentBlock();
717 $tpl->setCurrentBlock(
"js_item");
718 $tpl->setVariable(
"IT_ID", $this->
getId());
719 $tpl->setVariable(
"IT_HID_NAME", $this->form_mode[
"select_name"]);
720 $tpl->setVariable(
"IT_HID_VAL", $item[
"value"]);
721 $tpl->setVariable(
"IT_TITLE", str_replace(
"'",
"\\'", $item[
"title"]));
722 $tpl->parseCurrentBlock();
728 $tpl->setCurrentBlock(
"hidden_input");
729 $tpl->setVariable(
"HID", $this->
getId());
730 $tpl->parseCurrentBlock();
736 $tpl->setCurrentBlock(
"hidden_input");
737 $tpl->setVariable(
"HID", $this->
getId());
738 $tpl->parseCurrentBlock();
741 $tpl->setCurrentBlock(
"init_hidden_input");
742 $tpl->setVariable(
"H2ID", $this->
getId());
743 $tpl->setVariable(
"HID_NAME", $this->form_mode[
"select_name"]);
745 $tpl->parseCurrentBlock();
750 if ($a_only_cmd_list_asynch)
752 $tpl->touchBlock(
"cmd_table");
753 return $tpl->get(
"cmd_table");
758 $tpl->setCurrentBlock(
"dd_content");
761 $tpl->setVariable(
"UL_CLASS",
"dropdown-menu pull-right");
765 $tpl->setVariable(
"UL_CLASS",
"dropdown-menu");
767 $tpl->setVariable(
"TABLE_ID", $this->
getId());
768 $tpl->parseCurrentBlock();
773 $tpl->setCurrentBlock(
"top_img");
785 $tpl->parseCurrentBlock();
791 $tpl->setCurrentBlock(
"asynch_bl");
793 $tpl->setVariable(
"ASYNCH_ID", $this->
getId());
794 $tpl->setVariable(
"ASYNCH_TRIGGER_ID", $this->
getId());
795 $tpl->parseCurrentBlock();
799 $tpl->setCurrentBlock(
"js_section");
802 include_once(
"./Services/Accessibility/classes/class.ilAccessKeyGUI.php");
813 $cfg[
"anchor_id"] =
"ilAdvSelListAnchorElement_".$this->getId();
821 $cfg[
"toggle_el"] =
$toggle[
"el"];
822 $cfg[
"toggle_class_on"] =
$toggle[
"class_on"];
825 include_once(
"./Services/JSON/classes/class.ilJsonUtil.php");
836 case self::STYLE_DEFAULT:
837 $tpl->setVariable(
"BTN_CLASS",
"btn btn-sm btn-default");
838 $tpl->setVariable(
"TAG",
"button");
841 case self::STYLE_EMPH:
842 $tpl->setVariable(
"BTN_CLASS",
"btn btn-sm btn-primary");
843 $tpl->setVariable(
"TAG",
"button");
846 case self::STYLE_LINK_BUTTON:
847 $tpl->setVariable(
"BTN_CLASS",
"btn btn-sm btn-link");
848 $tpl->setVariable(
"TAG",
"button");
851 case self::STYLE_LINK:
852 $tpl->setVariable(
"BTN_CLASS",
"");
853 $tpl->setVariable(
"TAG",
"a");
860 $tpl->setVariable(
"CLASS_SEL_TOP_SPAN",
868 $tpl->parseCurrentBlock();
setStyle($a_val)
Set style.
const ON_ITEM_CLICK_FORM_SELECT
setSelectionHeaderSpanClass($a_val)
Set selection header span class.
setFormSelectMode($a_select_name, $a_select_class="", $a_include_form_tag=false, $a_form_action="", $a_form_id="", $a_form_class="", $a_form_target="_top", $a_button_text="", $a_button_class="", $a_button_cmd="")
Set form mode (for no js fallback)
setHeaderIcon($a_headericon)
Set Header Icon.
setAdditionalToggleElement($a_el, $a_on)
Set additional toggle element.
setGroupedList($a_val)
Set Grouped List.
getUseImages()
Get Use Images.
getSelectCallback()
Get select callback.
const ON_ITEM_CLICK_FORM_SUBMIT
setAsynchUrl($a_val)
Set asynch url.
setListTitle($a_listtitle)
Set List Title.
getHeaderIcon()
Get Header Icon.
static initConnection()
Init YUI Connection module.
addItem($a_title, $a_value="", $a_link="", $a_img="", $a_alt="", $a_frame="", $a_html="", $a_prevent_background_click=false, $a_onclick="", $a_ttip="", $a_tt_my="right center", $a_tt_at="left center", $a_tt_use_htmlspecialchars=true)
Add an item.
getAdditionalToggleElement()
Get additional toggle element.
getSelectedValue()
Get selected value.
setSelectCallback($a_val)
Set select callback.
getAutoHide()
Get auto hide.
setSelectionHeaderClass($a_selectionheaderclass)
Set Selection Header Class.
getListTitle()
Get List Title.
setNoJSLinkClass($a_nojslinkclass)
Set No Javascript Link Style Class.
setPullRight($a_val)
Set pull right.
setOnClickMode($a_val, $a_onclick_form_id="")
Set "onClick"- Mode.
getNoJSLinkClass()
Get No Javascript Link Style Class.
getTriggerEvent()
Get trigger event.
setSelectedValue($a_val)
Set selected value.
getSelectionHeaderSpanClass()
Get selection header span class.
getItemLinkClass()
Get Item Link Class.
static encode($mixed, $suppress_native=false)
__construct()
Constructor.
setLinksMode($a_link_class="")
Set links mode (for no js fallback)
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
special template class to simplify handling of ITX/PEAR
setAsynch($a_val)
Set asynch mode (this is set to true, if list should get items asynchronously)
setItemLinkClass($a_itemlinkclass)
Set Item Link Class.
getAsynch()
Get asynch mode.
getPullRight()
Get pull right.
getGroupedList()
Get Grouped List.
User interface class for advanced drop-down selection lists.
getHTML($a_only_cmd_list_asynch=false)
Get selection list HTML.
getAccessKey()
Get access key.
setAutoHide($a_val)
Set auto hide.
setTriggerEvent($a_val)
Set trigger event.
getAsynchUrl()
Get asynch url.
static getAttribute($a_func_id)
Get accesskey HTML attribute.
setUseImages($a_useimages)
Set Use Images.
getSelectionHeaderClass()
Get Selection Header Class.
setAccessKey($a_val)
Set access key.
getOnClickMode()
Get "onClick"-Mode.