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

Class: XoopsForm

Source Location: /class/xoopsform/form.php

Class Overview


Abstract base class for forms


Author(s):

Copyright:

  • copyright (c) 2000-2003 XOOPS.org

Methods


Child classes:

XoopsGroupPermForm
Renders a form for setting module specific group permissions
XoopsTableForm
Form that will output formatted as a HTML table
XoopsThemeForm
Form that will output as a theme-enabled HTML table
XoopsSimpleForm
Form that will output as a simple HTML form with minimum formatting

Class Details

[line 52]
Abstract base class for forms



Tags:

copyright:  copyright (c) 2000-2003 XOOPS.org
author:  Kazumi Ono <onokazu@xoops.org>


[ Top ]


Class Methods


constructor XoopsForm [line 109]

XoopsForm XoopsForm( string $title, string $name, string $action, [string $method = "post"], [bool $addtoken = false])

constructor



Parameters:

string   $title   title of the form
string   $name   "name" attribute for the <form> tag
string   $action   "action" attribute for the <form> tag
string   $method   "method" attribute for the <form> tag
bool   $addtoken   whether to add a security token to the form

[ Top ]

method addElement [line 161]

void addElement( object &$formElement, [bool $required = false])

Add an element to the form



Parameters:

object   &$formElement   reference to a XoopsFormElement
bool   $required   is this a "required" element?

[ Top ]

method assign [line 408]

void assign( object &$tpl)

assign to smarty form template instead of displaying directly



Tags:

see:  Smarty


Parameters:

object   &$tpl   reference to a Smarty object

[ Top ]

method display [line 368]

void display( )

displays rendered form



[ Top ]

method getAction [line 142]

string getAction( )

get the "action" attribute for the <form> tag



[ Top ]

method getElementByName [line 230]

object reference &getElementByName( string $name)

get a reference to a XoopsFormElement object by its "name"



Tags:

return:  to a XoopsFormElement, false if not found


Parameters:

string   $name   "name" attribute assigned to a XoopsFormElement

[ Top ]

method getElementNames [line 213]

array getElementNames( )

get an array of "name" attributes of form elements



Tags:

return:  array of form element names


[ Top ]

method getElements [line 186]

array &getElements( [bool $recurse = false])

get an array of forms elements



Tags:

return:  array of XoopsFormElements


Parameters:

bool   $recurse   get elements recursively?

[ Top ]

method getElementValue [line 279]

string &getElementValue( string $name)

Gets the "value" attribute of a form element



Tags:

return:  the "value" attribute assigned to a form element, null if not set


Parameters:

string   $name   the "name" attribute of a form element

[ Top ]

method getElementValues [line 292]

array &getElementValues( )

gets the "value" attribute of all form elements



Tags:

return:  array of name/value pairs assigned to form elements


[ Top ]

method getExtra [line 320]

string &getExtra( )

get the extra attributes for the <form> tag



[ Top ]

method getMethod [line 151]

string getMethod( )

get the "method" attribute for the <form> tag



[ Top ]

method getName [line 133]

string getName( )

get the "name" attribute for the <form> tag



[ Top ]

method getRequired [line 340]

array &getRequired( )

get an array of "required" form elements



Tags:

return:  array of XoopsFormElements


[ Top ]

method getTitle [line 124]

string getTitle( )

return the title of the form



[ Top ]

method insertBreak [line 352]

void insertBreak( [string $extra = null])

insert a break in the form

This method is abstract. It must be overwritten in the child classes.




Tags:

abstract:  


Overridden in child classes as:

XoopsThemeForm::insertBreak()
Insert an empty row in the table to serve as a seperator.

Parameters:

string   $extra   extra information for the break

[ Top ]

method render [line 362]

void render( )

returns renderered form

This method is abstract. It must be overwritten in the child classes.




Tags:

abstract:  


Overridden in child classes as:

XoopsGroupPermForm::render()
Renders the form
XoopsTableForm::render()
create HTML to output the form as a table
XoopsThemeForm::render()
create HTML to output the form as a theme-enabled table with validation.
XoopsSimpleForm::render()
create HTML to output the form with minimal formatting

[ Top ]

method renderValidationJS [line 377]

void renderValidationJS( [boolean $withtags = true])

Renders the Javascript function needed for client-side for validation



Parameters:

boolean   $withtags   Include the < javascript > tags in the returned string

[ Top ]

method setElementValue [line 247]

void setElementValue( string $name, string $value)

Sets the "value" attribute of a form element



Parameters:

string   $name   the "name" attribute of a form element
string   $value   the "value" attribute of a form element

[ Top ]

method setElementValues [line 259]

void setElementValues( array $values)

Sets the "value" attribute of form elements in a batch



Parameters:

array   $values   array of name/value pairs to be assigned to form elements

[ Top ]

method setExtra [line 311]

void setExtra( string $extra)

set the extra attributes for the <form> tag



Parameters:

string   $extra   extra attributes for the <form> tag

[ Top ]

method setRequired [line 331]

void setRequired( object &$formElement)

make an element "required"



Parameters:

object   &$formElement   reference to a XoopsFormElement

[ Top ]


Documentation generated on Fri, 03 Mar 2006 08:55:58 +0000 by phpDocumentor 1.3.0RC3