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

Description

Retrieves the default resource types for search functionality.

This function determines which resource types to include in the search based on the global
settings for resource and theme inclusion. If resources are to be included, it checks the
default resource types and returns them as an array. If no specific default resource types
are defined, it defaults to including "Global." If resources are not to be included, it
defaults to "Collections," and if themes are included, "FeaturedCollections" is also added.

Parameters

This function accepts no parameters.

Return

array An array of default resource types to be used in the search.

Location

include/search_functions.php lines 3389 to 3411

Definition

 
function get_search_default_restypes()
    {
    global 
$search_includes_resources$search_includes_themes,$default_res_types;
    
$defaultrestypes=array();

    if(
$search_includes_resources)
        {
        if(
$default_res_types == "")
            {
            
$defaultrestypes[] = "Global";
            }
        else
            {
            
$defaultrestypes = (is_array($default_res_types)?$default_res_types:explode(",",(string) $default_res_types));
            }
        }
    else
        {
        
$defaultrestypes[] = "Collections";
        if(
$search_includes_themes){$defaultrestypes[] = "FeaturedCollections";}
        }
    return 
$defaultrestypes;
    }

This article was last updated 12th December 2024 08:05 Europe/London time based on the source file dated 11th December 2024 15:55 Europe/London time.