HTML_Common
[ class tree: HTML_Common ] [ index: HTML_Common ] [ all elements ]

Class: HTML_QuickForm_element

Source Location: /pear/HTML/QuickForm/element.php

Class Overview

HTML_Common
   |
   --HTML_QuickForm_element

Base class for form elements


Author(s):

Version:

  • 1.3

Methods


Child classes:

HTML_QuickForm_group
HTML class for a form element group
HTML_QuickForm_input
Base class for input form elements
HTML_QuickForm_select
Class to dynamically create an HTML SELECT
HTML_QuickForm_static
HTML class for static data
HTML_QuickForm_textarea
HTML class for a textarea type field
HTML_QuickForm_xbutton
Class for HTML 4.0 <button> element

Inherited Methods

Class: HTML_Common

HTML_Common::HTML_Common()
Class constructor
HTML_Common::apiVersion()
Returns the current API version
HTML_Common::charset()
Sets the charset to use by htmlspecialchars() function
HTML_Common::display()
Displays the HTML to the screen
HTML_Common::getAttribute()
Returns the value of the given attribute
HTML_Common::getAttributes()
Returns the assoc array (default) or string of attributes
HTML_Common::getComment()
Returns the HTML comment
HTML_Common::getTabOffset()
Returns the tabOffset
HTML_Common::removeAttribute()
Removes an attribute
HTML_Common::setAttribute()
Sets the value of the attribute
HTML_Common::setAttributes()
Sets the HTML attributes
HTML_Common::setComment()
Sets the HTML comment to be displayed at the beginning of the HTML string
HTML_Common::setLineEnd()
Sets the line end style to Windows, Mac, Unix or a custom string.
HTML_Common::setTab()
Sets the string used to indent HTML
HTML_Common::setTabOffset()
Sets the tab offset
HTML_Common::toHtml()
Abstract method. Must be extended to return the objects HTML
HTML_Common::updateAttributes()
Updates the passed attributes without changing the other existing attributes

Class Details

[line 34]
Base class for form elements



Tags:

author:  Adam Daniel <adaniel1@eesus.jnj.com>
author:  Bertrand Mansion <bmansion@mamasam.com>
version:  1.3
abstract:  
since:  PHP4.04pl1
access:  public


[ Top ]


Class Methods


constructor HTML_QuickForm_element [line 83]

void HTML_QuickForm_element( [string $elementName = null], [mixed $elementLabel = null], [mixed $attributes = null])

Class constructor



Tags:

since:  1.0
access:  public


Parameters:

string   $elementName   Name of the element
mixed   $elementLabel   Label(s) for the element
mixed   $attributes   Associative array of tag attributes or HTML attributes name="value" pairs

[ Top ]

method accept [line 404]

void accept( object An &$renderer, [bool $required = false], [string $error = null])

Accepts a renderer



Tags:

access:  public


Overridden in child classes as:

HTML_QuickForm_group::accept()
Accepts a renderer
HTML_QuickForm_date::accept()
HTML_QuickForm_hierselect::accept()
HTML_QuickForm_hidden::accept()
Accepts a renderer
HTML_QuickForm_hiddenselect::accept()
This is essentially a hidden element and should be rendered as one
HTML_QuickForm_header::accept()
Accepts a renderer
HTML_QuickForm_html::accept()
Accepts a renderer

Parameters:

object An   &$renderer   HTML_QuickForm_Renderer object
bool   $required   Whether an element is required
string   $error   An error message associated with an element

[ Top ]

method apiVersion [line 104]

float apiVersion( )

Returns the current API version



Tags:

since:  1.0
access:  public


Overridden in child classes as:

HTML_QuickForm_select::apiVersion()
Returns the current API version

Overrides HTML_Common::apiVersion() (Returns the current API version)

[ Top ]

method exportValue [line 441]

mixed exportValue( array &$submitValues, [bool $assoc = false])

Returns a 'safe' element's value



Tags:

access:  public


Overridden in child classes as:

