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

get_fields_for_search_display()

Parameters

ColumnTypeDefaultDescription
$field_refs

Location

include/search_functions.php lines 2676 to 2701

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 " columns_in("resource_type_field") . " 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 19th April 2024 03:35 Europe/London time based on the source file dated 17th April 2024 16:25 Europe/London time.