CaMykS  1.0-20231201
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_colorInput ($input, $default=null)
 
 display_textareaInput ($input, $default=null)
 
 display_passwordInput ($input)
 
 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 ()
 

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

◆ __construct()

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

◆ allow_files()

HTMLForm::allow_files (   $allow = true,
  $size = null 
)

Allow files for this form.

Parameters
boolean$allow
integer$sizethe allowed file size in bytes
Returns
void

◆ set_object()

HTMLForm::set_object (   $object = null)

Update object value.

Parameters
ModuleLibrary$object
Returns
void

◆ set_parent()

HTMLForm::set_parent (   $parent = null)

Update parent value.

Parameters
Module$parent
Returns
void

◆ display_header()

HTMLForm::display_header ( )

Return form header as text.

Returns
string

◆ display_footer()

HTMLForm::display_footer ( )

Return form footer as string.

Returns
string

◆ add_hidden()

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

◆ display_hiddens()

HTMLForm::display_hiddens ( )

Return hidden input as text.

Returns
string

◆ set_jsFocus()

HTMLForm::set_jsFocus (   $focus)

Return javascript code to set focus on given form element.

Parameters
string$focusthe form item to focus
Returns
string

◆ display_dateInput()

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

◆ display_fileInput()

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

◆ display_selectInput()

HTMLForm::display_selectInput (   $select,
  $values = null,
  $default = null 
)

Build and return select input.

Parameters
mixed$select
array$values
mixed$default
Returns
string

◆ display_booleanSelectInput()

HTMLForm::display_booleanSelectInput (   $select,
  $default = null 
)

Build and return boolean select input.

Parameters
mixed$select
mixed$default
Returns
string

◆ display_countrySelectInput()

HTMLForm::display_countrySelectInput (   $select = array(),
  $default = null 
)

Build and return country select input.

Parameters
mixed$select
mixed$default
Returns
string

◆ display_phonePrefixSelectInput()

HTMLForm::display_phonePrefixSelectInput (   $select = array(),
  $default = null 
)

Build and return phone prefix select input.

Parameters
mixed$select
mixed$default
Returns
string

◆ display_civilitySelectInput()

HTMLForm::display_civilitySelectInput (   $select,
  $default = null 
)

Build and return civility select input.

Parameters
mixed$select
mixed$default
Returns
string

◆ display_weekDaySelectInput()

HTMLForm::display_weekDaySelectInput (   $select,
  $default = null 
)

Build and return week days select input.

Parameters
mixed$select
mixed$default
Returns
string

◆ display_textInput()

HTMLForm::display_textInput (   $input,
  $default = null 
)

Build and return text input.

Parameters
mixed$input
string$default
Returns
string

◆ display_numberInput()

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

Build and return number input.

Parameters
mixed$input
string$default
Returns
string

◆ display_emailInput()

HTMLForm::display_emailInput (   $input,
  $default = null 
)

Build and return email input.

Parameters
mixed$input
string$default
Returns
string

◆ display_phoneInput()

HTMLForm::display_phoneInput (   $input,
  $default = null 
)

Build and return phone input.

Parameters
mixed$input
string$default
Returns
string

◆ display_URLInput()

HTMLForm::display_URLInput (   $input,
  $default = null 
)

Build and return URL input.

Parameters
mixed$input
string$default
Returns
string

◆ display_colorInput()

HTMLForm::display_colorInput (   $input,
  $default = null 
)

Build and return color input.

Parameters
mixed$input
string$default
Returns
string

◆ display_textareaInput()

HTMLForm::display_textareaInput (   $input,
  $default = null 
)

Build and return textarea input.

Parameters
mixed$input
string$default
Returns
string

◆ display_passwordInput()

HTMLForm::display_passwordInput (   $input)

Build and return password input.

Parameters
mixed$input
Returns
string

◆ display_checkboxInput()

HTMLForm::display_checkboxInput (   $input,
  $default = null 
)

Build and return checkbox input.

Parameters
mixed$input
string$default
Returns
string

◆ display_radioInput()

HTMLForm::display_radioInput (   $input,
  $default = null 
)

Build and return radio input.

Parameters
mixed$input
string$default
Returns
string

◆ display_hiddenInput()

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

Build and return hidden input.

Parameters
mixed$input
string$default
Returns
string

◆ build_inputGenericAttributes()

HTMLForm::build_inputGenericAttributes (   $params)
protected

Return generic attributes for inputs

Parameters
array$params
Returns
string

◆ display_hiddenSubmit()

HTMLForm::display_hiddenSubmit ( )

Return hidden submit link for "enter" pressed validation.

Returns
string

◆ get_HTMLSubmitLink()

HTMLForm::get_HTMLSubmitLink ( )

Return current form html submit link.

Returns
string

◆ get_JSSubmitLink()

HTMLForm::get_JSSubmitLink ( )

Return current form javascript submit link.

Returns
string

◆ start_tabIndex()

HTMLForm::start_tabIndex ( )

Start tabIndex.

Returns
void

◆ get_tabIndex()

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

◆ check_inputsLimit()

HTMLForm::check_inputsLimit (   $items = 1,
  $name = false 
)
private

Check max input vars limit.

Parameters
integer$items
integer$name
Returns
boolean result

◆ update_inputsLimit()

HTMLForm::update_inputsLimit (   $value = 1000)

Temporarily and virtually update max input vars limit.

Parameters
integer$value
Returns
void

◆ display_ender()

HTMLForm::display_ender ( )

Alias to display_footer method.

See also
display_footer()
Returns
string
Deprecated:
Use display_footer instead.

Member Data Documentation

◆ $name

string HTMLForm::$name

Form name.

◆ $action

string HTMLForm::$action

Form action.

◆ $method

string HTMLForm::$method

Form data sending method.

◆ $onSubmit

string HTMLForm::$onSubmit

Form on submit action script.

◆ $target

string HTMLForm::$target

Form target window/frame.

◆ $hiddens

array HTMLForm::$hiddens = array()

Form hidden value list.

◆ $allowFiles

boolean HTMLForm::$allowFiles = false

Form on submit action script.

◆ $tabIndex

integer HTMLForm::$tabIndex = -1

Form current tab index.

◆ $object

ModuleLibrary HTMLForm::$object = null
protected

ModuleLibrary object to auto-fill values.

◆ $parent

Module HTMLForm::$parent = null
protected

Parent module.

◆ $inputsCount

integer HTMLForm::$inputsCount = 0
protected

Form inputs counter.

◆ $inputsLimit

integer HTMLForm::$inputsLimit
protected

Form input limit.

◆ $inputsLimitUniques

array HTMLForm::$inputsLimitUniques = array()
protected

Form stored unique input names.

◆ $inputsLimitReached

boolean HTMLForm::$inputsLimitReached = false
protected

Form input limit reached.

◆ $inputDefaultParams

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


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