Collections functions
Encryption functions
General functions
Render functions
Theme permission functions
Video functions
Resource functions

get_fields_for_search_display()

Parameters

ColumnTypeDefaultDescription
$field_refs

Location

include/search_functions.php lines 2404 to 2429

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)) {
        
print_r($field_refs);
        exit(
" passed to getfields() is not an array. ");
    }

    
# Executes query.
    
$fields sql_query("select *, ref, name, type, title, keywords_index, partial_index, value_filter from resource_type_field where ref in ('" join("','",$field_refs) . "')","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 29th November 2020 05:05 Europe/London time based on the source file dated 26th November 2020 14:30 Europe/London time.