ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilRoleTableGUI Class Reference

TableGUI for the presentation og roles and role templates. More...

+ Inheritance diagram for ilRoleTableGUI:
+ Collaboration diagram for ilRoleTableGUI:

Public Member Functions

 __construct (object $a_parent_gui, string $a_parent_cmd)
 
 init ()
 Init table. More...
 
 getType ()
 
 setType (int $a_type)
 
 initFilter ()
 Init filter. More...
 
 parse (int $role_folder_id)
 Parse role list. More...
 
 getRoleTitleFilter ()
 
 setRoleTitleFilter (string $a_filter)
 
- 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)
 

Data Fields

const TYPE_VIEW = 1
 
const TYPE_SEARCH = 2
 
- 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
 

Protected Member Functions

 fillRow (array $a_set)
 
 getPathGUI ()
 
- 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...
 

Private Attributes

const TYPE_GLOBAL_AU = 1
 
const TYPE_GLOBAL_UD = 2
 
const TYPE_LOCAL_AU = 3
 
const TYPE_LOCAL_UD = 4
 
const TYPE_ROLT_AU = 5
 
const TYPE_ROLT_UD = 6
 
const FILTER_ROLE_TYPE = 'role_type'
 
const FILTER_TITLE = 'title'
 
ilPathGUI $path_gui
 
int $type = self::TYPE_VIEW
 
string $role_title_filter = ''
 
int $role_folder_id = 0
 
array $filter = []
 
ilTree $tree
 
ilRbacReview $rbacreview
 
ilRbacSystem $system
 

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='')
 
- 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
 

Detailed Description

TableGUI for the presentation og roles and role templates.

Author
Stefan Meyer smeye.nosp@m.r.il.nosp@m.ias@g.nosp@m.mx.d.nosp@m.e

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

Constructor & Destructor Documentation

◆ __construct()

ilRoleTableGUI::__construct ( object  $a_parent_gui,
string  $a_parent_cmd 
)

Definition at line 52 of file class.ilRoleTableGUI.php.

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), ILIAS\Repository\lng(), and ilTable2GUI\setId().

53  {
54  global $DIC;
55 
56  $this->rbacreview = $DIC->rbac()->review();
57  $this->tree = $DIC->repositoryTree();
58  $this->system = $DIC->rbac()->system();
59 
60  $this->setId('rolf_role_tbl');
61  parent::__construct($a_parent_gui, $a_parent_cmd);
62  $this->lng->loadLanguageModule('rbac');
63  $this->lng->loadLanguageModule('search');
64  }
setId(string $a_val)
global $DIC
Definition: feed.php:28
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ fillRow()

ilRoleTableGUI::fillRow ( array  $a_set)
protected

Definition at line 66 of file class.ilRoleTableGUI.php.

References ANONYMOUS_ROLE_ID, ILIAS\Repository\ctrl(), ilTable2GUI\getParentObject(), getPathGUI(), getType(), ILIAS\Repository\lng(), ROLE_FOLDER_ID, ROOT_FOLDER_ID, and SYSTEM_ROLE_ID.

