Collections functions
General functions
Render functions
Theme permission functions
Resource functions

resource_type_config_override()

Parameters

ColumnTypeDefaultDescription
$resource_type
$only_onchange true

Location

include/resource_functions.php lines 5907 to 5941

Definition

 
function resource_type_config_override($resource_type$only_onchange=true)
    {
    
# 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);
            
debug_track_vars('end@resource_type_config_override'get_defined_vars());
            }
        }
    }

This article was last updated 4th October 2022 17:05 Europe/London time based on the source file dated 30th September 2022 14:20 Europe/London time.