ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilTextWizardInputGUI Class Reference

This class represents a text wizard property in a property form. 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
 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)
 

Detailed Description

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
Deprecated:
12 This component will be removed with ILIAS 12

Definition at line 27 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 33 of file class.ilTextWizardInputGUI.php.

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

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 73 of file class.ilTextWizardInputGUI.php.

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

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

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 101 of file class.ilTextWizardInputGUI.php.

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

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 58 of file class.ilTextWizardInputGUI.php.

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

References $values.

◆ insert()

ilTextWizardInputGUI::insert ( ilTemplate  $a_tpl)

Reimplemented from ilTextInputGUI.

Reimplemented in ilSelectBuilderInputGUI.

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

106 : void
107 {
108 $a_tpl->setCurrentBlock("prop_generic");
109 $a_tpl->setVariable("PROP_GENERIC", $this->render());
110 $a_tpl->parseCurrentBlock();
111 }
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:544
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 113 of file class.ilTextWizardInputGUI.php.

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

References $tpl, ilTextInputGUI\$value, ILIAS\UICore\GlobalTemplate\get(), getAllowMove(), ilFormPropertyGUI\getDisabled(), ilFormPropertyGUI\getFieldId(), ilTextInputGUI\getMaxLength(), ilFormPropertyGUI\getPostVar(), ilTextInputGUI\getSize(), ILIAS\UICore\GlobalTemplate\parseCurrentBlock(), ilLegacyFormElementsUtil\prepareFormOutput(), render(), ILIAS\UICore\GlobalTemplate\setCurrentBlock(), ILIAS\UICore\GlobalTemplate\setVariable(), and ilFormPropertyGUI\symbol().

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

+ 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 63 of file class.ilTextWizardInputGUI.php.

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

◆ setValue()

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

Reimplemented from ilTextInputGUI.

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

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

◆ setValues()

ilTextWizardInputGUI::setValues ( array  $a_values)

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

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

Field Documentation

◆ $allowMove

bool ilTextWizardInputGUI::$allowMove = false
protected

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

Referenced by getAllowMove().

◆ $tpl

ilGlobalTemplateInterface ilTextWizardInputGUI::$tpl
protected

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

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

◆ $values

array ilTextWizardInputGUI::$values = array()
protected

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

Referenced by getValues().


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