ILIAS  trunk Revision v5.2.0beta1-34115-g3a2438be29
ilAdvancedSelectionListGUI Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilAdvancedSelectionListGUI:
+ Collaboration diagram for ilAdvancedSelectionListGUI:

Public Member Functions

 setLinksMode (string $a_link_class="")
 Set links mode (for no js fallback) More...
 
 setFormSelectMode (string $a_select_name, string $a_select_class="", bool $a_include_form_tag=false, string $a_form_action="", string $a_form_id="", string $a_form_class="", string $a_form_target="_top", string $a_button_text="", string $a_button_class="", string $a_button_cmd="")
 Set form mode (for no js fallback) Outputs form selection including surrounding form. More...
 
 addItem (string $a_title, string $a_value="", string $a_link="", string $a_img="", string $a_alt="", string $a_frame="", string $a_html="", bool $a_prevent_background_click=false, string $a_onclick="", string $a_ttip="", string $a_tt_my="right center", string $a_tt_at="left center", bool $a_tt_use_htmlspecialchars=true, array $a_data=array())
 
 addComponent (\ILIAS\UI\Component\Component $component)
 
 setGroupedList (ilGroupedListGUI $a_val)
 
 getGroupedList ()
 
 flush ()
 
 getItems ()
 
 setListTitle (string $a_listtitle)
 
 getListTitle ()
 
 setAriaListTitle (string $a_listtitle)
 
 getAriaListTitle ()
 
 setSelectionHeaderClass (string $a_selectionheaderclass)
 DEPRECATED use set style instead. More...
 
 getSelectionHeaderClass ()
 
 setStyle (int $a_val)
 
 getStyle ()
 
 setSelectionHeaderSpanClass (string $a_val)
 
 getSelectionHeaderSpanClass ()
 
 setHeaderIcon (string $a_headericon)
 
 getHeaderIcon ()
 
 setNoJSLinkClass (string $a_nojslinkclass)
 
 getNoJSLinkClass ()
 
 setItemLinkClass (string $a_itemlinkclass)
 
 getItemLinkClass ()
 
 setId (string $a_id)
 
 getId ()
 
 setUseImages (bool $a_useimages)
 
 getUseImages ()
 
 setTriggerEvent (string $a_val)
 
 getTriggerEvent ()
 
 setAutoHide (bool $a_val)
 
 getAutoHide ()
 
 setOnClickMode (string $a_val, string $a_onclick_form_id="")
 Set "onClick"- Mode. More...
 
 getOnClickMode ()
 
 setSelectedValue (string $a_val)
 
 getSelectedValue ()
 
 setAdditionalToggleElement (string $a_el, string $a_on)
 Set additional toggle element. More...
 
 getAdditionalToggleElement ()
 Get additional toggle element. More...
 
 setAsynch (bool $a_val)
 
 getAsynch ()
 
 setAsynchUrl (string $a_val)
 
 getAsynchUrl ()
 
 setSelectCallback (string $a_val)
 
 getSelectCallback ()
 
 setPullRight (bool $a_val)
 
 getPullRight ()
 
 getToolbarHTML ()
 Get input item HTML to be inserted into ilToolbarGUI. More...
 
 getHTML (bool $a_only_cmd_list_asynch=false)
 
 getOnloadCode ()
 

Data Fields

const DOWN_ARROW_DARK = "down_arrow_dark"
 
const ICON_ARROW = "caret"
 
const ICON_CONFIG = "glyphicon glyphicon-cog"
 
const NO_ICON = ""
 
const MODE_LINKS = "links"
 
const MODE_FORM_SELECT = "select"
 
const ON_ITEM_CLICK_HREF = "href"
 
const ON_ITEM_CLICK_FORM_SUBMIT = "submit"
 
const ON_ITEM_CLICK_FORM_SELECT = "select"
 
const ON_ITEM_CLICK_NOP = "nop"
 
const STYLE_DEFAULT = 0
 
const STYLE_LINK = 1
 
const STYLE_EMPH = 2
 
const STYLE_LINK_BUTTON = 3
 
array select_class
 

Protected Member Functions

 getJSTemplate ()
 

Protected Attributes

string $css_row = ""
 
bool $access_key = false
 
array $toggle = null
 
string $asynch_url = ''
 
string $selected_value = ""
 
string $trigger_event = "click"
 
bool $auto_hide = false
 
ilGroupedListGUI $grouped_list = null
 
int $style = 0
 
string $listtitle = ""
 
string $aria_listtitle = ""
 
bool $useimages = false
 
string $itemlinkclass = ''
 
string $mode = ""
 
array $links_mode = []
 
string $selectionheaderclass = ""
 
string $headericon = ""
 
string $nojslinkclass = ""
 
string $on_click = ""
 
array $form_mode
 
string $select_callback = ''
 
string $sel_head_span_class = ''
 
ilLanguage $lng
 
string $on_click_form_id
 
ilGlobalTemplateInterface $global_tpl
 

Private Attributes

array $items = array()
 
string $id = "asl"
 
bool $asynch = false
 
bool $dd_pullright = true
 
ILIAS UI Renderer $renderer
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning User interface class for advanced drop-down selection lists

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de
Deprecated:
9 Use KS Dropdowns instead

Definition at line 25 of file class.ilAdvancedSelectionListGUI.php.

Member Function Documentation

◆ addComponent()

ilAdvancedSelectionListGUI::addComponent ( \ILIAS\UI\Component\Component  $component)

Definition at line 190 of file class.ilAdvancedSelectionListGUI.php.

190  : void
191  {
192  $this->items[] = [
193  'component' => $component,
194  ];
195  }

◆ addItem()

ilAdvancedSelectionListGUI::addItem ( string  $a_title,
string  $a_value = "",
string  $a_link = "",
string  $a_img = "",
string  $a_alt = "",
string  $a_frame = "",
string  $a_html = "",
bool  $a_prevent_background_click = false,
string  $a_onclick = "",
string  $a_ttip = "",
string  $a_tt_my = "right center",
string  $a_tt_at = "left center",
bool  $a_tt_use_htmlspecialchars = true,
array  $a_data = array() 
)

