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

render_user_collection_select()

Parameters

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

Location

include/render_functions.php lines 3710 to 3735

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\">" $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 19th March 2024 07:05 Europe/London time based on the source file dated 15th March 2024 17:00 Europe/London time.