ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilSuggestedSolutionSelectorGUI 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 ilSuggestedSolutionSelectorGUI:
+ Collaboration diagram for ilSuggestedSolutionSelectorGUI:

Public Member Functions

 __construct ($a_title="", $a_postvar="")
 Constructor. More...
 
 setOptions ($a_options)
 Set Options. More...
 
 getOptions ()
 Get Options. More...
 
 setValue ($a_value)
 Set Value. More...
 
 getValue ()
 Get Value. More...
 
 setInternalLink ($a_value)
 Set internal link. More...
 
 getInternalLink ()
 Get internal linnk. More...
 
 setInternalLinkText ($a_value)
 Set internal link.text. More...
 
 getInternalLinkText ()
 Get internal link text. More...
 
 setAddCommand ($a_add_command)
 Set add command. More...
 
 getAddCommand ()
 Get add command. More...
 
 setValueByArray ($a_values)
 Set value by array. More...
 
 checkInput ()
 Check input, strip slashes etc. More...
 
 insert ($a_tpl)
 
- Public Member Functions inherited from ilSubEnabledFormPropertyGUI
 addSubItem (ilFormPropertyGUI $a_item)
 
 getSubItems ()
 
 getSubInputItemsRecursive ()
 returns a flat array of possibly existing subitems recursively More...
 
 checkSubItemsInput ()
 Check SubItems. More...
 
 getSubForm ()
 
 getItemByPostVar (string $a_post_var)
 
- 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 Attributes

 $options
 
 $value
 
 $addCommand
 
 $intlink
 
 $intlinktext
 
- Protected Attributes inherited from ilSubEnabledFormPropertyGUI
array $sub_items = array()
 
- 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...
 
- Protected Member Functions inherited from ilFormPropertyGUI
 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)
 

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 a selection list property in a property form.

Author
Helmut Schottmüller ilias.nosp@m.@aur.nosp@m.ealis.nosp@m..de
Version
$Id$

Definition at line 26 of file class.ilSuggestedSolutionSelectorGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilSuggestedSolutionSelectorGUI::__construct (   $a_title = "",
  $a_postvar = "" 
)

Constructor.

Parameters
string$a_titleTitle
string$a_postvarPost Variable

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

References ILIAS\GlobalScreen\Provider\__construct(), and ilFormPropertyGUI\setType().

41  {
42  parent::__construct($a_title, $a_postvar);
43  $this->setType("select");
44  }
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ checkInput()

ilSuggestedSolutionSelectorGUI::checkInput ( )

Check input, strip slashes etc.

set alert, if input is not ok.

Returns
boolean Input ok, true/false

Definition at line 160 of file class.ilSuggestedSolutionSelectorGUI.php.

References $DIC, ilFormPropertyGUI\$lng, ilSubEnabledFormPropertyGUI\checkSubItemsInput(), ilFormPropertyGUI\getPostVar(), ilFormPropertyGUI\getRequired(), ilFormPropertyGUI\setAlert(), ilUtil\stripSlashes(), and ilLanguage\txt().

160  : bool
161  {
162  global $DIC;
163  $lng = $DIC['lng'];
164 
165  $_POST[$this->getPostVar()] =
166  ilUtil::stripSlashes($_POST[$this->getPostVar()]);
167  if ($this->getRequired() && trim($_POST[$this->getPostVar()]) == "") {
168  $this->setAlert($lng->txt("msg_input_is_required"));
169 
170  return false;
171  }
172  return $this->checkSubItemsInput();
173  }
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...
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:

◆ getAddCommand()

ilSuggestedSolutionSelectorGUI::getAddCommand ( )

Get add command.

Returns
string add command

Definition at line 141 of file class.ilSuggestedSolutionSelectorGUI.php.

Referenced by insert().

141  : string
142  {
143  return ($this->addCommand) ? $this->addCommand : "addInternalLink";
144  }
+ Here is the caller graph for this function:

◆ getInternalLink()

ilSuggestedSolutionSelectorGUI::getInternalLink ( )

Get internal linnk.

Returns
string Internal link

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

References $intlink.

Referenced by insert().

101  : string
102  {
103  return $this->intlink;
104  }
+ Here is the caller graph for this function:

◆ getInternalLinkText()

ilSuggestedSolutionSelectorGUI::getInternalLinkText ( )

Get internal link text.

Returns
string Internal link text

Definition at line 121 of file class.ilSuggestedSolutionSelectorGUI.php.

References $intlinktext.

Referenced by insert().

121  : string
122  {
123  return $this->intlinktext;
124  }
+ Here is the caller graph for this function:

◆ getOptions()

ilSuggestedSolutionSelectorGUI::getOptions ( )

Get Options.

Returns
array Options. Array ("value" => "option_text")

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

References $options.

Referenced by insert().

+ Here is the caller graph for this function:

◆ getValue()

ilSuggestedSolutionSelectorGUI::getValue ( )

Get Value.

Returns
string Value

Definition at line 81 of file class.ilSuggestedSolutionSelectorGUI.php.

References $value.

Referenced by insert().

+ Here is the caller graph for this function:

◆ insert()