Definition at line 167 of file class.ilAdvancedSelectionListGUI.php.

182  : void {
183  $this->items[] = array("title" => $a_title, "value" => $a_value,
184  "link" => $a_link, "img" => $a_img, "alt" => $a_alt, "frame" => $a_frame,
185  "html" => $a_html, "prevent_background_click" => $a_prevent_background_click,
186  "onclick" => $a_onclick, "ttip" => $a_ttip, "tt_my" => $a_tt_my, "tt_at" => $a_tt_at,
187  "tt_use_htmlspecialchars" => $a_tt_use_htmlspecialchars, "data" => $a_data);
188  }

◆ flush()

ilAdvancedSelectionListGUI::flush ( )

Definition at line 207 of file class.ilAdvancedSelectionListGUI.php.

207  : void
208  {
209  $this->items = array();
210  }

◆ getAdditionalToggleElement()

ilAdvancedSelectionListGUI::getAdditionalToggleElement ( )

Get additional toggle element.

Definition at line 391 of file class.ilAdvancedSelectionListGUI.php.

References $toggle.

Referenced by getHTML().

391  : ?array
392  {
393  return $this->toggle;
394  }
+ Here is the caller graph for this function:

◆ getAriaListTitle()

ilAdvancedSelectionListGUI::getAriaListTitle ( )

Definition at line 232 of file class.ilAdvancedSelectionListGUI.php.

Referenced by getHTML().

232  : string
233  {
234  return strip_tags($this->aria_listtitle);
235  }
+ Here is the caller graph for this function:

◆ getAsynch()

ilAdvancedSelectionListGUI::getAsynch ( )

Definition at line 404 of file class.ilAdvancedSelectionListGUI.php.

References $asynch.

Referenced by getHTML(), and getOnloadCode().

404  : bool
405  {
406  return $this->asynch;
407  }
+ Here is the caller graph for this function:

◆ getAsynchUrl()

ilAdvancedSelectionListGUI::getAsynchUrl ( )

Definition at line 414 of file class.ilAdvancedSelectionListGUI.php.

References $asynch_url.

Referenced by getHTML().

414  : string
415  {
416  return $this->asynch_url;
417  }
+ Here is the caller graph for this function:

◆ getAutoHide()

ilAdvancedSelectionListGUI::getAutoHide ( )

Definition at line 342 of file class.ilAdvancedSelectionListGUI.php.

References $auto_hide.

Referenced by getHTML().

342  : bool
343  {
344  return $this->auto_hide;
345  }
+ Here is the caller graph for this function:

◆ getGroupedList()

ilAdvancedSelectionListGUI::getGroupedList ( )

Definition at line 202 of file class.ilAdvancedSelectionListGUI.php.

References $grouped_list.

Referenced by getHTML(), and getOnloadCode().

