ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
ilRoleAssignmentTableGUI Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilRoleAssignmentTableGUI:
+ Collaboration diagram for ilRoleAssignmentTableGUI:

Public Member Functions

 __construct (object $a_parent_obj, string $a_parent_cmd)
 
 getPathGUI ()
 
 initFilter ()
 
 parse (int $usr_id)
 
- Public Member Functions inherited from ilTable2GUI
 __construct (?object $a_parent_obj, string $a_parent_cmd="", string $a_template_context="")
 
 setOpenFormTag (bool $a_val)
 
 getOpenFormTag ()
 
 setCloseFormTag (bool $a_val)
 
 getCloseFormTag ()
 
 determineLimit ()
 
 getSelectableColumns ()
 Get selectable columns. More...
 
 determineSelectedColumns ()
 
 isColumnSelected (string $col)
 
 getSelectedColumns ()
 
 resetOffset (bool $a_in_determination=false)
 
 initFilter ()
 
 getParentObject ()
 
 getParentCmd ()
 
 setTopAnchor (string $a_val)
 
 getTopAnchor ()
 
 setNoEntriesText (string $a_text)
 
 getNoEntriesText ()
 
 setIsDataTable (bool $a_val)
 
 getIsDataTable ()
 
 setEnableTitle (bool $a_enabletitle)
 
 getEnableTitle ()
 
 setEnableHeader (bool $a_enableheader)
 
 getEnableHeader ()
 
 setEnableNumInfo (bool $a_val)
 
 getEnableNumInfo ()
 
 setTitle (string $a_title, string $a_icon="", string $a_icon_alt="")
 
 setDescription (string $a_val)
 
 getDescription ()
 
 setOrderField (string $a_order_field)
 
 getOrderField ()
 
 setData (array $a_data)
 
 getData ()
 
 dataExists ()
 
 setPrefix (string $a_prefix)
 
 getPrefix ()
 
 addFilterItem (ilTableFilterItem $a_input_item, bool $a_optional=false)
 
 addFilterItemByMetaType (string $id, int $type=self::FILTER_TEXT, bool $a_optional=false, string $caption="")
 Add filter by standard type. More...
 
 getFilterItems (bool $a_optionals=false)
 
 getFilterItemByPostVar (string $a_post_var)
 
 setFilterCols (int $a_val)
 
 getFilterCols ()
 
 setDisableFilterHiding (bool $a_val=true)
 
 getDisableFilterHiding ()
 
 isFilterSelected (string $a_col)
 Is given filter selected? More...
 
 getSelectedFilters ()
 
 determineSelectedFilters ()
 
 setCustomPreviousNext (string $a_prev_link, string $a_next_link)
 
 setFormAction (string $a_form_action, bool $a_multipart=false)
 
 getFormAction ()
 
 setFormName (string $a_name="")
 
 getFormName ()
 
 setId (string $a_val)
 
 getId ()
 
 setDisplayAsBlock (bool $a_val)
 
 getDisplayAsBlock ()
 
 setSelectAllCheckbox (string $a_select_all_checkbox, bool $a_select_all_on_top=false)
 
 setExternalSorting (bool $a_val)
 
 getExternalSorting ()
 
 setFilterCommand (string $a_val, string $a_caption="")
 
 getFilterCommand ()
 
 setResetCommand (string $a_val, string $a_caption="")
 
 getResetCommand ()
 
 setExternalSegmentation (bool $a_val)
 
 getExternalSegmentation ()
 
 setRowTemplate (string $a_template, string $a_template_dir="")
 Set row template. More...
 
 setDefaultOrderField (string $a_defaultorderfield)
 
 getDefaultOrderField ()
 
 setDefaultOrderDirection (string $a_defaultorderdirection)
 
 getDefaultOrderDirection ()
 
 setDefaultFilterVisiblity (bool $a_status)
 
 getDefaultFilterVisibility ()
 
 clearCommandButtons ()
 
 addCommandButton (string $a_cmd, string $a_text, string $a_onclick='', string $a_id="", string $a_class="")
 
 addCommandButtonInstance (ilButtonBase $a_button)
 
 addMultiItemSelectionButton (string $a_sel_var, array $a_options, string $a_cmd, string $a_text, string $a_default_selection='')
 
 setCloseCommand (string $a_link)
 
 addMultiCommand (string $a_cmd, string $a_text)
 
 addHiddenInput (string $a_name, string $a_value)
 
 addHeaderCommand (string $a_href, string $a_text, string $a_target="", string $a_img="")
 
 setTopCommands (bool $a_val)
 
 getTopCommands ()
 
 addColumn (string $a_text, string $a_sort_field="", string $a_width="", bool $a_is_checkbox_action_column=false, string $a_class="", string $a_tooltip="", bool $a_tooltip_with_html=false)
 
 getNavParameter ()
 
 setOrderLink (string $key, string $order_dir)
 
 fillHeader ()
 
 determineOffsetAndOrder (bool $a_omit_offset=false)
 
 storeNavParameter ()
 
 getHTML ()
 Get HTML. More...
 
 numericOrdering (string $a_field)
 Should this field be sorted numeric? More...
 
 render ()
 
 writeFilterToSession ()
 
 resetFilter ()
 
 fillFooter ()
 
 getLinkbar (string $a_num)
 
 fillHiddenRow ()
 
 fillActionRow ()
 
 setHeaderHTML (string $html)
 
 storeProperty (string $type, string $value)
 
 loadProperty (string $type)
 
 getCurrentState ()
 get current settings for order, limit, columns and filter More...
 
 setContext (string $id)
 
 getContext ()
 
 setShowRowsSelector (bool $a_value)
 Toggle rows-per-page selector. More...
 
 getShowRowsSelector ()
 
 getLimit ()
 
 getOffset ()
 
 setExportFormats (array $formats)
 Set available export formats. More...
 
 setPrintMode (bool $a_value=false)
 
 getPrintMode ()
 
 getExportMode ()
 
 exportData (int $format, bool $send=false)
 Export and optionally send current table data. More...
 
 setEnableAllCommand (bool $a_value)
 
 setRowSelectorLabel (string $row_selector_label)
 
 getRowSelectorLabel ()
 
 setPreventDoubleSubmission (bool $a_val)
 
 getPreventDoubleSubmission ()
 
 setLimit (int $a_limit=0, int $a_default_limit=0)
 
