Collections functions
Encryption functions
General functions
Theme permission functions
Resource functions

new_featured_collection_form()

Description

Show the new featured collection form.

Parameters

ColumnTypeDefaultDescription
$themearray array array array of theme levels at which featured collection will be created

Return

void

Location

include/collections_functions.php lines 3295 to 3380

Definition

 
function new_featured_collection_form(array $themearray = array())
    {
    global 
$lang;

    if(!
checkperm('h'))
        {
        
http_response_code(401);
        exit(
$lang['error-permissiondenied']);
        }

    
$themes_count count($themearray);
    
?>
    <div class="BasicsBox">
        <h1> echo $lang["createnewcollection"?></h1>
        <form id="new_collection_form"
              name="new_collection_form"
              class="modalform"
              method="POST"
              action=" echo $_SERVER['PHP_SELF'?>"
              onsubmit="return CentralSpacePost(this, true);">
             generateFormToken("new_collection_form"); ?>
            <div class="Question">
                <label for="collectionname" > echo $lang["collectionname"?></label>
                <input type="text" name="collectionname" required="true"></input>
                <div class="clearleft"></div>
            </div>

        
        
if($themes_count)
            {
            
?>
            <div class="Question">
                <label for="location" ></label>
                <div>
                    <input type="radio"
                           name="location" 
                           value="root" 
                           onclick="jQuery('#theme_category_name').slideUp();jQuery('#category_name_input').prop('required',false);"
                           checked
                           > echo "&nbsp;" $lang["create_new_here"]; ?></input>
                </div>
                <label for="location" ></label>
                <div>
                    <input type="radio"
                           name="location"
                           value="subfolder"
                           onclick="jQuery('#theme_category_name').slideDown();jQuery('#category_name_input').prop('required',true);"
                           > echo "&nbsp;" $lang["create_new_below"]; ?></input>
                </div>
                <div class="clearleft"></div>
            </div>
            
            
}
            
?>
            <div class="Question" id="theme_category_name"  if($themes_count 0) {?>style="display:none;"  }?></div>
                <label for="category_name" > echo $lang["themecategory"?></label>
                <input type="text" name="category_name" id="category_name_input"  if($themes_count == 0) {?>required="true"  }?>></input>
                <div class="clearleft"></div>
            </div>
        
        
for($n 0$n $themes_count$n++)
            {
            echo 
"<input type='hidden' name='theme" . ($n $n "") . "' value='" htmlspecialchars($themearray[$n], ENT_QUOTES) . "'></input>";
            }

        
// Root level does not allow collections so the only option for the user is to just create a featured collection
        // category level
        
if(=== $themes_count)
            {
            
?>
            <input type="hidden" name="location" value="subfolder">
            
            
}
            
?>
            <input type='hidden' name='create' value='true'></input>
            <div class="QuestionSubmit" >
                <label></label>
                <input type="submit" name="create" value=" echo $lang["create"?>"></input>
                <div class="clearleft"></div>
            </div>
        </form>
    </div>
    

    
return;
    }

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