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

This class represents a non editable value in a property form. More...

+ Inheritance diagram for ilNonEditableValueGUI:
+ Collaboration diagram for ilNonEditableValueGUI:

Public Member Functions

 __construct (string $a_title="", string $a_id="", bool $a_disable_escaping=false)
 
 checkInput ()
 Check input, strip slashes etc. More...
 
 getInput ()
 
 getType ()
 
 setTitle (string $a_title)
 
 getTitle ()
 
 setInfo (string $a_info)
 
 getInfo ()
 
 setValue ($a_value)
 
 getValue ()
 
 render ()
 
 insert (ilTemplate $a_tpl)
 
 setValueByArray (array $a_values)
 
 getTableFilterHTML ()
 Get input item HTML to be inserted into table filters. More...
 
- 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...
 

Protected Member Functions

 setType (string $a_type)
 
- 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

 $value = null
 
string $section_icon = ""
 
bool $disable_escaping = false
 
- 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...
 

Detailed Description

This class represents a non editable value in a property form.

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de
Deprecated:
12 This component will be removed with ILIAS 12

Definition at line 27 of file class.ilNonEditableValueGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilNonEditableValueGUI::__construct ( string  $a_title = "",
string  $a_id = "",
bool  $a_disable_escaping = false 
)

Definition at line 36 of file class.ilNonEditableValueGUI.php.

40 {
41 parent::__construct($a_title, $a_id);
42 $this->setTitle($a_title);
43 $this->setType("non_editable_value");
44 $this->disable_escaping = $a_disable_escaping;
45 }
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

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

+ Here is the call graph for this function:

Member Function Documentation

◆ checkInput()

ilNonEditableValueGUI::checkInput ( )

Check input, strip slashes etc.

set alert, if input is not ok.

Reimplemented from ilFormPropertyGUI.

Definition at line 47 of file class.ilNonEditableValueGUI.php.

47 : bool
48 {
49 return $this->checkSubItemsInput();
50 }

References ilSubEnabledFormPropertyGUI\checkSubItemsInput().

+ Here is the call graph for this function:

◆ getInfo()

ilNonEditableValueGUI::getInfo ( )

Reimplemented from ilFormPropertyGUI.

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

88 : string
89 {
90 return $this->info;
91 }

References ilFormPropertyGUI\$info.

◆ getInput()

ilNonEditableValueGUI::getInput ( )
Returns
array|string

Definition at line 55 of file class.ilNonEditableValueGUI.php.

56 {
57 if ($this->isRequestParamArray($this->getPostVar())) {
58 return $this->strArray($this->getPostVar());
59 }
60 return $this->str($this->getPostVar());
61 }

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

+ Here is the call graph for this function:

◆ getTableFilterHTML()

ilNonEditableValueGUI::getTableFilterHTML ( )

Get input item HTML to be inserted into table filters.

Implements ilTableFilterItem.

Definition at line 165 of file class.ilNonEditableValueGUI.php.

165 : string
166 {
167 $html = $this->render();
168 return $html;
169 }

References render().

+ Here is the call graph for this function:

◆ getTitle()

ilNonEditableValueGUI::getTitle ( )

Reimplemented from ilFormPropertyGUI.

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

78 : string
79 {
80 return $this->title;
81 }

References ilFormPropertyGUI\$title.

◆ getType()

ilNonEditableValueGUI::getType ( )

Reimplemented from ilFormPropertyGUI.

Definition at line 68 of file class.ilNonEditableValueGUI.php.

68 : string
69 {
70 return $this->type;
71 }

References ilFormPropertyGUI\$type.

◆ getValue()

ilNonEditableValueGUI::getValue ( )
Returns
string|array

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

References $value.

Referenced by render().

+ Here is the caller graph for this function:

◆ insert()

ilNonEditableValueGUI::insert ( ilTemplate  $a_tpl)

Definition at line 148 of file class.ilNonEditableValueGUI.php.

148 : void
149 {
150 $a_tpl->setCurrentBlock("prop_generic");
151 $a_tpl->setVariable("PROP_GENERIC", $this->render());
152 $a_tpl->parseCurrentBlock();
153 }
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()

ilNonEditableValueGUI::render ( )

Definition at line 113 of file class.ilNonEditableValueGUI.php.