203  {
204  return $this->grouped_list;
205  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the caller graph for this function:

◆ getHeaderIcon()

ilAdvancedSelectionListGUI::getHeaderIcon ( )

Definition at line 282 of file class.ilAdvancedSelectionListGUI.php.

References $headericon.

Referenced by getHTML().

282  : string
283  {
284  return $this->headericon;
285  }
+ Here is the caller graph for this function:

◆ getHTML()

ilAdvancedSelectionListGUI::getHTML ( bool  $a_only_cmd_list_asynch = false)

Definition at line 444 of file class.ilAdvancedSelectionListGUI.php.

References ilTooltipGUI\addTooltip(), getAdditionalToggleElement(), getAriaListTitle(), getAsynch(), getAsynchUrl(), getAutoHide(), getGroupedList(), getHeaderIcon(), getId(), ilUtil\getImagePath(), getItemLinkClass(), getItems(), getJSTemplate(), getListTitle(), getOnClickMode(), getOnloadCode(), getPullRight(), getSelectCallback(), getSelectedValue(), getSelectionHeaderSpanClass(), getStyle(), getTriggerEvent(), getUseImages(), ILIAS\Repository\lng(), and ilLegacyFormElementsUtil\prepareFormOutput().

Referenced by getToolbarHTML().

444  : string
445  {
446  $items = $this->getItems();
447 
448  // do not show list, if no item is in list
449  if (count($items) === 0 && !$this->getAsynch() && $this->getGroupedList() === null) {
450  return "";
451  }
452 
453  $this->global_tpl->addJavaScript("./components/ILIAS/UIComponent/AdvancedSelectionList/js/AdvancedSelectionList.js");
454 
455  $tpl = new ilTemplate(
456  "tpl.adv_selection_list.html",
457  true,
458  true,
459  "components/ILIAS/UIComponent/AdvancedSelectionList",
460  "DEFAULT",
461  false,
462  true
463  );
464 
465  reset($items);
466 
467  $cnt = 0;
468 
469  if ($this->getAsynch()) {
470  $tpl->setCurrentBlock("asynch_request");
471  $tpl->setVariable("IMG_LOADER", ilUtil::getImagePath("media/loader.svg"));
472  $tpl->parseCurrentBlock();
473  } elseif ($this->getGroupedList() !== null) {
474  $tpl->setVariable("GROUPED_LIST_HTML", $this->getGroupedList()->getHTML());
475  } else {
476  foreach ($items as $item) {
477  $this->css_row = ($this->css_row !== "tblrow1_mo")
478  ? "tblrow1_mo"
479  : "tblrow2_mo";
480 
481  if (isset($item['component'])) {
482  $tpl->setCurrentBlock('component');
483  $tpl->setVariable('COMPONENT', $this->renderer->render([$item['component']]));
484  $tpl->parseCurrentBlock();
485 
486  $tpl->setCurrentBlock('item_loop');
487  $tpl->parseCurrentBlock();
488  continue;
489  }
490 
491  $item["value"] = htmlspecialchars($item["value"] ?? '', ENT_QUOTES);
492 
493  if ($this->getUseImages()) {
494  if ($item["img"]) {
495  $tpl->setCurrentBlock("image");
496  $tpl->setVariable("IMG_ITEM", $item["img"]);
497  $tpl->setVariable("ALT_ITEM", $item["alt"]);
498  $tpl->parseCurrentBlock();
499  } else {
500  $tpl->touchBlock("no_image");
501  }
502  }
503 
504  if ($this->getOnClickMode() === self::ON_ITEM_CLICK_HREF || $this->getItemLinkClass() !== "") {
505  if ($item["frame"]) {
506  $tpl->setCurrentBlock("frame");
507  $tpl->setVariable("TARGET_ITEM", $item["frame"]);
508  $tpl->parseCurrentBlock();
509  }
510 
511  if ($this->getItemLinkClass() !== "") {
512  $tpl->setCurrentBlock("item_link_class");
513  $tpl->setVariable("ITEM_LINK_CLASS", $this->getItemLinkClass());
514  $tpl->parseCurrentBlock();
515  }
516 
517  if (is_array($item["data"])) {
518  foreach ($item["data"] as $k => $v) {
519  $tpl->setCurrentBlock("f_data");
520  $tpl->setVariable("DATA_KEY", $k);
521  $tpl->setVariable("DATA_VAL", ilLegacyFormElementsUtil::prepareFormOutput($v));
522  $tpl->parseCurrentBlock();
523  }
524  }
525  if ($item["value"] != "") {
526  $tpl->setCurrentBlock("item_id");
527  $tpl->setVariable("ID_ITEM", $this->getId() . "_" . $item["value"]);
528  $tpl->parseCurrentBlock();
529  }
530 
531  $tpl->setCurrentBlock("href_s");
532  $tpl->setVariable("HREF_ITEM", 'href="' . $item["link"] . '"');
533  $tpl->parseCurrentBlock();
534 
535  $tpl->touchBlock("href_e");
536  }
537 
538  $tpl->setCurrentBlock("item");
539  if ($this->getOnClickMode() === self::ON_ITEM_CLICK_HREF) {
540  if ($item["prevent_background_click"]) {
541  $tpl->setVariable("ONCLICK_ITEM", '');
542  } elseif ($item["onclick"] == "" && $item["frame"] != "") { // see #28730
543  $tpl->setVariable(
544  "ONCLICK_ITEM",
545  'onclick="' . "return il.AdvancedSelectionList.openTarget('" . $item["link"] . "','" . $item["frame"] . "');" . '"'
546  );
547  } elseif ($item["onclick"] != "") {
548  $tpl->setVariable(
549  "ONCLICK_ITEM",
550  'onclick="' . "return " . $item["onclick"] . ";" . '"'
551  );
552  }
553  } elseif ($this->getOnClickMode() === self::ON_ITEM_CLICK_FORM_SUBMIT) {
554  $tpl->setVariable(
555  "ONCLICK_ITEM",
556  'onclick="return il.AdvancedSelectionList.submitForm(\'' . $this->getId() . '\'' .
557  ", '" . $this->form_mode["select_name"] . "','" . $item["value"] . "'," .
558  "'" . $this->on_click_form_id . "','" . $this->form_mode["button_cmd"] . "');\""
559  );
560  } elseif ($this->getOnClickMode() === self::ON_ITEM_CLICK_FORM_SELECT) {
561  $tpl->setVariable(
562  "ONCLICK_ITEM",
563  'onclick="return il.AdvancedSelectionList.selectForm(\'' . $this->getId() . '\'' .
564  ", '" . $this->form_mode["select_name"] . "','" . $item["value"] . "'," .
565  "'" . $item["title"] . "');\""
566  );
567  } elseif ($this->getOnClickMode() === self::ON_ITEM_CLICK_NOP) {
568  $tpl->setVariable(
569  "ONCLICK_ITEM",
570  'onclick="il.AdvancedSelectionList.clickNop(\'' . $this->getId() . '\'' .
571  ", '" . $this->form_mode["select_name"] . "','" . $item["value"] . "'," .
572  "'" . $item["title"] . "');\""
573  );
574  }
575 
576  $tpl->setVariable("CSS_ROW", $this->css_row);
577  if ($item["html"] == "") {
578  $tpl->setVariable("TXT_ITEM", $item["title"]);
579  } else {
580  $tpl->setVariable("TXT_ITEM", $item["html"]);
581  }
582 
583  $tpl->setVariable("ID_ITEM_TR", $this->getId() . "_" . $item["value"] . "_tr");
584  if ($item["ttip"] != "") {
586  $this->getId() . "_" . $item["value"] . "_tr",
587  $item["ttip"],
588  "",
589  $item["tt_my"],
590  $item["tt_at"],
591  $item["tt_use_htmlspecialchars"]
592  );
593  }
594 
595  $tpl->parseCurrentBlock();
596 
597  $tpl->setCurrentBlock('item_loop');
598  $tpl->parseCurrentBlock();
599  }
600 
601  // output hidden input, if click mode is form submission
602  if ($this->getOnClickMode() === self::ON_ITEM_CLICK_FORM_SUBMIT) {
603  $tpl->setCurrentBlock("hidden_input");
604  $tpl->setVariable("HID", $this->getId());
605  $tpl->parseCurrentBlock();
606  }
607 
608  // output hidden input and initialize
609  if ($this->getOnClickMode() === self::ON_ITEM_CLICK_FORM_SELECT) {
610  if ($this->getSelectedValue() !== "") {
611  $tpl->setCurrentBlock("selected_val");
612  $tpl->setVariable("SEL_VAL", $this->getSelectedValue());
613  $tpl->parseCurrentBlock();
614  }
615  $tpl->setCurrentBlock("hidden_input");
616  $tpl->setVariable("HID", $this->getId());
617  $tpl->parseCurrentBlock();
618  }
619  }
620 
621  if ($a_only_cmd_list_asynch) {
622  $tpl->touchBlock("cmd_table");
623  return $tpl->get("item_loop");
624  }
625 
626  if ($this->getGroupedList() === null) {
627  $tpl->setCurrentBlock("dd_content");
628  if ($this->getPullRight()) {
629  $tpl->setVariable("UL_CLASS", "dropdown-menu pull-right");
630  } else {
631  $tpl->setVariable("UL_CLASS", "dropdown-menu");
632  }
633  $tpl->setVariable("TABLE_ID", $this->getId());
634  $tpl->parseCurrentBlock();
635  }
636 
637  if ($this->getHeaderIcon() !== self::NO_ICON) {
638  $tpl->setCurrentBlock("top_img");
639  switch ($this->getHeaderIcon()) {
640  case self::ICON_CONFIG:
641  $tpl->setVariable("IMG_SPAN_STYLE", self::ICON_CONFIG);
642  break;
643 
644  case self::DOWN_ARROW_DARK:
645  default:
646  $tpl->setVariable("IMG_SPAN_STYLE", self::ICON_ARROW);
647  break;
648  }
649  $tpl->parseCurrentBlock();
650  }
651 
652 
653  if ($this->getAsynch()) {
654  $js_tpl = $this->getJSTemplate();
655  $js_tpl->setVariable("ID", $this->getId());
656  $js_tpl->setCurrentBlock("asynch_bl");
657  $js_tpl->setVariable("ASYNCH_URL", $this->getAsynchUrl());
658  $js_tpl->setVariable("ASYNCH_ID", $this->getId());
659  $js_tpl->setVariable("ASYNCH_TRIGGER_ID", $this->getId());
660  $js_tpl->parseCurrentBlock();
661  $this->global_tpl->addOnloadCode(
662  $js_tpl->get()
663  );
664  }
665 
666  // js section
667  $tpl->setCurrentBlock("js_section");
668 
669  $cfg["trigger_event"] = $this->getTriggerEvent();
670  $cfg["auto_hide"] = $this->getAutoHide();
671 
672  if ($this->getSelectCallback() !== "") {
673  $cfg["select_callback"] = $this->getSelectCallback();
674  }
675  $cfg["anchor_id"] = "ilAdvSelListAnchorElement_" . $this->getId();
676  $cfg["asynch"] = $this->getAsynch();
677  $cfg["asynch_url"] = $this->getAsynchUrl();
679  if (is_array($toggle)) {
680  $cfg["toggle_el"] = $toggle["el"];
681  $cfg["toggle_class_on"] = $toggle["class_on"];
682  }
683  //echo "<br>".htmlentities($this->getAsynchUrl());
684  $tpl->setVariable("CFG", json_encode($cfg, JSON_THROW_ON_ERROR));
685 
686  //echo htmlentities(json_encode($cfg, JSON_THROW_ON_ERROR));
687 
688  if ($this->getListTitle() !== "") {
689  $tpl->setVariable("TXT_SEL_TOP", $this->getListTitle());
690  }
691  if ($this->getListTitle() === "" || $this->getAriaListTitle() !== "") {
692  $aria_title = ($this->getAriaListTitle() !== "")
693  ? $this->getAriaListTitle()
694  : $this->lng->txt("actions");
695  $tpl->setVariable("TXT_ARIA_TOP", $aria_title);
696  }
697  $tpl->setVariable("ID", $this->getId());
698 
699  //$tpl->setVariable("CLASS_SEL_TOP", $this->getSelectionHeaderClass());
700  switch ($this->getStyle()) {
701  case self::STYLE_DEFAULT:
702  $tpl->setVariable("BTN_CLASS", "btn btn-default");
703  $tpl->setVariable("TAG", "button");
704  break;
705 
706  case self::STYLE_EMPH:
707  $tpl->setVariable("BTN_CLASS", "btn btn-primary");
708  $tpl->setVariable("TAG", "button");
709  break;
710 
711  case self::STYLE_LINK_BUTTON:
712  $tpl->setVariable("BTN_CLASS", "btn btn-link");
713  $tpl->setVariable("TAG", "button");
714  break;
715 
716  case self::STYLE_LINK:
717  $tpl->setVariable("BTN_CLASS", "");
718  $tpl->setVariable("TAG", "a");
719  $tpl->touchBlock("href_link");
720  break;
721  }
722 
723 
724  if ($this->getSelectionHeaderSpanClass() !== "") {
725  $tpl->setVariable(
726  "CLASS_SEL_TOP_SPAN",
728  );
729  }
730 
731  // set the async url to an extra template variable
732  // (needed for a mobile skin)
733  // $tpl->setVariable("ASYNC_URL", $this->getAsynchUrl());
734 
735  $tpl->parseCurrentBlock();
736 
737  foreach ($this->getOnloadCode() as $code) {
738  $this->global_tpl->addOnLoadCode(
739  $code
740  );
741  }
742  return $tpl->get();
743  }
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
getAdditionalToggleElement()
Get additional toggle element.
static prepareFormOutput($a_str, bool $a_strip=false)
getHTML(bool $a_only_cmd_list_asynch=false)
static addTooltip(string $a_el_id, string $a_text, string $a_container="", string $a_my="bottom center", string $a_at="top center", bool $a_use_htmlspecialchars=true)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getId()