- Public Member Functions inherited from ilTableGUI
 __construct (array $a_data=[], bool $a_global_tpl=true)
 
 setTemplate (ilTemplate $a_tpl)
 
 getTemplateObject ()
 
 setData (array $a_data)
 Set table data. More...
 
 getData ()
 
 setTitle (string $a_title, string $a_icon="", string $a_icon_alt="")
 
 setHelp (string $a_help_page, string $a_help_icon, string $a_help_icon_alt="")
 
 setHeaderNames (array $a_header_names)
 
 getColumnCount ()
 
 setHeaderVars (array $a_header_vars, array $a_header_params=[])
 
 setColumnWidth (array $a_column_width)
 set table column widths More...
 
 setOneColumnWidth (string $a_column_width, int $a_column_number)
 
 setMaxCount (int $a_max_count)
 set max. More...
 
 setLimit (int $a_limit=0, int $a_default_limit=0)
 set max. More...
 
 getLimit ()
 
 setPrefix (string $a_prefix)
 set prefix for sort and offset fields (if you have two or more tables on a page that you want to sort separately) More...
 
 setOffset (int $a_offset)
 set dataset offset More...
 
 getOffset ()
 
 setOrderColumn (string $a_order_column="", string $a_default_column="")
 
 getOrderColumn ()
 
 setOrderDirection (string $a_order_direction)
 
 getOrderDirection ()
 
 setFooter (string $a_style, string $a_previous="", string $a_next="")
 
 enable (string $a_module_name)
 
 disable (string $a_module_name)
 
 sortData ()
 
 render ()
 
 renderHeader ()
 
 setOrderLink (string $key, string $order_dir)
 
 setStyle (string $a_element, string $a_style)
 
 getStyle (string $a_element)
 
 setBase (string $a_base)
 
 getBase ()
 
 getFormName ()
 get the name of the parent form More...
 
 setFormName (string $a_name="cmd")
 
 getSelectAllCheckbox ()
 get the name of the checkbox that should be toggled with a select all button More...
 
 setSelectAllCheckbox (string $a_select_all_checkbox)
 
 clearActionButtons ()
 
 addActionButton (string $btn_name, string $btn_value)
 

Protected Member Functions

 fillRow (array $a_set)
 
 getTitleForReference (int $ref_id)
 
- Protected Member Functions inherited from ilTable2GUI
 getRequestedValues ()
 
 prepareOutput ()
 Anything that must be done before HTML is generated. More...
 
 isFilterVisible ()
 Check if filter is visible: manually shown (session, db) or default value set. More...
 
 isAdvMDFilter (ilAdvancedMDRecordGUI $a_gui, ilTableFilterItem $a_element)
 Check if filter element is based on adv md. More...
 
 fillRow (array $a_set)
 Standard Version of Fill Row. More...
 
 getFilterValue (ilTableFilterItem $a_item)
 Get current filter value. More...
 
 setFilterValue (ilTableFilterItem $a_item, $a_value)
 
 fillMetaExcel (ilExcel $a_excel, int &$a_row)
 Add meta information to excel export. More...
 
 fillHeaderExcel (ilExcel $a_excel, int &$a_row)
 Excel Version of Fill Header. More...
 
 fillRowExcel (ilExcel $a_excel, int &$a_row, array $a_set)
 Excel Version of Fill Row. More...
 
 fillMetaCSV (ilCSVWriter $a_csv)
 Add meta information to csv export. More...
 
 fillHeaderCSV (ilCSVWriter $a_csv)
 CSV Version of Fill Header. More...
 
 fillRowCSV (ilCSVWriter $a_csv, array $a_set)
 CSV Version of Fill Row. More...
 

Protected Attributes

ilPathGUI $path_gui
 
array $filter
 
ILIAS UI Factory $factory
 
ILIAS UI Renderer $renderer
 
ilObjectDefinition $objectDefinition
 
bool $edit_access
 
- Protected Attributes inherited from ilTable2GUI
string $requested_nav_par2 = ""
 
string $requested_nav_par = ""
 
string $requested_nav_par1 = ""
 
ILIAS Table TableGUIRequest $table_request = null
 
array $selected_columns = []
 
ilCtrl $ctrl
 
object $parent_obj = null
 
string $parent_cmd = ""
 
string $close_command = ""
 
string $top_anchor = "il_table_top"
 
array $filters = array()
 
array $optional_filters = array()
 
string $filter_cmd = 'applyFilter'
 
string $reset_cmd = 'resetFilter'
 
int $filter_cols = 5
 
bool $ext_sort = false
 
bool $ext_seg = false
 
string $context = ""
 
array $mi_sel_buttons = []
 
bool $disable_filter_hiding = false
 
bool $top_commands = true
 
array $selectable_columns = array()
 
array $selected_column = array()
 
bool $show_rows_selector = true
 
bool $rows_selector_off = false
 
bool $nav_determined = false
 
bool $limit_determined = false
 
bool $filters_determined = false
 
bool $columns_determined = false
 
bool $open_form_tag = true
 
bool $close_form_tag = true
 
array $export_formats = []
 
int $export_mode = 0
 
bool $print_mode = false
 
bool $enable_command_for_all = false
 
bool $restore_filter = false
 
array $restore_filter_values = []
 
bool $default_filter_visibility = false
 
array $sortable_fields = array()
 
bool $prevent_double_submission = true
 
string $row_selector_label = ""
 
bool $select_all_on_top = false
 
array $sel_buttons = []
 
string $nav_value = ''
 
string $noentriestext = ''
 
string $css_row = ''
 
bool $display_as_block = false
 
string $description = ''
 
string $id = ""
 
bool $custom_prev_next = false
 
string $reset_cmd_txt = ""
 
string $defaultorderfield = ""
 
string $defaultorderdirection = ""
 
array $column = []
 
bool $datatable = false
 
bool $num_info = false
 
bool $form_multipart = false
 
array $row_data = []
 
string $order_field = ""
 
array $selected_filter = []
 
string $form_action = ""
 
string $formname = ""
 
string $sort_order = ""
 
array $buttons = []
 
array $multi = []
 
array $hidden_inputs = []
 
array $header_commands = []
 
string $row_template = ""
 
string $row_template_dir = ""
 
string $filter_cmd_txt = ""
 
string $custom_prev = ""
 
string $custom_next = ""
 
array $raw_post_data = null
 
ilGlobalTemplateInterface $main_tpl
 
- Protected Attributes inherited from ilTableGUI
string $sort_order
 
string $link_params
 
array $header_params
 
 $tpl
 
ilLanguage $lng
 

Additional Inherited Members