113 : string
114 {
115 $postvar = "";
116
117 $tpl = new ilTemplate("tpl.non_editable_value.html", true, true, "components/ILIAS/Form");
118 if ($this->getPostVar() != "") {
119 $postvar = $this->getPostVar();
120 if ($this->getMulti() && substr($postvar, -2) != "[]") {
121 $postvar .= "[]";
122 }
123
124 $tpl->setCurrentBlock("hidden");
125 $tpl->setVariable('NON_EDITABLE_ID', $postvar);
126 $tpl->setVariable('MULTI_HIDDEN_ID', $this->getFieldId());
127 $tpl->setVariable("HVALUE", ilLegacyFormElementsUtil::prepareFormOutput((string) $this->getValue()));
128 $tpl->parseCurrentBlock();
129 }
130 $value = $this->getValue();
131 if (!$this->disable_escaping) {
133 }
134 $tpl->setVariable("VALUE", $value);
135 if ($this->getFieldId() != "") {
136 $tpl->setVariable("ID", ' id="' . $this->getFieldId() . '" ');
137 }
138 $tpl->parseCurrentBlock();
139
140 if ($this->getMulti() && $postvar != "" && !$this->getDisabled()) {
141 $tpl->setVariable("MULTI_ICONS", $this->getMultiIconsHTML());
142 }
143
144
145 return $tpl->get();
146 }
static prepareFormOutput($a_str, bool $a_strip=false)
special template class to simplify handling of ITX/PEAR

References ilFormPropertyGUI\$postvar, $value, ilFormPropertyGUI\getDisabled(), ilFormPropertyGUI\getFieldId(), ilFormPropertyGUI\getMulti(), ilFormPropertyGUI\getMultiIconsHTML(), ilFormPropertyGUI\getPostVar(), getValue(), and ilLegacyFormElementsUtil\prepareFormOutput().

Referenced by getTableFilterHTML(), and insert().

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

◆ setInfo()

ilNonEditableValueGUI::setInfo ( string  $a_info)

Reimplemented from ilFormPropertyGUI.

Definition at line 83 of file class.ilNonEditableValueGUI.php.

83 : void
84 {
85 $this->info = $a_info;
86 }

References ILIAS\UI\examples\MessageBox\Info\info().

+ Here is the call graph for this function:

◆ setTitle()

ilNonEditableValueGUI::setTitle ( string  $a_title)

Reimplemented from ilFormPropertyGUI.

Definition at line 73 of file class.ilNonEditableValueGUI.php.

73 : void
74 {
75 $this->title = $a_title;
76 }

Referenced by __construct().

+ Here is the caller graph for this function:

◆ setType()

ilNonEditableValueGUI::setType ( string  $a_type)
protected

Reimplemented from ilFormPropertyGUI.

Definition at line 63 of file class.ilNonEditableValueGUI.php.

63 : void
64 {
65 $this->type = $a_type;
66 }

Referenced by __construct().

+ Here is the caller graph for this function:

◆ setValue()

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

Definition at line 96 of file class.ilNonEditableValueGUI.php.

96 : void
97 {
98 if ($this->getMulti() && is_array($a_value)) {
99 $this->setMultiValues($a_value);
100 $a_value = array_shift($a_value);
101 }
102 $this->value = $a_value;
103 }
setMultiValues(array $a_values)

References ilFormPropertyGUI\getMulti(), and ilFormPropertyGUI\setMultiValues().

Referenced by setValueByArray().

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

◆ setValueByArray()

ilNonEditableValueGUI::setValueByArray ( array  $a_values)

Definition at line 155 of file class.ilNonEditableValueGUI.php.

155 : void
156 {
157 if ($this->getPostVar() && isset($a_values[$this->getPostVar()])) {
158 $this->setValue($a_values[$this->getPostVar()]);
159 }
160 foreach ($this->getSubItems() as $item) {
161 $item->setValueByArray($a_values);
162 }
163 }

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

+ Here is the call graph for this function:

Field Documentation

◆ $disable_escaping

bool ilNonEditableValueGUI::$disable_escaping = false
protected

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

◆ $section_icon

string ilNonEditableValueGUI::$section_icon = ""
protected

Definition at line 33 of file class.ilNonEditableValueGUI.php.

◆ $value

ilNonEditableValueGUI::$value = null
protected

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

Referenced by getValue(), and render().


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