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));
An exception for terminatinating execution or to throw for unit testing.
class ilRbacReview Contains Review functions of core Rbac.
Class ilTermsOfServiceCriterionConfig.
Class ilTermsOfServiceUserHasGlobalRoleCriterionGUI.
getValuePresentation(\ilTermsOfServiceCriterionConfig $config, Factory $uiFactory)
Component
getConfigByForm(\ilPropertyFormGUI $form)
\ilTermsOfServiceCriterionConfig
getIdentPresentation()
string
appendOption(\ilRadioGroupInputGUI $group, \ilTermsOfServiceCriterionConfig $config)
__construct(\ilTermsOfServiceUserHasGlobalRoleCriterion $type, \ilLanguage $lng, \ilRbacReview $rbacReview, \ilObjectDataCache $objectCache)
ilTermsOfServiceUserHasGlobalRoleCriterionGUI constructor.
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.
if(isset($_POST['submit'])) $form