Coding standards
Security in ResourceSpace
Developer reference
Database
Action functions
Admin functions
Ajax functions
Annotation functions
API functions
Collections functions
Comment functions
Config functions
CSV export functions
Dash functions
Debug functions
Encryption functions
Facial recognition functions
File functions
General functions
Language functions
Log functions
Login functions
Message functions
Migration functions
Node functions
PDF functions
Plugin functions
Render functions
Reporting functions
Request functions
Research functions
Slideshow functions
Theme permission functions
User functions
Video functions
Database functions
Metadata functions
Resource functions
Search functions
Map functions
Job functions
Tab functions
Test functions

get_fields_for_search_display()

Description

Retrieves a list of fields/properties suitable for search display based on the provided field references.

visible to the user based on permission checks.
@throws Exception if the input parameter is not an array.

Parameters

ColumnTypeDefaultDescription
$field_refs array An array of field references to filter the search display fields.

Return

array An array of fields with their properties, including translated titles, that are

Location

include/search_functions.php lines 2919 to 2940

Definition

 
function get_fields_for_search_display($field_refs)
    {
    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 4th December 2024 08:35 Europe/London time based on the source file dated 27th November 2024 09:40 Europe/London time.