ILIAS  release_8 Revision v8.24
ilNonEditableValueGUI 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 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
 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 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 non editable value in a property form.

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

Definition at line 26 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 35 of file class.ilNonEditableValueGUI.php.

39 {
40 parent::__construct($a_title, $a_id);
41 $this->setTitle($a_title);
42 $this->setType("non_editable_value");
43 $this->disable_escaping = $a_disable_escaping;
44 }
__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 46 of file class.ilNonEditableValueGUI.php.

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

References ilSubEnabledFormPropertyGUI\checkSubItemsInput().

+ Here is the call graph for this function:

◆ getInfo()

ilNonEditableValueGUI::getInfo ( )

Reimplemented from ilFormPropertyGUI.

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

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

References ilFormPropertyGUI\$info.

◆ getInput()

ilNonEditableValueGUI::getInput ( )
Returns
array|string

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

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

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 164 of file class.ilNonEditableValueGUI.php.

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

References render().

+ Here is the call graph for this function:

◆ getTitle()

ilNonEditableValueGUI::getTitle ( )

Reimplemented from ilFormPropertyGUI.

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

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

References ilFormPropertyGUI\$title.

◆ getType()

ilNonEditableValueGUI::getType ( )

Reimplemented from ilFormPropertyGUI.

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

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

References ilFormPropertyGUI\$type.

◆ getValue()

ilNonEditableValueGUI::getValue ( )
Returns
string|array

Definition at line 107 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 147 of file class.ilNonEditableValueGUI.php.

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

ilNonEditableValueGUI::render ( )

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

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

References ilFormPropertyGUI\$postvar, $tpl, $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 82 of file class.ilNonEditableValueGUI.php.

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

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 72 of file class.ilNonEditableValueGUI.php.

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

Referenced by __construct().

+ Here is the caller graph for this function:

◆ setType()

ilNonEditableValueGUI::setType ( string  $a_type)
protected

Reimplemented from ilFormPropertyGUI.

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

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

Referenced by __construct().

+ Here is the caller graph for this function:

◆ setValue()

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

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

95 : void
96 {
97 if ($this->getMulti() && is_array($a_value)) {
98 $this->setMultiValues($a_value);
99 $a_value = array_shift($a_value);
100 }
101 $this->value = $a_value;
102 }
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 154 of file class.ilNonEditableValueGUI.php.

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

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 33 of file class.ilNonEditableValueGUI.php.

◆ $section_icon

string ilNonEditableValueGUI::$section_icon = ""
protected

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

◆ $value

ilNonEditableValueGUI::$value = null
protected

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

Referenced by getValue(), and render().


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