ILIAS  trunk Revision v5.2.0beta1-34115-g3a2438be29
ilAdvSelectInputGUI 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 ilAdvSelectInputGUI:
+ Collaboration diagram for ilAdvSelectInputGUI:

Public Member Functions

 __construct (string $a_title="", string $a_postvar="")
 
 addOption (string $a_value, string $a_text, string $a_html="")
 
 getOptions ()
 
 setValue (string $a_value)
 
 getValue ()
 
 setValueByArray (array $a_values)
 
 checkInput ()
 
 getInput ()
 
 setPullRight (bool $right)
 
 getPullRight ()
 
 insert (ilTemplate $a_tpl)
 
 getOnloadCode ()
 
- Public Member Functions inherited from ilFormPropertyGUI
 __construct (string $a_title="", string $a_postvar="")
 
 executeCommand ()
 
 getType ()
 
 setTitle (string $a_title)
 
 getTitle ()
 
 setPostVar (string $a_postvar)
 
 getPostVar ()
 
 getFieldId ()
 
 setInfo (string $a_info)
 
 getInfo ()
 
 setAlert (string $a_alert)
 
 getAlert ()
 
 setRequired (bool $a_required)
 
 getRequired ()
 
 setDisabled (bool $a_disabled)
 
 getDisabled ()
 
 checkInput ()
 Check input, strip slashes etc. More...
 
 setParentForm (ilPropertyFormGUI $a_parentform)
 
 getParentForm ()
 
 setParent (ilFormPropertyGUI $a_val)
 
 getParent ()
 
 getSubForm ()
 
 hideSubForm ()
 
 setHiddenTitle (string $a_val)
 
 getHiddenTitle ()
 
 getItemByPostVar (string $a_post_var)
 Get item by post var. More...
 
 serializeData ()
 
 unserializeData (string $a_data)
 
 setParentTable ($a_val)
 Set parent table. More...
 
 getParentTable ()
 Get parent table. More...
 
 writeToSession ()
 
 clearFromSession ()
 
 readFromSession ()
 
 getHiddenTag (string $a_post_var, string $a_value)
 
 setMulti (bool $a_multi, bool $a_sortable=false, bool $a_addremove=true)
 
 getMulti ()
 
 setMultiValues (array $a_values)
 
 getMultiValues ()
 
 getContentOutsideFormTag ()
 Get content that has to reside outside of the parent form tag, e.g. More...
 
 stripSlashesAddSpaceFallback (string $a_str)
 Strip slashes with add space fallback, see https://www.ilias.de/mantis/view.php?id=19727. More...
 
 getTableFilterLabelFor ()
 Get label "for" attribute value for filter. More...
 
 getFormLabelFor ()
 Get label "for" attribute value for form. More...
 
 setRequestParam (string $key, $val)
 This writes the request (aka post) values. More...
 

Protected Member Functions

 getAdvSelection ()
 
- Protected Member Functions inherited from ilFormPropertyGUI
 symbol ()
 
 setType (string $a_type)
 
 checkParentFormTable ()
 
 getSessionKey ()
 
 getMultiIconsHTML ()
 
 int ($key)
 
 intArray ($key)
 
 str ($key)
 
 raw ($key)
 
 strArray ($key)
 
 arrayArray ($key)
 
 isRequestParamArray (string $key)
 
 getRequestParam (string $key, Refinery\Transformation $t)
 

Protected Attributes

bool $right = false
 
array $options = array()
 
string $value = ""
 
- Protected Attributes inherited from ilFormPropertyGUI
array $set_params = []
 
ilTable2GUI $parent_table = null
 
ilFormPropertyGUI $parent_gui = null
 
ilCtrl $ctrl
 
ilLanguage $lng
 
string $type = ""
 
string $title = ""
 
string $postvar = ""
 
string $info = ""
 
string $alert = ""
 
bool $required = false
 
ilPropertyFormGUI $parentform = null
 
string $hidden_title = ""
 
bool $multi = false
 
bool $multi_sortable = false
 
bool $multi_addremove = true
 
array $multi_values = []
 
RequestInterface $request
 
HTTP Services $http
 
Refinery Factory $refinery = null
 
bool $disabled = false
 
ilGlobalTemplateInterface $global_tpl = null
 

Additional Inherited Members

- Static Public Member Functions inherited from ilFormPropertyGUI
static removeProhibitedCharacters (string $a_text)
 Remove prohibited characters see #19159. More...
 

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 This class represents an advanced selection list property in a property form. It can hold graphical selection items, uses javascript and falls back to a normal selection list, when javascript is disabled.

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

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

Constructor & Destructor Documentation

◆ __construct()

ilAdvSelectInputGUI::__construct ( string  $a_title = "",
string  $a_postvar = "" 
)

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

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), ILIAS\Repository\lng(), and ilFormPropertyGUI\setType().

37  {
38  global $DIC;
39 
40  $this->lng = $DIC->language();
41  parent::__construct($a_title, $a_postvar);
42  $this->setType("advselect");
43  }
$DIC
Definition: xapitoken.php:62
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ addOption()

ilAdvSelectInputGUI::addOption ( string  $a_value,
string  $a_text,
string  $a_html = "" 
)

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

Referenced by ilPCListGUI\initListForm().

49  : void {
50  $this->options[$a_value] = array("value" => $a_value,
51  "txt" => $a_text, "html" => $a_html);
52  }
+ Here is the caller graph for this function:

