ILIAS  trunk Revision v11.0_alpha-1749-g1a06bdef097
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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 ()
 
 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)
 
- 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
 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

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.

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

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)
+ Here is the call graph for this function:

Member Function Documentation

◆ checkInput()

ilNonEditableValueGUI::checkInput ( )

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

References ilSubEnabledFormPropertyGUI\checkSubItemsInput().

46  : bool
47  {
48  return $this->checkSubItemsInput();
49  }
+ Here is the call graph for this function:

◆ getInfo()

ilNonEditableValueGUI::getInfo ( )

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

References ilFormPropertyGUI\$info.

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

◆ getInput()

ilNonEditableValueGUI::getInput ( )
Returns
array|string

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

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

55  {
56  if ($this->isRequestParamArray($this->getPostVar())) {
57  return $this->strArray($this->getPostVar());
58  }
59  return $this->str($this->getPostVar());
60  }
+ 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.

References render().

164  : string
165  {
166  $html = $this->render();
167  return $html;
168  }
+ Here is the call graph for this function:

◆ getTitle()

ilNonEditableValueGUI::getTitle ( )

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

References ilFormPropertyGUI\$title.

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

◆ getType()

ilNonEditableValueGUI::getType ( )

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

References ilFormPropertyGUI\$type.

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

◆ getValue()

ilNonEditableValueGUI::getValue ( )
Returns
string|array

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

References $value.

Referenced by render().

108  {
109  return $this->value;
110  }
+ Here is the caller graph for this function:

◆ insert()

ilNonEditableValueGUI::insert ( ilTemplate  $a_tpl)

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

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

147  : void
148  {
149  $a_tpl->setCurrentBlock("prop_generic");
150  $a_tpl->setVariable("PROP_GENERIC", $this->render());
151  $a_tpl->parseCurrentBlock();
152  }
parseCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:544
setCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
+ Here is the call graph for this function:

◆ render()

ilNonEditableValueGUI::render ( )

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

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

Referenced by getTableFilterHTML(), and insert().

112  : string
113  {
114  $postvar = "";
115 
116  $tpl = new ilTemplate("tpl.non_editable_value.html", true, true, "components/ILIAS/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)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setInfo()

ilNonEditableValueGUI::setInfo ( string  $a_info)

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

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

82  : void
83  {
84  $this->info = $a_info;
85  }
info()
description: > Example for rendering a info message box.
Definition: info.php:34
+ Here is the call graph for this function:

◆ setTitle()

ilNonEditableValueGUI::setTitle ( string  $a_title)

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

Referenced by __construct().

72  : void
73  {
74  $this->title = $a_title;
75  }
+ Here is the caller graph for this function:

◆ setType()

ilNonEditableValueGUI::setType ( string  $a_type)
protected

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

Referenced by __construct().

62  : void
63  {
64  $this->type = $a_type;
65  }
+ 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.

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

Referenced by setValueByArray().

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)
+ 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.

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

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  }
+ 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: