CaMykS  1.0-20181201
 All Classes Files Functions Variables Pages
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
HTMLForm Class Reference

Public Member Functions

 __construct ($name='', $action='./', $method=null, $onSubmit='', $target='')
 
 allow_files ($allow=true, $size=null)
 
 set_object ($object=null)
 
 set_parent ($parent=null)
 
 display_header ()
 
 display_footer ()
 
 add_hidden ($name, $value=null, $id='')
 
 display_hiddens ()
 
 set_jsFocus ($focus)
 
 display_dateInput ($date=TODAY, $oname='date', $objects=array('day','month','year','hours','minutes'), $buttons=array())
 
 display_fileInput ($file='file', $default='', $buttons=null)
 
 display_selectInput ($select, $values=null, $default=null)
 
 display_booleanSelectInput ($select, $default=null)
 
 display_countrySelectInput ($select=array(), $default=null)
 
 display_phonePrefixSelectInput ($select=array(), $default=null)
 
 display_civilitySelectInput ($select, $default=null)
 
 display_weekDaySelectInput ($select, $default=null)
 
 display_textInput ($input, $default=null)
 
 display_numberInput ($input, $default=null)
 
 display_emailInput ($input, $default=null)
 
 display_phoneInput ($input, $default=null)
 
 display_URLInput ($input, $default=null)
 
 display_textareaInput ($input, $default=null)
 
 display_passwordInput ($input, $default=null)
 
 display_checkboxInput ($input, $default=null)
 
 display_radioInput ($input, $default=null)
 
 display_hiddenInput ($input, $default=null)
 
 display_hiddenSubmit ()
 
 get_HTMLSubmitLink ()
 
 get_JSSubmitLink ()
 
 start_tabIndex ()
 
 get_tabIndex ($full=false, $index=-1)
 
 update_inputsLimit ($value=1000)
 
 display_ender ()
 
 HTMLForm ($name='', $action='./', $method=null, $onSubmit='', $target='')
 
 allow_files ($allow=true, $size=null)
 
 set_object ($object=null)
 
 set_parent ($parent=null)
 
 display_header ()
 
 display_footer ()
 
 display_ender ()
 
 add_hidden ($name, $value=null)
 
 display_hiddens ()
 
 set_jsFocus ($focus)
 
 display_dateInput ($date=TODAY, $oname='date', $objects=array('day','month','year','hours','minutes'), $buttons=array())
 
 display_fileInput ($file='file', $default='', $buttons=null)
 
 display_selectInput ($select, $values=null, $default=null)
 
 display_booleanSelectInput ($select, $default=null)
 
 display_countrySelectInput ($select=array(), $default=null)
 
 display_phonePrefixSelectInput ($select=array(), $default=null)
 
 display_civilitySelectInput ($select, $default=null)
 
 display_textInput ($input, $default=null)
 
 display_textareaInput ($input, $default=null)
 
 display_passwordInput ($input, $default=null)
 
 display_checkboxInput ($input, $default=null)
 
 display_radioInput ($input, $default=null)
 
 display_hiddenSubmit ()
 
 get_HTMLSubmitLink ()
 
 get_JSSubmitLink ()
 
 start_tabIndex ()
 
 get_tabIndex ($full=false, $index=-1)
 

Public Attributes

 $name
 Form name. More...
 
 $action
 Form action. More...
 
 $method
 Form data sending method. More...
 
 $onSubmit
 Form on submit action script. More...
 
 $target
 Form target window/frame. More...
 
 $hiddens = array()
 Form hidden value list. More...
 
 $allowFiles = false
 Form on submit action script. More...
 
 $tabIndex = -1
 Form current tab index. More...
 

Protected Member Functions

 build_inputGenericAttributes ($params)
 

Protected Attributes

 $object = null
 ModuleLibrary object to auto-fill values. More...
 
 $parent = null
 Parent module. More...
 
 $inputsCount = 0
 Form inputs counter. More...
 
 $inputsLimit
 Form input limit. More...
 
 $inputsLimitUniques = array()
 Form stored unique input names. More...
 
 $inputsLimitReached = false
 Form input limit reached. More...
 
 $inputDefaultParams
 List all default params for inputs. More...
 

Private Member Functions

 check_inputsLimit ($items=1, $name=false)
 

Detailed Description

HTMLForm class.

Author
CaMykS Team camyk.nosp@m.s.co.nosp@m.ntact.nosp@m.@gma.nosp@m.il.co.nosp@m.m

Constructor & Destructor Documentation

