ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilSuggestedSolutionSelectorGUI Class Reference

This class represents a selection list property in a property form. 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)
 Insert property html. More...
 
- Public Member Functions inherited from ilSubEnabledFormPropertyGUI
 addSubItem ($a_item)
 Add Subitem. More...
 
 getSubItems ()
 Get Subitems. More...
 
 getSubInputItemsRecursive ()
 returns a flat array of possibly existing subitems recursively More...
 
 checkSubItemsInput ()
 Check SubItems. More...
 
 getSubForm ()
 Get sub form html. More...
 
 getItemByPostVar ($a_post_var)
 Get item by post var. More...
 
- Public Member Functions inherited from ilFormPropertyGUI
 __construct ($a_title="", $a_postvar="")
 Constructor. More...
 
 executeCommand ()
 Execute command. More...
 
 getType ()
 Get Type. More...
 
 setTitle ($a_title)
 Set Title. More...
 
 getTitle ()
 Get Title. More...
 
 setPostVar ($a_postvar)
 Set Post Variable. More...
 
 getPostVar ()
 Get Post Variable. More...
 
 getFieldId ()
 Get Post Variable. More...
 
 setInfo ($a_info)
 Set Information Text. More...
 
 getInfo ()
 Get Information Text. More...
 
 setAlert ($a_alert)
 Set Alert Text. More...
 
 getAlert ()
 Get Alert Text. More...
 
 setRequired ($a_required)
 Set Required. More...
 
 getRequired ()
 Get Required. More...
 
 setDisabled ($a_disabled)
 Set Disabled. More...
 
 getDisabled ()
 Get Disabled. More...
 
 checkInput ()
 Check input, strip slashes etc. More...
 
 setParentForm ($a_parentform)
 Set Parent Form. More...
 
 getParentForm ()
 Get Parent Form. More...
 
 setParent ($a_val)
 Set Parent GUI object. More...
 
 getParent ()
 Get Parent GUI object. More...
 
 getSubForm ()
 Get sub form html. More...
 
 hideSubForm ()
 Sub form hidden on init? More...
 
 setHiddenTitle ($a_val)
 Set hidden title (for screenreaders) More...
 
 getHiddenTitle ()
 Get hidden title. More...
 
 getItemByPostVar ($a_post_var)
 Get item by post var. More...
 
 serializeData ()
 serialize data More...
 
 unserializeData ($a_data)
 unserialize data More...
 
 writeToSession ()
 Write to session. More...
 
 clearFromSession ()
 Clear session value. More...
 
 readFromSession ()
 Read from session. More...
 
 getHiddenTag ($a_post_var, $a_value)
 Get hidden tag (used for disabled properties) More...
 
 setMulti ($a_multi, $a_sortable=false, $a_addremove=true)
 Set Multi. More...
 
 getMulti ()
 Get Multi. More...
 
 setMultiValues (array $a_values)
 Set multi values. More...
 
 getMultiValues ()
 Get multi values. More...
 
 getContentOutsideFormTag ()
 Get content that has to reside outside of the parent form tag, e.g. More...
 
 stripSlashesAddSpaceFallback ($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...
 

Protected Attributes

 $options
 
 $value
 
 $addCommand
 
 $intlink
 
 $intlinktext
 
- Protected Attributes inherited from ilSubEnabledFormPropertyGUI
 $sub_items = array()
 
- Protected Attributes inherited from ilFormPropertyGUI
 $ctrl
 
 $lng
 
 $type
 
 $title
 
 $postvar
 
 $info
 
 $alert
 
 $required = false
 
 $parentgui
 
 $parentform
 
 $hidden_title = ""
 
 $multi = false
 
 $multi_sortable = false
 
 $multi_addremove = true
 
 $multi_values
 

Additional Inherited Members

- Static Public Member Functions inherited from ilFormPropertyGUI
static removeProhibitedCharacters ($a_text)
 Remove prohibited characters see #19159. More...
 
- Protected Member Functions inherited from ilFormPropertyGUI
 setType ($a_type)
 Set Type. More...
 
 getMultiIconsHTML ()
 Get HTML for multiple value icons. More...
 

Detailed Description

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 13 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 27 of file class.ilSuggestedSolutionSelectorGUI.php.

References ilFormPropertyGUI\setType().

28  {
29  parent::__construct($a_title, $a_postvar);
30  $this->setType("select");
31  }
setType($a_type)
Set Type.
+ 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 148 of file class.ilSuggestedSolutionSelectorGUI.php.

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

149  {
150  global $DIC;
151  $lng = $DIC['lng'];
152 
153  $_POST[$this->getPostVar()] =
155  if ($this->getRequired() && trim($_POST[$this->getPostVar()]) == "") {
156  $this->setAlert($lng->txt("msg_input_is_required"));
157 
158  return false;
159  }
160  return $this->checkSubItemsInput();
161  }
global $DIC
Definition: saml.php:7
getPostVar()
Get Post Variable.
setAlert($a_alert)
Set Alert Text.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
$_POST["username"]
+ Here is the call graph for this function:

◆ getAddCommand()

ilSuggestedSolutionSelectorGUI::getAddCommand ( )

Get add command.

Returns
string add command

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

Referenced by insert().

129  {
130  return ($this->addCommand) ? $this->addCommand : "addInternalLink";
131  }
+ Here is the caller graph for this function:

◆ getInternalLink()

ilSuggestedSolutionSelectorGUI::getInternalLink ( )

Get internal linnk.

Returns
string Internal link

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

References $intlink.

Referenced by insert().

+ Here is the caller graph for this function:

◆ getInternalLinkText()

ilSuggestedSolutionSelectorGUI::getInternalLinkText ( )

Get internal link text.

Returns
string Internal link text

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

References $intlinktext.

Referenced by insert().

+ Here is the caller graph for this function:

◆ getOptions()

ilSuggestedSolutionSelectorGUI::getOptions ( )

Get Options.

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

Definition at line 48 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 68 of file class.ilSuggestedSolutionSelectorGUI.php.

References $value.

Referenced by insert().

+ Here is the caller graph for this function:

◆ insert()

ilSuggestedSolutionSelectorGUI::insert ( $a_tpl)

Insert property html.

Returns
int Size

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

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

169  {
170  global $DIC;
171  $lng = $DIC['lng'];
172 
173  $template = new ilTemplate("tpl.prop_suggestedsolutionselector.html", true, true, "Modules/TestQuestionPool");
174 
175  foreach ($this->getOptions() as $option_value => $option_text) {
176  $template->setCurrentBlock("prop_intlink_select_option");
177  $template->setVariable("VAL_SELECT_OPTION", $option_value);
178  if ($option_value == $this->getValue()) {
179  $template->setVariable(
180  "CHK_SEL_OPTION",
181  'selected="selected"'
182  );
183  }
184  $template->setVariable("TXT_SELECT_OPTION", $option_text);
185  $template->parseCurrentBlock();
186  }
187  if ($this->getInternalLink()) {
188  $template->setCurrentBlock("delete_internallink");
189  $template->setVariable("TEXT_DELETE_INTERNALLINK", $lng->txt("remove_solution"));
190  $template->setVariable("POST_VAR", $this->getPostVar());
191  $template->parseCurrentBlock();
192  $template->setCurrentBlock("internal_link");
193  $template->setVariable("HREF_INT_LINK", $this->getInternalLink());
194  $template->setVariable("TEXT_INT_LINK", $this->getInternalLinkText());
195  $template->parseCurrentBlock();
196  }
197  $template->setCurrentBlock("prop_internallink_selector");
198  $template->setVariable("POST_VAR", $this->getPostVar());
199  if ($this->getDisabled()) {
200  $template->setVariable(
201  "DISABLED",
202  " disabled=\"disabled\""
203  );
204  }
205  $template->setVariable("TEXT_ADD_INTERNALLINK", ($this->getInternalLink()) ? $lng->txt("change") : $lng->txt("add"));
206  $template->setVariable("CMD_ADD_INTERNALLINK", $this->getAddCommand());
207  $template->parseCurrentBlock();
208  $a_tpl->setCurrentBlock("prop_generic");
209  $a_tpl->setVariable("PROP_GENERIC", $template->get());
210  $a_tpl->parseCurrentBlock();
211  }
$template
global $DIC
Definition: saml.php:7
getPostVar()
Get Post Variable.
special template class to simplify handling of ITX/PEAR
+ 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 118 of file class.ilSuggestedSolutionSelectorGUI.php.

119  {
120  $this->addCommand = $a_add_command;
121  }

◆ setInternalLink()

ilSuggestedSolutionSelectorGUI::setInternalLink (   $a_value)

Set internal link.

Parameters
string$a_valueValue

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

79  {
80  $this->intlink = $a_value;
81  }

◆ setInternalLinkText()

ilSuggestedSolutionSelectorGUI::setInternalLinkText (   $a_value)

Set internal link.text.

Parameters
string$a_valueInternal link text

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

99  {
100  $this->intlinktext = $a_value;
101  }

◆ setOptions()

ilSuggestedSolutionSelectorGUI::setOptions (   $a_options)

Set Options.

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

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

39  {
40  $this->options = $a_options;
41  }

◆ setValue()

ilSuggestedSolutionSelectorGUI::setValue (   $a_value)

Set Value.

Parameters
string$a_valueValue

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

Referenced by setValueByArray().

59  {
60  $this->value = $a_value;
61  }
+ 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 138 of file class.ilSuggestedSolutionSelectorGUI.php.

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

139  {
140  $this->setValue($a_values[$this->getPostVar()]);
141  }
getPostVar()
Get Post Variable.
+ Here is the call graph for this function:

Field Documentation

◆ $addCommand

ilSuggestedSolutionSelectorGUI::$addCommand
protected

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

◆ $intlink

ilSuggestedSolutionSelectorGUI::$intlink
protected

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

Referenced by getInternalLink().

◆ $intlinktext

ilSuggestedSolutionSelectorGUI::$intlinktext
protected

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

Referenced by getInternalLinkText().

◆ $options

ilSuggestedSolutionSelectorGUI::$options
protected

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

Referenced by getOptions().

◆ $value

ilSuggestedSolutionSelectorGUI::$value
protected

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

Referenced by getValue().


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