ILIAS  release_8 Revision v8.24
ilTextWizardInputGUI 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 ilTextWizardInputGUI:
+ Collaboration diagram for ilTextWizardInputGUI:

Public Member Functions

 __construct (string $a_title="", string $a_postvar="")
 
 setValues (array $a_values)
 
 setValue ($a_value)
 
 getValues ()
 
 setAllowMove (bool $a_allow_move)
 
 getAllowMove ()
 
 checkInput ()
 Check input, strip slashes etc. More...
 
 getInput ()
 
 insert (ilTemplate $a_tpl)
 
 render (string $a_mode="")
 
- Public Member Functions inherited from ilTextInputGUI
 __construct (string $a_title="", string $a_postvar="")
 
 setValue ($a_value)
 
 getValue ()
 
 setValidationFailureMessage (string $a_msg)
 
 getValidationFailureMessage ()
 
 setValidationRegexp (string $a_value)
 
 getValidationRegexp ()
 
 setMaxLength (?int $a_maxlength)
 
 getMaxLength ()
 
 setSize (int $a_size)
 
 setInlineStyle (string $a_style)
 
 getInlineStyle ()
 
 setCssClass (string $a_class)
 
 getCssClass ()
 
 setValueByArray (array $a_values)
 
 getSize ()
 
 setSuffix (string $a_value)
 
 getSuffix ()
 
 setInputType (string $a_type)
 set input type More...
 
 getInputType ()
 
 setSubmitFormOnEnter (bool $a_val)
 
 getSubmitFormOnEnter ()
 
 checkInput ()
 Check input, strip slashes etc. More...
 
 getInput ()
 
 getDataSource ()
 
 setDataSource (string $href, string $a_delimiter=null)
 
 setDataSourceSubmitOnSelection (bool $a_stat)
 
 getDataSourceSubmitOnSelection ()
 
 setDataSourceSubmitUrl (string $a_url)
 
 getDataSourceSubmitUrl ()
 
 setMultiValues (array $a_values)
 
 render (string $a_mode="")
 
 insert (ilTemplate $a_tpl)
 
 getTableFilterHTML ()
 Get input item HTML to be inserted into table filters. More...
 
 getToolbarHTML ()
 Get input item HTML to be inserted into ilToolbarGUI. More...
 
 setDisableHtmlAutoComplete (bool $autocomplete)
 
 isHtmlAutoCompleteDisabled ()
 
 getPostValueForComparison ()
 
- 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)
 Get item by post var. More...
 
- 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...
 
- Public Member Functions inherited from ilTableFilterItem
 getTableFilterHTML ()
 Get input item HTML to be inserted into table filters. More...
 
 getTableFilterLabelFor ()
 Get label "for" attribute value. More...
 
 getToolbarHTML ()
 Get input item HTML to be inserted into ilToolbarGUI. More...
 

Protected Attributes

ilGlobalTemplateInterface $tpl
 
array $values = array()
 
bool $allowMove = false
 
- Protected Attributes inherited from ilTextInputGUI
 $value = null
 
int $maxlength = 200
 
int $size = 40
 
string $validationRegexp = ""
 
string $validationFailureMessage = ''
 
string $suffix = ""
 
string $style_css = ""
 
string $css_class = ""
 
string $ajax_datasource = ""
 
string $ajax_datasource_delimiter = null
 
bool $ajax_datasource_commit = false
 
string $ajax_datasource_commit_url = ""
 
bool $submit_form_on_enter = false
 
bool $autocomplete_disabled = false
 
string $input_type = ""
 
- 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 text wizard property in a property form.

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

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

Constructor & Destructor Documentation

◆ __construct()

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

Reimplemented from ilTextInputGUI.

Reimplemented in ilSelectBuilderInputGUI.

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

35 {
36 global $DIC;
37
38 $this->lng = $DIC->language();
39 $this->tpl = $DIC["tpl"];
40 parent::__construct($a_title, $a_postvar);
41 $this->validationRegexp = "";
42 }
global $DIC
Definition: feed.php:28
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

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

+ Here is the call graph for this function:

Member Function Documentation

◆ checkInput()

ilTextWizardInputGUI::checkInput ( )

Check input, strip slashes etc.

set alert, if input is not ok.

Reimplemented from ilTextInputGUI.

Reimplemented in ilSelectBuilderInputGUI.

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

72 : bool
73 {
75
76 $foundvalues = $this->getInput();
77 if (count($foundvalues) > 0) {
78 foreach ($foundvalues as $value) {
79 if ($this->getRequired() && trim($value) == "") {
80 $this->setAlert($lng->txt("msg_input_is_required"));
81 return false;
82 } elseif (strlen($this->getValidationRegexp())) {
83 if (!preg_match($this->getValidationRegexp(), $value)) {
84 $this->setAlert($lng->txt("msg_wrong_format"));
85 return false;
86 }
87 } elseif ($this->getMaxLength() && mb_strlen($value) > $this->getMaxLength()) {
88 $this->setAlert($lng->txt("msg_input_char_limit_max"));
89 return false;
90 }
91 }
92 } elseif ($this->getRequired()) {
93 $this->setAlert($lng->txt("msg_input_is_required"));
94 return false;
95 }
96
97 return $this->checkSubItemsInput();
98 }
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...

References ilFormPropertyGUI\$lng, ilTextInputGUI\$value, ilSubEnabledFormPropertyGUI\checkSubItemsInput(), getInput(), ilTextInputGUI\getMaxLength(), ilFormPropertyGUI\getRequired(), ilTextInputGUI\getValidationRegexp(), ilFormPropertyGUI\setAlert(), and ilLanguage\txt().

+ Here is the call graph for this function:

◆ getAllowMove()

ilTextWizardInputGUI::getAllowMove ( )

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