- Static Public Member Functions inherited from ilTable2GUI
static getAllCommandLimit ()
 
- Static Public Member Functions inherited from ilTableGUI
static linkbar (string $AScript, int $AHits, int $ALimit, int $AOffset, array $AParams=array(), array $ALayout=array(), string $prefix='')
 
- Data Fields inherited from ilTable2GUI
const FILTER_TEXT = 1
 
const FILTER_SELECT = 2
 
const FILTER_DATE = 3
 
const FILTER_LANGUAGE = 4
 
const FILTER_NUMBER_RANGE = 5
 
const FILTER_DATE_RANGE = 6
 
const FILTER_DURATION_RANGE = 7
 
const FILTER_DATETIME_RANGE = 8
 
const FILTER_CHECKBOX = 9
 
const EXPORT_EXCEL = 1
 
const EXPORT_CSV = 2
 
const ACTION_ALL_LIMIT = 1000
 
- Data Fields inherited from ilTableGUI
string $title = ""
 
string $icon = ""
 
string $icon_alt = ""
 
string $help_page = ""
 
string $help_icon = ""
 
string $help_icon_alt = ""
 
array $header_names = []
 
array $header_vars = []
 
array $linkbar_vars = []
 
array $data = []
 
int $column_count = 0
 
array $column_width = []
 
int $max_count = 0
 
int $limit = 0
 
bool $max_limit = false
 
int $offset = 0
 
string $order_column = ""
 
string $order_direction = ""
 
string $footer_style = ""
 
string $footer_previous = ""
 
string $footer_next = ""
 
bool $lang_support = true
 
bool $global_tpl = false
 
string $form_name = ""
 
string $select_all_checkbox = ""
 
array $action_buttons = []
 
string $prefix = ""
 
string $base = ""
 
array $enabled
 
array $styles
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning TableGUI class for role assignment in user administration

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

Definition at line 23 of file class.ilRoleAssignmentTableGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilRoleAssignmentTableGUI::__construct ( object  $a_parent_obj,
string  $a_parent_cmd 
)

Definition at line 33 of file class.ilRoleAssignmentTableGUI.php.

References $DIC, ilTableGUI\$lng, ILIAS\GlobalScreen\Provider\__construct(), ilTable2GUI\addColumn(), ilTable2GUI\addMultiCommand(), factory(), getPathGUI(), initFilter(), ILIAS\Repository\lng(), ilLanguage\loadLanguageModule(), ILIAS\Repository\objectDefinition(), renderer(), ilTable2GUI\setDefaultOrderDirection(), ilTable2GUI\setDefaultOrderField(), ilTable2GUI\setDisableFilterHiding(), ilTable2GUI\setEnableHeader(), ilTable2GUI\setEnableTitle(), ilTable2GUI\setFormAction(), ilTable2GUI\setId(), ilTable2GUI\setRowTemplate(), ilTable2GUI\setSelectAllCheckbox(), ilTable2GUI\setTitle(), ilLanguage\txt(), and USER_FOLDER_ID.

