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

add_usergroup_dash_tile()

Parameters

ColumnTypeDefaultDescription
$usergroup
$tile
$default_order_by

Location

include/dash_functions.php lines 739 to 778

Definition

 
function add_usergroup_dash_tile($usergroup$tile$default_order_by)
    {
    if(!
is_numeric($usergroup) || !is_numeric($tile))
        {
        return 
false;
        }

    
$reorder true;
    if(!
is_numeric($default_order_by))
        {
        
$default_order_by append_usergroup_position($usergroup);
        
$reorder          false;
        }

    
$existing ps_query(
        
"SELECT ref, usergroup, dash_tile, default_order_by, order_by
            FROM usergroup_dash_tile
            WHERE usergroup = ? AND dash_tile = ?"
,
        [
'i'$usergroup'i'$tile]
    );
    if(!
$existing)
        {
        
ps_query(
            
"INSERT INTO usergroup_dash_tile (usergroup, dash_tile, default_order_by)
            VALUES (?, ?, ?)"
,
            [
'i'$usergroup'i'$tile'i'$default_order_by]
        );
        }
    else
        {
        return 
$existing;
        }

    if(
$reorder)
        {
        
reorder_usergroup_dash($usergroup);
        }

    return 
true;
    }

This article was last updated 14th December 2024 06:05 Europe/London time based on the source file dated 12th December 2024 19:40 Europe/London time.