ILIAS  trunk Revision v11.0_alpha-1744-gb0451eebef4
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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 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(), null, ilLegacyFormElementsUtil\prepareFormOutput(), and renderer().

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("assets/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 
585  $tpl->parseCurrentBlock();
586 
587  $tpl->setCurrentBlock('item_loop');
588  $tpl->parseCurrentBlock();
589  }
590 
591  // output hidden input, if click mode is form submission
592  if ($this->getOnClickMode() === self::ON_ITEM_CLICK_FORM_SUBMIT) {
593  $tpl->setCurrentBlock("hidden_input");
594  $tpl->setVariable("HID", $this->getId());
595  $tpl->parseCurrentBlock();
596  }
597 
598  // output hidden input and initialize
599  if ($this->getOnClickMode() === self::ON_ITEM_CLICK_FORM_SELECT) {
600  if ($this->getSelectedValue() !== "") {
601  $tpl->setCurrentBlock("selected_val");
602  $tpl->setVariable("SEL_VAL", $this->getSelectedValue());
603  $tpl->parseCurrentBlock();
604  }
605  $tpl->setCurrentBlock("hidden_input");
606  $tpl->setVariable("HID", $this->getId());
607  $tpl->parseCurrentBlock();
608  }
609  }
610 
611  if ($a_only_cmd_list_asynch) {
612  $tpl->touchBlock("cmd_table");
613  return $tpl->get("item_loop");
614  }
615 
616  if ($this->getGroupedList() === null) {
617  $tpl->setCurrentBlock("dd_content");
618  if ($this->getPullRight()) {
619  $tpl->setVariable("UL_CLASS", "dropdown-menu pull-right");
620  } else {
621  $tpl->setVariable("UL_CLASS", "dropdown-menu");
622  }
623  $tpl->setVariable("TABLE_ID", $this->getId());
624  $tpl->parseCurrentBlock();
625  }
626 
627  if ($this->getHeaderIcon() !== self::NO_ICON) {
628  $tpl->setCurrentBlock("top_img");
629  switch ($this->getHeaderIcon()) {
630  case self::ICON_CONFIG:
631  $tpl->setVariable("IMG_SPAN_STYLE", self::ICON_CONFIG);
632  break;
633 
634  case self::DOWN_ARROW_DARK:
635  default:
636  $tpl->setVariable("IMG_SPAN_STYLE", self::ICON_ARROW);
637  break;
638  }
639  $tpl->parseCurrentBlock();
640  }
641 
642 
643  if ($this->getAsynch()) {
644  $js_tpl = $this->getJSTemplate();
645  $js_tpl->setVariable("ID", $this->getId());
646  $js_tpl->setCurrentBlock("asynch_bl");
647  $js_tpl->setVariable("ASYNCH_URL", $this->getAsynchUrl());
648  $js_tpl->setVariable("ASYNCH_ID", $this->getId());
649  $js_tpl->setVariable("ASYNCH_TRIGGER_ID", $this->getId());
650  $js_tpl->parseCurrentBlock();
651  $this->global_tpl->addOnloadCode(
652  $js_tpl->get()
653  );
654  }
655 
656  // js section
657  $tpl->setCurrentBlock("js_section");
658 
659  $cfg["trigger_event"] = $this->getTriggerEvent();
660  $cfg["auto_hide"] = $this->getAutoHide();
661 
662  if ($this->getSelectCallback() !== "") {
663  $cfg["select_callback"] = $this->getSelectCallback();
664  }
665  $cfg["anchor_id"] = "ilAdvSelListAnchorElement_" . $this->getId();
666  $cfg["asynch"] = $this->getAsynch();
667  $cfg["asynch_url"] = $this->getAsynchUrl();
669  if (is_array($toggle)) {
670  $cfg["toggle_el"] = $toggle["el"];
671  $cfg["toggle_class_on"] = $toggle["class_on"];
672  }
673  //echo "<br>".htmlentities($this->getAsynchUrl());
674  $tpl->setVariable("CFG", json_encode($cfg, JSON_THROW_ON_ERROR));
675 
676  //echo htmlentities(json_encode($cfg, JSON_THROW_ON_ERROR));
677 
678  if ($this->getListTitle() !== "") {
679  $tpl->setVariable("TXT_SEL_TOP", $this->getListTitle());
680  }
681  if ($this->getListTitle() === "" || $this->getAriaListTitle() !== "") {
682  $aria_title = ($this->getAriaListTitle() !== "")
683  ? $this->getAriaListTitle()
684  : $this->lng->txt("actions");
685  $tpl->setVariable("TXT_ARIA_TOP", $aria_title);
686  }
687  $tpl->setVariable("ID", $this->getId());
688 
689  //$tpl->setVariable("CLASS_SEL_TOP", $this->getSelectionHeaderClass());
690  switch ($this->getStyle()) {
691  case self::STYLE_DEFAULT:
692  $tpl->setVariable("BTN_CLASS", "btn btn-default");
693  $tpl->setVariable("TAG", "button");
694  break;
695 
696  case self::STYLE_EMPH:
697  $tpl->setVariable("BTN_CLASS", "btn btn-primary");
698  $tpl->setVariable("TAG", "button");
699  break;
700 
701  case self::STYLE_LINK_BUTTON:
702  $tpl->setVariable("BTN_CLASS", "btn btn-link");
703  $tpl->setVariable("TAG", "button");
704  break;
705 
706  case self::STYLE_LINK:
707  $tpl->setVariable("BTN_CLASS", "");
708  $tpl->setVariable("TAG", "a");
709  $tpl->touchBlock("href_link");
710  break;
711  }
712 
713 
714  if ($this->getSelectionHeaderSpanClass() !== "") {
715  $tpl->setVariable(
716  "CLASS_SEL_TOP_SPAN",
718  );
719  }
720 
721  // set the async url to an extra template variable
722  // (needed for a mobile skin)
723  // $tpl->setVariable("ASYNC_URL", $this->getAsynchUrl());
724 
725  $tpl->parseCurrentBlock();
726 
727  foreach ($this->getOnloadCode() as $code) {
728  $this->global_tpl->addOnLoadCode(
729  $code
730  );
731  }
732  return $tpl->get();
733  }
getAdditionalToggleElement()
Get additional toggle element.
renderer()
static prepareFormOutput($a_str, bool $a_strip=false)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
getHTML(bool $a_only_cmd_list_asynch=false)
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
+ 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 736 of file class.ilAdvancedSelectionListGUI.php.

