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

validate_tile_style()

Description

Validate the type of dash tile and check that the style provided is valid for it.

Parameters

ColumnTypeDefaultDescription
$type string Tile type name.
$style string Tile style name.

Return

string Will return the style value provided if correct, the first defined style or blank if no styles defined.

Location

include/dash_functions.php lines 1867 to 1889

Definition

 
function validate_tile_style(string $typestring $style
    {
    global 
$tile_styles;
    if (isset(
$tile_styles) && array_key_exists($type$tile_styles))
        {
        if (
count($tile_styles[$type]) === 0)
            {
            return 
'';
            }
        if (
in_array($style,$tile_styles[$type]))
            {
            return 
$style;
            }
        else
            {
            return 
$tile_styles[$type][0];
            }
        }
    else
        {
        return 
'';
        }
    }

This article was last updated 19th March 2024 11:05 Europe/London time based on the source file dated 15th March 2024 17:00 Europe/London time.