ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 ()
 
- 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
 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

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

References $DIC, and ilFormPropertyGUI\setType().

45  {
46  global $DIC;
47 
48  $this->lng = $DIC->language();
49  parent::__construct($a_title, $a_postvar);
50  $this->setType("radio");
51  }
global $DIC
Definition: saml.php:7
setType($a_type)
Set Type.
+ Here is the call graph for this function:

Member Function Documentation

◆ addOption()

ilRadioGroupInputGUI::addOption (   $a_option)

Add Option.

Parameters
object$a_optionRadioOption object

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

Referenced by FormMailCodesGUI\__construct(), ilExerciseCertificateAdapter\addAdditionalFormElements(), ilTestCertificateAdapter\addAdditionalFormElements(), ilPhantomJSRenderer\addConfigElementsToForm(), ilTestExpressPageObjectGUI\addQuestion(), ilObjTestSettingsGeneralGUI\addQuestionBehaviourProperties(), ilObjTestGUI\addQuestionObject(), ilObjTestSettingsScoringResultsGUI\addScoringSettingsFormSection(), ilIncomingMailInputGUI\addSubOptions(), ilObjTestSettingsGeneralGUI\addTestFinishProperties(), ilObjTestSettingsGeneralGUI\addTestSequenceProperties(), ilTermsOfServiceUserHasLanguageCriterionGUI\appendOption(), ilTermsOfServiceUserHasGlobalRoleCriterionGUI\appendOption(), ilObjQuestionPoolGUI\buildCreateQuestionForm(), ilAssConfigurableMultiOptionQuestionFeedback\completeSpecificFormProperties(), ilSurveyConstraintsGUI\constraintForm(), ilObjTestGUI\createQuestionObject(), ilObjPersonalDesktopSettingsGUI\editSettings(), ilForumSettingsGUI\getCustomForm(), ilObjForumAdministrationGUI\getSettingsForm(), ilTrUserObjectsPropsTableGUI\initFilter(), ilRegistrationSettingsGUI\initForm(), ilObjStudyProgrammeAdminGUI\initFormSettings(), ilExAssignmentEditorGUI\initPeerReviewForm(), ilObjMediaCastGUI\initSettingsForm(), ilObjFileAccessSettingsGUI\initWebDAVSettingsForm(), ilPCQuestionGUI\insert(), assQuestionGUI\suggestedsolution(), and ilPCPlaceHolderGUI\textCOSelectionGUI().

59  {
60  $this->options[] = $a_option;
61  }
+ Here is the caller graph for this function:

◆ checkInput()

ilRadioGroupInputGUI::checkInput ( )

Check input, strip slashes etc.

set alert, if input is not ok.

Returns
boolean Input ok, true/false

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

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

114  {
115  $lng = $this->lng;
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  }
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
$_POST["username"]
+ Here is the call graph for this function:

◆ getFormLabelFor()

ilRadioGroupInputGUI::getFormLabelFor ( )

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

274  {
275  return "";
276  }

◆ getItemByPostVar()

ilRadioGroupInputGUI::getItemByPostVar (   $a_post_var)

Get item by post var.

Returns
mixed false or item object

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

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

229  {
230  if ($this->getPostVar() == $a_post_var) {
231  return $this;
232  }
233 
234  foreach ($this->getOptions() as $option) {
235  foreach ($option->getSubItems() as $item) {
236  if ($item->getType() != "section_header") {
237  $ret = $item->getItemByPostVar($a_post_var);
238  if (is_object($ret)) {
239  return $ret;
240  }
241  }
242  }
243  }
244 
245  return false;
246  }
getPostVar()
Get Post Variable.
$ret
Definition: parser.php:6
+ Here is the call graph for this function:

◆ getOptions()

ilRadioGroupInputGUI::getOptions ( )

Get Options.

Returns
array Array of RadioOption objects

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

References $options.

Referenced by checkInput(), getItemByPostVar(), getTableFilterHTML(), 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 248 of file class.ilRadioGroupInputGUI.php.

References getOptions(), ilSubEnabledFormPropertyGUI\getSubInputItemsRecursive(), and render().

249  {
250  return $this->render();
251  }
render()
Insert property html.
+ 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.

References $html, and render().

144  {
145  $html = $this->render();
146 
147  $a_tpl->setCurrentBlock("prop_generic");
148  $a_tpl->setVariable("PROP_GENERIC", $html);
149  $a_tpl->parseCurrentBlock();
150  }
render()
Insert property html.
$html
Definition: example_001.php:87
+ Here is the call graph for this function:

◆ render()

ilRadioGroupInputGUI::render ( )

Insert property html.

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

References $tpl, ilFormPropertyGUI\getDisabled(), ilFormPropertyGUI\getFieldId(), ilFormPropertyGUI\getHiddenTag(), getOptions(), ilFormPropertyGUI\getParentForm(), ilFormPropertyGUI\getPostVar(), and getValue().