◆ checkInput()

ilAdvSelectInputGUI::checkInput ( )

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

References ilFormPropertyGUI\$lng, ilFormPropertyGUI\getPostVar(), ilFormPropertyGUI\getRequired(), ilFormPropertyGUI\setAlert(), ilFormPropertyGUI\str(), and ilLanguage\txt().

74  : bool
75  {
76  $lng = $this->lng;
77 
78  if ($this->getRequired() && trim($this->str($this->getPostVar())) == "") {
79  $this->setAlert($lng->txt("msg_input_is_required"));
80  return false;
81  }
82  return true;
83  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
+ Here is the call graph for this function:

◆ getAdvSelection()

ilAdvSelectInputGUI::getAdvSelection ( )
protected

Definition at line 101 of file class.ilAdvSelectInputGUI.php.

References ilAdvancedSelectionListGUI\DOWN_ARROW_DARK, getOptions(), ilFormPropertyGUI\getPostVar(), getValue(), and ilAdvancedSelectionListGUI\ON_ITEM_CLICK_FORM_SELECT.

Referenced by getOnloadCode(), and insert().

102  {
103  $selection = new ilAdvancedSelectionListGUI();
104  $selection->setFormSelectMode(
105  $this->getPostVar(),
106  "",
107  false,
108  "",
109  "",
110  "",
111  ""
112  );
113  $selection->setId($this->getPostVar());
114  $selection->setHeaderIcon(ilAdvancedSelectionListGUI::DOWN_ARROW_DARK);
115  $selection->setSelectedValue($this->getValue());
116  $selection->setUseImages(false);
117  $selection->setPullRight($this->right);
118  $selection->setOnClickMode(ilAdvancedSelectionListGUI::ON_ITEM_CLICK_FORM_SELECT);
119 
120  foreach ($this->getOptions() as $option) {
121  $selection->addItem(
122  $option["txt"],
123  $option["value"],
124  "",
125  "",
126  $option["value"],
127  "",
128  $option["html"]
129  );
130  if ($this->getValue() == $option["value"]) {
131  $selection->setListTitle($option["txt"]);
132  }
133  }
134  return $selection;
135  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getInput()

ilAdvSelectInputGUI::getInput ( )

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

References ilFormPropertyGUI\getPostVar(), and ilFormPropertyGUI\str().

85  : string
86  {
87  return $this->str($this->getPostVar());
88  }
+ Here is the call graph for this function:

◆ getOnloadCode()

ilAdvSelectInputGUI::getOnloadCode ( )

Definition at line 145 of file class.ilAdvSelectInputGUI.php.

References getAdvSelection().

145  : array
146  {
147  return $this->getAdvSelection()->getOnloadCode();
148  }
+ Here is the call graph for this function:

◆ getOptions()

ilAdvSelectInputGUI::getOptions ( )

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

References $options.

Referenced by getAdvSelection().

54  : array
55  {
56  return $this->options;
57  }
+ Here is the caller graph for this function:

◆ getPullRight()

ilAdvSelectInputGUI::getPullRight ( )

Definition at line 95 of file class.ilAdvSelectInputGUI.php.

References $right.

95  : bool
96  {
97  return $this->right;
98  }

◆ getValue()

ilAdvSelectInputGUI::getValue ( )

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

References $value.

Referenced by getAdvSelection().

64  : string
65  {
66  return $this->value;
67  }
+ Here is the caller graph for this function:

◆ insert()

ilAdvSelectInputGUI::insert ( ilTemplate  $a_tpl)

Definition at line 137 of file class.ilAdvSelectInputGUI.php.

References getAdvSelection(), ilTemplate\parseCurrentBlock(), ilTemplate\setCurrentBlock(), and HTML_Template_IT\setVariable().

137  : void
138  {
139  $selection = $this->getAdvSelection();
140  $a_tpl->setCurrentBlock("prop_generic");
141  $a_tpl->setVariable("PROP_GENERIC", $selection->getHTML());
142  $a_tpl->parseCurrentBlock();
143  }
parseCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:546
setCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
+ Here is the call graph for this function:

◆ setPullRight()

ilAdvSelectInputGUI::setPullRight ( bool  $right)

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

References $right.

90  : void
91  {
92  $this->right = $right;
93  }

◆ setValue()

ilAdvSelectInputGUI::setValue ( string  $a_value)

Definition at line 59 of file class.ilAdvSelectInputGUI.php.

Referenced by ilPCListGUI\initListForm(), and setValueByArray().

59  : void
60  {
61  $this->value = $a_value;
62  }
+ Here is the caller graph for this function:

◆ setValueByArray()

ilAdvSelectInputGUI::setValueByArray ( array  $a_values)

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

References ilFormPropertyGUI\getPostVar(), and setValue().

69  : void
70  {
71  $this->setValue($a_values[$this->getPostVar()] ?? "");
72  }
+ Here is the call graph for this function:

Field Documentation

◆ $options

array ilAdvSelectInputGUI::$options = array()
protected

Definition at line 31 of file class.ilAdvSelectInputGUI.php.

Referenced by getOptions().

◆ $right

bool ilAdvSelectInputGUI::$right = false
protected

Definition at line 30 of file class.ilAdvSelectInputGUI.php.

Referenced by getPullRight(), and setPullRight().

◆ $value

string ilAdvSelectInputGUI::$value = ""
protected

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

Referenced by getValue().


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