Collections functions
General functions
Node functions
Render functions
Theme permission functions
User functions
Resource functions

cleanup_dash_tiles()

Parameters

This function accepts no parameters.

Location

include/dash_functions.php lines 325 to 348

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 19th March 2024 05:35 Europe/London time based on the source file dated 15th March 2024 17:00 Europe/London time.