Collections functions
Encryption functions
General functions
Render functions
Theme permission functions
Video functions
Resource functions

get_selectedtypes()

Parameters

This function accepts no parameters.

Location

include/search_functions.php lines 2854 to 2897

Definition

 
function get_selectedtypes()
    {
    global 
$search_includes_resources$collection_search_includes_resource_metadata;

    
# The restypes cookie is populated with $default_res_type at login and maintained thereafter
    # The advanced_search_section cookie is for the advanced search page and is not referenced elsewhere
    
$restypes=getvalescaped("restypes","");
    
$advanced_search_section getvalescaped("advanced_search_section""");
    
    
# If advanced_search_section is absent then load it from restypes
    
if (getval("submitted","")==""
        {
        if (!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(',',$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 27th November 2020 16:35 Europe/London time based on the source file dated 26th November 2020 14:30 Europe/London time.