66  : void
67  {
68  if ($a_set['type'] == 'role') {
69  if ($a_set['parent'] != ROLE_FOLDER_ID) {
70  $this->ctrl->setParameterByClass(
71  "ilobjrolegui",
72  "rolf_ref_id",
73  $a_set['parent']
74  );
75  }
76 
77  $this->ctrl->setParameterByClass("ilobjrolegui", "obj_id", $a_set["obj_id"]);
78  $link = $this->ctrl->getLinkTargetByClass("ilobjrolegui", "perm");
79  $this->ctrl->setParameterByClass("ilobjrolegui", "rolf_ref_id", "");
80  } else {
81  $this->ctrl->setParameterByClass("ilobjroletemplategui", "obj_id", $a_set["obj_id"]);
82  $link = $this->ctrl->getLinkTargetByClass("ilobjroletemplategui", "perm");
83  }
84 
85  switch ($a_set['rtype']) {
86  case self::TYPE_GLOBAL_AU:
87  $this->tpl->setVariable('ROLE_TYPE', $this->lng->txt('rbac_auto_global'));
88  break;
89  case self::TYPE_GLOBAL_UD:
90  $this->tpl->setVariable('ROLE_TYPE', $this->lng->txt('rbac_ud_global'));
91  break;
92  case self::TYPE_LOCAL_AU:
93  $this->tpl->setVariable('ROLE_TYPE', $this->lng->txt('rbac_auto_local'));
94  break;
95  case self::TYPE_LOCAL_UD:
96  $this->tpl->setVariable('ROLE_TYPE', $this->lng->txt('rbac_ud_local'));
97  break;
98  case self::TYPE_ROLT_AU:
99  $this->tpl->setVariable('ROLE_TYPE', $this->lng->txt('rbac_auto_rolt'));
100  break;
101  case self::TYPE_ROLT_UD:
102  $this->tpl->setVariable('ROLE_TYPE', $this->lng->txt('rbac_ud_rolt'));
103  break;
104  }
105 
106  if (
107  $a_set['obj_id'] != ANONYMOUS_ROLE_ID && $a_set['obj_id'] != SYSTEM_ROLE_ID && substr($a_set['title_orig'], 0, 3) != 'il_' || $this->getType() == self::TYPE_SEARCH) {
108  $this->tpl->setVariable('VAL_ID', $a_set['obj_id']);
109  }
110  $this->tpl->setVariable('VAL_TITLE_LINKED', $a_set['title']);
111  $this->tpl->setVariable('VAL_LINK', $link);
112  if (strlen($a_set['description'])) {
113  $this->tpl->setVariable('VAL_DESC', $a_set['description']);
114  }
115 
116  $ref = $a_set['parent'];
117  if ($ref == ROLE_FOLDER_ID) {
118  $this->tpl->setVariable('CONTEXT', $this->lng->txt('rbac_context_global'));
119  } else {
120  $this->tpl->setVariable(
121  'CONTEXT',
122  $this->getPathGUI()->getPath(ROOT_FOLDER_ID, (int) $ref)
123  );
124  }
125 
126  if ($this->getType() == self::TYPE_VIEW and $a_set['obj_id'] != SYSTEM_ROLE_ID) {
127  if ($this->system->checkAccess('write', $this->role_folder_id)) {
128  // Copy role
129  $this->tpl->setVariable('COPY_TEXT', $this->lng->txt('rbac_role_rights_copy'));
130  $this->ctrl->setParameter($this->getParentObject(), "csource", $a_set["obj_id"]);
131  $link = $this->ctrl->getLinkTarget($this->getParentObject(), 'roleSearch');
132  $this->tpl->setVariable(
133  'COPY_LINK',
134  $link
135  );
136  }
137  }
138  }
const ROOT_FOLDER_ID
Definition: constants.php:32
const SYSTEM_ROLE_ID
Definition: constants.php:29
const ROLE_FOLDER_ID
Definition: constants.php:34
const ANONYMOUS_ROLE_ID
Definition: constants.php:28
+ Here is the call graph for this function:

◆ getPathGUI()

ilRoleTableGUI::getPathGUI ( )
protected

Definition at line 200 of file class.ilRoleTableGUI.php.

References $path_gui.

Referenced by fillRow(), and init().

200  : ilPathGUI
201  {
202  return $this->path_gui;
203  }
Creates a path for a start and endnode.
+ Here is the caller graph for this function:

◆ getRoleTitleFilter()

ilRoleTableGUI::getRoleTitleFilter ( )

Definition at line 317 of file class.ilRoleTableGUI.php.

References $role_title_filter.

Referenced by parse().

317  : string
318  {
320  }
+ Here is the caller graph for this function:

◆ getType()

ilRoleTableGUI::getType ( )

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

References $type.

Referenced by fillRow(), init(), initFilter(), and parse().

190  : int
191  {
192  return $this->type;
193  }
+ Here is the caller graph for this function:

◆ init()

ilRoleTableGUI::init ( )

Init table.

Definition at line 143 of file class.ilRoleTableGUI.php.

References $GLOBALS, ilTable2GUI\addColumn(), ilTable2GUI\addCommandButton(), ilTable2GUI\addMultiCommand(), ILIAS\Repository\ctrl(), ilTableGUI\disable(), ilTable2GUI\getParentObject(), getPathGUI(), getType(), initFilter(), ILIAS\Repository\lng(), ilTable2GUI\setDefaultOrderDirection(), ilTable2GUI\setDefaultOrderField(), ilTable2GUI\setFormAction(), ilTable2GUI\setRowTemplate(), ilTable2GUI\setSelectAllCheckbox(), ilTable2GUI\setShowRowsSelector(), and ilTable2GUI\setTitle().

