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();
682 if ($item[
"value"] !=
"") {
683 $tpl->setCurrentBlock(
"item_id");
684 $tpl->setVariable(
"ID_ITEM", $this->
getId() .
"_" . $item[
"value"]);
685 $tpl->parseCurrentBlock();
688 $tpl->setCurrentBlock(
"href_s");
689 $tpl->setVariable(
"HREF_ITEM",
'href="' . $item[
"link"] .
'"');
690 $tpl->parseCurrentBlock();
692 $tpl->touchBlock(
"href_e");
695 $tpl->setCurrentBlock(
"item");
698 if ($item[
"prevent_background_click"]) {
699 $tpl->setVariable(
"ONCLICK_ITEM",
'');
701 if ($item[
"onclick"] ==
"") {
704 'onclick="' .
"return il.AdvancedSelectionList.openTarget('" . $item[
"link"] .
"','" . $item[
"frame"] .
"');" .
'"' 709 'onclick="' .
"return " . $item[
"onclick"] .
";" .
'"' 717 'onclick="return il.AdvancedSelectionList.submitForm(\'' . $this->
getId() .
'\'' .
718 ", '" . $this->form_mode[
"select_name"] .
"','" . $item[
"value"] .
"'," .
719 "'" . $this->on_click_form_id .
"','" . $this->form_mode[
"button_cmd"] .
"');\"" 725 'onclick="return il.AdvancedSelectionList.selectForm(\'' . $this->
getId() .
'\'' .
726 ", '" . $this->form_mode[
"select_name"] .
"','" . $item[
"value"] .
"'," .
727 "'" . $item[
"title"] .
"');\"" 733 'onclick="il.AdvancedSelectionList.clickNop(\'' . $this->
getId() .
'\'' .
734 ", '" . $this->form_mode[
"select_name"] .
"','" . $item[
"value"] .
"'," .
735 "'" . $item[
"title"] .
"');\"" 739 $tpl->setVariable(
"CSS_ROW", $this->css_row);
740 if ($item[
"html"] ==
"") {
741 $tpl->setVariable(
"TXT_ITEM", $item[
"title"]);
743 $tpl->setVariable(
"TXT_ITEM", $item[
"html"]);
746 $tpl->setVariable(
"ID_ITEM_TR", $this->
getId() .
"_" . $item[
"value"] .
"_tr");
747 if ($item[
"ttip"] !=
"") {
748 include_once(
"./Services/UIComponent/Tooltip/classes/class.ilTooltipGUI.php");
750 $this->
getId() .
"_" . $item[
"value"] .
"_tr",
755 $item[
"tt_use_htmlspecialchars"]
759 $tpl->parseCurrentBlock();
762 $tpl->setCurrentBlock(
"js_item");
763 $tpl->setVariable(
"IT_ID", $this->
getId());
764 $tpl->setVariable(
"IT_HID_NAME", $this->form_mode[
"select_name"]);
765 $tpl->setVariable(
"IT_HID_VAL", $item[
"value"]);
766 $tpl->setVariable(
"IT_TITLE", str_replace(
"'",
"\\'", $item[
"title"]));
767 $tpl->parseCurrentBlock();
772 $tpl->setCurrentBlock(
"hidden_input");
773 $tpl->setVariable(
"HID", $this->
getId());
774 $tpl->parseCurrentBlock();
779 $tpl->setCurrentBlock(
"hidden_input");
780 $tpl->setVariable(
"HID", $this->
getId());
781 $tpl->parseCurrentBlock();
784 $tpl->setCurrentBlock(
"init_hidden_input");
785 $tpl->setVariable(
"H2ID", $this->
getId());
786 $tpl->setVariable(
"HID_NAME", $this->form_mode[
"select_name"]);
788 $tpl->parseCurrentBlock();
793 if ($a_only_cmd_list_asynch) {
794 $tpl->touchBlock(
"cmd_table");
795 return $tpl->get(
"cmd_table");
799 $tpl->setCurrentBlock(
"dd_content");
801 $tpl->setVariable(
"UL_CLASS",
"dropdown-menu pull-right");
803 $tpl->setVariable(
"UL_CLASS",
"dropdown-menu");
805 $tpl->setVariable(
"TABLE_ID", $this->
getId());
806 $tpl->parseCurrentBlock();
810 $tpl->setCurrentBlock(
"top_img");
821 $tpl->parseCurrentBlock();
826 $tpl->setCurrentBlock(
"asynch_bl");
828 $tpl->setVariable(
"ASYNCH_ID", $this->
getId());
829 $tpl->setVariable(
"ASYNCH_TRIGGER_ID", $this->
getId());
830 $tpl->parseCurrentBlock();
834 $tpl->setCurrentBlock(
"js_section");
836 include_once(
"./Services/Accessibility/classes/class.ilAccessKeyGUI.php");
846 $cfg[
"anchor_id"] =
"ilAdvSelListAnchorElement_" . $this->
getId();
857 include_once(
"./Services/JSON/classes/class.ilJsonUtil.php");
866 : $this->lng->txt(
"actions");
867 $tpl->setVariable(
"TXT_ARIA_TOP", $aria_title);
873 case self::STYLE_DEFAULT:
874 $tpl->setVariable(
"BTN_CLASS",
"btn btn-default");
875 $tpl->setVariable(
"TAG",
"button");
878 case self::STYLE_EMPH:
879 $tpl->setVariable(
"BTN_CLASS",
"btn btn-primary");
880 $tpl->setVariable(
"TAG",
"button");
883 case self::STYLE_LINK_BUTTON:
884 $tpl->setVariable(
"BTN_CLASS",
"btn btn-link");
885 $tpl->setVariable(
"TAG",
"button");
888 case self::STYLE_LINK:
889 $tpl->setVariable(
"BTN_CLASS",
"");
890 $tpl->setVariable(
"TAG",
"a");
897 "CLASS_SEL_TOP_SPAN",
906 $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.
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.
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.
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
getOnClickMode()
Get "onClick"-Mode.