Collections functions
Encryption functions
General functions
Render functions
Theme permission functions
Video functions
Resource functions

get_user_available_tiles()

Parameters

ColumnTypeDefaultDescription
$user
$tile "null"

Location

include/dash_functions.php lines 1021 to 1100

Definition

 
function get_user_available_tiles($user,$tile="null")
    {
    
$tilecheck = (is_numeric($tile)) ? "WHERE ref='".$tile."'":"";
    return 
sql_query
        
(
            
"
            SELECT 
                result.*
            FROM
            (    (
                SELECT 
                    dash_tile.ref,
                    '' as 'dash_tile',
                    '' as 'usertile', 
                    '' as 'user', 
                    '' as 'order_by',
                    dash_tile.ref as 'tile',
                    dash_tile.title,
                    dash_tile.txt,
                    dash_tile.link,
                    dash_tile.url,
                    dash_tile.resource_count,
                    dash_tile.all_users,
                    dash_tile.allow_delete,
                    dash_tile.default_order_by
                FROM
                    dash_tile
                WHERE
                    dash_tile.all_users = 1
                    AND
                    ref 
                    NOT IN
                    (
                        SELECT 
                            dash_tile.ref
                        FROM
                            user_dash_tile
                        RIGHT OUTER JOIN
                            dash_tile
                        ON 
                            user_dash_tile.dash_tile = dash_tile.ref

                        WHERE
                            user_dash_tile.user = '"
.$user."'
                    )
                AND ref NOT IN (SELECT dash_tile FROM usergroup_dash_tile)
                )
            UNION
                (
                SELECT 
                    dash_tile.ref,
                    user_dash_tile.dash_tile,
                    user_dash_tile.ref as 'usertile', 
                    user_dash_tile.user, 
                    user_dash_tile.order_by,
                    dash_tile.ref as 'tile',
                    dash_tile.title,
                    dash_tile.txt,
                    dash_tile.link,
                    dash_tile.url,
                    dash_tile.resource_count,
                    dash_tile.all_users,
                    dash_tile.allow_delete,
                    dash_tile.default_order_by
                FROM
                    user_dash_tile
                RIGHT OUTER JOIN
                    dash_tile
                ON 
                    user_dash_tile.dash_tile = dash_tile.ref
                WHERE
                    user_dash_tile.user = '"
.$user."'
                )
            ) result
            "
.$tilecheck."
            ORDER BY result.order_by,result.default_order_by

            "
        
);
    }

This article was last updated 28th November 2020 23:05 Europe/London time based on the source file dated 3rd November 2020 16:55 Europe/London time.