143  : void
144  {
145  $this->addColumn('', 'f', '1px');
146 
147  switch ($this->getType()) {
148  case self::TYPE_VIEW:
149  $this->setShowRowsSelector(true);
150  $this->setDefaultOrderField('title');
151  $this->setDefaultOrderDirection('asc');
152  //$this->setId('rolf_role_tbl');
153  $this->addColumn($this->lng->txt('search_title_description'), 'title', '30%');
154  $this->addColumn($this->lng->txt('type'), 'rtype', '20%');
155  $this->addColumn($this->lng->txt('context'), '', '40%');
156  $this->addColumn($this->lng->txt('actions'), '', '10%');
157  $this->setTitle($this->lng->txt('objs_role'));
158 
159  if ($GLOBALS['DIC']['rbacsystem']->checkAccess(
160  'delete',
161  $this->getParentObject()->getObject()->getRefId()
162  )) {
163  $this->addMultiCommand('confirmDelete', $this->lng->txt('delete'));
164  }
165  break;
166 
167  case self::TYPE_SEARCH:
168  $this->setShowRowsSelector(true);
169  $this->disable('sort');
170  //$this->setId('rolf_role_search_tbl');
171  $this->addColumn($this->lng->txt('search_title_description'), 'title', '30%');
172  $this->addColumn($this->lng->txt('type'), 'rtype', '20%');
173  $this->addColumn($this->lng->txt('context'), '', '50%');
174  $this->setTitle($this->lng->txt('rbac_role_rights_copy'));
175  $this->addMultiCommand('chooseCopyBehaviour', $this->lng->txt('btn_next'));
176  $this->addCommandButton('roleSearch', $this->lng->txt('btn_previous'));
177  break;
178  }
179 
180  $this->setRowTemplate('tpl.role_row.html', 'Services/AccessControl');
181  $this->setFormAction($this->ctrl->getFormAction($this->getParentObject()));
182  $this->setSelectAllCheckbox('roles');
183 
184  $this->path_gui = new ilPathGUI();
185  $this->getPathGUI()->enableTextOnly(false);
186  $this->getPathGUI()->enableHideLeaf(false);
187  $this->initFilter();
188  }
Creates a path for a start and endnode.
setFormAction(string $a_form_action, bool $a_multipart=false)
addCommandButton(string $a_cmd, string $a_text, string $a_onclick='', string $a_id="", string $a_class="")
setSelectAllCheckbox(string $a_select_all_checkbox, bool $a_select_all_on_top=false)
setShowRowsSelector(bool $a_value)
Toggle rows-per-page selector.
setDefaultOrderField(string $a_defaultorderfield)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
setDefaultOrderDirection(string $a_defaultorderdirection)
setTitle(string $a_title, string $a_icon="", string $a_icon_alt="")
initFilter()
Init filter.
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)
disable(string $a_module_name)
addMultiCommand(string $a_cmd, string $a_text)
+ Here is the call graph for this function:

◆ initFilter()

ilRoleTableGUI::initFilter ( )

Init filter.

Definition at line 208 of file class.ilRoleTableGUI.php.

References ilTableGUI\$title, ilTable2GUI\addFilterItem(), ILIAS\UI\examples\Symbol\Glyph\Filter\filter(), ilRbacReview\FILTER_ALL, ilRbacReview\FILTER_ALL_GLOBAL, ilRbacReview\FILTER_ALL_LOCAL, ilRbacReview\FILTER_INTERNAL, ilRbacReview\FILTER_NOT_INTERNAL, ilRbacReview\FILTER_TEMPLATES, getType(), ILIAS\Repository\int(), ILIAS\Repository\lng(), and ilTable2GUI\setDisableFilterHiding().

Referenced by init().

208  : void
209  {
210  $this->setDisableFilterHiding(true);
211 
212  $action = [];
213  switch ($this->getType()) {
214  case self::TYPE_VIEW:
215  $action[ilRbacReview::FILTER_ALL] = $this->lng->txt('all_roles');
216  $action[ilRbacReview::FILTER_ALL_GLOBAL] = $this->lng->txt('all_global_roles');
217  $action[ilRbacReview::FILTER_ALL_LOCAL] = $this->lng->txt('all_local_roles');
218  $action[ilRbacReview::FILTER_INTERNAL] = $this->lng->txt('internal_local_roles_only');
219  $action[ilRbacReview::FILTER_NOT_INTERNAL] = $this->lng->txt('non_internal_local_roles_only');
220  $action[ilRbacReview::FILTER_TEMPLATES] = $this->lng->txt('role_templates_only');
221  break;
222 
223  case self::TYPE_SEARCH:
224  $action[ilRbacReview::FILTER_ALL] = $this->lng->txt('all_roles');
225  $action[ilRbacReview::FILTER_ALL_GLOBAL] = $this->lng->txt('all_global_roles');
226  $action[ilRbacReview::FILTER_ALL_LOCAL] = $this->lng->txt('all_local_roles');
227  $action[ilRbacReview::FILTER_INTERNAL] = $this->lng->txt('internal_local_roles_only');
228  $action[ilRbacReview::FILTER_NOT_INTERNAL] = $this->lng->txt('non_internal_local_roles_only');
229  break;
230  }
231 
232  $roles = new ilSelectInputGUI($this->lng->txt('rbac_role_selection'), 'role_type');
233  $roles->setOptions($action);
234  $this->addFilterItem($roles);
235  $roles->readFromSession();
236 
237  if (!$roles->getValue()) {
238  $roles->setValue(ilRbacReview::FILTER_ALL_GLOBAL);
239  }
240 
241  // title filter
242  $title = new ilTextInputGUI($this->lng->txt('title'), self::FILTER_TITLE);
243  $title->setSize(16);
244  $title->setMaxLength(64);
245  $this->addFilterItem($title);
246  $title->readFromSession();
247 
248  $this->filter[self::FILTER_ROLE_TYPE] = (int) $roles->getValue();
249  $this->filter[self::FILTER_TITLE] = (string) $title->getValue();
250  }
addFilterItem(ilTableFilterItem $a_input_item, bool $a_optional=false)
setDisableFilterHiding(bool $a_val=true)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ parse()

ilRoleTableGUI::parse ( int  $role_folder_id)

Parse role list.

Parameters
array$role_list

Definition at line 256 of file class.ilRoleTableGUI.php.

References $role_folder_id, $rows, ilTableGUI\$title, ilObjRole\_getTranslation(), ANONYMOUS_ROLE_ID, ILIAS\UI\examples\Symbol\Glyph\Filter\filter(), ilRbacReview\FILTER_ALL, getRoleTitleFilter(), getType(), ROLE_FOLDER_ID, ilTable2GUI\setData(), ilTableGUI\setMaxCount(), and SYSTEM_ROLE_ID.

256  : void
257  {
258  $this->role_folder_id = $role_folder_id;
259 
260  $filter_orig = '';
261  if ($this->getType() == self::TYPE_VIEW) {
262  $filter_orig = $this->filter[self::FILTER_TITLE];
263  $type_filter = $this->filter[self::FILTER_ROLE_TYPE];
264  } else {
265  $filter_orig = $this->getRoleTitleFilter();
266  $type_filter = ilRbacReview::FILTER_ALL;
267  }
268 
269  $counter = 0;
270  $rows = [];
271  foreach ($this->rbacreview->getRolesByFilter($type_filter, 0, '') as $role) {
272  if (
273  $role['parent'] and
274  (
275  $this->tree->isDeleted($role['parent']) ||
276  !$this->tree->isInTree($role['parent'])
277  )
278  ) {
279  continue;
280  }
281  $title = ilObjRole::_getTranslation($role['title']);
282  if (strlen($filter_orig)) {
283  if (stristr($title, $filter_orig) == false) {
284  continue;
285  }
286  }
287 
288  $rows[$counter]['title_orig'] = $role['title'];
289  $rows[$counter]['title'] = $title;
290  $rows[$counter]['description'] = $role['description'];
291  $rows[$counter]['obj_id'] = $role['obj_id'];
292  $rows[$counter]['parent'] = $role['parent'];
293  $rows[$counter]['type'] = $role['type'];
294 
295  $auto = substr($role['title'], 0, 3) == 'il_';
296 
297  // Role templates
298  if ($role['type'] == 'rolt') {
299  $rows[$counter]['rtype'] = $auto ? self::TYPE_ROLT_AU : self::TYPE_ROLT_UD;
300  } elseif ($role['parent'] == ROLE_FOLDER_ID) {
301  // Roles
302  if ($role['obj_id'] == ANONYMOUS_ROLE_ID || $role['obj_id'] == SYSTEM_ROLE_ID) {
303  $rows[$counter]['rtype'] = self::TYPE_GLOBAL_AU;
304  } else {
305  $rows[$counter]['rtype'] = self::TYPE_GLOBAL_UD;
306  }
307  } else {
308  $rows[$counter]['rtype'] = $auto ? self::TYPE_LOCAL_AU : self::TYPE_LOCAL_UD;
309  }
310 
311  ++$counter;
312  }
313  $this->setMaxCount(count($rows));
314  $this->setData($rows);
315  }
setData(array $a_data)
const SYSTEM_ROLE_ID
Definition: constants.php:29
static _getTranslation(string $a_role_title)
const ROLE_FOLDER_ID
Definition: constants.php:34
$rows
Definition: xhr_table.php:10
const ANONYMOUS_ROLE_ID
Definition: constants.php:28
setMaxCount(int $a_max_count)
set max.
+ Here is the call graph for this function:

◆ setRoleTitleFilter()

ilRoleTableGUI::setRoleTitleFilter ( string  $a_filter)

Definition at line 322 of file class.ilRoleTableGUI.php.

322  : void
323  {
324  $this->role_title_filter = $a_filter;
325  }

◆ setType()

ilRoleTableGUI::setType ( int  $a_type)

Definition at line 195 of file class.ilRoleTableGUI.php.

195  : void
196  {
197  $this->type = $a_type;
198  }

Field Documentation

◆ $filter

array ilRoleTableGUI::$filter = []
private

Definition at line 47 of file class.ilRoleTableGUI.php.

◆ $path_gui

ilPathGUI ilRoleTableGUI::$path_gui
private

Definition at line 41 of file class.ilRoleTableGUI.php.

Referenced by getPathGUI().

◆ $rbacreview

ilRbacReview ilRoleTableGUI::$rbacreview
private

Definition at line 49 of file class.ilRoleTableGUI.php.

◆ $role_folder_id

int ilRoleTableGUI::$role_folder_id = 0
private

Definition at line 45 of file class.ilRoleTableGUI.php.

Referenced by parse().

◆ $role_title_filter

string ilRoleTableGUI::$role_title_filter = ''
private

Definition at line 44 of file class.ilRoleTableGUI.php.

Referenced by getRoleTitleFilter().

◆ $system

ilRbacSystem ilRoleTableGUI::$system
private

Definition at line 50 of file class.ilRoleTableGUI.php.

◆ $tree

ilTree ilRoleTableGUI::$tree
private

Definition at line 48 of file class.ilRoleTableGUI.php.

◆ $type

int ilRoleTableGUI::$type = self::TYPE_VIEW
private

Definition at line 43 of file class.ilRoleTableGUI.php.

Referenced by getType().

◆ FILTER_ROLE_TYPE

const ilRoleTableGUI::FILTER_ROLE_TYPE = 'role_type'
private

Definition at line 35 of file class.ilRoleTableGUI.php.

◆ FILTER_TITLE

const ilRoleTableGUI::FILTER_TITLE = 'title'
private

Definition at line 36 of file class.ilRoleTableGUI.php.

◆ TYPE_GLOBAL_AU

const ilRoleTableGUI::TYPE_GLOBAL_AU = 1
private

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

◆ TYPE_GLOBAL_UD

const ilRoleTableGUI::TYPE_GLOBAL_UD = 2
private

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

◆ TYPE_LOCAL_AU

const ilRoleTableGUI::TYPE_LOCAL_AU = 3
private

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

◆ TYPE_LOCAL_UD

const ilRoleTableGUI::TYPE_LOCAL_UD = 4
private

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

◆ TYPE_ROLT_AU

const ilRoleTableGUI::TYPE_ROLT_AU = 5
private

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

◆ TYPE_ROLT_UD

const ilRoleTableGUI::TYPE_ROLT_UD = 6
private

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

◆ TYPE_SEARCH

const ilRoleTableGUI::TYPE_SEARCH = 2

Definition at line 39 of file class.ilRoleTableGUI.php.

Referenced by ilObjRoleFolderGUI\roleSearchListObject().

◆ TYPE_VIEW

const ilRoleTableGUI::TYPE_VIEW = 1

Definition at line 38 of file class.ilRoleTableGUI.php.


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