HTMLForm::__construct (   $name = '',
  $action = './',
  $method = null,
  $onSubmit = '',
  $target = '' 
)

Class constructor.

Parameters
string$name
string$action
mixed$method
string$onSubmit
string$target
Returns
void

Member Function Documentation

HTMLForm::add_hidden (   $name,
  $value = null 
)
HTMLForm::add_hidden (   $name,
  $value = null,
  $id = '' 
)

Create an hidden value.

Parameters
string$namethe hidden value name
string$valuethe hidden value content
string$idthe hidden value id
Returns
void
HTMLForm::allow_files (   $allow = true,
  $size = null 
)
HTMLForm::allow_files (   $allow = true,
  $size = null 
)

Allow files for this form.

Parameters
boolean$allow
integer$sizethe allowed file size in bytes
Returns
void
HTMLForm::build_inputGenericAttributes (   $params)
protected

Return generic attributes for inputs

Parameters
array$params
Returns
string
HTMLForm::check_inputsLimit (   $items = 1,
  $name = false 
)
private

Check max input vars limit.

Parameters
integer$items
integer$name
Returns
boolean result
HTMLForm::display_booleanSelectInput (   $select,
  $default = null 
)
HTMLForm::display_booleanSelectInput (   $select,
  $default = null 
)

Build and return boolean select input.

Parameters
mixed$select
mixed$default
Returns
string
HTMLForm::display_checkboxInput (   $input,
  $default = null 
)
HTMLForm::display_checkboxInput (   $input,
  $default = null 
)

Build and return checkbox input.

Parameters
mixed$input
string$default
Returns
string
HTMLForm::display_civilitySelectInput (   $select,
  $default = null 
)
HTMLForm::display_civilitySelectInput (   $select,
  $default = null 
)

Build and return civility select input.

Parameters
mixed$select
mixed$default
Returns
string
HTMLForm::display_countrySelectInput (   $select = array(),
  $default = null 
)
HTMLForm::display_countrySelectInput (   $select = array(),
  $default = null 
)

Build and return country select input.

Parameters
mixed$select
mixed$default
Returns
string
HTMLForm::display_dateInput (   $date = TODAY,
  $oname = 'date',
  $objects = array('day','month','year','hours','minutes'),
  $buttons = array() 
)
HTMLForm::display_dateInput (   $date = TODAY,
  $oname = 'date',
  $objects = array('day','month','year','hours','minutes'),
  $buttons = array() 
)

Return complete date form display.

Parameters
date$date
string$oname
array$objects
array$buttons
Returns
string
HTMLForm::display_emailInput (   $input,
  $default = null 
)

Build and return email input.

Parameters
mixed$input
string$default
Returns
string
HTMLForm::display_ender ( )
HTMLForm::display_ender ( )

Alias to display_footer method.

See also
display_footer()
Returns
string
Deprecated:
Use display_footer instead.
HTMLForm::display_fileInput (   $file = 'file',
  $default = '',
  $buttons = null 
)
HTMLForm::display_fileInput (   $file = 'file',
  $default = '',
  $buttons = null 
)

Display file input form item.

Parameters
string$filethe form item name
string$defaultthe default value
array$buttonsthe button descriptions to add
Returns
string
HTMLForm::display_footer ( )
HTMLForm::display_footer ( )

Return form footer as string.

Returns
string
HTMLForm::display_header ( )
HTMLForm::display_header ( )

Return form header as text.

Returns
string
HTMLForm::display_hiddenInput (   $input,
  $default = null 
)

Build and return hidden input.

Parameters
mixed$input
string$default
Returns
string
HTMLForm::display_hiddens ( )
HTMLForm::display_hiddens ( )

Return hidden input as text.

Returns
string
HTMLForm::display_hiddenSubmit ( )
HTMLForm::display_hiddenSubmit ( )

Return hidden submit link for "enter" pressed validation.

Returns
string
HTMLForm::display_numberInput (   $input,
  $default = null 
)

Build and return number input.

Parameters
mixed$input
string$default
Returns
string
HTMLForm::display_passwordInput (   $input,
  $default = null 
)
HTMLForm::display_passwordInput (   $input,
  $default = null 
)

Build and return password input.

Parameters
mixed$input
string$default
Returns
string
HTMLForm::display_phoneInput (   $input,
  $default = null 
)

Build and return phone input.

Parameters
mixed$input
string$default
Returns
string
HTMLForm::display_phonePrefixSelectInput (   $select = array(),
  $default = null 
)
HTMLForm::display_phonePrefixSelectInput (   $select = array(),
  $default = null 
)

