Collections functions
General functions
Render functions
Theme permission functions
Resource functions

cleanup_dash_tiles()

Parameters

This function accepts no parameters.

Location

include/dash_functions.php lines 322 to 345

Definition

 
function cleanup_dash_tiles()
    {
    global 
$lang;
    
$tiles ps_query(
        
"SELECT ref, title, txt, all_users, default_order_by, url, link, reload_interval_secs, resource_count, allow_delete FROM dash_tile 
            WHERE allow_delete = 1
                AND all_users = 0
                AND ref NOT IN (SELECT DISTINCT dash_tile FROM user_dash_tile)
                AND ref NOT IN (SELECT DISTINCT dash_tile FROM usergroup_dash_tile)"
    
);

    
ps_query(
        
"DELETE FROM dash_tile 
            WHERE allow_delete = 1
                AND all_users = 0
                AND ref NOT IN (SELECT DISTINCT dash_tile FROM user_dash_tile)
                AND ref NOT IN (SELECT DISTINCT dash_tile FROM usergroup_dash_tile)"
    
);

    foreach (
$tiles as $tile)
        {
        
log_activity($lang['manage_all_dash'],LOG_CODE_DELETED,$tile["title"],'dash_tile',NULL,$tile["ref"]);
        }
    }

This article was last updated 2nd October 2022 16:05 Europe/London time based on the source file dated 27th September 2022 15:05 Europe/London time.