Referenced by getHTML(), and getOnloadCode().

736  : ilTemplate
737  {
738  return new ilTemplate(
739  "tpl.adv_selection_list_js_init.js",
740  true,
741  true,
742  "components/ILIAS/UIComponent/AdvancedSelectionList",
743  "DEFAULT",
744  false,
745  true
746  );
747  }
+ 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 749 of file class.ilAdvancedSelectionListGUI.php.

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

Referenced by getHTML().

749  : array
750  {
751  $items = $this->getItems();
752 
753  // do not show list, if no item is in list
754  if (count($items) === 0 && !$this->getAsynch() && $this->getGroupedList() === null) {
755  return [];
756  }
757 
758  $js_tpl = $this->getJSTemplate();
759 
760  $cnt = 0;
761 
762  if (!$this->getAsynch() && $this->getGroupedList() === null) {
763  foreach ($items as $item) {
764  if (isset($item['component'])) {
765  continue;
766  }
767 
768  // add item to js object
769  $js_tpl->setCurrentBlock("js_item");
770  $js_tpl->setVariable("IT_ID", $this->getId());
771  $js_tpl->setVariable("IT_HID_NAME", $this->form_mode["select_name"]);
772 
773  $js_tpl->setVariable("IT_HID_VAL", $item["value"]);
774  $js_tpl->setVariable("IT_TITLE", str_replace("'", "\\'", $item["title"]));
775  $js_tpl->parseCurrentBlock();
776  }
777 
778  // output hidden input, if click mode is form submission
779  if ($this->getOnClickMode() === self::ON_ITEM_CLICK_FORM_SUBMIT) {
780  $js_tpl->setCurrentBlock("hidden_input");
781  $js_tpl->setVariable("HID", $this->getId());
782  $js_tpl->parseCurrentBlock();
783  }
784 
785  // output hidden input and initialize
786  if ($this->getOnClickMode() === self::ON_ITEM_CLICK_FORM_SELECT) {
787  // init hidden input with selected value
788  $js_tpl->setCurrentBlock("init_hidden_input");
789  $js_tpl->setVariable("H2ID", $this->getId());
790  $js_tpl->setVariable("HID_NAME", $this->form_mode["select_name"]);
791  $js_tpl->setVariable("HID_VALUE", $this->getSelectedValue());
792  $js_tpl->parseCurrentBlock();
793  }
794  }
795 
796  $js_tpl->setVariable("ID", $this->getId());
797 
798  return [$js_tpl->get()];
799  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ 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.

◆ 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: