Collections functions
General functions
Render functions
Theme permission functions
Resource functions

get_fields_for_search_display()

Parameters

ColumnTypeDefaultDescription
$field_refs

Location

include/search_functions.php lines 2531 to 2556

Definition

 
function get_fields_for_search_display($field_refs)
    {
    
# Returns a list of fields/properties with refs matching the supplied field refs, for search display setup
    # This returns fewer columns and doesn't require that the fields be indexed, as in this case it's only used to judge whether the field should be highlighted.
    # Standard field titles are translated using $lang.  Custom field titles are i18n translated.

    
if (!is_array($field_refs))
        {
        exit(
" passed to getfields() is not an array. ");
        }

    
# Executes query.
    
$fields ps_query("select ref, name, title, type ,order_by, keywords_index, partial_index, resource_type, resource_column, display_field, use_for_similar, iptc_equiv, display_template, tab_name, required, smart_theme_name, exiftool_field, advanced_search, simple_search, help_text, tooltip_text, display_as_dropdown, display_condition, field_constraint, active, value_filter from resource_type_field where ref in (" ps_param_insert(count($field_refs)) . ")",ps_param_fill($field_refs,"i"), "schema");

    
# Applies field permissions and translates field titles in the newly created array.
    
$return = array();
    for (
$n 0;$n<count($fields);$n++)
        {
        if (
metadata_field_view_access($fields[$n]["ref"]))
            {
            
$fields[$n]["title"] = lang_or_i18n_get_translated($fields[$n]["title"], "fieldtitle-");
            
$return[] = $fields[$n];
            }
        }
    return 
$return;
    }

This article was last updated 3rd October 2022 13:05 Europe/London time based on the source file dated 13th September 2022 17:55 Europe/London time.