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_advanced_search_collection_fields()

Description

Retrieves a list of fields suitable for advanced searching within collections.

This function constructs an array of fields specifically related to collections, including
collection title, keywords, and owner. It checks against a list of hidden fields to determine
which fields should be included in the return array for advanced searching.

Parameters

ColumnTypeDefaultDescription
$archive bool false Whether to include fields related to archived collections. Defaults to false.
$hiddenfields string "" A comma-separated string of field references that should be hidden from the search.

Return

array An array of fields suitable for advanced searching in the context of collections.

Location

include/search_functions.php lines 142 to 160

Definition

 
function get_advanced_search_collection_fields($archive=false$hiddenfields="")
    {
    
$return=array();

    
$hiddenfields=explode(",",$hiddenfields);

    
$fields[] = array("ref" => "collection_title""name" => "collectiontitle""display_condition" => """tooltip_text" => """title"=>"Title""type" => 0"global"=>0"resource_types"=>'Collections');
    
$fields[] = array("ref" => "collection_keywords""name" => "collectionkeywords""display_condition" => """tooltip_text" => """title"=>"Keywords""type" => 0"global"=>0"resource_types"=>'Collections');
    
$fields[] = array("ref" => "collection_owner""name" => "collectionowner""display_condition" => """tooltip_text" => """title"=>"Owner""type" => 0"global"=>0"resource_types"=>'Collections');
    
# Apply field permissions and check for fields hidden in advanced search
    
for ($n=0;$n<count($fields);$n++)
        {

        if (!
in_array($fields[$n]["ref"], $hiddenfields))
        {
$return[]=$fields[$n];}
        }

    return 
$return;
    }

This article was last updated 8th December 2024 20:35 Europe/London time based on the source file dated 27th November 2024 09:40 Europe/London time.