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

render_user_collection_select()

Parameters

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

Location

include/render_functions.php lines 3297 to 3322

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=\"" htmlspecialchars($onchangejs) . "\"") : "") . ($classes != "" ? (" class=\"" htmlspecialchars($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 24th November 2020 06:05 Europe/London time based on the source file dated 13th November 2020 15:00 Europe/London time.