HTML_QuickForm_group::exportValue()
As usual, to get the group's value we access its elements and call
HTML_QuickForm_input::exportValue()
We don't need values from button-type elements (except submit) and files
HTML_QuickForm_checkbox::exportValue()
Return true if the checkbox is checked, null if it is not checked (getValue() returns false)
HTML_QuickForm_advcheckbox::exportValue()
This element has a value even if it is not checked, thus we override
HTML_QuickForm_radio::exportValue()
Returns the value attribute if the radio is checked, null if it is not
HTML_QuickForm_submit::exportValue()
Only return the value if it is found within $submitValues (i.e. if
HTML_QuickForm_select::exportValue()
We check the options and return only the values that _could_ have been
HTML_QuickForm_static::exportValue()
We override this here because we don't want any values from static elements
HTML_QuickForm_xbutton::exportValue()
Returns a 'safe' element's value

Parameters:

array   &$submitValues   array of submitted values to search
bool   $assoc   whether to return the value as associative array

[ Top ]

method freeze [line 196]

void freeze( )

Freeze the element so that only its value is returned



Tags:

access:  public


Overridden in child classes as:

HTML_QuickForm_group::freeze()
HTML_QuickForm_button::freeze()
Freeze the element so that only its value is returned
HTML_QuickForm_file::freeze()
Freeze the element so that only its value is returned
HTML_QuickForm_hidden::freeze()
Freeze the element so that only its value is returned
HTML_QuickForm_image::freeze()
Freeze the element so that only its value is returned
HTML_QuickForm_reset::freeze()
Freeze the element so that only its value is returned
HTML_QuickForm_submit::freeze()
Freeze the element so that only its value is returned
HTML_QuickForm_xbutton::freeze()

[ Top ]

method getFrozenHtml [line 226]

string getFrozenHtml( )

Returns the value of field without HTML tags



Tags:

since:  1.0
access:  public


Overridden in child classes as:

HTML_QuickForm_group::getFrozenHtml()
Returns the value of field without HTML tags
HTML_QuickForm_checkbox::getFrozenHtml()
Returns the value of field without HTML tags
HTML_QuickForm_advcheckbox::getFrozenHtml()
Unlike checkbox, this has to append a hidden input in both
HTML_QuickForm_password::getFrozenHtml()
Returns the value of field without HTML tags (in this case, value is changed to a mask)
HTML_QuickForm_radio::getFrozenHtml()
Returns the value of field without HTML tags
HTML_QuickForm_select::getFrozenHtml()
Returns the value of field without HTML tags
HTML_QuickForm_static::getFrozenHtml()
Returns the value of field without HTML tags
HTML_QuickForm_link::getFrozenHtml()
Returns the value of field without HTML tags (in this case, value is changed to a mask)
HTML_QuickForm_textarea::getFrozenHtml()
Returns the value of field without HTML tags (in this case, value is changed to a mask)
HTML_QuickForm_xbutton::getFrozenHtml()

[ Top ]

method getLabel [line 314]

string getLabel( )

Returns display text for the element



Tags:

since:  1.3
access:  public


[ Top ]

method getName [line 150]

string getName( )

Returns the element name



Tags:

since:  1.0
access:  public


Overridden in child classes as:

HTML_QuickForm_group::getName()
Returns the group name
HTML_QuickForm_input::getName()
Returns the element name
HTML_QuickForm_select::getName()
Returns the element name
HTML_QuickForm_static::getName()
Returns the element name
HTML_QuickForm_link::getName()
Returns the element name
HTML_QuickForm_textarea::getName()
Returns the element name
HTML_QuickForm_xbutton::getName()

[ Top ]

method getType [line 119]

string getType( )

Returns element type



Tags:

since:  1.0
access:  public


[ Top ]

method getValue [line 181]

mixed getValue( )

Returns the value of the form element



Tags:

since:  1.0
access:  public


Overridden in child classes as:

HTML_QuickForm_group::getValue()
Returns the value of the group
HTML_QuickForm_input::getValue()
Returns the value of the form element
HTML_QuickForm_checkbox::getValue()
Returns the value of the form element
HTML_QuickForm_advcheckbox::getValue()
Returns the element's value
HTML_QuickForm_file::getValue()
Returns information about the uploaded file
HTML_QuickForm_select::getValue()
Returns an array of the selected values
HTML_QuickForm_link::getValue()
Returns the value of the form element
HTML_QuickForm_textarea::getValue()
Returns the value of the form element
HTML_QuickForm_xbutton::getValue()

[ Top ]

method isFrozen [line 266]

bool isFrozen( )

Returns whether or not the element is frozen



Tags:

since:  1.3
access:  public


[ Top ]

method onQuickFormEvent [line 361]

void onQuickFormEvent( string $event, mixed $arg, &$caller, object $caller)

Called by HTML_QuickForm whenever form event is made on this element



Tags:

since:  1.0
access:  public


Overridden in child classes as:

HTML_QuickForm_group::onQuickFormEvent()
Called by HTML_QuickForm whenever form event is made on this element
HTML_QuickForm_date::onQuickFormEvent()
HTML_QuickForm_hierselect::onQuickFormEvent()
HTML_QuickForm_input::onQuickFormEvent()
Called by HTML_QuickForm whenever form event is made on this element
HTML_QuickForm_checkbox::onQuickFormEvent()
Called by HTML_QuickForm whenever form event is made on this element
HTML_QuickForm_advcheckbox::onQuickFormEvent()
Called by HTML_QuickForm whenever form event is made on this element
HTML_QuickForm_file::onQuickFormEvent()
Called by HTML_QuickForm whenever form event is made on this element
HTML_QuickForm_radio::onQuickFormEvent()
Called by HTML_QuickForm whenever form event is made on this element
HTML_QuickForm_select::onQuickFormEvent()
HTML_QuickForm_static::onQuickFormEvent()
Called by HTML_QuickForm whenever form event is made on this element
HTML_QuickForm_xbutton::onQuickFormEvent()

Parameters:

string   $event   Name of event
mixed   $arg   event arguments
object   $caller   calling object
   &$caller  

[ Top ]

method setLabel [line 299]

void setLabel( string $label)

Sets display text for the element



Tags:

since:  1.3
access:  public


Parameters:

string   $label   Display text for the element

[ Top ]

method setName [line 135]

void setName( string $name)

Sets the input field name



Tags:

since:  1.0
access:  public


Overridden in child classes as:

HTML_QuickForm_group::setName()
Sets the group name
HTML_QuickForm_input::setName()
Sets the input field name
HTML_QuickForm_select::setName()
Sets the input field name
HTML_QuickForm_static::setName()
Sets the element name
HTML_QuickForm_link::setName()
Sets the input field name
HTML_QuickForm_textarea::setName()
Sets the input field name
HTML_QuickForm_xbutton::setName()

Parameters:

string   $name   Input field name attribute

[ Top ]

method setPersistantFreeze [line 283]

void setPersistantFreeze( [bool $persistant = false])

Sets wether an element value should be kept in an hidden field when the element is frozen or not



Tags:

since:  2.0
access:  public


Overridden in child classes as:

HTML_QuickForm_group::setPersistantFreeze()

Parameters:

bool   $persistant   True if persistant value

[ Top ]

method setValue [line 166]

void setValue( string $value)

Sets the value of the form element



Tags:

since:  1.0
access:  public


Overridden in child classes as:

HTML_QuickForm_group::setValue()
Sets values for group's elements
HTML_QuickForm_date::setValue()
HTML_QuickForm_hierselect::setValue()
Sets values for group's elements
HTML_QuickForm_input::setValue()
Sets the value of the form element
HTML_QuickForm_checkbox::setValue()
Sets the value of the form element
HTML_QuickForm_advcheckbox::setValue()
Sets the element's value
HTML_QuickForm_file::setValue()
Sets value for file element.
HTML_QuickForm_select::setValue()
Sets the value of the form element
HTML_QuickForm_static::setValue()
Sets the text (uses the standard setValue call to emulate a form element.
HTML_QuickForm_link::setValue()
Sets value for textarea element
HTML_QuickForm_textarea::setValue()
Sets value for textarea element
HTML_QuickForm_xbutton::setValue()

Parameters:

string   $value   Default value of the form element

[ Top ]

method unfreeze [line 211]

void unfreeze( )

Unfreezes the element so that it becomes editable



Tags:

since:  3.2.4
access:  public


Overridden in child classes as:

HTML_QuickForm_group::unfreeze()

[ Top ]


Documentation generated on Sun, 08 Jan 2012 17:51:46 +0100 by phpDocumentor 1.4.3