ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilRbacLogTableGUI Class Reference

Class ilRbacLogTableGUI. More...

+ Inheritance diagram for ilRbacLogTableGUI:
+ Collaboration diagram for ilRbacLogTableGUI:

Public Member Functions

 __construct (object $a_parent_obj, string $a_parent_cmd, int $a_ref_id)
 
 initFilter ()
 
- 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 ()
 
 setShowTemplates (bool $a_value)
 
 getShowTemplates ()
 
 restoreTemplate (string $a_name)
 Restore state from template. More...
 
 saveTemplate (string $a_name)
 Save current state as template. More...
 
 deleteTemplate (string $a_name)
 
 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

 getItems (int $a_ref_id, array $a_current_filter=null)
 
 fillRow (array $a_set)
 
 parseChangesFaPa (array $raw)
 
 parseChangesTemplate (array $raw)
 
 getOPCaption (string $a_type, $a_op)
 
 getTranslationFromPlugin (string $type, string $op_id)
 Check the type for plugin and get the translation for op_id. More...
 
 notTranslated (?string $perm, string $op_id)
 Check the op is translated correctly. More...
 
- 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

array $operations = []
 
array $filter = []
 
array $action_map = []
 
- Protected Attributes inherited from ilTable2GUI
string $requested_tmpl_delete
 
string $requested_tmpl_create
 
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_templates = false
 
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
 

Private Attributes

int $ref_id
 

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

Constructor & Destructor Documentation

◆ __construct()

ilRbacLogTableGUI::__construct ( object  $a_parent_obj,
string  $a_parent_cmd,
int  $a_ref_id 
)

Definition at line 34 of file class.ilRbacLogTableGUI.php.

References $DIC, ILIAS\MetaData\Repository\Validation\Data\__construct(), ilTable2GUI\addColumn(), ilRbacLog\CHANGE_OWNER, ilRbacLog\COPY_OBJECT, ilRbacLog\CREATE_OBJECT, ILIAS\Repository\ctrl(), ilRbacLog\EDIT_PERMISSIONS, ilRbacLog\EDIT_TEMPLATE, ilRbacLog\EDIT_TEMPLATE_EXISTING, ILIAS\Repository\filter(), getItems(), initFilter(), ilRbacLog\LINK_OBJECT, ILIAS\Repository\lng(), ilRbacLog\MOVE_OBJECT, ilTable2GUI\setEnableHeader(), ilTable2GUI\setExternalSegmentation(), ilTable2GUI\setFilterCommand(), ilTable2GUI\setFormAction(), ilTable2GUI\setId(), ilTable2GUI\setLimit(), ilTable2GUI\setResetCommand(), ilTable2GUI\setRowTemplate(), and ilTable2GUI\setTitle().

35  {
36  global $DIC;
37 
38  $this->setId('rbaclog');
39  $this->ref_id = $a_ref_id;
40 
41  parent::__construct($a_parent_obj, $a_parent_cmd);
42  $this->setTitle($this->lng->txt('rbac_log'));
43  $this->setLimit(5);
44 
45  $this->addColumn($this->lng->txt('date'), '', '15%');
46  $this->addColumn($this->lng->txt('name'), '', '10%');
47  $this->addColumn($this->lng->txt('login'), '', '10%');
48  $this->addColumn($this->lng->txt('action'), '', '15%');
49  $this->addColumn($this->lng->txt('rbac_changes'), '', '50%');
50 
51  $this->setExternalSegmentation(true);
52  $this->setEnableHeader(true);
53  $this->setFormAction($this->ctrl->getFormAction($a_parent_obj, $a_parent_cmd));
54  $this->setRowTemplate('tpl.rbac_log_row.html', 'Services/AccessControl');
55  $this->setFilterCommand('applyLogFilter');
56  $this->setResetCommand('resetLogFilter');
57 
58  $this->action_map = [ilRbacLog::EDIT_PERMISSIONS => $this->lng->txt('rbac_log_edit_permissions'),
59  ilRbacLog::MOVE_OBJECT => $this->lng->txt('rbac_log_move_object'),
60  ilRbacLog::LINK_OBJECT => $this->lng->txt('rbac_log_link_object'),
61  ilRbacLog::COPY_OBJECT => $this->lng->txt('rbac_log_copy_object'),
62  ilRbacLog::CREATE_OBJECT => $this->lng->txt('rbac_log_create_object'),
63  ilRbacLog::EDIT_TEMPLATE => $this->lng->txt('rbac_log_edit_template'),
64  ilRbacLog::EDIT_TEMPLATE_EXISTING => $this->lng->txt('rbac_log_edit_template_existing'),
65  ilRbacLog::CHANGE_OWNER => $this->lng->txt('rbac_log_change_owner')
66  ];
67 
68  $this->initFilter();
69  $this->getItems($this->ref_id, $this->filter);
70  }
getItems(int $a_ref_id, array $a_current_filter=null)
setFormAction(string $a_form_action, bool $a_multipart=false)
setResetCommand(string $a_val, string $a_caption="")
const CHANGE_OWNER
setId(string $a_val)
global $DIC
Definition: feed.php:28
const EDIT_PERMISSIONS
const CREATE_OBJECT
__construct(VocabulariesInterface $vocabularies)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setFilterCommand(string $a_val, string $a_caption="")
const COPY_OBJECT
const LINK_OBJECT
setTitle(string $a_title, string $a_icon="", string $a_icon_alt="")
setLimit(int $a_limit=0, int $a_default_limit=0)
const EDIT_TEMPLATE_EXISTING
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)
const EDIT_TEMPLATE
const MOVE_OBJECT
filter(string $filter_id, $class_path, string $cmd, bool $activated=true, bool $expanded=true)
setEnableHeader(bool $a_enableheader)
setExternalSegmentation(bool $a_val)
+ Here is the call graph for this function:

