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

render_user_collection_select()

Parameters

ColumnTypeDefaultDescription
$name "collection"
$collections array
$selected 0
$classes ""
$onchangejs ""

Location

include/render_functions.php lines 3777 to 3802

Definition

 
function render_user_collection_select($name "collection"$collections=array(), $selected=0$classes ""$onchangejs "")
    {
    global 
$userref,$hidden_collections,$active_collections,$lang;
    if(
count($collections) == 0)
        {
        
$collections get_user_collections($userref);   
        }
    
    echo 
"<select name=\"" $name "\" id=\"" $name "\" " . ($onchangejs != "" ? (" onchange=\"" escape($onchangejs) . "\"") : "") . ($classes != "" ? (" class=\"" escape($classes) . "\"") : "")  . ">";
    echo 
"<option value=\"0\">" escape($lang["select"]) . "</option>";
    for (
$n=0;$n<count($collections);$n++)
        {
        if(
in_array($collections[$n]['ref'],$hidden_collections))
            {
            continue;
            }
        
        
#show only active collections if a start date is set for $active_collections 
        
if (strtotime($collections[$n]['created']) > ((isset($active_collections))?strtotime($active_collections):1))
            {
            echo 
"<option value=\"" $collections[$n]["ref"] . "\" " . ($selected==$collections[$n]["ref"] ? "selected" "") . ">" i18n_get_collection_name($collections[$n]) . "</option>";
            }
        }
           
    echo 
"</select>";
    }

This article was last updated 14th December 2024 20:35 Europe/London time based on the source file dated 13th December 2024 14:05 Europe/London time.