ILIAS  release_7 Revision v7.30-3-g800a261c036
ilRadioGroupInputGUI Class Reference

This class represents a property in a property form. More...

+ Inheritance diagram for ilRadioGroupInputGUI:
+ Collaboration diagram for ilRadioGroupInputGUI:

Public Member Functions

 __construct ($a_title="", $a_postvar="")
 Constructor. More...
 
 addOption ($a_option)
 Add Option. More...
 
 getOptions ()
 Get Options. More...
 
 setValue ($a_value)
 Set Value. More...
 
 getValue ()
 Get Value. More...
 
 setValueByArray ($a_values)
 Set value by array. More...
 
 checkInput ()
 Check input, strip slashes etc. More...
 
 insert ($a_tpl)
 Insert property html. More...
 
 render ()
 Insert property html. More...
 
 getItemByPostVar ($a_post_var)
 Get item by post var. More...
 
 getTableFilterHTML ()
 Get input item HTML to be inserted into table filters. More...
 
 getFormLabelFor ()
 @inheritDoc More...
 
- Public Member Functions inherited from ilSubEnabledFormPropertyGUI
 addSubItem ($a_item)
 Add Subitem. More...
 
 getSubItems ()
 Get Subitems. More...
 
 getSubInputItemsRecursive ()
 returns a flat array of possibly existing subitems recursively More...
 
 checkSubItemsInput ()
 Check SubItems. More...
 
 getSubForm ()
 Get sub form html. More...
 
 getItemByPostVar ($a_post_var)
 Get item by post var. More...
 
- Public Member Functions inherited from ilFormPropertyGUI
 __construct ($a_title="", $a_postvar="")
 Constructor. More...
 
 executeCommand ()
 Execute command. More...
 
 getType ()
 Get Type. More...
 
 setTitle ($a_title)
 Set Title. More...
 
 getTitle ()
 Get Title. More...
 
 setPostVar ($a_postvar)
 Set Post Variable. More...
 
 getPostVar ()
 Get Post Variable. More...
 
 getFieldId ()
 Get Post Variable. More...
 
 setInfo ($a_info)
 Set Information Text. More...
 
 getInfo ()
 Get Information Text. More...
 
 setAlert ($a_alert)
 Set Alert Text. More...
 
 getAlert ()
 Get Alert Text. More...
 
 setRequired ($a_required)
 Set Required. More...
 
 getRequired ()
 Get Required. More...
 
 setDisabled ($a_disabled)
 Set Disabled. More...
 
 getDisabled ()
 Get Disabled. More...
 
 checkInput ()
 Check input, strip slashes etc. More...
 
 setParentForm ($a_parentform)
 Set Parent Form. More...
 
 getParentForm ()
 Get Parent Form. More...
 
 setParent ($a_val)
 Set Parent GUI object. More...
 
 getParent ()
 Get Parent GUI object. More...
 
 getSubForm ()
 Get sub form html. More...
 
 hideSubForm ()
 Sub form hidden on init? More...
 
 setHiddenTitle ($a_val)
 Set hidden title (for screenreaders) More...
 
 getHiddenTitle ()
 Get hidden title. More...
 
 getItemByPostVar ($a_post_var)
 Get item by post var. More...
 
 serializeData ()
 serialize data More...
 
 unserializeData ($a_data)
 unserialize data More...
 
 writeToSession ()
 Write to session. More...
 
 clearFromSession ()
 Clear session value. More...
 
 readFromSession ()
 Read from session. More...
 
 getHiddenTag ($a_post_var, $a_value)
 Get hidden tag (used for disabled properties) More...
 
 setMulti ($a_multi, $a_sortable=false, $a_addremove=true)
 Set Multi. More...
 
 getMulti ()
 Get Multi. More...
 
 setMultiValues (array $a_values)
 Set multi values. More...
 
 getMultiValues ()
 Get multi values. More...
 
 getContentOutsideFormTag ()
 Get content that has to reside outside of the parent form tag, e.g. More...
 
 stripSlashesAddSpaceFallback ($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...
 
- 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 Attributes

 $options = array()
 
 $value
 
- Protected Attributes inherited from ilSubEnabledFormPropertyGUI
 $sub_items = array()
 
- Protected Attributes inherited from ilFormPropertyGUI
 $ctrl
 
 $lng
 
 $type
 
 $title
 
 $postvar
 
 $info
 
 $alert
 
 $required = false
 
 $parentgui
 
 $parentform
 
 $hidden_title = ""
 
 $multi = false
 
 $multi_sortable = false
 
 $multi_addremove = true
 
 $multi_values
 

Additional Inherited Members

- Static Public Member Functions inherited from ilFormPropertyGUI
static removeProhibitedCharacters ($a_text)
 Remove prohibited characters see #19159. More...
 
- Protected Member Functions inherited from ilFormPropertyGUI
 setType ($a_type)
 Set Type. More...
 
 getMultiIconsHTML ()
 Get HTML for multiple value icons. More...
 

Detailed Description

This class represents a property in a property form.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

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

Constructor & Destructor Documentation

◆ __construct()

ilRadioGroupInputGUI::__construct (   $a_title = "",
  $a_postvar = "" 
)

Constructor.

Parameters
string$a_titleTitle
string$a_postvarPost Variable

Reimplemented from ilFormPropertyGUI.

Reimplemented in ilCharSelectorRadioGroupInputGUI.

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

45 {
46 global $DIC;
47
48 $this->lng = $DIC->language();
49 parent::__construct($a_title, $a_postvar);
50 $this->setType("radio");
51 }
setType($a_type)
Set Type.
global $DIC
Definition: goto.php:24
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), and ilFormPropertyGUI\setType().