ilSuggestedSolutionSelectorGUI::insert (   $a_tpl)

Definition at line 175 of file class.ilSuggestedSolutionSelectorGUI.php.

References $DIC, ilFormPropertyGUI\$lng, getAddCommand(), ilFormPropertyGUI\getDisabled(), getInternalLink(), getInternalLinkText(), getOptions(), ilFormPropertyGUI\getPostVar(), getValue(), and ilLanguage\txt().

175  : void
176  {
177  global $DIC;
178  $lng = $DIC['lng'];
179 
180  $template = new ilTemplate("tpl.prop_suggestedsolutionselector.html", true, true, "Modules/TestQuestionPool");
181 
182  foreach ($this->getOptions() as $option_value => $option_text) {
183  $template->setCurrentBlock("prop_intlink_select_option");
184  $template->setVariable("VAL_SELECT_OPTION", $option_value);
185  if ($option_value == $this->getValue()) {
186  $template->setVariable(
187  "CHK_SEL_OPTION",
188  'selected="selected"'
189  );
190  }
191  $template->setVariable("TXT_SELECT_OPTION", $option_text);
192  $template->parseCurrentBlock();
193  }
194  if ($this->getInternalLink()) {
195  $template->setCurrentBlock("delete_internallink");
196  $template->setVariable("TEXT_DELETE_INTERNALLINK", $lng->txt("remove_solution"));
197  $template->setVariable("POST_VAR", $this->getPostVar());
198  $template->parseCurrentBlock();
199  $template->setCurrentBlock("internal_link");
200  $template->setVariable("HREF_INT_LINK", $this->getInternalLink());
201  $template->setVariable("TEXT_INT_LINK", $this->getInternalLinkText());
202  $template->parseCurrentBlock();
203  }
204  $template->setCurrentBlock("prop_internallink_selector");
205  $template->setVariable("POST_VAR", $this->getPostVar());
206  if ($this->getDisabled()) {
207  $template->setVariable(
208  "DISABLED",
209  " disabled=\"disabled\""
210  );
211  }
212  $template->setVariable("TEXT_ADD_INTERNALLINK", ($this->getInternalLink()) ? $lng->txt("change") : $lng->txt("add"));
213  $template->setVariable("CMD_ADD_INTERNALLINK", $this->getAddCommand());
214  $template->parseCurrentBlock();
215  $a_tpl->setCurrentBlock("prop_generic");
216  $a_tpl->setVariable("PROP_GENERIC", $template->get());
217  $a_tpl->parseCurrentBlock();
218  }
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...
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:

◆ setAddCommand()

ilSuggestedSolutionSelectorGUI::setAddCommand (   $a_add_command)

Set add command.

Parameters
string$a_add_commandadd command

Definition at line 131 of file class.ilSuggestedSolutionSelectorGUI.php.

131  : void
132  {
133  $this->addCommand = $a_add_command;
134  }

◆ setInternalLink()

ilSuggestedSolutionSelectorGUI::setInternalLink (   $a_value)

Set internal link.

Parameters
string$a_valueValue

Definition at line 91 of file class.ilSuggestedSolutionSelectorGUI.php.

91  : void
92  {
93  $this->intlink = $a_value;
94  }

◆ setInternalLinkText()

ilSuggestedSolutionSelectorGUI::setInternalLinkText (   $a_value)

Set internal link.text.

Parameters
string$a_valueInternal link text

Definition at line 111 of file class.ilSuggestedSolutionSelectorGUI.php.

111  : void
112  {
113  $this->intlinktext = $a_value;
114  }

◆ setOptions()

ilSuggestedSolutionSelectorGUI::setOptions (   $a_options)

Set Options.

Parameters
array$a_optionsOptions. Array ("value" => "option_text")

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

51  : void
52  {
53  $this->options = $a_options;
54  }

◆ setValue()

ilSuggestedSolutionSelectorGUI::setValue (   $a_value)

Set Value.

Parameters
string$a_valueValue

Definition at line 71 of file class.ilSuggestedSolutionSelectorGUI.php.

Referenced by setValueByArray().

71  : void
72  {
73  $this->value = $a_value;
74  }
+ Here is the caller graph for this function:

◆ setValueByArray()

ilSuggestedSolutionSelectorGUI::setValueByArray (   $a_values)

Set value by array.

Parameters
array$a_valuesvalue array

Definition at line 151 of file class.ilSuggestedSolutionSelectorGUI.php.

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

151  : void
152  {
153  $this->setValue($a_values[$this->getPostVar()]);
154  }
+ Here is the call graph for this function:

Field Documentation

◆ $addCommand

ilSuggestedSolutionSelectorGUI::$addCommand
protected

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

◆ $intlink

ilSuggestedSolutionSelectorGUI::$intlink
protected

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

Referenced by getInternalLink().

◆ $intlinktext

ilSuggestedSolutionSelectorGUI::$intlinktext
protected

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

Referenced by getInternalLinkText().

◆ $options

ilSuggestedSolutionSelectorGUI::$options
protected

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

Referenced by getOptions().

◆ $value

ilSuggestedSolutionSelectorGUI::$value
protected

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

Referenced by getValue().


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