Collections functions
Encryption functions
General functions
Theme permission functions
Resource functions

config_file_input()

Description

Generate an HTML input file with its own form

Parameters

ColumnTypeDefaultDescription
$name string HTML input file name attribute
$label string
$current
$form_action string URL where the form should post to
$width int 420 Wdidth of the input file HTML tag. Default - 420

Location

include/config_functions.php lines 442 to 487

Definition

 
function config_file_input($name$label$current$form_action$width 420)
    {
    global 
$lang,$storagedir;
    
    if(
$current !=='')
        { 
        
$missing_file str_replace('[storage_url]'$storagedir$current);
        
$pathparts=explode("/",$current);
        }
        
    
?>
    <div class="Question" id="question_ echo $name?>">
        <form method="POST" action=" echo $form_action?>" enctype="multipart/form-data">
            <label for=" echo $name?>"> echo $label?></label>
            <div class="AutoSaveStatus">
                <span id="AutoSaveStatus- echo $name?>" style="display:none;"></span>
            </div>
        
        
if($current !== '' && $pathparts[1]=="system" && !file_exists($missing_file))
            {
            
?>
            <span> echo $lang['applogo_does_not_exists']; ?></span>
            <input type="submit" name="clear_ echo $name?>" value=" echo $lang["clearbutton"]; ?>">
            
            
}
        elseif(
'' === $current || !get_config_option(null$name$current_option) || $current_option === '')
            {
            
?>
            <input type="file" name=" echo $name?>" style="width: echo $width?>px">
            <input type="submit" name="upload_ echo $name?>" value=" echo $lang['upload']; ?>">
            
            
}
        else
            {
            
?>
            <span> echo htmlspecialchars(str_replace('[storage_url]/'''$current), ENT_QUOTES); ?></span>
            <input type="submit" name="delete_ echo $name?>" value=" echo $lang['action-delete']; ?>">
            
            
}
            
generateFormToken($name);
            
?>
        </form>
        <div class="clearerleft"></div>
    </div>
    
    
}

This article was last updated 10th July 2020 00:05 Europe/London time based on the source file dated 8th July 2020 11:40 Europe/London time.