Member Function Documentation

◆ fillRow()

ilRbacLogTableGUI::fillRow ( array  $a_set)
protected

Definition at line 105 of file class.ilRbacLogTableGUI.php.

References ilObjUser\_lookupFullname(), ilObjUser\_lookupName(), ilRbacLog\CHANGE_OWNER, ilRbacLog\EDIT_TEMPLATE, ilDatePresentation\formatDate(), IL_CAL_UNIX, ILIAS\Repository\lng(), parseChangesFaPa(), and parseChangesTemplate().

105  : void
106  {
107  $this->tpl->setVariable('DATE', ilDatePresentation::formatDate(new ilDateTime($a_set['created'] ?? 0, IL_CAL_UNIX)));
108  $name = ilObjUser::_lookupName((int) ($a_set['user_id']) ?? 0);
109  $this->tpl->setVariable('LASTNAME', $name['lastname'] ?? '');
110  $this->tpl->setVariable('FIRSTNAME', $name['firstname'] ?? '');
111  $this->tpl->setVariable('LOGIN', $name['login'] ?? '');
112  $this->tpl->setVariable('ACTION', $this->action_map[$a_set['action']] ?? '');
113 
114  if ($a_set['action'] == ilRbacLog::CHANGE_OWNER) {
115  $user = ilObjUser::_lookupFullname($a_set['data'][0] ?? 0);
116  $changes = [['action' => $this->lng->txt('rbac_log_changed_owner'), 'operation' => $user]];
117  } elseif ($a_set['action'] == ilRbacLog::EDIT_TEMPLATE) {
118  $changes = $this->parseChangesTemplate($a_set['data'] ?? []);
119  } else {
120  $changes = $this->parseChangesFaPa($a_set['data'] ?? []);
121  }
122 
123  $this->tpl->setCurrentBlock('changes');
124  foreach ($changes as $change) {
125  $this->tpl->setVariable('CHANGE_ACTION', $change['action'] ?? '');
126  $this->tpl->setVariable('CHANGE_OPERATION', $change['operation'] ?? '');
127  $this->tpl->parseCurrentBlock();
128  }
129  }
static _lookupFullname(int $a_user_id)
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false)
const CHANGE_OWNER
static _lookupName(int $a_user_id)
lookup user name
const IL_CAL_UNIX
const EDIT_TEMPLATE
+ Here is the call graph for this function:

◆ getItems()

ilRbacLogTableGUI::getItems ( int  $a_ref_id,
array  $a_current_filter = null 
)
protected

Definition at line 82 of file class.ilRbacLogTableGUI.php.

References ilTableGUI\$data, $DIC, ilTable2GUI\determineOffsetAndOrder(), ilTable2GUI\getLimit(), ilRbacLog\getLogItems(), ilTable2GUI\getOffset(), ROLE_FOLDER_ID, ROOT_FOLDER_ID, ilTable2GUI\setData(), and ilTableGUI\setMaxCount().

