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 738 to 777

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 4th December 2024 08:35 Europe/London time based on the source file dated 13th November 2024 15:50 Europe/London time.