+ Here is the call graph for this function:

Member Function Documentation

◆ addOption()

ilRadioGroupInputGUI::addOption (   $a_option)

◆ checkInput()

ilRadioGroupInputGUI::checkInput ( )

Check input, strip slashes etc.

set alert, if input is not ok.

Returns
boolean Input ok, true/false

Reimplemented from ilFormPropertyGUI.

Reimplemented in ilIncomingMailInputGUI, and ilCharSelectorRadioGroupInputGUI.

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

114 {
116
117 $_POST[$this->getPostVar()] =
119 if ($this->getRequired() && trim($_POST[$this->getPostVar()]) == "") {
120 $this->setAlert($lng->txt("msg_input_is_required"));
121
122 return false;
123 }
124
125 $ok = true;
126 foreach ($this->getOptions() as $option) {
127 foreach ($option->getSubItems() as $item) {
128 if ($_POST[$this->getPostVar()] == $option->getValue()) {
129 if (!$item->checkInput()) {
130 $ok = false;
131 }
132 }
133 }
134 }
135 return $ok;
136 }
$_POST["username"]
getPostVar()
Get Post Variable.
setAlert($a_alert)
Set Alert Text.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled

References $_POST, ilFormPropertyGUI\$lng, $ok, getOptions(), ilFormPropertyGUI\getPostVar(), ilFormPropertyGUI\getRequired(), ilFormPropertyGUI\setAlert(), and ilUtil\stripSlashes().

+ Here is the call graph for this function:

◆ getFormLabelFor()

ilRadioGroupInputGUI::getFormLabelFor ( )

@inheritDoc

Reimplemented from ilFormPropertyGUI.

Definition at line 272 of file class.ilRadioGroupInputGUI.php.

273 {
274 return "";
275 }

◆ getItemByPostVar()

ilRadioGroupInputGUI::getItemByPostVar (   $a_post_var)

Get item by post var.

Returns
mixed false or item object

Reimplemented from ilSubEnabledFormPropertyGUI.

Reimplemented in ilIncomingMailInputGUI.

Definition at line 226 of file class.ilRadioGroupInputGUI.php.

227 {
228 if ($this->getPostVar() == $a_post_var) {
229 return $this;
230 }
231
232 foreach ($this->getOptions() as $option) {
233 foreach ($option->getSubItems() as $item) {
234 if ($item->getType() != "section_header") {
235 $ret = $item->getItemByPostVar($a_post_var);
236 if (is_object($ret)) {
237 return $ret;
238 }
239 }
240 }
241 }
242
243 return false;
244 }
$ret
Definition: parser.php:6

References $ret, getOptions(), and ilFormPropertyGUI\getPostVar().

+ Here is the call graph for this function:

◆ getOptions()

ilRadioGroupInputGUI::getOptions ( )

Get Options.

Returns
array Array of RadioOption objects

Reimplemented in ilIncomingMailInputGUI.

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

References $options.

Referenced by checkInput(), getItemByPostVar(), render(), and setValueByArray().

+ Here is the caller graph for this function:

◆ getTableFilterHTML()

ilRadioGroupInputGUI::getTableFilterHTML ( )

Get input item HTML to be inserted into table filters.

Returns
string

Implements ilTableFilterItem.

Definition at line 246 of file class.ilRadioGroupInputGUI.php.

247 {
248 return $this->render();
249 }
render()
Insert property html.

References render().

+ Here is the call graph for this function:

◆ getValue()

ilRadioGroupInputGUI::getValue ( )

Get Value.

Returns
string Value

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

References $value.

Referenced by render().

+ Here is the caller graph for this function:

◆ insert()

ilRadioGroupInputGUI::insert (   $a_tpl)

Insert property html.

Returns
int Size

Definition at line 143 of file class.ilRadioGroupInputGUI.php.

