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

resource_type_config_override()

Parameters

ColumnTypeDefaultDescription
$resource_type
$only_onchange true

Location

include/resource_functions.php lines 6415 to 6449

Definition

 
function resource_type_config_override($resource_type$only_onchange=true)
    {
    
debug_function_call(__FUNCTION__func_get_args());
    
# Pull in the necessary config for a given resource type
    # As this could be called many times, e.g. during search result display
    # By default (only_onchange) only execute the override if the passed resourcetype is different from the previous
    
global $resource_type_config_override_last,$resource_type_config_override_snapshot$ffmpeg_alternatives;

    
$config_override_required=false;
    
# If the overrides are only to be executed on change of resource type
    
if ($only_onchange)
        {
        
# If the resource type has changed or if this is the first resource....
        
if (!isset($resource_type_config_override_last) || $resource_type_config_override_last!=$resource_type)
            {
            
$config_override_required=true;
            
$resource_type_config_override_last=$resource_type;
            }
        }
    else
        
# The overrides are to be executed for every resource
        
{
        
$config_override_required=true;
        }

    if (
$config_override_required)
        {
        
# Look for config and execute.
        
$config_options=ps_value("select config_options value from resource_type where ref=?",array("i",$resource_type), "","schema");
        if (
$config_options!="")
            {
            
override_rs_variables_by_eval($GLOBALS$config_options);
            }
        }
    }

This article was last updated 19th March 2024 10:05 Europe/London time based on the source file dated 11th March 2024 14:25 Europe/London time.