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

resource_type_config_override()

Parameters

ColumnTypeDefaultDescription
$resource_type
$only_onchange true

Location

include/resource_functions.php lines 6667 to 6701

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'resource_type');
            }
        }
    }

This article was last updated 15th December 2024 10:35 Europe/London time based on the source file dated 13th December 2024 14:45 Europe/London time.