function __construct($name, $method = 'POST', $action = '', $attributes = '')
{
$this->controls = $this->variables = $this->errors = $this->master_labels = array();
// default filesysyem permissions for uploaded files
$this->file_upload_permissions = '0755';
// default values for the form's properties
$this->form_properties = array('action' => $action == '' ? $_SERVER['REQUEST_URI'] : $action, 'assets_server_path' => rtrim(dirname(__FILE__), '\\/') . DIRECTORY_SEPARATOR, 'assets_url' => rtrim(str_replace('\\', '/', 'http' . (isset($_SERVER['HTTPS']) || isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https' ? 's' : '') . '://' . rtrim($_SERVER['HTTP_HOST'], '\\/') . '/' . substr(rtrim(dirname(__FILE__), '\\/'), strlen($_SERVER['DOCUMENT_ROOT']))), '\\/') . '/', 'attributes' => $attributes, 'auto_fill' => false, 'captcha_storage' => 'cookie', 'csrf_cookie_config' => array('path' => '/', 'domain' => '', 'secure' => false, 'httponly' => true), 'csrf_cookie_name' => 'zebra_csrf_token_' . $name, 'csrf_storage_method' => 'auto', 'csrf_token' => '', 'csrf_token_lifetime' => 0, 'csrf_token_name' => 'zebra_csrf_token_' . $name, 'doctype' => 'html', 'has_upload' => false, 'honeypot' => 'zebra_honeypot_' . $name, 'identifier' => 'name_' . $name, 'language' => array(), 'method' => strtoupper($method), 'name' => $name, 'other_suffix' => '_other', 'secret_key' => '', 'show_all_error_messages' => false);
// set default client-side validation properties
$this->clientside_validation(true);
// get the maximum allowed file size for uploads
$upload_max_filesize = ini_get('upload_max_filesize');
// see what it is given in (G, M, K)
$unit = strtolower(substr($upload_max_filesize, -1));
// get the numeric value
$value = substr($upload_max_filesize, 0, -1);
// convert to bytes
// notice that there is no break
switch (strtolower(substr($upload_max_filesize, -1))) {
case 'g':
$value *= 1024;
case 'm':
$value *= 1024;
case 'k':
$value *= 1024;
}
// set the form's respective property
$this->form_properties['max_file_size'] = $value;
// include the XSS filter class - the Zebra_Form_Control class extends this class
require_once dirname(__FILE__) . '/includes/XSSClean.php';
// include the Control.php file which contains the Zebra_Form_Control class which is
// extended by all of the classes
require_once dirname(__FILE__) . '/includes/Control.php';
// load the default language file
$this->language('english');
// enable protection against CSRF attacks using the default values
// note that this has no effect if this method was already called before
$this->csrf();
}