get_exiftool_fields()

Description

Returns a list of exiftool fields, which are basically fields with an 'exiftool field' set.

- Recommended NODE_NAME_STRING_SEPARATOR
- Defaults to comma for backwards compatibility

Parameters

ColumnTypeDefaultDescription
$resource_type integer
$option_separator string " String to separate the node options returned for fixed list fields
"
$skip_translation bool false Set to true to return the entire untranslated node value rather than the appropriate translation only.

Return

array

Location

include/resource_functions.php lines 4466 to 4498

Definition

 
function get_exiftool_fields($resource_typestring $option_separator ","bool $skip_translation false)
    {
    global 
$FIXED_LIST_FIELD_TYPES;
    
$return ps_query("
           SELECT f.ref,
                  f.type,
                  f.exiftool_field,
                  f.exiftool_filter,
                  f.name,
                  f.read_only
             FROM resource_type_field AS f
        LEFT JOIN resource_type_field_resource_type rtfrt ON f.ref=rtfrt.resource_type_field
            WHERE length(exiftool_field) > 0
              AND (rtfrt.resource_type = ? OR f.global=1)
         GROUP BY ref
         ORDER BY exiftool_field"
, array("i",$resource_type),"schema");
        

    
// Add options for fixed list fields
    
foreach($return as &$field)
        {
        if(
in_array($field["type"],$FIXED_LIST_FIELD_TYPES))
            {
            
$options get_field_options($field["ref"], false$skip_translation);
            
$field["options"] = implode($option_separator,$options);
            }
        else
            {
            
$field["options"] = "";
            }
        }
    return 
$return;
    }

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