ilAdvancedSelectionListGUI::getId ( )

Definition at line 312 of file class.ilAdvancedSelectionListGUI.php.

References $id.

Referenced by getHTML(), and getOnloadCode().

312  : string
313  {
314  return $this->id;
315  }
+ Here is the caller graph for this function:

◆ getItemLinkClass()

ilAdvancedSelectionListGUI::getItemLinkClass ( )

Definition at line 302 of file class.ilAdvancedSelectionListGUI.php.

References $itemlinkclass.

Referenced by getHTML().

302  : string
303  {
304  return $this->itemlinkclass;
305  }
+ Here is the caller graph for this function:

◆ getItems()

ilAdvancedSelectionListGUI::getItems ( )

Definition at line 212 of file class.ilAdvancedSelectionListGUI.php.

References $items.

Referenced by getHTML(), and getOnloadCode().

212  : array
213  {
214  return $this->items;
215  }
+ Here is the caller graph for this function:

◆ getJSTemplate()

ilAdvancedSelectionListGUI::getJSTemplate ( )
protected

Definition at line 746 of file class.ilAdvancedSelectionListGUI.php.

Referenced by getHTML(), and getOnloadCode().

746  : ilTemplate
747  {
748  return new ilTemplate(
749  "tpl.adv_selection_list_js_init.js",
750  true,
751  true,
752  "components/ILIAS/UIComponent/AdvancedSelectionList",
753  "DEFAULT",
754  false,
755  true
756  );
757  }
+ Here is the caller graph for this function:

