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

get_user_available_tiles()

Parameters

ColumnTypeDefaultDescription
$user
$tile "null"

Location

include/dash_functions.php lines 1123 to 1206

Definition

 
function get_user_available_tiles($user,$tile="null")
    {
    
$tilecheck ''$params = [];
    if(
is_numeric($tile))
        {
        
$tilecheck 'WHERE ref = ?';
        
$params = ['i'$tile];
        }
    return 
ps_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 = ?
                    )
                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 = ?
                )
            ) result
            "
.$tilecheck."
            ORDER BY result.order_by,result.default_order_by

            "
        
array_merge(['i'$user'i'$user], $params));
    }

This article was last updated 17th November 2024 15:35 Europe/London time based on the source file dated 13th November 2024 15:50 Europe/London time.