Collections functions
General functions
Render functions
Theme permission 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 4231 to 4264

Definition

 
function get_exiftool_fields($resource_typestring $option_separator ","bool $skip_translation false)
    {
    global 
$FIXED_LIST_FIELD_TYPES;
    
$include_globals ps_value('SELECT inherit_global_fields AS `value` FROM resource_type WHERE ref = ?', ['i'$resource_type], 1);

    
$return ps_query("
           SELECT ref,
                  type,
                  exiftool_field,
                  exiftool_filter,
                  name,
                  read_only
             FROM resource_type_field 
            WHERE length(exiftool_field) > 0
              AND (resource_type = ? "
. ($include_globals == ?" OR resource_type = '0'":"") .")
         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 4th February 2023 11:35 Europe/London time based on the source file dated 3rd February 2023 13:55 Europe/London time.