67 : bool
68 {
69 return $this->allowMove;
70 }

References $allowMove.

Referenced by ilSelectBuilderInputGUI\insert(), and render().

+ Here is the caller graph for this function:

◆ getInput()

ilTextWizardInputGUI::getInput ( )
Returns
string|string[]

Reimplemented from ilTextInputGUI.

Reimplemented in ilSelectBuilderInputGUI.

Definition at line 100 of file class.ilTextWizardInputGUI.php.

100 : array
101 {
102 return $this->strArray($this->getPostVar());
103 }

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

Referenced by checkInput().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getValues()

ilTextWizardInputGUI::getValues ( )

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

57 : array
58 {
59 return $this->values;
60 }

References $values.

◆ insert()

ilTextWizardInputGUI::insert ( ilTemplate  $a_tpl)

Reimplemented from ilTextInputGUI.

Reimplemented in ilSelectBuilderInputGUI.

Definition at line 105 of file class.ilTextWizardInputGUI.php.

105 : void
106 {
107 $a_tpl->setCurrentBlock("prop_generic");
108 $a_tpl->setVariable("PROP_GENERIC", $this->render());
109 $a_tpl->parseCurrentBlock();
110 }
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:514
setCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
parseCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)

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

+ Here is the call graph for this function:

◆ render()

ilTextWizardInputGUI::render ( string  $a_mode = "")

Reimplemented from ilTextInputGUI.

Definition at line 112 of file class.ilTextWizardInputGUI.php.

112 : string
113 {
114 $tpl = new ilTemplate("tpl.prop_textwizardinput.html", true, true, "Services/Form");
115 $i = 0;
116 foreach ($this->values as $value) {
117 if (strlen($value)) {
118 $tpl->setCurrentBlock("prop_text_propval");
121 }
122 if ($this->getAllowMove()) {
123 $tpl->setCurrentBlock("move");
124 $tpl->setVariable("CMD_UP", "cmd[up" . $this->getFieldId() . "][$i]");
125 $tpl->setVariable("CMD_DOWN", "cmd[down" . $this->getFieldId() . "][$i]");
126 $tpl->setVariable("ID", $this->getFieldId() . "[$i]");
130 }
131 $tpl->setCurrentBlock("row");
132 $tpl->setVariable("POST_VAR", $this->getPostVar() . "[$i]");
133 $tpl->setVariable("ID", $this->getFieldId() . "[$i]");
134 $tpl->setVariable("SIZE", $this->getSize());
135 $tpl->setVariable("MAXLENGTH", $this->getMaxLength());
136
137 if ($this->getDisabled()) {
139 "DISABLED",
140 " disabled=\"disabled\""
141 );
142 } else {
143 $tpl->setVariable("CMD_ADD", "cmd[add" . $this->getFieldId() . "][$i]");
144 $tpl->setVariable("CMD_REMOVE", "cmd[remove" . $this->getFieldId() . "][$i]");
147 }
148
150 $i++;
151 }
152
153 $tpl->setVariable("ELEMENT_ID", $this->getFieldId());
154
155 if (!$this->getDisabled()) {
156 $this->tpl->addJavascript("./Services/Form/js/ServiceFormWizardInput.js");
157 $this->tpl->addJavascript("./Services/Form/templates/default/textwizard.js");
158 }
159
160 return $tpl->get();
161 }
static get(string $a_glyph, string $a_text="")
static prepareFormOutput($a_str, bool $a_strip=false)
special template class to simplify handling of ITX/PEAR
ilGlobalTemplateInterface $tpl
setCurrentBlock(string $part=self::DEFAULT_BLOCK)
Sets the template to the given block.
parseCurrentBlock(string $block_name=self::DEFAULT_BLOCK)
Parses the given block.
setVariable(string $variable, $value='')
Sets the given variable to the given value.
get(string $part=self::DEFAULT_BLOCK)
Renders the given block and returns the html string.
$i
Definition: metadata.php:41

References $i, $tpl, ilTextInputGUI\$value, ilGlyphGUI\ADD, ilGlyphGUI\DOWN, ilGlyphGUI\get(), ilGlobalTemplateInterface\get(), getAllowMove(), ilFormPropertyGUI\getDisabled(), ilFormPropertyGUI\getFieldId(), ilTextInputGUI\getMaxLength(), ilFormPropertyGUI\getPostVar(), ilTextInputGUI\getSize(), ilGlobalTemplateInterface\parseCurrentBlock(), ilLegacyFormElementsUtil\prepareFormOutput(), ilGlyphGUI\REMOVE, ilGlobalTemplateInterface\setCurrentBlock(), ilGlobalTemplateInterface\setVariable(), and ilGlyphGUI\UP.

Referenced by insert().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setAllowMove()

ilTextWizardInputGUI::setAllowMove ( bool  $a_allow_move)

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

62 : void
63 {
64 $this->allowMove = $a_allow_move;
65 }

◆ setValue()

ilTextWizardInputGUI::setValue (   $a_value)
Parameters
array | string$a_value

Reimplemented from ilTextInputGUI.

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

52 : void
53 {
54 $this->values = (array) $a_value;
55 }

◆ setValues()

ilTextWizardInputGUI::setValues ( array  $a_values)

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

44 : void
45 {
46 $this->values = $a_values;
47 }

Field Documentation

◆ $allowMove

bool ilTextWizardInputGUI::$allowMove = false
protected

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

Referenced by getAllowMove().

◆ $tpl

ilGlobalTemplateInterface ilTextWizardInputGUI::$tpl
protected

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

Referenced by ilSelectBuilderInputGUI\insert(), and render().

◆ $values

array ilTextWizardInputGUI::$values = array()
protected

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

Referenced by getValues().


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