control to the form.
//
// Do not instantiate this class directly! Use the add() method instead!
//
// PARAMETERS
//
// string $id
// Unique name to identify the control in the form.
//
// The control's name attribute will be the same as the id
// attribute!
//
// This is the name to be used when referring to the control's
// value in the POST/GET superglobals, after the form is
// submitted.
//
// This is also the name of the variable to be used in custom
// template files, in order to display the control. Ie; in a
// template file, in order to print the generated HTML for a
// control named "my_text", one would use:
//
// echo $my_text;
//
// string $default
// (Optional) Default value of the text box.
//
// array $attributes
// (Optional) An array of attributes valid for input controls
// (size, readonly, style, etc)
//
// Must be specified as an associative array, in the form of
// attribute => value.
//
// There's a special data-prefix attribute that you can use to
// add uneditable prefixes to input fields (text, images, or
// plain HTML), as seen in the image below. It works by
// injecting an absolutely positioned element into the DOM,
// right after the parent element, and then positioning it on
// the left side of the parent element and adjusting the width
// and the left padding of the parent element, so it looks like
// the prefix is part of the parent element.
//
// If the prefix is plain text or HTML code, it will be
// contained in a
tag having the class
// Zebra_Form_Input_Prefix; if the prefix is a path to an
// image, it will be an tag having the class
// Zebra_Form_Input_Prefix.
//
// For anything other than plain text, you must use CSS to set
// the width and height of the prefix, or it will not be
// correctly positioned because when the image is not cached by
// the browser the code taking care of centering the image will
// be executed before the image is loaded by the browser and it
// will not know the image's width and height!
//
// // add simple text
// // style the text through the Zebra_Form_Input_Prefix class
// $form->add('text', 'my_text', '', array('data-prefix' => 'http://'));
// $form->add('text', 'my_text', '', array('data-prefix' => '(+1 917)'));
//
// // add images
// // set the image's width and height through the img.Zebra_Form_Input_Prefix class
// // in your CSS or the image will not be correctly positioned!
// $form->add('text', 'my_text', '', array('data-prefix' => 'img:path/to/image'));
//
// // add html - useful when using sprites
// // again, make sure that you set somewhere the width and height of the prefix!
// $form->add('text', 'my_text', '', array('data-prefix' => ''));
// $form->add('text', 'my_text', '', array('data-prefix' => ''));
//
// See set_attributes() on how to set attributes, other than
// through the constructor.
//
// The following attributes are automatically set when the
// control is created and should not be altered manually:
//
// type, id, name, value, class
// ---------------------------------------------------------------------
// -----------------------------------------------------------------
// ADD the FIELD...
// -----------------------------------------------------------------
$zebra_form->add( 'label' ,
$zebra_form_field_label_args['id'] ,
$zebra_form_field_label_args['attach_to'] ,
$zebra_form_field_label_args['caption'] ,
$zebra_form_field_label_args['attributes']
) ;
// -----------------------------------------------------------------
if ( isset( $zebra_form_field_note_args ) ) {
$zebra_form->add( 'note' ,
$zebra_form_field_note_args['id'] ,
$zebra_form_field_note_args['attach_to'] ,
$zebra_form_field_note_args['caption'] ,
$zebra_form_field_note_args['attributes']
) ;
}
// -----------------------------------------------------------------
$field_obj = $zebra_form->add( 'text' ,
$zebra_form_add_field_args['id'] ,
$zebra_form_add_field_args['default'] ,
$zebra_form_add_field_args['attributes']
) ;
// Returns a reference to the newly created object
// -----------------------------------------------------------------
if ( isset( $zebra_form_field_details['rules'] )
&&
is_array( $zebra_form_field_details['rules'] )
) {
$field_obj->set_rule( $zebra_form_field_details['rules'] ) ;
}
// -----------------------------------------------------------------
} elseif ( $zebra_form_field_details['zebra_control_type'] === 'password' ) {
// :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// PASSWORD...
// :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// -------------------------------------------------------------------------
// void __construct ( string $id , [ string $default = ''] , [ array $attributes = ''] )
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// Adds an control to the form.
//
// Do not instantiate this class directly! Use the add() method instead!
//
// string $id
// Unique name to identify the control in the form.
//
// The control's name attribute will be the same as the id attribute!
//
// This is the name to be used when referring to the control's
// value in the POST/GET superglobals, after the form is submitted.
//
// This is also the name of the variable to be used in custom
// template files, in order to display the control.
//
// // in a template file, in order to print the generated HTML
// // for a control named "my_password", one would use:
// echo $my_password;
//
// string $default (Optional) Default value of the password field.
//
// array $attributes
// (Optional) An array of attributes valid for input controls
// (size, readonly, style, etc)
//
// Must be specified as an associative array, in the form of
// attribute => value.
//
// // setting the "disabled" attribute
// $obj = $form->add(
// 'password',
// 'my_password',
// '',
// array(
// 'disabled' => 'disabled'
// )
// );
//
// There's a special data-prefix attribute that you can use to add
// uneditable prefixes to input fields (text, images, or plain
// HTML), as seen in the image below. It works by injecting an
// absolutely positioned element into the DOM, right after the
// parent element, and then positioning it on the left side of the
// parent element and adjusting the width and the left padding of
// the parent element, so it looks like the prefix is part of the
// parent element.
//
// If the prefix is plain text or HTML code, it will be contained
// in a
tag having the class Zebra_Form_Input_Prefix; if the
// prefix is a path to an image, it will be an tag having the
// class Zebra_Form_Input_Prefix.
//
// For anything other than plain text, you must use CSS to set the
// width and height of the prefix, or it will not be correctly
// positioned because when the image is not cached by the browser
// the code taking care of centering the image will be executed
// before the image is loaded by the browser and it will not know
// the image's width and height!
//
// // add simple text
// // style the text through the Zebra_Form_Input_Prefix class
// $form->add('password', 'my_password', '', array('data-prefix' => 'Hash:'));
//
// // add images
// // set the image's width and height through the img.Zebra_Form_Input_Prefix class
// // in your CSS or the image will not be correctly positioned!
// $form->add('password', 'my_password', '', array('data-prefix' => 'img:path/to/image'));
//
// // add html - useful when using sprites
// // again, make sure that you set somewhere the width and height of the prefix!
// $form->add('password', 'my_password', '', array('data-prefix' => ''));
// $form->add('password', 'my_password', '', array('data-prefix' => ''));
//
// See set_attributes() on how to set attributes, other than
// through the constructor.
//
// The following attributes are automatically set when the control
// is created and should not be altered manually:
//
// type, id, name, value, class
// -------------------------------------------------------------------------
// -----------------------------------------------------------------
// ADD the FIELD...
// -----------------------------------------------------------------
$zebra_form->add( 'label' ,
$zebra_form_field_label_args['id'] ,
$zebra_form_field_label_args['attach_to'] ,
$zebra_form_field_label_args['caption'] ,
$zebra_form_field_label_args['attributes']
) ;
// -----------------------------------------------------------------
if ( isset( $zebra_form_field_note_args ) ) {
$zebra_form->add( 'note' ,
$zebra_form_field_note_args['id'] ,
$zebra_form_field_note_args['attach_to'] ,
$zebra_form_field_note_args['caption'] ,
$zebra_form_field_note_args['attributes']
) ;
}
// -----------------------------------------------------------------
//\greatKiwi_byFernTec_adSwapper_local_v0x1x211_testDebug\pr( $zebra_form_add_field_args ) ;
$field_obj = $zebra_form->add( 'password' ,
$zebra_form_add_field_args['id'] ,
$zebra_form_add_field_args['default'] ,
$zebra_form_add_field_args['attributes']
) ;
// Returns a reference to the newly created object
// -----------------------------------------------------------------
if ( isset( $zebra_form_field_details['rules'] )
&&
is_array( $zebra_form_field_details['rules'] )
) {
$field_obj->set_rule( $zebra_form_field_details['rules'] ) ;
}
// -----------------------------------------------------------------
} elseif ( $zebra_form_field_details['zebra_control_type'] === 'textarea' ) {
// :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// TEXTAREA...
// :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// ---------------------------------------------------------------------
// void __construct ( string $id , [ string $default = ''] , [ array $attributes = ''] )
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// Adds an