Collections functions
General functions
Render functions
Theme permission functions
Resource functions

get_managed_dash()

Parameters

This function accepts no parameters.

Location

include/dash_functions.php lines 640 to 732

Definition

 
function get_managed_dash()
    {
    global 
$baseurl,$baseurl_short,$lang,$anonymous_login,$username$userref$usergroup;
    global 
$dash_tile_colour$dash_tile_colour_options$managed_home_dash$help_modal;
    
#Build Tile Templates
    
$tiles ps_query("
        SELECT dash_tile.ref AS 'tile',
                dash_tile.title,
                dash_tile.url,
                dash_tile.reload_interval_secs,
                dash_tile.link,
                dash_tile.default_order_by,
                (
                    SELECT ugdt.default_order_by
                        FROM usergroup_dash_tile AS ugdt
                        WHERE ugdt.dash_tile = dash_tile.ref
                        AND ugdt.usergroup = ?
                ) AS 'usergroup_default_order_by'
            FROM dash_tile
            WHERE dash_tile.all_users = 1
            AND (dash_tile.ref IN (SELECT dash_tile FROM usergroup_dash_tile WHERE usergroup_dash_tile.usergroup = ?)
            OR dash_tile.ref NOT IN (SELECT distinct dash_tile FROM usergroup_dash_tile))
            AND (
                dash_tile.allow_delete = 1
                OR (
                    dash_tile.allow_delete = 0
                    AND dash_tile.ref IN (SELECT DISTINCT user_dash_tile.dash_tile FROM user_dash_tile)
                    )
                )
        ORDER BY usergroup_default_order_by ASC, default_order_by ASC
    "
, ['i'$usergroup'i'$usergroup]);
    
    foreach(
$tiles as $tile)
        {
        
$tile_custom_style '';
    if(
$dash_tile_colour)
            {
            
$buildstring explode('?'$tile['url']);
            
parse_str(str_replace('&''&', ($buildstring[1]??"")), $buildstring);
            
            if(isset(
$buildstring['tltype']) && allow_tile_colour_change($buildstring['tltype']) && isset($buildstring['tlstylecolour']))
                {
                
$tile_custom_style .= get_tile_custom_style($buildstring);
                
                }
            }
        
?>
        <a 
            
            
# Check link for external or internal
            
if('http' == mb_strtolower(substr($tile['link'], 04)))
                {
                
$link   parse_dashtile_link($tile['link']);
                
$newtab true;
                }
            else
                {
                
$link   $baseurl '/' htmlspecialchars(parse_dashtile_link($tile['link']));
                
$newtab false;
                }
                
?>
            href=" echo $link?> echo $newtab "target='_blank'" "";?>
            onClick=" echo (!$newtab 'return ' . (($help_modal && strpos($link,'pages/help.php')!==false)?'ModalLoad(this,true);':'CentralSpaceLoad(this,true);') : ''); ?>"

            
            
# Check if tile is set to double width
            
$tlsize = (isset($buildstring['tlsize']) ? $buildstring['tlsize'] : '');
            
?>
            class="HomePanel DashTile DashTileDraggable  echo ('double' == $tlsize 'DoubleWidthDashTile' ''); ?>
            id="tile echo htmlspecialchars($tile["tile"]);?>"
        >
            <div id="contents_tile echo htmlspecialchars($tile["tile"]);?>" class="HomePanelIN HomePanelDynamicDash" style=" echo $tile_custom_style?>">
                 if (strpos($tile["url"],"dash_tile.php")!==false
                    {
                    
# Only pre-render the title if using a "standard" tile and therefore we know the H2 will be in the target data.
                    
?>
                    <h2 class="title"> echo htmlspecialchars($tile["title"]);?></h2>
                     
                    
?>
                <p>Loading...</p>
                <script>
                    height = jQuery("#contents_tile echo htmlspecialchars($tile["tile"]);?>").height();
                    width = jQuery("#contents_tile echo htmlspecialchars($tile["tile"]);?>").width();
                    jQuery("#contents_tile echo htmlspecialchars($tile["tile"]);?>").load(" echo $baseurl."/".$tile["url"]."&tile=".htmlspecialchars($tile["tile"]);?>&tlwidth="+width+"&tlheight="+height);
                </script>
            </div>
        </a>
        
        

    
?>
    <div class="clearerleft"></div>
    
    
}

This article was last updated 30th January 2023 08:35 Europe/London time based on the source file dated 19th January 2023 11:35 Europe/London time.