Collections functions
Encryption functions
General functions
Theme permission functions
Resource functions

get_session_collections()

Description

Get an array of collection IDs for the specified ResourceSpace session and user

Parameters

ColumnTypeDefaultDescription
$rs_session string Session id - as obtained by get_rs_session_id()
$userref integer "" User ID
$create boolean false Create new collection?

Return

array Array of collection IDs for the specified sesssion

Location

include/collections_functions.php lines 2669 to 2682

Definition

 
function get_session_collections($rs_session,$userref="",$create=false)
    {
    
$extrasql="";
    if(
$userref!="")
        {
        
$extrasql="and user='" escape_check($userref) ."'";    
        }
    
$collectionrefs=sql_array("select ref value from collection where session_id='" escape_check($rs_session) . "' " $extrasql,"");
    if(
count($collectionrefs)<&& $create)
        {
        
$collectionrefs[0]=create_collection($userref,"Default Collection",0,1); # Do not translate this string!    
        
}        
    return 
$collectionrefs;    
    }

This article was last updated 11th July 2020 22:05 Europe/London time based on the source file dated 9th July 2020 17:22 Europe/London time.