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

empty_user_dash()

Parameters

ColumnTypeDefaultDescription
$user
$purge true

Location

include/dash_functions.php lines 1056 to 1080

Definition

 
function empty_user_dash($user,$purge=true)
    {
    global 
$lang;
    
$usertiles ps_query(
        
"SELECT udt.dash_tile,dt.title
            FROM user_dash_tile udt
                JOIN dash_tile dt ON udt.dash_tile=dt.ref
            WHERE udt.user= ?"
,
        [
'i'$user]
    );

    
ps_query("DELETE FROM user_dash_tile WHERE user= ?", ['i'$user]);
    if(
$purge)
        {
        foreach(
$usertiles as $tile)
            {
            
$existing ps_query("SELECT count(*) as 'count' FROM user_dash_tile WHERE dash_tile= ?", ['i'$tile['dash_tile']]);
            if(
$existing[0]["count"]<1)
                {
                
delete_dash_tile($tile["dash_tile"]);
                
log_activity($lang['manage_all_dash'],LOG_CODE_DELETED,$tile["title"],'dash_tile',null,$tile["dash_tile"]);
                }
            }
        }
    }

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