Coding standards
Security in ResourceSpace
Developer reference
Database
Action functions
Admin functions
Ajax functions
Annotation functions
API functions
Collections functions
Comment functions
Config functions
CSV export functions
Dash functions
Debug functions
Encryption functions
Facial recognition functions
File functions
General functions
Language functions
Log functions
Login functions
Message functions
Migration functions
Node functions
PDF functions
Plugin functions
Render functions
Reporting functions
Request functions
Research functions
Slideshow functions
Theme permission functions
User functions
Video functions
Database functions
Metadata functions
Resource functions
Search functions
Map functions
Job functions
Tab functions
Test functions

render_text_option()

Description

Renders a text field for a given field name.

Uses $lang['cfg-<fieldname>'] as the field label.

Parameters

ColumnTypeDefaultDescription
$fieldname string Name of field
$value string Current field value
$size int 20 Size of text field, optional, defaults to 20
$units string '' Optional units parameter. Displays to right of text field.

Return

string HTML Output

Location

include/config_functions.php lines 91 to 102

Definition

 
function render_text_option($fieldname$value$size=20$units=''){
    global 
$errorfields$lang;
    if (isset(
$errorfields[$fieldname]) && isset($_POST[$fieldname])) {
        
$value $_POST[$fieldname];
    }
    
$output '';
    
$output .= "<tr><th><label for=\"$fieldname\">".$lang['cfg-'.$fieldname]."</label></th>";
    
$output .= "<td><input type=\"text\" value=\"$value\" size=\"$size\" name=\"$fieldname\"/> $units ";
    
$output .= isset($errorfields[$fieldname])?'<span class="error">* '.$errorfields[$fieldname].'</span>':'';
    
$output .= "</td></tr>";
    return 
$output;
}

This article was last updated 11th December 2024 08:05 Europe/London time based on the source file dated 13th November 2024 15:50 Europe/London time.