Collections functions
General functions
Node functions
Render functions
Theme permission functions
User functions
Resource functions

get_selectedtypes()

Parameters

This function accepts no parameters.

Location

include/search_functions.php lines 3169 to 3211

Definition

 
function get_selectedtypes()
    {
    global 
$search_includes_resources$default_advanced_search_mode;

    
# 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=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 19th March 2024 08:35 Europe/London time based on the source file dated 15th March 2024 17:00 Europe/London time.