1<?
php declare(strict_types=1);
51 $this->lng->loadLanguageModule(
'rbac');
60 $option->setInfo($this->lng->txt(
'tos_crit_type_usr_global_role_info'));
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);
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));
An exception for terminatinating execution or to throw for unit testing.
This class represents an option in a radio group.
class ilRbacReview Contains Review functions of core Rbac.
Class ilTermsOfServiceCriterionConfig.
Class ilTermsOfServiceUserHasGlobalRoleCriterionGUI.
appendOption(ilRadioGroupInputGUI $group, ilTermsOfServiceCriterionConfig $config)
__construct(ilTermsOfServiceUserHasGlobalRoleCriterion $type, ilLanguage $lng, ilRbacReview $rbacReview, ilObjectDataCache $objectCache)
ilTermsOfServiceUserHasGlobalRoleCriterionGUI constructor.
getIdentPresentation()
string
getConfigByForm(ilPropertyFormGUI $form)
ilTermsOfServiceCriterionConfig
getValuePresentation(ilTermsOfServiceCriterionConfig $config, Factory $uiFactory)
Component
Class ilTermsOfServiceUserHasGlobalRoleCriterion.
A component is the most general form of an entity in the UI.
This is how the factory for UI elements looks.
Interface ilTermsOfServiceCriterionTypeGUI.