Referenced by __construct().

82  : void
83  {
84  global $DIC;
85 
86  $rbacreview = $DIC['rbacreview'];
87 
88  $this->determineOffsetAndOrder();
89 
90  foreach ($rbacreview->getOperations() as $op) {
91  $this->operations[$op['ops_id']] = $op['operation'];
92  }
93 
94  // special case: role folder should display root folder entries
95  if ($a_ref_id == ROLE_FOLDER_ID) {
96  $a_ref_id = ROOT_FOLDER_ID;
97  }
98 
99  $data = ilRbacLog::getLogItems($a_ref_id, $this->getLimit(), $this->getOffset(), $a_current_filter);
100 
101  $this->setData($data['set']);
102  $this->setMaxCount((int) $data['cnt']);
103  }
setData(array $a_data)
const ROOT_FOLDER_ID
Definition: constants.php:32
static getLogItems(int $a_ref_id, int $a_limit, int $a_offset, array $a_filter=null)
global $DIC
Definition: feed.php:28
const ROLE_FOLDER_ID
Definition: constants.php:34
determineOffsetAndOrder(bool $a_omit_offset=false)
setMaxCount(int $a_max_count)
set max.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getOPCaption()

ilRbacLogTableGUI::getOPCaption ( string  $a_type,
  $a_op 
)
protected
Parameters
array | int | string$a_op

Definition at line 211 of file class.ilRbacLogTableGUI.php.

References $res, getTranslationFromPlugin(), ILIAS\Repository\lng(), and notTranslated().

Referenced by parseChangesFaPa(), and parseChangesTemplate().

211  : string
212  {
213  // #11717
214  if (is_array($a_op)) {
215  $res = [];
216  foreach ($a_op as $op) {
217  $res[] = $this->getOPCaption($a_type, $op);
218  }
219  return implode(', ', $res);
220  }
221 
222  if (is_numeric($a_op) && isset($this->operations[$a_op])) {
223  $op_id = $this->operations[$a_op];
224  if (substr($op_id, 0, 7) != 'create_') {
225  $perm = $this->getTranslationFromPlugin($a_type, $op_id);
226 
227  if ($this->notTranslated($perm, $op_id)) {
228  if ($this->lng->exists($a_type . '_' . $op_id . '_short')) {
229  $perm = $this->lng->txt($a_type . '_' . $op_id . '_short');
230  } else {
231  $perm = $this->lng->txt($op_id);
232  }
233  }
234 
235  return $perm;
236  } else {
237  $type = substr($op_id, 7, strlen($op_id));
238  $perm = $this->getTranslationFromPlugin($type, $op_id);
239 
240  if ($this->notTranslated($perm, $op_id)) {
241  $perm = $this->lng->txt('rbac_' . $op_id);
242  }
243 
244  return $perm;
245  }
246  }
247  return '';
248  }
$res
Definition: ltiservices.php:69
getTranslationFromPlugin(string $type, string $op_id)
Check the type for plugin and get the translation for op_id.
getOPCaption(string $a_type, $a_op)
notTranslated(?string $perm, string $op_id)
Check the op is translated correctly.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTranslationFromPlugin()

ilRbacLogTableGUI::getTranslationFromPlugin ( string  $type,
string  $op_id 
)
protected

Check the type for plugin and get the translation for op_id.

Definition at line 253 of file class.ilRbacLogTableGUI.php.

References ilObjectPlugin\lookupTxtById().

Referenced by getOPCaption().

253  : ?string
254  {
255  global $objDefinition;
256 
257  if ($objDefinition->isPlugin($type)) {
258  return ilObjectPlugin::lookupTxtById($type, $op_id);
259  }
260  return null;
261  }
static lookupTxtById(string $plugin_id, string $lang_var)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initFilter()

ilRbacLogTableGUI::initFilter ( )

Definition at line 72 of file class.ilRbacLogTableGUI.php.

References $action_map, ilTable2GUI\addFilterItemByMetaType(), ILIAS\Repository\filter(), ilTable2GUI\FILTER_DATE_RANGE, ilTable2GUI\FILTER_SELECT, and ILIAS\Repository\lng().

Referenced by __construct().

