77 $this->lng = $DIC->language();
89 $this->links_mode =
array(
90 "link_class" => $a_link_class);
100 $a_select_class =
"",
101 $a_include_form_tag =
false,
105 $a_form_target =
"_top",
107 $a_button_class =
"",
111 $this->form_mode =
array(
112 "select_name" => $a_select_name,
113 "select_class" => $a_select_class,
114 "include_form_tag" => $a_include_form_tag,
115 "form_action" => $a_form_action,
116 "form_id" => $a_form_id,
117 "form_class" => $a_form_class,
118 "form_target" => $a_form_target,
119 "button_text" => $a_button_text,
120 "button_class" => $a_button_class,
121 "button_cmd" => $a_button_cmd
144 $a_prevent_background_click =
false,
147 $a_tt_my =
"right center",
148 $a_tt_at =
"left center",
149 $a_tt_use_htmlspecialchars =
true,
152 $this->items[] =
array(
"title" => $a_title,
"value" => $a_value,
153 "link" => $a_link,
"img" => $a_img,
"alt" => $a_alt,
"frame" => $a_frame,
154 "html" => $a_html,
"prevent_background_click" => $a_prevent_background_click,
155 "onclick" => $a_onclick,
"ttip" => $a_ttip,
"tt_my" => $a_tt_my,
"tt_at" => $a_tt_at,
156 "tt_use_htmlspecialchars" => $a_tt_use_htmlspecialchars,
"data" => $a_data);
166 $this->grouped_list = $a_val;
181 $this->items =
array();
201 $this->listtitle = $a_listtitle;
221 $this->aria_listtitle = $a_listtitle;
243 $this->selectionheaderclass = $a_selectionheaderclass;
253 return $this->selectionheaderclass;
263 $this->
style = $a_val;
285 $this->sel_head_span_class = $a_val;
295 return $this->sel_head_span_class;
305 $this->headericon = $a_headericon;
315 return $this->headericon;
325 $this->nojslinkclass = $a_nojslinkclass;
335 return $this->nojslinkclass;
345 $this->itemlinkclass = $a_itemlinkclass;
355 return $this->itemlinkclass;
385 $this->useimages = $a_useimages;
395 return $this->useimages;
405 $this->access_key = $a_val;
423 $this->trigger_event = $a_val;
439 $this->auto_hide = $a_val;
462 $this->on_click = $a_val;
463 $this->on_click_form_id = $a_onclick_form_id;
473 return $this->on_click;
483 $this->selected_value = $a_val;
504 $this->toggle =
array(
"el" => $a_el,
"class_on" => $a_on);
525 include_once(
"./Services/YUI/classes/class.ilYuiUtil.php");
528 $this->asynch = $a_val;
548 $this->asynch_url = $a_val;
566 $this->select_callback = $a_val;
574 return $this->select_callback;
584 $this->dd_pullright = $a_val;
600 public function getHTML($a_only_cmd_list_asynch =
false)
614 $GLOBALS[
"tpl"]->addJavascript(
"./Services/UIComponent/AdvancedSelectionList/js/AdvancedSelectionList.js");
617 "tpl.adv_selection_list.html",
620 "Services/UIComponent/AdvancedSelectionList",
631 $tpl->setCurrentBlock(
"asynch_request");
633 $tpl->parseCurrentBlock();
638 foreach (
$items as $item) {
639 if (isset($item[
"ref_id"])) {
640 $sel_arr[$item[
"ref_id"]] = (isset($item[
"title"]))
644 $this->css_row = ($this->css_row !=
"tblrow1_mo")
650 $tpl->setCurrentBlock(
"image");
651 $tpl->setVariable(
"IMG_ITEM", $item[
"img"]);
652 $tpl->setVariable(
"ALT_ITEM", $item[
"alt"]);
653 $tpl->parseCurrentBlock();
655 $tpl->touchBlock(
"no_image");
662 if ($item[
"frame"]) {
663 $tpl->setCurrentBlock(
"frame");
664 $tpl->setVariable(
"TARGET_ITEM", $item[
"frame"]);
665 $tpl->parseCurrentBlock();
669 $tpl->setCurrentBlock(
"item_link_class");
671 $tpl->parseCurrentBlock();
674 if (is_array($item[
"data"])) {
675 foreach ($item[
"data"] as $k => $v) {
676 $tpl->setCurrentBlock(
"f_data");
677 $tpl->setVariable(
"DATA_KEY", $k);
679 $tpl->parseCurrentBlock();
683 $tpl->setCurrentBlock(
"href_s");
684 $tpl->setVariable(
"HREF_ITEM",
'href="' . $item[
"link"] .
'"');
685 $tpl->setVariable(
"ID_ITEM", $this->
getId() .
"_" . $item[
"value"]);
686 $tpl->parseCurrentBlock();
688 $tpl->touchBlock(
"href_e");
691 $tpl->setCurrentBlock(
"item");
694 if ($item[
"prevent_background_click"]) {
695 $tpl->setVariable(
"ONCLICK_ITEM",
'');
697 if ($item[
"onclick"] ==
"") {
700 'onclick="' .
"return il.AdvancedSelectionList.openTarget('" . $item[
"link"] .
"','" . $item[
"frame"] .
"');" .
'"' 705 'onclick="' .
"return " . $item[
"onclick"] .
";" .
'"' 713 'onclick="return il.AdvancedSelectionList.submitForm(\'' . $this->
getId() .
'\'' .
714 ", '" . $this->form_mode[
"select_name"] .
"','" . $item[
"value"] .
"'," .
715 "'" . $this->on_click_form_id .
"','" . $this->form_mode[
"button_cmd"] .
"');\"" 721 'onclick="return il.AdvancedSelectionList.selectForm(\'' . $this->
getId() .
'\'' .
722 ", '" . $this->form_mode[
"select_name"] .
"','" . $item[
"value"] .
"'," .
723 "'" . $item[
"title"] .
"');\"" 729 'onclick="il.AdvancedSelectionList.clickNop(\'' . $this->
getId() .
'\'' .
730 ", '" . $this->form_mode[
"select_name"] .
"','" . $item[
"value"] .
"'," .
731 "'" . $item[
"title"] .
"');\"" 735 $tpl->setVariable(
"CSS_ROW", $this->css_row);
736 if ($item[
"html"] ==
"") {
737 $tpl->setVariable(
"TXT_ITEM", $item[
"title"]);
739 $tpl->setVariable(
"TXT_ITEM", $item[
"html"]);
742 $tpl->setVariable(
"ID_ITEM_TR", $this->
getId() .
"_" . $item[
"value"] .
"_tr");
743 if ($item[
"ttip"] !=
"") {
744 include_once(
"./Services/UIComponent/Tooltip/classes/class.ilTooltipGUI.php");
746 $this->
getId() .
"_" . $item[
"value"] .
"_tr",
751 $item[
"tt_use_htmlspecialchars"]
755 $tpl->parseCurrentBlock();
758 $tpl->setCurrentBlock(
"js_item");
759 $tpl->setVariable(
"IT_ID", $this->
getId());
760 $tpl->setVariable(
"IT_HID_NAME", $this->form_mode[
"select_name"]);
761 $tpl->setVariable(
"IT_HID_VAL", $item[
"value"]);
762 $tpl->setVariable(
"IT_TITLE", str_replace(
"'",
"\\'", $item[
"title"]));
763 $tpl->parseCurrentBlock();
768 $tpl->setCurrentBlock(
"hidden_input");
769 $tpl->setVariable(
"HID", $this->
getId());
770 $tpl->parseCurrentBlock();
775 $tpl->setCurrentBlock(
"hidden_input");
776 $tpl->setVariable(
"HID", $this->
getId());
777 $tpl->parseCurrentBlock();
780 $tpl->setCurrentBlock(
"init_hidden_input");
781 $tpl->setVariable(
"H2ID", $this->
getId());
782 $tpl->setVariable(
"HID_NAME", $this->form_mode[
"select_name"]);
784 $tpl->parseCurrentBlock();
789 if ($a_only_cmd_list_asynch) {
790 $tpl->touchBlock(
"cmd_table");
791 return $tpl->get(
"cmd_table");
795 $tpl->setCurrentBlock(
"dd_content");
797 $tpl->setVariable(
"UL_CLASS",
"dropdown-menu pull-right");
799 $tpl->setVariable(
"UL_CLASS",
"dropdown-menu");
801 $tpl->setVariable(
"TABLE_ID", $this->
getId());
802 $tpl->parseCurrentBlock();
806 $tpl->setCurrentBlock(
"top_img");
817 $tpl->parseCurrentBlock();
822 $tpl->setCurrentBlock(
"asynch_bl");
824 $tpl->setVariable(
"ASYNCH_ID", $this->
getId());
825 $tpl->setVariable(
"ASYNCH_TRIGGER_ID", $this->
getId());
826 $tpl->parseCurrentBlock();
830 $tpl->setCurrentBlock(
"js_section");
832 include_once(
"./Services/Accessibility/classes/class.ilAccessKeyGUI.php");
842 $cfg[
"anchor_id"] =
"ilAdvSelListAnchorElement_" . $this->
getId();
853 include_once(
"./Services/JSON/classes/class.ilJsonUtil.php");
862 : $this->lng->txt(
"actions");
863 $tpl->setVariable(
"TXT_ARIA_TOP", $aria_title);
869 case self::STYLE_DEFAULT:
870 $tpl->setVariable(
"BTN_CLASS",
"btn btn-default");
871 $tpl->setVariable(
"TAG",
"button");
874 case self::STYLE_EMPH:
875 $tpl->setVariable(
"BTN_CLASS",
"btn btn-primary");
876 $tpl->setVariable(
"TAG",
"button");
879 case self::STYLE_LINK_BUTTON:
880 $tpl->setVariable(
"BTN_CLASS",
"btn btn-link");
881 $tpl->setVariable(
"TAG",
"button");
884 case self::STYLE_LINK:
885 $tpl->setVariable(
"BTN_CLASS",
"");
886 $tpl->setVariable(
"TAG",
"a");
893 "CLASS_SEL_TOP_SPAN",
902 $tpl->parseCurrentBlock();
setStyle($a_val)
Set style.
const ON_ITEM_CLICK_FORM_SELECT
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
setSelectionHeaderSpanClass($a_val)
Set selection header span class.
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.
static initConnection(ilTemplate $a_main_tpl=null)
Init YUI Connection module.
const ON_ITEM_CLICK_FORM_SUBMIT
setAsynchUrl($a_val)
Set asynch url.
setListTitle($a_listtitle)
Set List Title.
getHeaderIcon()
Get Header Icon.
getAdditionalToggleElement()
Get additional toggle element.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
getSelectedValue()
Get selected value.
setSelectCallback($a_val)
Set select callback.
getAutoHide()
Get auto hide.
setSelectionHeaderClass($a_selectionheaderclass)
Set Selection Header Class.
setAriaListTitle($a_listtitle)
Set List Title.
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.
getAriaListTitle()
Get List Title.
getSelectionHeaderSpanClass()
Get selection header span class.
getItemLinkClass()
Get Item Link Class.
static encode($mixed, $suppress_native=false)
__construct()
Constructor.
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)
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
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, $a_data=array())
Add an item.
catch(Exception $e) if(isset($_POST['cancel'])) if(isset($_POST['continue'])) $cfg
setAsynch($a_val)
Set asynch mode (this is set to true, if list should get items asynchronously)
setItemLinkClass($a_itemlinkclass)
Set Item Link Class.
Create styles array
The data for the language used.
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.