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

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 4432 to 4464

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 19th April 2024 09:35 Europe/London time based on the source file dated 18th April 2024 16:10 Europe/London time.