Public Member Functions | Protected Member Functions | Protected Attributes

form_db Class Reference

Inheritance diagram for form_db:
form object

Public Member Functions

 addFromField (array $field, $isI18n=false)
 addFromRelated (array $related)
 addFromFieldFilter (array $field)
 addFromRelatedFilter (array $related)
 getFromFieldPrm (array $field)
 setSubmitText ($text)
 setSubmitPlus ($text)
 __toString ()
 to ($type)
 finalize ()
 toHtml ()
 toXul ()
 isValid ()
 isI18n ()
 getErrors ()
 hasErrors ()
 addCustomError ($field, $error)
 add ($type, array $prm=array(), $isI18n=false)
 has ($name)
 get ($name)
 del ($name)
 reOrder (array $order)
 reOrderSection (array $order)
 getValue ($name)
 getValues ($onlyFilled=false, $ignoreWhitePassword=true)
 addNotValue ($name)
 getNames ()
 setValue ($name, $value, $refill=false)
 setValues (array $data, $refill=false)
 isBound ()
 setBound ($bound)
 refill ()
 getNew ($type, array $prm)
 addSection ($name)
 setSection ($search)
 setSectionName ($name, $search=null)
 moveToSection ($name, $section=null)
 setMode ($mode, $force=true)
 firstSection ()
 lastSection ()
 getSection ()
 set ($key1, $key2, $val)
 __set ($key, $val)
 __clone ()
 getAttr ($name)
 setAttr ($name, $value)
 getCfg ()

Protected Member Functions

 afterInit ()
 addCaptcha ()
 beforeInit ()

Protected Attributes

 $elements = array()
 $i18nElements = array()
 $section = array()
 $elementsSection = array()
 $curSection = 0
 $hasFiles = 0
 $isBound = false
 $errors = array()
 $customErrors = array()
 $captchaAdded = false
 $cfg

Detailed Description

class for create form directly from the db fields

Definition at line 10 of file form/db.class.php.


Member Function Documentation

__clone (  )  [inherited]

Used when cloning the form to create new field element

Definition at line 768 of file form.class.php.

__set ( key,
val 
) [inherited]

Definition at line 761 of file form.class.php.

__toString (  )  [inherited]

Transform the element to a string to be shown, with the courant output

Returns:
string

Definition at line 112 of file form.class.php.

add ( type,
array $  prm = array(),
isI18n = false 
) [inherited]

Add a form element in the current section

Parameters:
string|form_abstract $type Form element type or element form
array $prm Parameter array for the element
bool $isI18n
Returns:
form_abstract|null Reference to the added element or null if not added or i18n (name exist yet)

Definition at line 343 of file form.class.php.

addCaptcha (  )  [protected, inherited]

Add a captcha if parametred and not already added

Definition at line 740 of file form.class.php.

addCustomError ( field,
error 
) [inherited]

Add a custom error

Parameters:
string $field Filed name to be associate with
string $error The error text

Definition at line 325 of file form.class.php.

addFromField ( array $  field,
isI18n = false 
)

Add a form element regarding the field information

Parameters:
array $field Field information
bool $isI18n
Returns:
form_abstract Reference to the new element

Definition at line 19 of file form/db.class.php.

addFromFieldFilter ( array $  field  ) 

Add a form element regarding the field information, especially for a filter

Parameters:
array $field Field information
Returns:
form_abstract Reference to the new element

Definition at line 67 of file form/db.class.php.

addFromRelated ( array $  related  ) 

Add a form element for a related filter

Parameters:
array $related

Definition at line 29 of file form/db.class.php.

addFromRelatedFilter ( array $  related  ) 

Add a form element for a related filter, especially for a filter

Parameters:
array $related

Definition at line 121 of file form/db.class.php.

addNotValue ( name  )  [inherited]

Add field to be considered as a non value (ie non attribued in getValues)

Parameters:
string $name

Definition at line 525 of file form.class.php.

addSection ( name  )  [inherited]

Add a new section

Parameters:
string $name Section name
Returns:
int The section index

Definition at line 623 of file form.class.php.

afterInit (  )  [protected, inherited]

Add the first section from the configuration file

Reimplemented from object.

Definition at line 85 of file form.class.php.

beforeInit (  )  [protected, inherited]

Call just before the configuration initialisation

Reimplemented in form_file.

Definition at line 35 of file object.class.php.

del ( name  )  [inherited]

Delete a form element

Parameters:
string $name

Definition at line 395 of file form.class.php.

finalize (  )  [inherited]

Finalize the construction of the form. Should be call when i18n are present

Definition at line 220 of file form.class.php.

firstSection (  )  [inherited]

Set the section to the first

Definition at line 717 of file form.class.php.

get ( name  )  [inherited]

Get a form element

Parameters:
string $name Field name
Returns:
form_abstract|null

Definition at line 384 of file form.class.php.

getAttr ( name  )  [inherited]

Get an attribute

Parameters:
string $name Attribute name
Returns:
mixed|null The attribute or null if not set

Reimplemented in response_proxy.

Definition at line 48 of file object.class.php.

getCfg (  )  [inherited]

Get the configuration object

Returns:
config

Definition at line 67 of file object.class.php.

getErrors (  )  [inherited]

Get all the errors for the last validation

Returns:
array

Definition at line 306 of file form.class.php.

getFromFieldPrm ( array $  field  ) 

Get a form element array parameter regarding the field information

Parameters:
array $field Field information
Returns:
form_abstract Reference to the new element

Definition at line 152 of file form/db.class.php.

getNames (  )  [inherited]

Get all the available names

Returns:
array

Definition at line 534 of file form.class.php.

getNew ( type,
array $  prm 
) [inherited]

Get a form element for the form type

Parameters:
string $type Form element type
array $prm Parameter array for the element
Returns:
form_abstract Reference to the new element

Definition at line 611 of file form.class.php.

getSection (  )  [inherited]

Get the current section index

Returns:
int

Definition at line 733 of file form.class.php.

getValue ( name  )  [inherited]

Get the actual value for 1 field

Parameters:
string $name Field name
Returns:
mixed

Definition at line 469 of file form.class.php.

getValues ( onlyFilled = false,
ignoreWhitePassword = true 
) [inherited]

Get all the values field

Parameters:
bool $onlyFilled
bool $ignoreWhitePassword
Returns:
array

Definition at line 483 of file form.class.php.

has ( name  )  [inherited]

Check if the form has a element

Parameters:
string $name Field name
Returns:
bool

Definition at line 374 of file form.class.php.

hasErrors (  )  [inherited]

Check if the form has errors (only if a validations was done)

Returns:
bool

Definition at line 315 of file form.class.php.

isBound (  )  [inherited]

Indicates if the form has been bound

Returns:
boolean

Definition at line 576 of file form.class.php.

isI18n (  )  [inherited]

Indicate if the form has i18n elements

Returns:
bool

Definition at line 297 of file form.class.php.

isValid (  )  [inherited]

Check if all the form elements are valid

Returns:
bool True if valid

Definition at line 278 of file form.class.php.

lastSection (  )  [inherited]

Set the section to the last

Definition at line 724 of file form.class.php.

moveToSection ( name,
section = null 
) [inherited]

Move a field to another section

Parameters:
string $name Fieldname
int $section Section Number. If null, current section will be used
Returns:
bool True if the field was found and moved

Definition at line 686 of file form.class.php.

refill (  )  [inherited]

Refill the whole form from the post argument

Definition at line 592 of file form.class.php.

reOrder ( array $  order  )  [inherited]

Reorder the fields in the current section

Parameters:
array $order Array containing the field names in order wanted

Definition at line 407 of file form.class.php.

reOrderSection ( array $  order  )  [inherited]

Reorder the sections

Parameters:
array $order Array containing either the section index or the section name

Definition at line 428 of file form.class.php.

set ( key1,
key2,
val 
) [inherited]

Set configuration var with a depth of 2

Parameters:
string $key1 The 1st index
string $key2 The 2nd index
mixed $val The value

Definition at line 757 of file form.class.php.

setAttr ( name,
value 
) [inherited]

Set an attribute

Parameters:
string $name Attribute name
mixed $value Attribute value

Reimplemented in response_proxy.

Definition at line 58 of file object.class.php.

setBound ( bound  )  [inherited]

Set the bound status

Parameters:
boolean $bound

Definition at line 585 of file form.class.php.

setMode ( mode,
force = true 
) [inherited]

Change the mode of the form

Parameters:
string $mode edit or view
bool $force True to reaffect all the field

Definition at line 705 of file form.class.php.

setSection ( search  )  [inherited]

Set the current section

Parameters:
int|string $search Section index or section name
Returns:
false|int Section index if found or false

Definition at line 636 of file form.class.php.

setSectionName ( name,
search = null 
) [inherited]

Set a section name

Parameters:
string $name Section name to set
null|int|string $search null to set to the current section, int or string to search a section
Returns:
bool True if section name was correctly set

Definition at line 659 of file form.class.php.

setSubmitPlus ( text  )  [inherited]

Set the submit plus

Parameters:
string $text

Definition at line 103 of file form.class.php.

setSubmitText ( text  )  [inherited]

Set the submit text

Parameters:
string $text

Definition at line 94 of file form.class.php.

setValue ( name,
value,
refill = false 
) [inherited]

Set a field value

Parameters:
string $name Field name
mixed $value
boolean $refill Indicate if the value is a refill one
Returns:
bool True if successful

Definition at line 546 of file form.class.php.

setValues ( array $  data,
refill = false 
) [inherited]

Set values to the form elements

Parameters:
array $data
boolean $refill Indicate if the value is a refill one
Returns:
int Element values updated count

Definition at line 562 of file form.class.php.

to ( type  )  [inherited]

Transform the element to a string to be shown

Parameters:
string $type The output type
Returns:
string

Definition at line 129 of file form.class.php.

toHtml (  )  [inherited]

Transform the form in HTML

Definition at line 262 of file form.class.php.

toXul (  )  [inherited]

Transform the form in XUL

Definition at line 269 of file form.class.php.


Field Documentation

$captchaAdded = false [protected, inherited]

Definition at line 80 of file form.class.php.

$cfg [protected, inherited]

Definition at line 17 of file object.class.php.

$curSection = 0 [protected, inherited]

Definition at line 45 of file form.class.php.

$customErrors = array() [protected, inherited]

Definition at line 73 of file form.class.php.

$elements = array() [protected, inherited]

Definition at line 17 of file form.class.php.

$elementsSection = array() [protected, inherited]

Definition at line 38 of file form.class.php.

$errors = array() [protected, inherited]

Definition at line 66 of file form.class.php.

$hasFiles = 0 [protected, inherited]

Definition at line 52 of file form.class.php.

$i18nElements = array() [protected, inherited]

Definition at line 24 of file form.class.php.

$isBound = false [protected, inherited]

Definition at line 59 of file form.class.php.

$section = array() [protected, inherited]

Definition at line 31 of file form.class.php.


The documentation for this class was generated from the following file:
 All Data Structures Files Functions Variables Enumerations
Generated on Tue May 8 2012 16:02:25 for nyroFwk by doxygen 1.7.1