72  : void
73  {
74  $item = $this->addFilterItemByMetaType('action', ilTable2GUI::FILTER_SELECT);
75  $item->setOptions(['' => $this->lng->txt('all')] + $this->action_map);
76  $this->filter['action'] = $item->getValue();
77 
79  $this->filter['date'] = $item->getDate();
80  }
addFilterItemByMetaType(string $id, int $type=self::FILTER_TEXT, bool $a_optional=false, string $caption="")
Add filter by standard type.
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:

◆ notTranslated()

ilRbacLogTableGUI::notTranslated ( ?string  $perm,
string  $op_id 
)
protected

Check the op is translated correctly.

Definition at line 266 of file class.ilRbacLogTableGUI.php.

Referenced by getOPCaption().

266  : bool
267  {
268  return is_null($perm) || (strpos($perm, $op_id) !== false);
269  }
+ Here is the caller graph for this function:

◆ parseChangesFaPa()

ilRbacLogTableGUI::parseChangesFaPa ( array  $raw)
protected

Definition at line 131 of file class.ilRbacLogTableGUI.php.

References ilObjRole\_getTranslation(), ilObject\_lookupObjectId(), ilObject\_lookupTitle(), ilObject\_lookupType(), getOPCaption(), and ILIAS\Repository\lng().

Referenced by fillRow().

131  : array
132  {
133  $result = [];
134 
135  $type = ilObject::_lookupType($this->ref_id, true);
136 
137  if (isset($raw['src']) && is_numeric($raw['src'])) {
138  $obj_id = ilObject::_lookupObjectId($raw['src']);
139  if ($obj_id) {
140  $result[] = [
141  'action' => $this->lng->txt('rbac_log_source_object'),
142  'operation' => '<a href="' . ilLink::_getLink($raw['src']) . '">' . ilObject::_lookupTitle($obj_id) . '</a>'
143  ];
144  }
145 
146  // added only
147  foreach ($raw['ops'] as $role_id => $ops) {
148  foreach ($ops as $op) {
149  $result[] = [
150  'action' => sprintf(
151  $this->lng->txt('rbac_log_operation_add'),
153  ),
154  'operation' => $this->getOPCaption($type, $op)
155  ];
156  }
157  }
158  } elseif (isset($raw['ops'])) {
159  foreach ($raw['ops'] as $role_id => $actions) {
160  foreach ($actions as $action => $ops) {
161  foreach ((array) $ops as $op) {
162  $result[] = [
163  'action' => sprintf(
164  $this->lng->txt('rbac_log_operation_' . $action),
166  ),
167  'operation' => $this->getOPCaption($type, $op)
168  ];
169  }
170  }
171  }
172  }
173 
174  if (isset($raw['inht'])) {
175  foreach ($raw['inht'] as $action => $role_ids) {
176  foreach ((array) $role_ids as $role_id) {
177  $result[] = [
178  'action' => sprintf(
179  $this->lng->txt('rbac_log_inheritance_' . $action),
181  )
182  ];
183  }
184  }
185  }
186 
187  return $result;
188  }
getOPCaption(string $a_type, $a_op)
static _lookupTitle(int $obj_id)
static _getTranslation(string $a_role_title)
static _lookupObjectId(int $ref_id)
static _lookupType(int $id, bool $reference=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ parseChangesTemplate()

ilRbacLogTableGUI::parseChangesTemplate ( array  $raw)
protected

Definition at line 190 of file class.ilRbacLogTableGUI.php.

References getOPCaption(), and ILIAS\Repository\lng().

Referenced by fillRow().

190  : array
191  {
192  $result = [];
193  foreach ($raw as $type => $actions) {
194  foreach ($actions as $action => $ops) {
195  foreach ($ops as $op) {
196  $result[] = ['action' => sprintf(
197  $this->lng->txt('rbac_log_operation_' . $action),
198  $this->lng->txt('obj_' . $type)
199  ),
200  'operation' => $this->getOPCaption($type, $op)
201  ];
202  }
203  }
204  }
205  return $result;
206  }
getOPCaption(string $a_type, $a_op)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $action_map

array ilRbacLogTableGUI::$action_map = []
protected

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

Referenced by initFilter().

◆ $filter

array ilRbacLogTableGUI::$filter = []
protected

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

◆ $operations

array ilRbacLogTableGUI::$operations = []
protected

Definition at line 29 of file class.ilRbacLogTableGUI.php.

◆ $ref_id

int ilRbacLogTableGUI::$ref_id
private

Definition at line 32 of file class.ilRbacLogTableGUI.php.


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