Coding standards
Security in ResourceSpace
Developer reference
Database
Action functions
Admin functions
Ajax functions
Annotation functions
API functions
Collections functions
Comment functions
Config functions
CSV export functions
Dash functions
Debug functions
Encryption functions
Facial recognition functions
File functions
General functions
Language functions
Log functions
Login functions
Message functions
Migration functions
Node functions
PDF functions
Plugin functions
Render functions
Reporting functions
Request functions
Research functions
Slideshow functions
Theme permission functions
User functions
Video functions
Database functions
Metadata functions
Resource functions
Search functions
Map functions
Job functions
Tab functions
Test functions

reorder_usergroup_dash()

Description

Reorder dashboard tiles for a specific user group.

This function retrieves all dashboard tiles assigned to a user group and updates each tile's order in increments of 10.

Parameters

ColumnTypeDefaultDescription
$usergroup int The user group ID for which dashboard tiles should be reordered.

Return

void

Location

include/dash_functions.php lines 798 to 808

Definition

 
function reorder_usergroup_dash($usergroup)
    {
    
$usergroup_tiles ps_query("SELECT usergroup_dash_tile.dash_tile FROM usergroup_dash_tile LEFT JOIN dash_tile ON usergroup_dash_tile.dash_tile = dash_tile.ref WHERE usergroup_dash_tile.usergroup = ? ORDER BY usergroup_dash_tile.default_order_by", ['i'$usergroup]);
    
$order_by        10 count($usergroup_tiles);

    for(
$i count($usergroup_tiles) - 1$i >= 0$i--)
        {
        
update_usergroup_dash_tile_order($usergroup$usergroup_tiles[$i]['dash_tile'], $order_by);
        
$order_by -= 10;
        }
    }

This article was last updated 17th November 2024 15:35 Europe/London time based on the source file dated 13th November 2024 15:50 Europe/London time.