Referenced by getTableFilterHTML(), and insert().

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  if (!$this->getDisabled()) {
192  $tpl->setVariable("POST_VAR", $this->getPostVar());
193  }
194  $tpl->setVariable("VAL_RADIO_OPTION", $option->getValue());
195  $tpl->setVariable("OP_ID", $this->getFieldId() . "_" . $option->getValue());
196  $tpl->setVariable("FID", $this->getFieldId());
197  if ($this->getDisabled() or $option->getDisabled()) {
198  $tpl->setVariable('DISABLED', 'disabled="disabled" ');
199  }
200  if ($option->getValue() == $this->getValue()) {
201  $tpl->setVariable(
202  "CHK_RADIO_OPTION",
203  'checked="checked"'
204  );
205  }
206  $tpl->setVariable("TXT_RADIO_OPTION", $option->getTitle());
207 
208 
209  $tpl->parseCurrentBlock();
210  }
211  $tpl->setVariable("ID", $this->getFieldId());
212 
213  if ($this->getDisabled()) {
214  $tpl->setVariable(
215  "HIDDEN_INPUT",
216  $this->getHiddenTag($this->getPostVar(), $this->getValue())
217  );
218  }
219 
220  return $tpl->get();
221  }
getHiddenTag($a_post_var, $a_value)
Get hidden tag (used for disabled properties)
This class represents a property form user interface.
$tpl
Definition: ilias.php:10
getPostVar()
Get Post Variable.
getParentForm()
Get Parent Form.
getFieldId()
Get Post Variable.
special template class to simplify handling of ITX/PEAR
+ 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.

Referenced by ilObjRemoteGlossaryGUI\addCustomEditForm(), ilObjRemoteLearningModuleGUI\addCustomEditForm(), ilObjRemoteWikiGUI\addCustomEditForm(), ilObjRemoteGroupGUI\addCustomEditForm(), ilObjRemoteTestGUI\addCustomEditForm(), ilObjRemoteCourseGUI\addCustomEditForm(), ilUserProfile\addStandardFieldsToForm(), ilTestRandomQuestionSetGeneralConfigFormGUI\build(), ilObjTestDynamicQuestionSetConfigGUI\buildForm(), ilObjSystemFolderGUI\checkObject(), ilECSMappingSettingsGUI\cInitMappingForm(), ilExSubmissionTeamGUI\createTeamObject(), ilSetupGUI\displaySessions(), ilPCResourcesGUI\edit(), ilForumSettingsGUI\getCustomForm(), ilObjUserGUI\getValues(), ilImageMapEditorGUI\initAreaEditingForm(), ilExAssignmentEditorGUI\initAssignmentForm(), ilECSSettingsGUI\initCategoryMappingForm(), ilObjPortfolioGUI\initCreateForm(), ilObjCourseGUI\initEditForm(), ilObjNotificationSettingsGUI\initForm(), ilUserProfileInfoSettingsGUI\initForm(), ilPCTabsGUI\initForm(), ilContainerReferenceGUI\initForm(), ilObjGroupGUI\initForm(), ilObjSessionGUI\initForm(), ilConditionHandlerGUI\initFormCondition(), ilAuthShibbolethSettingsGUI\initFormRoleAssignment(), ilRepositorySearchGUI\initFormSearch(), ilObjCalendarSettingsGUI\initFormSettings(), ilContainerGUI\initManualSortingOptionForm(), ilObjPortfolioGUI\initPDFSelectionForm(), ilWikiPageGUI\initPrintViewSelectionForm(), ilGlossaryPresentationGUI\initPrintViewSelectionForm(), ilLMPresentationGUI\initPrintViewSelectionForm(), ilObjContentObjectGUI\initPropertiesForm(), ilObjSurveyGUI\initPropertiesForm(), ilSetupGUI\initRegistrationForm(), ilOrgUnitGlobalSettingsGUI\initSettingsForm(), ilObjRepositorySettingsGUI\initSettingsForm(), ilOpenIdConnectSettingsGUI\initSettingsForm(), ilCalendarUserSettingsGUI\initSettingsForm(), ilECSSettingsGUI\initSettingsForm(), ilLOEditorGUI\initSettingsForm(), ilObjGlossaryGUI\initSettingsForm(), ilSearchBaseGUI\initStandardSearchForm(), ilObjSAHSLearningModuleGUI\initUploadForm(), ilMDEditorGUI\listQuickEditCopyright(), assImagemapQuestionGUI\populateQuestionSpecificFormPart(), ilStartUpGUI\purgePlaceholders(), setValueByArray(), and ilObjRoleGUI\showChangeExistingObjectsConfirmation().

79  {
80  $this->value = $a_value;
81  }
+ Here is the caller graph for this function:

◆ setValueByArray()

ilRadioGroupInputGUI::setValueByArray (   $a_values)

Set value by array.

Parameters
array$a_valuesvalue array

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

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

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  }
getPostVar()
Get Post Variable.
+ 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: