tab_functions.php
Table of Contents
Functions
- acl_can_manage_tabs() : bool
- Access control check if user is allowed to manage system tabs.
- get_tabs_by_refs() : array<string|int, mixed>
- Get entire tab records for a list of IDs
- get_tabs_with_usage_count() : array<string|int, mixed>
- Get tabs (paged) based on some criteria (currently only order by and limit).
- get_all_tabs() : array<string|int, mixed>
- Get all tab records, sorted by the order_by column
- get_tab_name_options() : array<string|int, mixed>
- Get list of all tabs sorted based on current configuration. This always adds a fake record (ref #0) to indicate no assignment.
- sort_tabs_as_configured() : array<string|int, mixed>
- Sort list of tab names (preserving their key ID)
- create_tab() : bool|int
- Create a new system tab record NOTE: order_by should only be set when re-ordering the set by the user. {@see sql_reorder_records('tab', $refs)}
- delete_tabs() : bool
- Delete system tabs.
- save_tab() : bool
- Update an existing tab.
Functions
acl_can_manage_tabs()
Access control check if user is allowed to manage system tabs.
acl_can_manage_tabs() : bool
Return values
boolget_tabs_by_refs()
Get entire tab records for a list of IDs
get_tabs_by_refs(array<string|int, mixed> $refs) : array<string|int, mixed>
Parameters
- $refs : array<string|int, mixed>
-
List of tab refs
Return values
array<string|int, mixed>get_tabs_with_usage_count()
Get tabs (paged) based on some criteria (currently only order by and limit).
get_tabs_with_usage_count(array<string|int, mixed> $criteria) : array<string|int, mixed>
Parameters
- $criteria : array<string|int, mixed>
-
Array holding criteria information (order_by and limit).
Return values
array<string|int, mixed> —get_all_tabs()
Get all tab records, sorted by the order_by column
get_all_tabs() : array<string|int, mixed>
Return values
array<string|int, mixed>get_tab_name_options()
Get list of all tabs sorted based on current configuration. This always adds a fake record (ref #0) to indicate no assignment.
get_tab_name_options() : array<string|int, mixed>
Return values
array<string|int, mixed> —Key is the tabs' ID and value its translated name.
sort_tabs_as_configured()
Sort list of tab names (preserving their key ID)
sort_tabs_as_configured(array<string|int, mixed> $tabs) : array<string|int, mixed>
Parameters
- $tabs : array<string|int, mixed>
-
List of tab ID and tab translated name pairs
Return values
array<string|int, mixed>create_tab()
Create a new system tab record NOTE: order_by should only be set when re-ordering the set by the user. {@see sql_reorder_records('tab', $refs)}
create_tab(array<string|int, mixed> $tab) : bool|int
Parameters
- $tab : array<string|int, mixed>
Return values
bool|int —Return new tab record ID or FALSE otherwise
delete_tabs()
Delete system tabs.
delete_tabs(array<string|int, mixed> $refs) : bool
IMPORTANT: never allow the "Default" tab (ref #1) to be deleted because this is the fallback location for information that has no association with other tabs.
Parameters
- $refs : array<string|int, mixed>
-
List of tab IDs
Return values
bool —Returns TRUE if it executed the query, FALSE otherwise
save_tab()
Update an existing tab.
save_tab(array<string|int, mixed> $tab) : bool
NOTE: order_by should only be set when re-ordering the set by the user. sql_reorder_records('tab', $refs)
Parameters
- $tab : array<string|int, mixed>
-
A tab record (type)
Return values
bool —Returns TRUE if it executed the query, FALSE otherwise