51 $this->lng->loadLanguageModule(
'rbac');
60 $option->setInfo($this->lng->txt(
'tos_crit_type_usr_global_role_info'));
62 $roleSelection = new \ilSelectInputGUI(
63 $this->lng->txt(
'perm_global_role'),
64 $this->type->getTypeIdent() .
'_role_id' 66 $roleSelection->setRequired(
true);
69 foreach ($this->rbacReview->getGlobalRoles() as $roleId) {
70 $options[$roleId] = $this->objectCache->lookupTitle($roleId);
75 $roleSelection->setOptions([
'' => $this->lng->txt(
'please_choose')] +
$options);
76 $roleSelection->setValue((
int) ($config[
'role_id'] ?? 0));
78 $option->addSubItem($roleSelection);
88 $config = new \ilTermsOfServiceCriterionConfig([
89 'role_id' => (
int) $form->
getInput($this->type->getTypeIdent() .
'_role_id')
100 return $this->lng->txt(
'tos_crit_type_usr_global_role');
108 $roleId = $config[
'role_id'] ?? 0;
110 if (!is_numeric($roleId) || $roleId < 1 || is_float($roleId)) {
111 return $uiFactory->
legacy(
'');
114 return $uiFactory->
legacy($this->objectCache->lookupTitle($roleId));
getConfigByForm(\ilPropertyFormGUI $form)
getIdentPresentation()
string
Interface ilTermsOfServiceCriterionTypeGUI.
Class ilTermsOfServiceUserHasGlobalRoleCriterion.
getValuePresentation(\ilTermsOfServiceCriterionConfig $config, Factory $uiFactory)
Component
Class ilTermsOfServiceCriterionConfig.
if(isset($_POST['submit'])) $form
This is how the factory for UI elements looks.
legacy($content)
description: purpose: > This component is used to wrap an existing ILIAS UI element into a UI compon...
Class ilTermsOfServiceUserHasGlobalRoleCriterionGUI.
__construct(\ilTermsOfServiceUserHasGlobalRoleCriterion $type, \ilLanguage $lng, \ilRbacReview $rbacReview, \ilObjectDataCache $objectCache)
ilTermsOfServiceUserHasGlobalRoleCriterionGUI constructor.
appendOption(\ilRadioGroupInputGUI $group, \ilTermsOfServiceCriterionConfig $config)
class ilRbacReview Contains Review functions of core Rbac.