36  {
37  global $DIC;
38 
39  $ilCtrl = $DIC['ilCtrl'];
40  $lng = $DIC['lng'];
41  $rbacsystem = $DIC['rbacsystem'];
42  $this->objectDefinition = $DIC['objDefinition'];
43  $this->factory = $DIC->ui()->factory();
44  $this->renderer = $DIC->ui()->renderer();
45 
46 
47  $lng->loadLanguageModule('rbac');
48  $this->setId("usrroleass");
49 
50  parent::__construct($a_parent_obj, $a_parent_cmd);
51 
52  $this->setTitle($lng->txt("role_assignment"));
53  $this->setDefaultOrderField("title");
54  $this->setDefaultOrderDirection("asc");
55  $this->setDisableFilterHiding(true);
56  $this->addColumn("", "", "1", true);
57  $this->addColumn($this->lng->txt("role"), "title");
58  $this->addColumn($this->lng->txt("description"), "description");
59  $this->addColumn($this->lng->txt("context"), "context");
60  $this->addColumn($this->lng->txt('path'), 'path');
61  $this->edit_access = $rbacsystem->checkAccess("edit_roleassignment", USER_FOLDER_ID);
62  $this->initFilter();
63  $this->setEnableHeader(true);
64  $this->setRowTemplate("tpl.role_assignment_row.html", "components/ILIAS/User");
65  $this->setEnableTitle(true);
66 
67  if ($this->edit_access) {
68  $this->setSelectAllCheckbox("role_id[]");
69  $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
70  $this->addMultiCommand("assignSave", $lng->txt("change_assignment"));
71  }
72 
73  $this->path_gui = new ilPathGUI();
74  $this->getPathGUI()->enableTextOnly(false);
75  $this->getPathGUI()->enableHideLeaf(false);
76  }
const USER_FOLDER_ID
Definition: constants.php:33
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
setFormAction(string $a_form_action, bool $a_multipart=false)
setEnableTitle(bool $a_enabletitle)
factory()
setSelectAllCheckbox(string $a_select_all_checkbox, bool $a_select_all_on_top=false)
renderer()
setDisableFilterHiding(bool $a_val=true)
loadLanguageModule(string $a_module)
Load language module.
ilLanguage $lng
setId(string $a_val)
setDefaultOrderField(string $a_defaultorderfield)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
global $DIC
Definition: shib_login.php:26
setDefaultOrderDirection(string $a_defaultorderdirection)
setTitle(string $a_title, string $a_icon="", string $a_icon_alt="")
__construct(Container $dic, ilPlugin $plugin)
addColumn(string $a_text, string $a_sort_field="", string $a_width="", bool $a_is_checkbox_action_column=false, string $a_class="", string $a_tooltip="", bool $a_tooltip_with_html=false)
addMultiCommand(string $a_cmd, string $a_text)
setEnableHeader(bool $a_enableheader)
+ Here is the call graph for this function:

Member Function Documentation

◆ fillRow()

ilRoleAssignmentTableGUI::fillRow ( array  $a_set)
protected

Definition at line 108 of file class.ilRoleAssignmentTableGUI.php.

References ilTable2GUI\$context, ilObjRole\_getTranslation(), ilObject\_lookupObjId(), ilObject\_lookupType(), ILIAS\Repository\ctrl(), factory(), and renderer().

108  : void // Missing array type.
109  {
110  if ($this->edit_access) {
111  if (isset($a_set['checkbox']['id'])) {
112  $this->tpl->setVariable('VAL_ID', $a_set['checkbox']['id']);
113  if ($a_set['checkbox']['disabled']) {
114  $this->tpl->setVariable('VAL_DISABLED', 'disabled="disabled"');
115  }
116  if ($a_set['checkbox']['checked']) {
117  $this->tpl->setVariable('VAL_CHECKED', 'checked="checked"');
118  }
119  }
120  }
121 
122  $this->ctrl->setParameterByClass("ilobjrolegui", "ref_id", $a_set['ref_id']);
123  $this->ctrl->setParameterByClass("ilobjrolegui", "obj_id", $a_set["obj_id"]);
124 
125  $this->tpl->setVariable(
126  'ROLE',
127  $this->renderer->render(
128  $this->factory->link()->standard(
129  ilObjRole::_getTranslation($a_set['title']),
130  $this->ctrl->getLinkTargetByClass(ilObjRoleGUI::class, 'perm')
131  )
132  )
133  );
134  $this->tpl->setVariable('DESCRIPTION', $a_set['description']);
135  // Add link to objector local Rores
136  $context = $a_set['context'];
137  if ($a_set['role_type'] === 'local') {
138  $context = $this->renderer->render(
139  $this->factory->link()->standard(
140  $context,
141  ilLink::_getLink(
142  $a_set['ref_id'],
144  )
145  )
146  );
147  }
148  $this->tpl->setVariable('CONTEXT', $context);
149  $this->tpl->setVariable('PATH', $a_set['path']);
150  }
factory()
renderer()
static _lookupObjId(int $ref_id)
static _getTranslation(string $a_role_title)
static _lookupType(int $id, bool $reference=false)
+ Here is the call graph for this function:

◆ getPathGUI()

ilRoleAssignmentTableGUI::getPathGUI ( )

Definition at line 78 of file class.ilRoleAssignmentTableGUI.php.

References $path_gui.

Referenced by __construct(), and parse().

+ Here is the caller graph for this function:

◆ getTitleForReference()

ilRoleAssignmentTableGUI::getTitleForReference ( int  $ref_id)
protected

Definition at line 243 of file class.ilRoleAssignmentTableGUI.php.