◆ getListTitle()

ilAdvancedSelectionListGUI::getListTitle ( )

Definition at line 222 of file class.ilAdvancedSelectionListGUI.php.

References $listtitle.

Referenced by getHTML().

222  : string
223  {
224  return $this->listtitle;
225  }
+ Here is the caller graph for this function:

◆ getNoJSLinkClass()

ilAdvancedSelectionListGUI::getNoJSLinkClass ( )

Definition at line 292 of file class.ilAdvancedSelectionListGUI.php.

References $nojslinkclass.

292  : string
293  {
294  return $this->nojslinkclass;
295  }

◆ getOnClickMode()

ilAdvancedSelectionListGUI::getOnClickMode ( )

Definition at line 363 of file class.ilAdvancedSelectionListGUI.php.

References $on_click.

Referenced by getHTML(), and getOnloadCode().

363  : string
364  {
365  return $this->on_click;
366  }
+ Here is the caller graph for this function:

◆ getOnloadCode()

ilAdvancedSelectionListGUI::getOnloadCode ( )

Definition at line 759 of file class.ilAdvancedSelectionListGUI.php.

References getAsynch(), getGroupedList(), getId(), getItems(), getJSTemplate(), getOnClickMode(), and getSelectedValue().

Referenced by getHTML().

759  : array
760  {
761  $items = $this->getItems();
762 
763  // do not show list, if no item is in list
764  if (count($items) === 0 && !$this->getAsynch() && $this->getGroupedList() === null) {
765  return [];
766  }
767 
768  $js_tpl = $this->getJSTemplate();
769 
770  $cnt = 0;
771 
772  if (!$this->getAsynch() && $this->getGroupedList() === null) {
773  foreach ($items as $item) {
774  if (isset($item['component'])) {
775  continue;
776  }
777 
778  // add item to js object
779  $js_tpl->setCurrentBlock("js_item");
780  $js_tpl->setVariable("IT_ID", $this->getId());
781  $js_tpl->setVariable("IT_HID_NAME", $this->form_mode["select_name"]);
782 
783  $js_tpl->setVariable("IT_HID_VAL", $item["value"]);
784  $js_tpl->setVariable("IT_TITLE", str_replace("'", "\\'", $item["title"]));
785  $js_tpl->parseCurrentBlock();
786  }
787 
788  // output hidden input, if click mode is form submission
789  if ($this->getOnClickMode() === self::ON_ITEM_CLICK_FORM_SUBMIT) {
790  $js_tpl->setCurrentBlock("hidden_input");
791  $js_tpl->setVariable("HID", $this->getId());
792  $js_tpl->parseCurrentBlock();
793  }
794 
795  // output hidden input and initialize
796  if ($this->getOnClickMode() === self::ON_ITEM_CLICK_FORM_SELECT) {
797  // init hidden input with selected value
798  $js_tpl->setCurrentBlock("init_hidden_input");
799  $js_tpl->setVariable("H2ID", $this->getId());
800  $js_tpl->setVariable("HID_NAME", $this->form_mode["select_name"]);
801  $js_tpl->setVariable("HID_VALUE", $this->getSelectedValue());
802  $js_tpl->parseCurrentBlock();
803  }
804  }
805 
806  $js_tpl->setVariable("ID", $this->getId());
807 
808  return [$js_tpl->get()];
809  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPullRight()

ilAdvancedSelectionListGUI::getPullRight ( )

Definition at line 434 of file class.ilAdvancedSelectionListGUI.php.

References $dd_pullright.

Referenced by getHTML().

434  : bool
435  {
436  return $this->dd_pullright;
437  }
+ Here is the caller graph for this function:

◆ getSelectCallback()

ilAdvancedSelectionListGUI::getSelectCallback ( )

Definition at line 424 of file class.ilAdvancedSelectionListGUI.php.

References $select_callback.

Referenced by getHTML().

424  : string
425  {
426  return $this->select_callback;
427  }
+ Here is the caller graph for this function:

◆ getSelectedValue()

ilAdvancedSelectionListGUI::getSelectedValue ( )

Definition at line 373 of file class.ilAdvancedSelectionListGUI.php.

References $selected_value.

Referenced by getHTML(), and getOnloadCode().

373  : string
374  {
375  return $this->selected_value;
376  }
+ Here is the caller graph for this function:

◆ getSelectionHeaderClass()

ilAdvancedSelectionListGUI::getSelectionHeaderClass ( )

Definition at line 246 of file class.ilAdvancedSelectionListGUI.php.

References $selectionheaderclass.

246  : string
247  {
249  }

◆ getSelectionHeaderSpanClass()

ilAdvancedSelectionListGUI::getSelectionHeaderSpanClass ( )

Definition at line 272 of file class.ilAdvancedSelectionListGUI.php.

References $sel_head_span_class.

Referenced by getHTML().

272  : string
273  {
275  }
+ Here is the caller graph for this function:

◆ getStyle()

ilAdvancedSelectionListGUI::getStyle ( )
Returns
int button style STYLE_DEFAULT, STYLE_LINK, STYLE_EMPH

Definition at line 262 of file class.ilAdvancedSelectionListGUI.php.

References $style.

Referenced by getHTML().

262  : int
263  {
264  return $this->style;
265  }
+ Here is the caller graph for this function:

◆ getToolbarHTML()

ilAdvancedSelectionListGUI::getToolbarHTML ( )

Get input item HTML to be inserted into ilToolbarGUI.

Implements ilToolbarItem.

Definition at line 439 of file class.ilAdvancedSelectionListGUI.php.

References getHTML().

439  : string
440  {
441  return $this->getHTML();
442  }
getHTML(bool $a_only_cmd_list_asynch=false)
+ Here is the call graph for this function:

◆ getTriggerEvent()

ilAdvancedSelectionListGUI::getTriggerEvent ( )

Definition at line 332 of file class.ilAdvancedSelectionListGUI.php.

References $trigger_event.

Referenced by getHTML().

332  : string
333  {
334  return $this->trigger_event;
335  }
+ Here is the caller graph for this function:

◆ getUseImages()

ilAdvancedSelectionListGUI::getUseImages ( )

Definition at line 322 of file class.ilAdvancedSelectionListGUI.php.

References $useimages.

Referenced by getHTML().

322  : bool
323  {
324  return $this->useimages;
325  }
+ Here is the caller graph for this function:

◆ setAdditionalToggleElement()

ilAdvancedSelectionListGUI::setAdditionalToggleElement ( string  $a_el,
string  $a_on 
)

Set additional toggle element.

Parameters
string$a_elelement id
string$a_onclass for "on"

Definition at line 383 of file class.ilAdvancedSelectionListGUI.php.

383  : void
384  {
385  $this->toggle = array("el" => $a_el, "class_on" => $a_on);
386  }

◆ setAriaListTitle()

ilAdvancedSelectionListGUI::setAriaListTitle ( string  $a_listtitle)

Definition at line 227 of file class.ilAdvancedSelectionListGUI.php.

227  : void
228  {
229  $this->aria_listtitle = $a_listtitle;
230  }

◆ setAsynch()

ilAdvancedSelectionListGUI::setAsynch ( bool  $a_val)

Definition at line 396 of file class.ilAdvancedSelectionListGUI.php.

References ilYuiUtil\initConnection().

396  : void
397  {
398  if ($a_val) {
400  }
401  $this->asynch = $a_val;
402  }
static initConnection(?ilGlobalTemplateInterface $a_main_tpl=null)
Init YUI Connection module.
+ Here is the call graph for this function:

◆ setAsynchUrl()

ilAdvancedSelectionListGUI::setAsynchUrl ( string  $a_val)

Definition at line 409 of file class.ilAdvancedSelectionListGUI.php.

409  : void
410  {
411  $this->asynch_url = $a_val;
412  }

◆ setAutoHide()

ilAdvancedSelectionListGUI::setAutoHide ( bool  $a_val)

Definition at line 337 of file class.ilAdvancedSelectionListGUI.php.

337  : void
338  {
339  $this->auto_hide = $a_val;
340  }

◆ setFormSelectMode()

ilAdvancedSelectionListGUI::setFormSelectMode ( string  $a_select_name,
string  $a_select_class = "",
bool  $a_include_form_tag = false,
string  $a_form_action = "",
string  $a_form_id = "",
string  $a_form_class = "",
string  $a_form_target = "_top",
string  $a_button_text = "",
string  $a_button_class = "",
string  $a_button_cmd = "" 
)

Set form mode (for no js fallback) Outputs form selection including surrounding form.

Definition at line 140 of file class.ilAdvancedSelectionListGUI.php.

151  : void {
152  $this->mode = self::MODE_FORM_SELECT;
153  $this->form_mode = array(
154  "select_name" => $a_select_name,
155  "select_class" => $a_select_class,
156  "include_form_tag" => $a_include_form_tag,
157  "form_action" => $a_form_action,
158  "form_id" => $a_form_id,
159  "form_class" => $a_form_class,
160  "form_target" => $a_form_target,
161  "button_text" => $a_button_text,
162  "button_class" => $a_button_class,
163  "button_cmd" => $a_button_cmd
164  );
165  }

◆ setGroupedList()

ilAdvancedSelectionListGUI::setGroupedList ( ilGroupedListGUI  $a_val)

Definition at line 197 of file class.ilAdvancedSelectionListGUI.php.

197  : void
198  {
199  $this->grouped_list = $a_val;
200  }

◆ setHeaderIcon()

ilAdvancedSelectionListGUI::setHeaderIcon ( string  $a_headericon)

Definition at line 277 of file class.ilAdvancedSelectionListGUI.php.

277  : void
278  {
279  $this->headericon = $a_headericon;
280  }

◆ setId()

ilAdvancedSelectionListGUI::setId ( string  $a_id)

Definition at line 307 of file class.ilAdvancedSelectionListGUI.php.

307  : void
308  {
309  $this->id = $a_id;
310  }

◆ setItemLinkClass()

ilAdvancedSelectionListGUI::setItemLinkClass ( string  $a_itemlinkclass)

Definition at line 297 of file class.ilAdvancedSelectionListGUI.php.

297  : void
298  {
299  $this->itemlinkclass = $a_itemlinkclass;
300  }

◆ setLinksMode()

ilAdvancedSelectionListGUI::setLinksMode ( string  $a_link_class = "")

Set links mode (for no js fallback)

Definition at line 128 of file class.ilAdvancedSelectionListGUI.php.

130  : void {
131  $this->mode = self::MODE_LINKS;
132  $this->links_mode = array(
133  "link_class" => $a_link_class);
134  }

◆ setListTitle()

ilAdvancedSelectionListGUI::setListTitle ( string  $a_listtitle)

Definition at line 217 of file class.ilAdvancedSelectionListGUI.php.

217  : void
218  {
219  $this->listtitle = $a_listtitle;
220  }

◆ setNoJSLinkClass()

ilAdvancedSelectionListGUI::setNoJSLinkClass ( string  $a_nojslinkclass)

Definition at line 287 of file class.ilAdvancedSelectionListGUI.php.

287  : void
288  {
289  $this->nojslinkclass = $a_nojslinkclass;
290  }

◆ setOnClickMode()

ilAdvancedSelectionListGUI::setOnClickMode ( string  $a_val,
string  $a_onclick_form_id = "" 
)

Set "onClick"- Mode.

Valid values are: ilAdvancedSelectionList::ON_ITEM_CLICK_HREF or ilAdvancedSelectionList::ON_ITEM_CLICK_FORM_SUBMIT ilAdvancedSelectionList::ON_ITEM_CLICK_FORM_SELECT

Definition at line 355 of file class.ilAdvancedSelectionListGUI.php.

358  : void {
359  $this->on_click = $a_val;
360  $this->on_click_form_id = $a_onclick_form_id;
361  }

◆ setPullRight()

ilAdvancedSelectionListGUI::setPullRight ( bool  $a_val)

Definition at line 429 of file class.ilAdvancedSelectionListGUI.php.

429  : void
430  {
431  $this->dd_pullright = $a_val;
432  }

◆ setSelectCallback()

ilAdvancedSelectionListGUI::setSelectCallback ( string  $a_val)

Definition at line 419 of file class.ilAdvancedSelectionListGUI.php.

419  : void
420  {
421  $this->select_callback = $a_val;
422  }

◆ setSelectedValue()

ilAdvancedSelectionListGUI::setSelectedValue ( string  $a_val)

Definition at line 368 of file class.ilAdvancedSelectionListGUI.php.

368  : void
369  {
370  $this->selected_value = $a_val;
371  }

◆ setSelectionHeaderClass()

ilAdvancedSelectionListGUI::setSelectionHeaderClass ( string  $a_selectionheaderclass)

DEPRECATED use set style instead.

Deprecated:

Definition at line 241 of file class.ilAdvancedSelectionListGUI.php.

241  : void
242  {
243  $this->selectionheaderclass = $a_selectionheaderclass;
244  }

◆ setSelectionHeaderSpanClass()

ilAdvancedSelectionListGUI::setSelectionHeaderSpanClass ( string  $a_val)

Definition at line 267 of file class.ilAdvancedSelectionListGUI.php.

267  : void
268  {
269  $this->sel_head_span_class = $a_val;
270  }

◆ setStyle()

ilAdvancedSelectionListGUI::setStyle ( int  $a_val)
Parameters
int$a_valbutton style STYLE_DEFAULT, STYLE_LINK, STYLE_EMPH

Definition at line 254 of file class.ilAdvancedSelectionListGUI.php.

254  : void
255  {
256  $this->style = $a_val;
257  }

◆ setTriggerEvent()

ilAdvancedSelectionListGUI::setTriggerEvent ( string  $a_val)

Definition at line 327 of file class.ilAdvancedSelectionListGUI.php.

327  : void
328  {
329  $this->trigger_event = $a_val;
330  }

◆ setUseImages()

ilAdvancedSelectionListGUI::setUseImages ( bool  $a_useimages)

Definition at line 317 of file class.ilAdvancedSelectionListGUI.php.

317  : void
318  {
319  $this->useimages = $a_useimages;
320  }

Field Documentation

◆ $access_key

bool ilAdvancedSelectionListGUI::$access_key = false
protected

Definition at line 50 of file class.ilAdvancedSelectionListGUI.php.

◆ $aria_listtitle

string ilAdvancedSelectionListGUI::$aria_listtitle = ""
protected

Definition at line 61 of file class.ilAdvancedSelectionListGUI.php.

◆ $asynch

bool ilAdvancedSelectionListGUI::$asynch = false
private

Definition at line 29 of file class.ilAdvancedSelectionListGUI.php.

Referenced by getAsynch().

◆ $asynch_url

string ilAdvancedSelectionListGUI::$asynch_url = ''
protected

Definition at line 52 of file class.ilAdvancedSelectionListGUI.php.

Referenced by getAsynchUrl().

◆ $auto_hide

bool ilAdvancedSelectionListGUI::$auto_hide = false
protected

Definition at line 55 of file class.ilAdvancedSelectionListGUI.php.

Referenced by getAutoHide().

◆ $css_row

string ilAdvancedSelectionListGUI::$css_row = ""
protected

Definition at line 49 of file class.ilAdvancedSelectionListGUI.php.

◆ $dd_pullright

bool ilAdvancedSelectionListGUI::$dd_pullright = true
private

Definition at line 58 of file class.ilAdvancedSelectionListGUI.php.

Referenced by getPullRight().

◆ $form_mode

array ilAdvancedSelectionListGUI::$form_mode
protected
Initial value:
= [
"select_name" => ''

Definition at line 72 of file class.ilAdvancedSelectionListGUI.php.

◆ $global_tpl

ilGlobalTemplateInterface ilAdvancedSelectionListGUI::$global_tpl
protected

Definition at line 90 of file class.ilAdvancedSelectionListGUI.php.

◆ $grouped_list

ilGroupedListGUI ilAdvancedSelectionListGUI::$grouped_list = null
protected

Definition at line 56 of file class.ilAdvancedSelectionListGUI.php.

Referenced by getGroupedList().

◆ $headericon

string ilAdvancedSelectionListGUI::$headericon = ""
protected

Definition at line 67 of file class.ilAdvancedSelectionListGUI.php.

Referenced by getHeaderIcon().

◆ $id

string ilAdvancedSelectionListGUI::$id = "asl"
private

Definition at line 28 of file class.ilAdvancedSelectionListGUI.php.

Referenced by getId().

◆ $itemlinkclass

string ilAdvancedSelectionListGUI::$itemlinkclass = ''
protected

Definition at line 63 of file class.ilAdvancedSelectionListGUI.php.

Referenced by getItemLinkClass().

◆ $items

array ilAdvancedSelectionListGUI::$items = array()
private

Definition at line 27 of file class.ilAdvancedSelectionListGUI.php.

Referenced by getItems().

◆ $links_mode

array ilAdvancedSelectionListGUI::$links_mode = []
protected

Definition at line 65 of file class.ilAdvancedSelectionListGUI.php.

◆ $listtitle

string ilAdvancedSelectionListGUI::$listtitle = ""
protected

Definition at line 60 of file class.ilAdvancedSelectionListGUI.php.

Referenced by getListTitle().

◆ $lng

ilLanguage ilAdvancedSelectionListGUI::$lng
protected

Definition at line 88 of file class.ilAdvancedSelectionListGUI.php.

◆ $mode

string ilAdvancedSelectionListGUI::$mode = ""
protected

Definition at line 64 of file class.ilAdvancedSelectionListGUI.php.

◆ $nojslinkclass

string ilAdvancedSelectionListGUI::$nojslinkclass = ""
protected

Definition at line 68 of file class.ilAdvancedSelectionListGUI.php.

Referenced by getNoJSLinkClass().

◆ $on_click

string ilAdvancedSelectionListGUI::$on_click = ""
protected

Definition at line 69 of file class.ilAdvancedSelectionListGUI.php.

Referenced by getOnClickMode().

◆ $on_click_form_id

string ilAdvancedSelectionListGUI::$on_click_form_id
protected

Definition at line 89 of file class.ilAdvancedSelectionListGUI.php.

◆ $renderer

ILIAS UI Renderer ilAdvancedSelectionListGUI::$renderer
private

Definition at line 87 of file class.ilAdvancedSelectionListGUI.php.

◆ $sel_head_span_class

string ilAdvancedSelectionListGUI::$sel_head_span_class = ''
protected

Definition at line 86 of file class.ilAdvancedSelectionListGUI.php.

Referenced by getSelectionHeaderSpanClass().

◆ $select_callback

string ilAdvancedSelectionListGUI::$select_callback = ''
protected

Definition at line 85 of file class.ilAdvancedSelectionListGUI.php.

Referenced by getSelectCallback().

◆ $selected_value

string ilAdvancedSelectionListGUI::$selected_value = ""
protected

Definition at line 53 of file class.ilAdvancedSelectionListGUI.php.

Referenced by getSelectedValue().

◆ $selectionheaderclass

string ilAdvancedSelectionListGUI::$selectionheaderclass = ""
protected

Definition at line 66 of file class.ilAdvancedSelectionListGUI.php.

Referenced by getSelectionHeaderClass().

◆ $style

int ilAdvancedSelectionListGUI::$style = 0
protected

Definition at line 57 of file class.ilAdvancedSelectionListGUI.php.

Referenced by getStyle().

◆ $toggle

array ilAdvancedSelectionListGUI::$toggle = null
protected

Definition at line 51 of file class.ilAdvancedSelectionListGUI.php.

Referenced by getAdditionalToggleElement().

◆ $trigger_event

string ilAdvancedSelectionListGUI::$trigger_event = "click"
protected

Definition at line 54 of file class.ilAdvancedSelectionListGUI.php.

Referenced by getTriggerEvent().

◆ $useimages

bool ilAdvancedSelectionListGUI::$useimages = false
protected

Definition at line 62 of file class.ilAdvancedSelectionListGUI.php.

Referenced by getUseImages().

◆ DOWN_ARROW_DARK

const ilAdvancedSelectionListGUI::DOWN_ARROW_DARK = "down_arrow_dark"

◆ ICON_ARROW

const ilAdvancedSelectionListGUI::ICON_ARROW = "caret"

Definition at line 32 of file class.ilAdvancedSelectionListGUI.php.

◆ ICON_CONFIG

const ilAdvancedSelectionListGUI::ICON_CONFIG = "glyphicon glyphicon-cog"

Definition at line 33 of file class.ilAdvancedSelectionListGUI.php.

◆ MODE_FORM_SELECT

const ilAdvancedSelectionListGUI::MODE_FORM_SELECT = "select"

Definition at line 37 of file class.ilAdvancedSelectionListGUI.php.

◆ MODE_LINKS

const ilAdvancedSelectionListGUI::MODE_LINKS = "links"

Definition at line 36 of file class.ilAdvancedSelectionListGUI.php.

◆ NO_ICON

const ilAdvancedSelectionListGUI::NO_ICON = ""

Definition at line 34 of file class.ilAdvancedSelectionListGUI.php.

◆ ON_ITEM_CLICK_FORM_SELECT

const ilAdvancedSelectionListGUI::ON_ITEM_CLICK_FORM_SELECT = "select"

◆ ON_ITEM_CLICK_FORM_SUBMIT

const ilAdvancedSelectionListGUI::ON_ITEM_CLICK_FORM_SUBMIT = "submit"

Definition at line 40 of file class.ilAdvancedSelectionListGUI.php.

◆ ON_ITEM_CLICK_HREF

const ilAdvancedSelectionListGUI::ON_ITEM_CLICK_HREF = "href"

Definition at line 39 of file class.ilAdvancedSelectionListGUI.php.

◆ ON_ITEM_CLICK_NOP

const ilAdvancedSelectionListGUI::ON_ITEM_CLICK_NOP = "nop"

Definition at line 42 of file class.ilAdvancedSelectionListGUI.php.

◆ select_class

array ilAdvancedSelectionListGUI::select_class
Initial value:
=> '',
"include_form_tag" => false,
"form_action" => '',
"form_id" => '',
"form_class" => '',
"form_target" => '',
"button_text" => '',
"button_class" => '',
"button_cmd" => ''
]

Definition at line 74 of file class.ilAdvancedSelectionListGUI.php.

◆ STYLE_DEFAULT

const ilAdvancedSelectionListGUI::STYLE_DEFAULT = 0

Definition at line 44 of file class.ilAdvancedSelectionListGUI.php.

◆ STYLE_EMPH

const ilAdvancedSelectionListGUI::STYLE_EMPH = 2

Definition at line 46 of file class.ilAdvancedSelectionListGUI.php.

Referenced by ilObjectAddNewItemGUI\render().

◆ STYLE_LINK

const ilAdvancedSelectionListGUI::STYLE_LINK = 1

Definition at line 45 of file class.ilAdvancedSelectionListGUI.php.

◆ STYLE_LINK_BUTTON

const ilAdvancedSelectionListGUI::STYLE_LINK_BUTTON = 3

Definition at line 47 of file class.ilAdvancedSelectionListGUI.php.


The documentation for this class was generated from the following file: