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

config_text_input()

Description

Generate an html text entry or password block

field. Defaulted to false.

Parameters

ColumnTypeDefaultDescription
$name string the name of the text block. Usually the name of the config variable being set.
$label string the user text displayed to label the text block. Usually a $lang string.
$current string the current value of the config variable being set.
$password boolean false whether this is a "normal" text-entry field or a password-style
$width integer 420 the width of the input field in pixels. Default: 420.
$textarea false
$title null
$autosave false
$hidden false

Location

include/config_functions.php lines 455 to 500

Definition

 
function config_text_input($name$label$current$password false$width 420$textarea false$title null$autosave false$hidden false)
    {
    global 
$lang;

    if(
is_null($title))
        {
        
// This is how it was used on plugins setup page. Makes sense for developers when trying to debug and not much for non-technical users
        
$title str_replace('%cvn'$name$lang['plugins-configvar']);
        }
    
?>

    <div class="Question" id="question_ echo $name?> if ($hidden){echo "style=\"display:none;\"";} ?> >
        <label for=" echo $name?>" title=" echo $title?>"> echo $label?></label>
    
    
if($autosave)
        {
        
?>
        <div class="AutoSaveStatus">
            <span id="AutoSaveStatus- echo $name?>" style="display:none;"></span>
        </div>
        
        
}

    if(
$textarea == false)
        {
        
?>
        <input id=" echo $name?>"
               name=" echo $name?>"
               type=" echo $password 'password' 'text'?>"
               value=" echo escape((string) $current); ?>"
                if($autosave) { ?>onFocusOut="AutoSaveConfigOption(' echo $name?>');" ?>
               style="width: echo $width?>px" />
        
        
}
    else
        {
        
?>
        <textarea id=" echo $name?>" name=" echo $name?>" style="width: echo $width?>px"> echo escape($current); ?></textarea>
        
        
}
        
?>
        <div class="clearerleft"></div>
    </div>

    
    
}

This article was last updated 25th April 2024 21:35 Europe/London time based on the source file dated 18th April 2024 17:15 Europe/London time.