Build and return phone prefix select input.

Parameters
mixed$select
mixed$default
Returns
string
HTMLForm::display_radioInput (   $input,
  $default = null 
)
HTMLForm::display_radioInput (   $input,
  $default = null 
)

Build and return radio input.

Parameters
mixed$input
string$default
Returns
string
HTMLForm::display_selectInput (   $select,
  $values = null,
  $default = null 
)
HTMLForm::display_selectInput (   $select,
  $values = null,
  $default = null 
)

Build and return select input.

Parameters
mixed$select
array$values
mixed$default
Returns
string
HTMLForm::display_textareaInput (   $input,
  $default = null 
)
HTMLForm::display_textareaInput (   $input,
  $default = null 
)

Build and return textarea input.

Parameters
mixed$input
string$default
Returns
string
HTMLForm::display_textInput (   $input,
  $default = null 
)
HTMLForm::display_textInput (   $input,
  $default = null 
)

Build and return text input.

Parameters
mixed$input
string$default
Returns
string
HTMLForm::display_URLInput (   $input,
  $default = null 
)

Build and return URL input.

Parameters
mixed$input
string$default
Returns
string
HTMLForm::display_weekDaySelectInput (   $select,
  $default = null 
)

Build and return week days select input.

Parameters
mixed$select
mixed$default
Returns
string
HTMLForm::get_HTMLSubmitLink ( )
HTMLForm::get_HTMLSubmitLink ( )

Return current form html submit link.

Returns
string
HTMLForm::get_JSSubmitLink ( )
HTMLForm::get_JSSubmitLink ( )

Return current form javascript submit link.

Returns
string
HTMLForm::get_tabIndex (   $full = false,
  $index = -1 
)
HTMLForm::get_tabIndex (   $full = false,
  $index = -1 
)

Return tabIndex value or form value.

Parameters
boolean$fullindicate if method return html source
integer$indexindicate forced value
Returns
mixed
HTMLForm::HTMLForm (   $name = '',
  $action = './',
  $method = null,
  $onSubmit = '',
  $target = '' 
)
HTMLForm::set_jsFocus (   $focus)
HTMLForm::set_jsFocus (   $focus)

Return javascript code to set focus on given form element.

Parameters
string$focusthe form item to focus
Returns
string
HTMLForm::set_object (   $object = null)
HTMLForm::set_object (   $object = null)

Update object value.

Parameters
ModuleLibrary$object
Returns
void
HTMLForm::set_parent (   $parent = null)
HTMLForm::set_parent (   $parent = null)

Update parent value.

Parameters
Module$parent
Returns
void
HTMLForm::start_tabIndex ( )
HTMLForm::start_tabIndex ( )

Start tabIndex.

Returns
void
HTMLForm::update_inputsLimit (   $value = 1000)

Temporarily and virtually update max input vars limit.

Parameters
integer$value
Returns
void

Member Data Documentation

string HTMLForm::$action

Form action.

boolean HTMLForm::$allowFiles = false

Form on submit action script.

array HTMLForm::$hiddens = array()

Form hidden value list.

HTMLForm::$inputDefaultParams
protected
Initial value:
= array(
'id' => '',
'name' => '',
'language' => '',
'default' => '',
'class' => 'inputs',
'style' => '',
'onchange' => '',
'onfocus' => '',
'onblur' => '',
'oninput' => '',
'onkeydown' => '',
'onkeyup' => '',
'disabled' => '',
'data' => array(),
'tabIndex' => -1,
'placeholder' => '',
'maxlength' => 0,
'minlength' => 0,
'pattern' => '',
'readonly' => '',
'list' => '',
'autocomplete' => '',
'allowMultiple' => false,
'size' => 0,
)

List all default params for inputs.

var array $inputDefaultParams

integer HTMLForm::$inputsCount = 0
protected

Form inputs counter.

integer HTMLForm::$inputsLimit
protected

Form input limit.

boolean HTMLForm::$inputsLimitReached = false
protected

Form input limit reached.

array HTMLForm::$inputsLimitUniques = array()
protected

Form stored unique input names.

string HTMLForm::$method

Form data sending method.

string HTMLForm::$name

Form name.

ModuleLibrary HTMLForm::$object = null
protected

ModuleLibrary object to auto-fill values.

string HTMLForm::$onSubmit

Form on submit action script.

Module HTMLForm::$parent = null
protected

Parent module.

integer HTMLForm::$tabIndex = -1

Form current tab index.

string HTMLForm::$target

Form target window/frame.


The documentation for this class was generated from the following file: