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

Description

Retrieves the selected resource types for the search functionality.

Parameters

This function accepts no parameters.

Return

array An array of selected resource types for the search.

Location

include/search_functions.php lines 3420 to 3459

Definition

 
function get_selectedtypes()
    {
    global 
$search_includes_resources$default_advanced_search_mode;
    
$restypes=getval("restypes","");
    
$advanced_search_section getval("advanced_search_section""");

    
# If advanced_search_section is absent then load it from restypes
    
if (
        
getval("submitted","") == ""
        
&& !isset($advanced_search_section)
        ) {
            
$advanced_search_section $restypes;
        }

    
# If clearbutton pressed then the selected types are reset based on configuration settings
    
if(getval('resetform''') != '')
        {
        if (isset(
$default_advanced_search_mode))
            {
            
$selectedtypes explode(',',trim($default_advanced_search_mode' ,'));
            }
        else
            {
            if(
$search_includes_resources)
                {
                
$selectedtypes = array('Global''Media');
                }
            else
                {
                
$selectedtypes = array('Collections');
                }
            }
        }
    else 
# Not clearing, so get the currently selected types
        
{
        
$selectedtypes explode(','$advanced_search_section);
        }

    return 
$selectedtypes;
    }

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