### Display Warning with tmpl_if (HTML)
Source: https://github.com/ispconfig/ispconfig3-dev-docs/blob/main/tform/template-logic.md
Demonstrates how to use the tag with a comparison operator (>) to display a warning message if a template variable (disk_usage) exceeds another (disk_quota).
```html
Disk quota exceeded!
```
--------------------------------
### Include Static File - ISPConfig Template - HTML
Source: https://github.com/ispconfig/ispconfig3-dev-docs/blob/main/tform/template-logic.md
Includes the content of another template file statically at the point of the tag. Useful for reusing common parts like headers or footers.
```HTML
```
--------------------------------
### Include Dynamic File - ISPConfig Template - HTML
Source: https://github.com/ispconfig/ispconfig3-dev-docs/blob/main/tform/template-logic.md
Includes the content of a template file whose name is determined by the value of a template variable. Allows for dynamic content loading based on context.
```HTML
```
--------------------------------
### Output Variable Value - ISPConfig Template - HTML
Source: https://github.com/ispconfig/ispconfig3-dev-docs/blob/main/tform/template-logic.md
Outputs the raw value of the specified template variable directly into the HTML output. Basic way to display dynamic data.
```HTML
{tmpl_var name='username'}
```
--------------------------------
### Dynamic Include and Loop Context in Template (HTML)
Source: https://github.com/ispconfig/ispconfig3-dev-docs/blob/main/tform/template-logic.md
Demonstrates how to use to include a template file dynamically based on a variable set in PHP and how to use the __FIRST__ loop context variable within a .
```html
{tmpl_var name='username'}
First
```
--------------------------------
### List Items with tmpl_loop and Empty State (HTML)
Source: https://github.com/ispconfig/ispconfig3-dev-docs/blob/main/tform/template-logic.md
Shows how to use to check if a list of items exists and then use to iterate over the items. Includes an block to display a message when the list is empty.
```html
{tmpl_var name='item_label'}
No items found.
```
--------------------------------
### Rendering TEXT Field in ISPConfig Template (HTML)
Source: https://github.com/ispconfig/ispconfig3-dev-docs/blob/main/tform/form-field-types.md
HTML template example for rendering a single-line text input field using ISPConfig template variables.
```HTML
```
--------------------------------
### Rendering PASSWORD Field in ISPConfig Template (HTML)
Source: https://github.com/ispconfig/ispconfig3-dev-docs/blob/main/tform/form-field-types.md
HTML template example for rendering a password input field using ISPConfig template variables.
```HTML
```
--------------------------------
### Show/Hide Form Field Conditionally - ISPConfig Template - HTML
Source: https://github.com/ispconfig/ispconfig3-dev-docs/blob/main/tform/template-logic.md
A practical example demonstrating how to use to conditionally display an entire form group (label and input/value) based on a variable, such as user permissions.
```HTML
{tmpl_var name='quota'}
```
--------------------------------
### Conditionally Render Content (Unless) - ISPConfig Template - HTML
Source: https://github.com/ispconfig/ispconfig3-dev-docs/blob/main/tform/template-logic.md
Renders the enclosed content only if the specified variable is not set or evaluates to false. The inverse of .
```HTML
No domains configured yet.
```
--------------------------------
### Compare Variable Value - ISPConfig Template - HTML
Source: https://github.com/ispconfig/ispconfig3-dev-docs/blob/main/tform/template-logic.md
Compares a variable's value against a specified literal value using various operators (==, !=, >, <, >=, <=). Renders content based on the comparison result.
```HTML
ActiveInactive
```
--------------------------------
### Loop with Context Variables - ISPConfig Template - HTML
Source: https://github.com/ispconfig/ispconfig3-dev-docs/blob/main/tform/template-logic.md
Demonstrates using special variables within a (like __FIRST__, __LAST__, __EVEN__, __ODD__, __ROWNUM__) to apply specific logic or display information based on the current iteration's position or properties.
```HTML
{tmpl_var name='username'}
First userLast userEven rowOdd row
Row: {tmpl_var name='__ROWNUM__'}
```
--------------------------------
### Rendering CHECKBOX Field in ISPConfig Template (HTML)
Source: https://github.com/ispconfig/ispconfig3-dev-docs/blob/main/tform/form-field-types.md
HTML template example for rendering a single checkbox field using ISPConfig template variables.
```HTML
{tmpl_var name='active'}
```
--------------------------------
### Conditional Logic with Else - ISPConfig Template - HTML
Source: https://github.com/ispconfig/ispconfig3-dev-docs/blob/main/tform/template-logic.md
Provides an alternative content block to render when the condition evaluates to false. Allows for displaying different content based on a boolean variable.
```HTML
Welcome, admin!
Welcome, user!
```
--------------------------------
### Iterate Over Array - ISPConfig Template - HTML
Source: https://github.com/ispconfig/ispconfig3-dev-docs/blob/main/tform/template-logic.md
Loops through each item in an array variable, rendering the enclosed content block for every item. Variables within the loop context refer to the current item's properties.
```HTML
{tmpl_var name='domain'}
{tmpl_var name='status'}
```
--------------------------------
### Include PHP File (Conditional) - ISPConfig Template - HTML
Source: https://github.com/ispconfig/ispconfig3-dev-docs/blob/main/tform/template-logic.md
Directly includes and executes a PHP file at this point in the template rendering process. *Requires the ENABLE_PHPINCLUDE option to be enabled.* Use with caution.
```HTML
```
--------------------------------
### Multi-condition Logic (Elseif) - ISPConfig Template - HTML
Source: https://github.com/ispconfig/ispconfig3-dev-docs/blob/main/tform/template-logic.md
Extends with to handle multiple possible conditions sequentially. Renders the first block whose condition evaluates to true, falling back to if none match.
```HTML
ActivePendingInactive
```
--------------------------------
### Rendering SELECT Field in ISPConfig Template (HTML)
Source: https://github.com/ispconfig/ispconfig3-dev-docs/blob/main/tform/form-field-types.md
HTML template example for rendering a dropdown select field using ISPConfig template variables, showing where options are injected.
```HTML
```
--------------------------------
### Conditionally Render Content - ISPConfig Template - HTML
Source: https://github.com/ispconfig/ispconfig3-dev-docs/blob/main/tform/template-logic.md
Renders the enclosed content only if the specified variable is set and evaluates to true. Useful for showing elements based on user permissions or data availability.
```HTML
You are an admin.
```
--------------------------------
### Output Variable with Formatting/Escaping - ISPConfig Template - HTML
Source: https://github.com/ispconfig/ispconfig3-dev-docs/blob/main/tform/template-logic.md
Outputs a variable's value after applying specified formatting functions (e.g., strtoupper, ucfirst) and escaping (e.g., html, url) for safe display.
```HTML
{tmpl_var name='domain' format='strtoupper' escape='html'}
```
--------------------------------
### Template Comment Block - ISPConfig Template - HTML
Source: https://github.com/ispconfig/ispconfig3-dev-docs/blob/main/tform/template-logic.md
Defines a block of text that is ignored by the template engine and does not appear in the final output. Used for adding notes or temporarily disabling template code.
```HTML
This section is for developers only and will not appear in output.
```
--------------------------------
### Nested Logic and Iteration - ISPConfig Template - HTML
Source: https://github.com/ispconfig/ispconfig3-dev-docs/blob/main/tform/template-logic.md
Demonstrates combining and tags. Loops through a list of users and conditionally displays "Admin" or "User" based on a property of the current user object within the loop.
```HTML
{tmpl_var name='username'}
AdminUser
```
--------------------------------
### Rendering MULTIPLE Field in ISPConfig Template (HTML)
Source: https://github.com/ispconfig/ispconfig3-dev-docs/blob/main/tform/form-field-types.md
HTML template example for rendering a multi-select dropdown field using ISPConfig template variables, indicating where options are injected.
```HTML
```
--------------------------------
### Trigger PHP Hook - ISPConfig Template - HTML
Source: https://github.com/ispconfig/ispconfig3-dev-docs/blob/main/tform/template-logic.md
Inserts a marker in the template that triggers a corresponding PHP hook function defined in the ISPConfig backend. Allows for extending template rendering logic from PHP modules.
```HTML
```
--------------------------------
### Rendering CHECKBOXARRAY Field in ISPConfig Template (HTML)
Source: https://github.com/ispconfig/ispconfig3-dev-docs/blob/main/tform/form-field-types.md
HTML template example for rendering a group of checkboxes (checkbox array) using ISPConfig template variables.
```HTML
{tmpl_var name='features'}
```
--------------------------------
### Assign Variables and Loops in PHP
Source: https://github.com/ispconfig/ispconfig3-dev-docs/blob/main/tform/template-logic.md
Shows how to use the $tpl->setInclude() method to assign a template file name to a variable for dynamic inclusion and $tpl->setLoop() to assign a PHP array to a template loop variable.
```php
// PHP
$tpl->setInclude('content_tpl', 'form_content.htm');
$tpl->setLoop('users', $usersArray);
```
--------------------------------
### Use tmpl_unless for Negative Condition (HTML)
Source: https://github.com/ispconfig/ispconfig3-dev-docs/blob/main/tform/template-logic.md
Illustrates the use of the tag as an alternative to or similar, to display content only when a variable is false or not set.
```html
SSL is not enabled for this domain.
```
--------------------------------
### Defining Top-Level Form Properties in PHP
Source: https://github.com/ispconfig/ispconfig3-dev-docs/blob/main/tform/form-file-structure.md
This snippet illustrates how core form properties are set in an ISPConfig .tform.php file. It shows assignments for the form's title, description, unique name, associated database table and primary key, action script, history setting, default tab and list pages, and authentication requirements. It also includes an example of setting default permission presets for new records.
```php
$form["title"] = "My Module"; // Form title
$form["description"] = "..."; // Form description
$form["name"] = "module_name"; // Unique form identifier
$form["record_name_field"] = "name"; // Field for record display
$form["action"] = "module_edit.php"; // Submit handler script
$form["db_table"] = "module_table"; // Database table
$form["db_table_idx"] = "id"; // Primary key column
$form["db_history"] = "yes"; // Enable history (yes/no)
$form["tab_default"] = "main"; // Default tab
$form["list_default"] = "module_list.php"; // Default list page
$form["auth"] = "yes"; // Enable auth check (yes/no)
// Permission presets when creating new records (record_id = 0)
$form["auth_preset"]["userid"] = 0;
$form["auth_preset"]["groupid"] = 0;
$form["auth_preset"]["perm_user"] = 'riud';
$form["auth_preset"]["perm_group"] = 'riud';
$form["auth_preset"]["perm_other"] = '';
```
--------------------------------
### ISPConfig Server Backend Directory Structure (Bash)
Source: https://github.com/ispconfig/ispconfig3-dev-docs/blob/main/folder-structure.md
This snippet shows the directory layout for the ISPConfig server backend, located at /usr/local/ispconfig/server/. It includes directories for CLI tools, configuration templates, libraries, modules, plugins, scripts, and temporary files.
```bash
server/
├── aps_packages/ # APS packaging resources and definitions (deprecated)
├── cli/ # Command-line interface tools
│ ├── ispc # CLI shell script wrapper
│ ├── ispc.php # Main PHP CLI entry point
│ └── modules/ # CLI modules
│ ├── extension.inc.php # ISPConfig extension management
│ ├── help.inc.php # CLI help generator
│ ├── letsencrypt.inc.php # Let's Encrypt integration
│ ├── php.inc.php # PHP module helper
│ ├── update.inc.php # Update management
│ ├── user.inc.php # User management
│ └── version.inc.php # Version info
├── conf/ # Default configuration templates
├── conf-custom/ # Custom configuration overrides
├── lib/ # Server-side libraries and classes
│ ├── app.inc.php # Application bootstrap and global helpers
│ ├── compatibility.inc.php # Backwards compatibility utilities
│ └── classes/ # Core server classes and libraries
│ ├── aps_base.inc.php # APS service base class (deprecated)
│ ├── backup.inc.php # Backup management
│ ├── cli.inc.php # CLI dispatch logic
│ ├── cron.d/ # Cron job definitions
│ ├── tpl.inc.php # Template engine core
│ └── ... # Other class files
├── mods-available/ # Available server modules
├── mods-core/ # Core server modules
├── mods-enabled/ # Enabled server modules (symlinks)
├── plugins-available/ # Available plugins
├── plugins-enabled/ # Enabled plugins (symlinks)
├── scripts/ # Daemon and script utilities
└── temp/ # Temporary files and caches
```
--------------------------------
### ISPConfig Web Interface Directory Structure (Bash)
Source: https://github.com/ispconfig/ispconfig3-dev-docs/blob/main/folder-structure.md
This snippet details the directory structure for the ISPConfig web interface, located at /usr/local/ispconfig/interface/. It contains directories for ACME challenges, cache, libraries, SSL certificates, temporary files, tools, and the main web assets organized by module.
```bash
interface/
├── acme/ # ACME (Let's Encrypt) challenge response scripts
├── cache/ # Compiled template and data cache
├── lib/
│ ├── app.inc.php # Application bootstrap and global helpers
│ ├── classes/ # Core PHP classes and libraries
│ ├── compatibility.inc.php # Backwards compatibility utilities
│ ├── config.inc.php # Main configuration file (DB credentials, paths) for the UI
│ ├── lang/ # Global language files (en.lang, de.lang, ...)
│ ├── plugins/ # Interface plugins
│ ├── server_conf.master # Template for server-specific configuration
│ └── shelluser_blacklist # Blacklist for shell user creation
├── ssl/ # SSL Certificates for the UI and apps vhost
├── temp/ # Temporary files and uploads
├── tools/ # CLI and maintenance scripts
└── web/
├── js/ # JavaScript assets
├── themes/ # CSS, images, layout templates
├── admin/ # Admin interface module
├── client/ # Client interface module
├── dashboard/ # Summary dashboard module
├── dns/ # DNS management module
├── help/ # Help and documentation module
├── login/ # Login module
├── mail/ # Mail server module
├── mailuser/ # Mailuser login module
├── monitor/ # Monitoring and status module
├── remote/ # Remote API endpoint
├── sites/ # Website management module
├── strengthmeter/ # Password strength meter code
├── temp/ # Temporary web scripts
├── tools/ # Web-based tools and utilities
├── vm/ # OpenVZ Virtual machine management module (deprecated)
└── /... # Other modules
```
--------------------------------
### Configuring Field with SQL Datasource and Static Options (PHP)
Source: https://github.com/ispconfig/ispconfig3-dev-docs/blob/main/tform/form-datasource.md
This complete ISPConfig tform field definition in PHP demonstrates how to configure a 'SELECT' field ('client_id') using a SQL datasource. It includes static options ('value'), the SQL query ('querystring') utilizing the '{AUTHSQL}' placeholder for authorization, and specifies the 'keyfield' and 'valuefield' for mapping query results to options.
```PHP
'client_id' => [
'datatype' => 'INTEGER',
'formtype' => 'SELECT',
'default' => '',
'value' => [0 => 'Select Client'],
'datasource' => [
'type' => 'SQL',
'querystring' => 'SELECT `client_id`, `contact_name` FROM `client` WHERE {AUTHSQL} ORDER BY `contact_name`',
'keyfield' => 'client_id',
'valuefield' => 'contact_name'
]
]
```
--------------------------------
### Defining SQL Datasource in ISPConfig tform (PHP)
Source: https://github.com/ispconfig/ispconfig3-dev-docs/blob/main/tform/form-field-settings.md
This snippet shows how to configure a field's `datasource` setting to fetch dynamic values from a database using an SQL query. It specifies the query, the key field for the value, and the value field for display.
```php
'datasource' => [
'type' => 'SQL',
'querystring' => 'SELECT id, name FROM table',
'keyfield' => 'id',
'valuefield' => 'name'
]
```
--------------------------------
### Apply IDNTOUTF8 Filter (ISPConfig tform) - PHP
Source: https://github.com/ispconfig/ispconfig3-dev-docs/blob/main/tform/form-filters.md
Configures an ISPConfig tform field filter to convert ASCII (Punycode) domain names back to their UTF-8 representation. This filter is applied during the 'SHOW' event, typically before displaying the value to the user. It makes domain names readable for international users.
```php
'filters' => [
[
'event' => 'SHOW',
'type' => 'IDNTOUTF8'
]
]
```
--------------------------------
### Defining SQL Datasource Configuration (PHP)
Source: https://github.com/ispconfig/ispconfig3-dev-docs/blob/main/tform/form-datasource.md
This PHP array snippet shows the structure for configuring a SQL datasource within an ISPConfig tform field definition. It specifies the type as 'SQL', provides the SQL query string, and identifies the database fields to use for option values ('keyfield') and labels ('valuefield').
```PHP
'datasource' => [
'type' => 'SQL',
'querystring' => 'SELECT `server_id`, `server_name` FROM `server` WHERE `mail_server` = 1 ORDER BY `server_name`',
'keyfield' => 'server_id',
'valuefield' => 'server_name'
]
```
--------------------------------
### Template for Textarea Field (HTML)
Source: https://github.com/ispconfig/ispconfig3-dev-docs/blob/main/tform/form-field-types.md
Shows the HTML template structure for a multi-line text input field (textarea) in the ISPConfig Form System. It uses template variables for the label and the field value.
```html
```
--------------------------------
### Configuring Form Tabs and Fields in PHP
Source: https://github.com/ispconfig/ispconfig3-dev-docs/blob/main/tform/form-file-structure.md
This snippet demonstrates how to define form tabs and their contained fields within the `$form["tabs"]` array. Each tab is an associative array specifying its title, template file, optional width, and a 'fields' array. Each field within the 'fields' array is configured with properties like datatype, formtype, datasource (e.g., SQL query), filters (for SAVE/SHOW events), validators (with error messages), default value, and optional value override.
```php
$form["tabs"]["domain"] = [
'title' => "Domain",
'template' => "templates/mail_domain_edit.htm",
'width' => 100, // optional
'fields' => [
'server_id' => [
'datatype' => 'INTEGER',
'formtype' => 'SELECT',
'default' => '',
'datasource' => [
'type' => 'SQL',
'querystring' => 'SELECT server_id,server_name ...',
'keyfield' => 'server_id',
'valuefield' => 'server_name'
],
'value' => '' // optional override
],
'domain' => [
'datatype' => 'VARCHAR',
'formtype' => 'TEXT',
'filters' => [
['event'=>'SAVE','type'=>'IDNTOASCII'],
['event'=>'SHOW','type'=>'IDNTOUTF8'],
['event'=>'SAVE','type'=>'TOLOWER']
],
'validators' => [
['type'=>'NOTEMPTY','errmsg'=>'domain_error_empty'],
['type'=>'ISDOMAIN','errmsg'=>'domain_error_regex'],
['type'=>'CUSTOM','class'=>'validate_mail_transport','function'=>'validate_isnot_mailtransport','errmsg'=>'domain_is_transport']
],
'default' => '',
'value' => '' // optional override
]
// ... other fields
]
];
```
--------------------------------
### Template for Radio Button Group (HTML)
Source: https://github.com/ispconfig/ispconfig3-dev-docs/blob/main/tform/form-field-types.md
Demonstrates the HTML structure for rendering a group of radio buttons using ISPConfig template variables. The {tmpl_var name='type'} placeholder is replaced by the actual radio button HTML.
```html
{tmpl_var name='type'}
```
--------------------------------
### Apply IDNTOASCII Filter (ISPConfig tform) - PHP
Source: https://github.com/ispconfig/ispconfig3-dev-docs/blob/main/tform/form-filters.md
Configures an ISPConfig tform field filter to convert Internationalized Domain Names (IDNs) to their ASCII (Punycode) representation. This filter is applied during the 'SAVE' event, typically before storing the value in the database. It ensures domain names are stored in a standardized format.
```php
'filters' => [
[
'event' => 'SAVE',
'type' => 'IDNTOASCII'
]
]
```
--------------------------------
### Apply NORMALIZEPATH Filter (ISPConfig tform) - PHP
Source: https://github.com/ispconfig/ispconfig3-dev-docs/blob/main/tform/form-filters.md
Configures an ISPConfig tform field filter to normalize filesystem paths. This includes resolving '..' and '.' segments, standardizing directory separators, and removing redundant slashes. This filter is applied during the 'SAVE' event to ensure paths are stored in a consistent and secure format.
```php
'filters' => [
[
'event' => 'SAVE',
'type' => 'NORMALIZEPATH'
]
]
```
--------------------------------
### Apply TOUPPER Filter (ISPConfig tform) - PHP
Source: https://github.com/ispconfig/ispconfig3-dev-docs/blob/main/tform/form-filters.md
Configures an ISPConfig tform field filter to convert the input value to uppercase. This filter is applied during the 'SAVE' event, typically before storing the value in the database. It is useful for standardizing input where uppercase is required.
```php
'filters' => [
[
'event' => 'SAVE',
'type' => 'TOUPPER'
]
]
```
--------------------------------
### Apply TRIM Filter (ISPConfig tform) - PHP
Source: https://github.com/ispconfig/ispconfig3-dev-docs/blob/main/tform/form-filters.md
Configures an ISPConfig tform field filter to remove leading and trailing whitespace from the input value. This filter is applied during the 'SAVE' event, typically before storing the value in the database. It helps clean up user input.
```php
'filters' => [
[
'event' => 'SAVE',
'type' => 'TRIM'
]
]
```
--------------------------------
### Defining CUSTOM Datasource Configuration (PHP)
Source: https://github.com/ispconfig/ispconfig3-dev-docs/blob/main/tform/form-datasource.md
This PHP array snippet illustrates the configuration for a CUSTOM datasource in an ISPConfig tform field definition. It sets the type to 'CUSTOM' and specifies the PHP class and function that will be called to dynamically generate the field options.
```PHP
'datasource' => [
'type' => 'CUSTOM',
'class' => 'my_custom_class',
'function' => 'get_options'
]
```
--------------------------------
### Defining Custom Datasource in ISPConfig tform (PHP)
Source: https://github.com/ispconfig/ispconfig3-dev-docs/blob/main/tform/form-field-settings.md
This snippet demonstrates how to configure a field's `datasource` setting to use a custom PHP class and function to generate dynamic values. It specifies the class name and the function name to be called.
```php
'datasource' => [
'type' => 'CUSTOM',
'class' => 'my_class',
'function' => 'my_function'
]
```
--------------------------------
### Defining TEXT Field Type in ISPConfig tform (PHP)
Source: https://github.com/ispconfig/ispconfig3-dev-docs/blob/main/tform/form-field-types.md
Configuration array for a single-line text input field in the ISPConfig tform system.
```PHP
'fieldname' => [
'datatype' => 'VARCHAR',
'formtype' => 'TEXT',
'default' => '',
'validators' => [],
'value' => ''
]
```
--------------------------------
### Defining TEXTAREA Field Type in ISPConfig tform (PHP)
Source: https://github.com/ispconfig/ispconfig3-dev-docs/blob/main/tform/form-field-types.md
Configuration array for a multi-line text input field in the ISPConfig tform system.
```PHP
'fieldname' => [
'datatype' => 'TEXT',
'formtype' => 'TEXTAREA',
'default' => '',
'validators' => [],
'value' => ''
]
```
--------------------------------
### Apply TOLOWER Filter (ISPConfig tform) - PHP
Source: https://github.com/ispconfig/ispconfig3-dev-docs/blob/main/tform/form-filters.md
Configures an ISPConfig tform field filter to convert the input value to lowercase. This filter is applied during the 'SAVE' event, typically before storing the value in the database. It is useful for ensuring case-insensitive comparisons or standardizing input.
```php
'filters' => [
[
'event' => 'SAVE',
'type' => 'TOLOWER'
]
]
```
--------------------------------
### Configuring Field with CUSTOM Datasource (PHP)
Source: https://github.com/ispconfig/ispconfig3-dev-docs/blob/main/tform/form-datasource.md
This PHP snippet provides a complete ISPConfig tform field definition ('custom_field') configured to use a CUSTOM datasource. It specifies the field's datatype and formtype, and defines the datasource by referencing a custom PHP class and function responsible for generating the field's options dynamically.
```PHP
'custom_field' => [
'datatype' => 'VARCHAR',
'formtype' => 'SELECT',
'datasource' => [
'type' => 'CUSTOM',
'class' => 'my_custom_class',
'function' => 'get_options'
]
]
```
--------------------------------
### Using NOTEMPTY Validator in ISPConfig tform (PHP)
Source: https://github.com/ispconfig/ispconfig3-dev-docs/blob/main/tform/form-validators.md
Configures a form field validator in ISPConfig's tform system to ensure the field is not left empty. The `errmsg` key specifies the error message or its translation key to display if the validation fails.
```php
'validators' => [
[
'type' => 'NOTEMPTY',
'errmsg' => 'field_required_error'
]
]
```
--------------------------------
### Using REGEX Validator in ISPConfig tform (PHP)
Source: https://github.com/ispconfig/ispconfig3-dev-docs/blob/main/tform/form-validators.md
Configures a form field validator in ISPConfig's tform system to validate the field's value against a specified regular expression pattern. The `regex` key holds the pattern, and `errmsg` provides the error message.
```php
'validators' => [
[
'type' => 'REGEX',
'regex' => '/^([0-9]{1,5})$/',
'errmsg' => 'field_error_regex'
]
]
```
--------------------------------
### Defining MULTIPLE Field Type in ISPConfig tform (PHP)
Source: https://github.com/ispconfig/ispconfig3-dev-docs/blob/main/tform/form-field-types.md
Configuration array for a field that allows selection of multiple values from a list, rendering as a multi-select dropdown in the ISPConfig tform system.
```PHP
'fieldname' => [
'datatype' => 'VARCHAR',
'formtype' => 'MULTIPLE',
'separator' => ',',
'value' => ['1' => 'Option 1', '2' => 'Option 2', '3' => 'Option 3']
]
```
--------------------------------
### Defining SELECT Field Type in ISPConfig tform (PHP)
Source: https://github.com/ispconfig/ispconfig3-dev-docs/blob/main/tform/form-field-types.md
Configuration array for a dropdown select field in the ISPConfig tform system.
```PHP
'fieldname' => [
'datatype' => 'VARCHAR',
'formtype' => 'SELECT',
'default' => '',
'value' => ['option1' => 'Option 1', 'option2' => 'Option 2']
]
```
--------------------------------
### Apply TOLATIN1 Filter (ISPConfig tform) - PHP
Source: https://github.com/ispconfig/ispconfig3-dev-docs/blob/main/tform/form-filters.md
Configures an ISPConfig tform field filter to convert the input value to ISO-8859-1 (Latin-1) encoding. This filter is applied during the 'SAVE' event, typically before storing the value in the database. It is used for compatibility with systems or databases expecting this specific encoding.
```php
'filters' => [
[
'event' => 'SAVE',
'type' => 'TOLATIN1'
]
]
```
--------------------------------
### Defining a Domain Form Field in PHP
Source: https://github.com/ispconfig/ispconfig3-dev-docs/blob/main/tform/form-field-settings.md
This PHP array defines the structure and validation rules for a 'domain' form field. It specifies the data type, form input type, default value, filters applied on save and show events (like IDN conversion and lowercasing), and validators to ensure the field is not empty, is a valid domain format, and passes custom validation.
```php
'domain' => [
'datatype' => 'VARCHAR',
'formtype' => 'TEXT',
'default' => '',
'filters' => [
['event' => 'SAVE', 'type' => 'IDNTOASCII'],
['event' => 'SHOW', 'type' => 'IDNTOUTF8'],
['event' => 'SAVE', 'type' => 'TOLOWER']
],
'validators' => [
['type' => 'NOTEMPTY', 'errmsg' => 'domain_error_empty'],
['type' => 'ISDOMAIN', 'errmsg' => 'domain_error_regex'],
['type' => 'CUSTOM', 'class' => 'validate_mail_transport', 'function' => 'validate_domain']
]
]
```
--------------------------------
### Using ISASCII Validator in ISPConfig tform (PHP)
Source: https://github.com/ispconfig/ispconfig3-dev-docs/blob/main/tform/form-validators.md
Configures a form field validator in ISPConfig's tform system to ensure that the field's value contains only ASCII characters. The `errmsg` key specifies the error message.
```php
'validators' => [
[
'type' => 'ISASCII',
'errmsg' => 'Value must be ASCII only.'
]
]
```
--------------------------------
### Using ISDOMAIN Validator in ISPConfig tform (PHP)
Source: https://github.com/ispconfig/ispconfig3-dev-docs/blob/main/tform/form-validators.md
Configures a form field validator in ISPConfig's tform system to check if the field's value is a valid domain name. The `errmsg` key specifies the error message.
```php
'validators' => [
[
'type' => 'ISDOMAIN',
'errmsg' => 'Invalid domain name.'
]
]
```
--------------------------------
### Defining RADIO Field Type in ISPConfig tform (PHP)
Source: https://github.com/ispconfig/ispconfig3-dev-docs/blob/main/tform/form-field-types.md
Configuration array for a radio button group in the ISPConfig tform system.
```PHP
'fieldname' => [
'datatype' => 'VARCHAR',
'formtype' => 'RADIO',
'default' => '',
'value' => ['option1' => 'Option 1', 'option2' => 'Option 2']
]
```
--------------------------------
### Apply NOWHITESPACE Filter (ISPConfig tform) - PHP
Source: https://github.com/ispconfig/ispconfig3-dev-docs/blob/main/tform/form-filters.md
Configures an ISPConfig tform field filter to remove all whitespace characters (spaces, tabs, newlines, etc.) from the input value. This filter is applied during the 'SAVE' event, typically before storing the value in the database. It is useful for fields where whitespace is not allowed, like usernames or codes.
```php
'filters' => [
[
'event' => 'SAVE',
'type' => 'NOWHITESPACE'
]
]
```
--------------------------------
### Apply STRIPNL Filter (ISPConfig tform) - PHP
Source: https://github.com/ispconfig/ispconfig3-dev-docs/blob/main/tform/form-filters.md
Configures an ISPConfig tform field filter to remove newline characters (\n, \r) from the input value. This filter is applied during the 'SAVE' event, typically before storing the value in the database. It is useful for single-line text fields.
```php
'filters' => [
[
'event' => 'SAVE',
'type' => 'STRIPNL'
]
]
```
--------------------------------
### Defining PASSWORD Field Type in ISPConfig tform (PHP)
Source: https://github.com/ispconfig/ispconfig3-dev-docs/blob/main/tform/form-field-types.md
Configuration array for a password input field (masked input) in the ISPConfig tform system.
```PHP
'fieldname' => [
'datatype' => 'VARCHAR',
'formtype' => 'PASSWORD',
'default' => '',
'validators' => [],
'value' => ''
]
```
--------------------------------
### Apply STRIPTAGS Filter (ISPConfig tform) - PHP
Source: https://github.com/ispconfig/ispconfig3-dev-docs/blob/main/tform/form-filters.md
Configures an ISPConfig tform field filter to remove HTML and PHP tags from the input value. This filter is applied during the 'SAVE' event, typically before storing the value in the database. It is a basic security measure to prevent XSS or code injection in fields that should only contain plain text.
```php
'filters' => [
[
'event' => 'SAVE',
'type' => 'STRIPTAGS'
]
]
```
--------------------------------
### Defining CHECKBOX Field Type in ISPConfig tform (PHP)
Source: https://github.com/ispconfig/ispconfig3-dev-docs/blob/main/tform/form-field-types.md
Configuration array for a single checkbox input field in the ISPConfig tform system.
```PHP
'fieldname' => [
'datatype' => 'VARCHAR',
'formtype' => 'CHECKBOX',
'default' => 'n',
'value' => ['y' => 'Yes', 'n' => 'No']
]
```
--------------------------------
### Using ISEMAILADDRESS Validator in ISPConfig tform (PHP)
Source: https://github.com/ispconfig/ispconfig3-dev-docs/blob/main/tform/form-validators.md
Configures a form field validator in ISPConfig's tform system to check if the field's value is a valid email address using standard validation rules. The `errmsg` key specifies the error message.
```php
'validators' => [
[
'type' => 'ISEMAILADDRESS',
'errmsg' => 'Invalid email address.'
]
]
```
--------------------------------
### Defining CHECKBOXARRAY Field Type in ISPConfig tform (PHP)
Source: https://github.com/ispconfig/ispconfig3-dev-docs/blob/main/tform/form-field-types.md
Configuration array for multiple checkbox inputs (array of checkboxes) in the ISPConfig tform system.
```PHP
'fieldname' => [
'datatype' => 'VARCHAR',
'formtype' => 'CHECKBOXARRAY',
'default' => '',
'value' => ['option1' => 'Option 1', 'option2' => 'Option 2']
]
```
--------------------------------
### Using ISPOSITIVE Validator in ISPConfig tform (PHP)
Source: https://github.com/ispconfig/ispconfig3-dev-docs/blob/main/tform/form-validators.md
Configures a form field validator in ISPConfig's tform system to check if the field's value is a positive number. The `errmsg` key specifies the error message or its translation key.
```php
'validators' => [
[
'type' => 'ISPOSITIVE',
'errmsg' => 'value_must_be_positive'
]
]
```
--------------------------------
### Using CUSTOM Validator in ISPConfig tform (PHP)
Source: https://github.com/ispconfig/ispconfig3-dev-docs/blob/main/tform/form-validators.md
Configures a form field validator in ISPConfig's tform system to use a custom PHP class and function for validation logic. The `class` and `function` keys specify the callable, and `errmsg` provides the error message.
```php
'validators' => [
[
'type' => 'CUSTOM',
'class' => 'validate_domain',
'function' => 'web_domain_autosub',
'errmsg' => 'domain_error_autosub'
]
]
```
--------------------------------
### Using ISEMAIL Validator in ISPConfig tform (PHP)
Source: https://github.com/ispconfig/ispconfig3-dev-docs/blob/main/tform/form-validators.md
Configures a form field validator in ISPConfig's tform system to check if the field's value is a valid email address using stricter validation rules (e.g., disallowing plus signs in the local part). The `errmsg` key specifies the error message.
```php
'validators' => [
[
'type' => 'ISEMAIL',
'errmsg' => 'Invalid email address.'
]
]
```
--------------------------------
### Using UNIQUE Validator in ISPConfig tform (PHP)
Source: https://github.com/ispconfig/ispconfig3-dev-docs/blob/main/tform/form-validators.md
Configures a form field validator in ISPConfig's tform system to check if the field's value is unique within the relevant database table. The `errmsg` key specifies the error message or its translation key.
```php
'validators' => [
[
'type' => 'UNIQUE',
'errmsg' => 'value_must_be_unique'
]
]
```
=== COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.