ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
ilTermsOfServiceUserHasGlobalRoleCriterionGUI Class Reference

Class ilTermsOfServiceUserHasGlobalRoleCriterionGUI. More...

+ Inheritance diagram for ilTermsOfServiceUserHasGlobalRoleCriterionGUI:
+ Collaboration diagram for ilTermsOfServiceUserHasGlobalRoleCriterionGUI:

Public Member Functions

 __construct (ilTermsOfServiceUserHasGlobalRoleCriterion $type, ilLanguage $lng, ilRbacReview $rbacReview, ilObjectDataCache $objectCache)
 ilTermsOfServiceUserHasGlobalRoleCriterionGUI constructor. More...
 
 appendOption (ilRadioGroupInputGUI $group, ilTermsOfServiceCriterionConfig $config)
 
Parameters
ilRadioGroupInputGUI$option
ilTermsOfServiceCriterionConfig$config
More...
 
 getConfigByForm (ilPropertyFormGUI $form)
 
Parameters
ilPropertyFormGUI$form
Returns
ilTermsOfServiceCriterionConfig
More...
 
 getIdentPresentation ()
 
Returns
string
More...
 
 getValuePresentation (ilTermsOfServiceCriterionConfig $config, Factory $uiFactory)
 
Parameters
ilTermsOfServiceCriterionConfig$config
Factory$uiFactory
Returns
Component
More...
 

Protected Attributes

 $type
 
 $rbacReview
 
 $lng
 
 $objectCache
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

Member Function Documentation

◆ appendOption()

ilTermsOfServiceUserHasGlobalRoleCriterionGUI::appendOption ( ilRadioGroupInputGUI  $group,
ilTermsOfServiceCriterionConfig  $config 
)

Parameters
ilRadioGroupInputGUI$option
ilTermsOfServiceCriterionConfig$config

Implements ilTermsOfServiceCriterionTypeGUI.

Definition at line 57 of file class.ilTermsOfServiceUserHasGlobalRoleCriterionGUI.php.

References ilRadioGroupInputGUI\addOption(), getIdentPresentation(), and ilRadioOption\setInfo().

57  : void
58  {
59  $option = new ilRadioOption($this->getIdentPresentation(), $this->type->getTypeIdent());
60  $option->setInfo($this->lng->txt('tos_crit_type_usr_global_role_info'));
61 
62  $roleSelection = new ilSelectInputGUI(
63  $this->lng->txt('perm_global_role'),
64  $this->type->getTypeIdent() . '_role_id'
65  );
66  $roleSelection->setRequired(true);
67 
68  $options = [];
69  foreach ($this->rbacReview->getGlobalRoles() as $roleId) {
70  $options[$roleId] = $this->objectCache->lookupTitle($roleId);
71  }
72 
73  asort($options);
74 
75  $roleSelection->setOptions(['' => $this->lng->txt('please_choose')] + $options);
76  $roleSelection->setValue((int) ($config['role_id'] ?? 0));
77 
78  $option->addSubItem($roleSelection);
79 
80  $group->addOption($option);
81  }
This class represents an option in a radio group.
setInfo($a_info)
Set Info.
addOption($a_option)
Add Option.
+ Here is the call graph for this function:

◆ getConfigByForm()

ilTermsOfServiceUserHasGlobalRoleCriterionGUI::getConfigByForm ( ilPropertyFormGUI  $form)

Parameters
ilPropertyFormGUI$form
Returns
ilTermsOfServiceCriterionConfig

Implements ilTermsOfServiceCriterionTypeGUI.

Definition at line 86 of file class.ilTermsOfServiceUserHasGlobalRoleCriterionGUI.php.

References $config, and ilPropertyFormGUI\getInput().

87  {
89  'role_id' => (int) $form->getInput($this->type->getTypeIdent() . '_role_id')
90  ]);
91 
92  return $config;
93  }
if(!array_key_exists('PATH_INFO', $_SERVER)) $config
Definition: metadata.php:68
Class ilTermsOfServiceCriterionConfig.
getInput($a_post_var, $ensureValidation=true)
Returns the value of a HTTP-POST variable, identified by the passed id.
+ Here is the call graph for this function:

◆ getIdentPresentation()

ilTermsOfServiceUserHasGlobalRoleCriterionGUI::getIdentPresentation ( )

Returns
string

Implements ilTermsOfServiceCriterionTypeGUI.

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

Referenced by appendOption().

98  : string
99  {
100  return $this->lng->txt('tos_crit_type_usr_global_role');
101  }
+ Here is the caller graph for this function:

◆ getValuePresentation()

ilTermsOfServiceUserHasGlobalRoleCriterionGUI::getValuePresentation ( ilTermsOfServiceCriterionConfig  $config,
Factory  $uiFactory 
)

Parameters
ilTermsOfServiceCriterionConfig$config
Factory$uiFactory
Returns
Component

Implements ilTermsOfServiceCriterionTypeGUI.

Definition at line 106 of file class.ilTermsOfServiceUserHasGlobalRoleCriterionGUI.php.

References ILIAS\UI\Factory\legacy().

106  : Component
107  {
108  $roleId = $config['role_id'] ?? 0;
109 
110  if (!is_numeric($roleId) || $roleId < 1 || is_float($roleId)) {
111  return $uiFactory->legacy('');
112  }
113 
114  return $uiFactory->legacy($this->objectCache->lookupTitle($roleId));
115  }
legacy($content)
description: purpose: > This component is used to wrap an existing ILIAS UI element into a UI compon...
+ Here is the call graph for this function:

Field Documentation

◆ $lng

ilTermsOfServiceUserHasGlobalRoleCriterionGUI::$lng
protected

Definition at line 26 of file class.ilTermsOfServiceUserHasGlobalRoleCriterionGUI.php.

Referenced by __construct().

◆ $objectCache

ilTermsOfServiceUserHasGlobalRoleCriterionGUI::$objectCache
protected

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

Referenced by __construct().

◆ $rbacReview

ilTermsOfServiceUserHasGlobalRoleCriterionGUI::$rbacReview
protected

Definition at line 21 of file class.ilTermsOfServiceUserHasGlobalRoleCriterionGUI.php.

Referenced by __construct().

◆ $type

ilTermsOfServiceUserHasGlobalRoleCriterionGUI::$type
protected

Definition at line 16 of file class.ilTermsOfServiceUserHasGlobalRoleCriterionGUI.php.

Referenced by __construct().


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