144 {
145 $html = $this->render();
146
147 $a_tpl->setCurrentBlock("prop_generic");
148 $a_tpl->setVariable("PROP_GENERIC", $html);
149 $a_tpl->parseCurrentBlock();
150 }

References render().

+ Here is the call graph for this function:

◆ render()

ilRadioGroupInputGUI::render ( )

Insert property html.

Reimplemented in ilIncomingMailInputGUI.

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

156 {
157 $tpl = new ilTemplate("tpl.prop_radio.html", true, true, "Services/Form");
158
159 foreach ($this->getOptions() as $option) {
160 // information text for option
161 if ($option->getInfo() != "") {
162 $tpl->setCurrentBlock("radio_option_desc");
163 $tpl->setVariable("RADIO_OPTION_DESC", $option->getInfo());
164 $tpl->parseCurrentBlock();
165 }
166
167
168 if (count($option->getSubItems()) > 0) {
169 if ($option->getValue() != $this->getValue()) {
170 // #10930
171 $tpl->setCurrentBlock("prop_radio_opt_hide");
172 $tpl->setVariable("HOP_ID", $this->getFieldId() . "_" . $option->getValue());
173 $tpl->parseCurrentBlock();
174 }
175 $tpl->setCurrentBlock("radio_option_subform");
176 $pf = new ilPropertyFormGUI();
177 $pf->setMode("subform");
178 $pf->setItems($option->getSubItems());
179 $tpl->setVariable("SUB_FORM", $pf->getContent());
180 $tpl->setVariable("SOP_ID", $this->getFieldId() . "_" . $option->getValue());
181 if ($pf->getMultipart()) {
182 $this->getParentForm()->setMultipart(true);
183 }
184 $tpl->parseCurrentBlock();
185 if ($pf->getMultipart()) {
186 $this->getParentForm()->setMultipart(true);
187 }
188 }
189
190 $tpl->setCurrentBlock("prop_radio_option");
191 $tpl->setVariable("POST_VAR", $this->getPostVar());
192 $tpl->setVariable("VAL_RADIO_OPTION", $option->getValue());
193 $tpl->setVariable("OP_ID", $this->getFieldId() . "_" . $option->getValue());
194 $tpl->setVariable("FID", $this->getFieldId());
195 if ($this->getDisabled() or $option->getDisabled()) {
196 $tpl->setVariable('DISABLED', 'disabled="disabled" ');
197 }
198 if ($option->getValue() == $this->getValue()) {
199 $tpl->setVariable(
200 "CHK_RADIO_OPTION",
201 'checked="checked"'
202 );
203 }
204 $tpl->setVariable("TXT_RADIO_OPTION", $option->getTitle());
205
206
207 $tpl->parseCurrentBlock();
208 }
209 $tpl->setVariable("ID", $this->getFieldId());
210
211 if ($this->getDisabled()) {
212 $tpl->setVariable(
213 "HIDDEN_INPUT",
214 $this->getHiddenTag($this->getPostVar(), $this->getValue())
215 );
216 }
217
218 return $tpl->get();
219 }
getParentForm()
Get Parent Form.
getHiddenTag($a_post_var, $a_value)
Get hidden tag (used for disabled properties)
getFieldId()
Get Post Variable.
This class represents a property form user interface.
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 $tpl, ilFormPropertyGUI\getDisabled(), ilFormPropertyGUI\getFieldId(), ilFormPropertyGUI\getHiddenTag(), getOptions(), ilFormPropertyGUI\getParentForm(), ilFormPropertyGUI\getPostVar(), and getValue().

Referenced by getTableFilterHTML(), and insert().

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

◆ setValue()

ilRadioGroupInputGUI::setValue (   $a_value)

Set Value.

Parameters
string$a_valueValue

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

79 {
80 $this->value = $a_value;
81 }

Referenced by ilCmiXapiLP\initModeOptions(), and setValueByArray().

+ Here is the caller graph for this function:

◆ setValueByArray()

ilRadioGroupInputGUI::setValueByArray (   $a_values)

Set value by array.

Parameters
array$a_valuesvalue array

Reimplemented in ilIncomingMailInputGUI.

Definition at line 98 of file class.ilRadioGroupInputGUI.php.

99 {
100 $this->setValue($a_values[$this->getPostVar()]);
101 foreach ($this->getOptions() as $option) {
102 foreach ($option->getSubItems() as $item) {
103 $item->setValueByArray($a_values);
104 }
105 }
106 }

References getOptions(), ilFormPropertyGUI\getPostVar(), and setValue().

+ Here is the call graph for this function:

Field Documentation

◆ $options

ilRadioGroupInputGUI::$options = array()
protected

Definition at line 35 of file class.ilRadioGroupInputGUI.php.

Referenced by getOptions().

◆ $value

ilRadioGroupInputGUI::$value
protected

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

Referenced by getValue().


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