References Vendor\Package\$e, ilTableGUI\$title, ilObjectListGUIFactory\_getListGUIByType(), ilObject\_lookupObjId(), ilObject\_lookupTitle(), ilObject\_lookupType(), ILIAS\Repository\lng(), ILIAS\Repository\objectDefinition(), ilDatePresentation\resetToDefaults(), and ilDatePresentation\setUseRelativeDates().

Referenced by parse().

243  : string
244  {
245  $type = ilObject::_lookupType($ref_id, true);
246  $obj_id = ilObject::_lookupObjId($ref_id);
247  $title = ilObject::_lookupTitle($obj_id);
248 
249  if ($this->objectDefinition->isAdministrationObject($type)) {
250  return $this->lng->txt('obj_' . $type);
251  }
252 
253  try {
255  $list->initItem(
256  $ref_id,
257  $obj_id,
258  $type,
259  $title
260  );
261 
263  $title = $list->getTitle();
265  return $title;
266  } catch (ilObjectException $e) {
267  // could be an administration object
268  }
269  return $title;
270  }
static array static setUseRelativeDates(bool $a_status)
set use relative dates
Base exception class for object service.
static resetToDefaults()
reset to defaults
static _lookupObjId(int $ref_id)
$ref_id
Definition: ltiauth.php:65
static _lookupTitle(int $obj_id)
static _getListGUIByType(string $type, int $context=ilObjectListGUI::CONTEXT_REPOSITORY)
static _lookupType(int $id, bool $reference=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initFilter()

ilRoleAssignmentTableGUI::initFilter ( )

Definition at line 83 of file class.ilRoleAssignmentTableGUI.php.

References $DIC, ilTableGUI\$lng, ilTable2GUI\addFilterItem(), ILIAS\Repository\filter(), ilSelectInputGUI\setOptions(), and ilLanguage\txt().

Referenced by __construct().

83  : void
84  {
85  global $DIC;
86 
87  $lng = $DIC['lng'];
88 
89  // roles
90  $option[0] = $lng->txt('assigned_roles');
91  $option[1] = $lng->txt('all_roles');
92  $option[2] = $lng->txt('all_global_roles');
93  $option[3] = $lng->txt('all_local_roles');
94  $option[4] = $lng->txt('internal_local_roles_only');
95  $option[5] = $lng->txt('non_internal_local_roles_only');
96 
97  if ($this->edit_access) {
98  $si = new ilSelectInputGUI($lng->txt("roles"), "role_filter");
99  $si->setOptions($option);
100  $this->addFilterItem($si);
101  $si->readFromSession();
102  $this->filter["role_filter"] = $si->getValue();
103  } else {
104  $this->filter["role_filter"] = 0;
105  }
106  }
This class represents a selection list property in a property form.
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
addFilterItem(ilTableFilterItem $a_input_item, bool $a_optional=false)
setOptions(array $a_options)
ilLanguage $lng
global $DIC
Definition: shib_login.php:26
filter(string $filter_id, $class_path, string $cmd, bool $activated=true, bool $expanded=true)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ parse()

ilRoleAssignmentTableGUI::parse ( int  $usr_id)

Definition at line 152 of file class.ilRoleAssignmentTableGUI.php.

References ilTable2GUI\$context, $DIC, $ref_id, ilTableGUI\$title, ilSecuritySettings\_getInstance(), ilObjRole\_getTranslation(), getPathGUI(), getTitleForReference(), ILIAS\Repository\int(), ILIAS\Repository\lng(), ROLE_FOLDER_ID, ROOT_FOLDER_ID, ilTable2GUI\setData(), SYSTEM_ROLE_ID, and SYSTEM_USER_ID.

152  : void
153  {
154  global $DIC;
155  $rbacreview = $DIC->rbac()->review();
156  $tree = $DIC->repositoryTree();
157  $ilUser = $DIC->user();
158  $assignable = false; // @todo: check this
159 
160  $assigned_roles = $rbacreview->assignedRoles($usr_id);
161 
162  $counter = 0;
163 
164  $records = [];
165  foreach ($rbacreview->getRolesByFilter((int) $this->filter['role_filter'], $usr_id) as $role) {
166  // fetch context path of role
167  $rolf = $rbacreview->getFoldersAssignedToRole($role["obj_id"], true);
168  $ref_id = $rbacreview->getObjectReferenceOfRole($role['rol_id']);
169 
170  // only list roles that are not set to status "deleted"
171  if ($rbacreview->isDeleted($rolf[0])) {
172  continue;
173  }
174 
175  $context = "";
176  if ($tree->isInTree($rolf[0])) {
177  if ($rolf[0] == ROLE_FOLDER_ID) {
178  $context = $this->lng->txt("global");
179  } else {
180  $tmpPath = $tree->getPathFull($rolf[0]);
182  }
183  } else {
184  $context = "<b>Rolefolder " . $rolf[0] . " not found in tree! (Role " . $role["obj_id"] . ")</b>";
185  }
186 
187  $disabled = false;
188  // disable checkbox for system role for the system user
189  if (
190  ($usr_id === (int) SYSTEM_USER_ID && $role["obj_id"] === (int) SYSTEM_ROLE_ID) ||
191  (!in_array(SYSTEM_ROLE_ID, $rbacreview->assignedRoles($ilUser->getId())) && $role["obj_id"] === (int) SYSTEM_ROLE_ID)
192  ) {
193  $disabled = true;
194  }
195 
196  // protected admin role
197  if ($role['obj_id'] == SYSTEM_ROLE_ID && !$rbacreview->isAssigned($ilUser->getId(), SYSTEM_ROLE_ID)) {
198  if (ilSecuritySettings::_getInstance()->isAdminRoleProtected()) {
199  $disabled = true;
200  }
201  }
202 
203  if (strpos($role["title"], "il_") === 0) {
204  if (!$assignable) {
205  $rolf_arr = $rbacreview->getFoldersAssignedToRole($role["obj_id"], true);
206  $rolf2 = $rolf_arr[0];
207  } else {
208  $rolf2 = $rolf;
209  }
210 
211  $parent_node = $tree->getNodeData($rolf2);
212  if (!isset($parent_node['type']) || !isset($parent_node['obj_id'])) {
213  continue;
214  }
215  $role['description'] = "{$this->lng->txt("obj_{$parent_node['type']}")}&nbsp;(#{$parent_node['obj_id']})";
216  }
217 
218  $role_ids[$counter] = $role["obj_id"];
219 
220  $checkbox = [
221  'id' => $role['obj_id'],
222  'disabled' => $disabled,
223  'checked' => in_array($role['obj_id'], $assigned_roles)
224  ];
225 
226  $title = ilObjRole::_getTranslation($role["title"]);
227 
228  $records[] = [
229  "description" => $role["description"],
230  "context" => $context,
231  "checkbox" => $checkbox,
232  "role_type" => $role["role_type"],
233  "ref_id" => $ref_id,
234  "obj_id" => $role["obj_id"],
235  "title" => $title,
236  'path' => $this->getPathGUI()->getPath(ROOT_FOLDER_ID, $ref_id)
237  ];
238  ++$counter;
239  }
240  $this->setData($records);
241  }
setData(array $a_data)
const ROOT_FOLDER_ID
Definition: constants.php:32
const SYSTEM_ROLE_ID
Definition: constants.php:29
const SYSTEM_USER_ID
This file contains constants for PHPStan analyis, see: https://phpstan.org/config-reference#constants...
Definition: constants.php:26
$ref_id
Definition: ltiauth.php:65
static _getTranslation(string $a_role_title)
global $DIC
Definition: shib_login.php:26
const ROLE_FOLDER_ID
Definition: constants.php:34
static _getInstance()
Get instance of ilSecuritySettings.
+ Here is the call graph for this function:

Field Documentation

◆ $edit_access

bool ilRoleAssignmentTableGUI::$edit_access
protected

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

◆ $factory

ILIAS UI Factory ilRoleAssignmentTableGUI::$factory
protected

Definition at line 27 of file class.ilRoleAssignmentTableGUI.php.

◆ $filter

array ilRoleAssignmentTableGUI::$filter
protected

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

◆ $objectDefinition

ilObjectDefinition ilRoleAssignmentTableGUI::$objectDefinition
protected

Definition at line 30 of file class.ilRoleAssignmentTableGUI.php.

◆ $path_gui

ilPathGUI ilRoleAssignmentTableGUI::$path_gui
protected

Definition at line 25 of file class.ilRoleAssignmentTableGUI.php.

Referenced by getPathGUI().

◆ $renderer

ILIAS UI Renderer ilRoleAssignmentTableGUI::$renderer
protected

Definition at line 28 of file class.ilRoleAssignmentTableGUI.php.


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