Packageindex Classtrees Modulegroups Elementlist Report XML Files
 
File: c:/www/apache/doc2//form/form_flow_layout.inc
PHPLib Form Rewrite 11.02.2001 - Form

form_flow_layout

form_commonobject
   |
  +-- form
     |
    +-- form_flow_layout

Simple Form Layout Manager based on a modified flow control rule.

 

private class form_flow_layout extends form

Simple Form Layout Manager based on a modified flow control rule.
This simple flow based "layout manager" can be used to layout simpleforms or to dump forms. It's based on the idea that most simple formscan be automatically layouted by a simple rule: put all elements ina row as long as you're not told to do a use a new row.Requires IT[X] template.

AuthorsUlf Wendel <ulf.wendel@phpdoc.de>
Version$Id: form_flow_layout.inc,v 1.1 2001/01/14 20:33:51 uw Exp $

 

Methods inherited from form

setjsmode, setmethod, autoloadvalues, setvalues, validation, validationoff, validationon, setvalidator, getstart, start, getfinish, finish, get, show, gettype, getvalue, showelement, validate, setvalidationerror, getvalidationresult, getcustomvalidators, freeze, unfreeze, addjs, getjs, compressjs, thawout, getelements, getoptions, elementexists, setdefaults, adddefaultattributes, getnametranslationlist, getelementnames, clearcode, getsessionhash, setelementnameprefix, ischecked, getnewcombooption, addoption, gettree, settree, ismethodallowed, setjserror, list, setoptions

Methods inherited from form_commonobject

introspection

Public Method Summary

void

form_flow_layout([ string $tpl_root, string $tpl_file ])

Sets the template file and template root directory
void

addBreak()

Starts a new row / adds a row to the layout.
void

startGroup(string $label)

Starts a fieldset/group.
void

endGroup()

Ends a group.
string

getPage()

Returns the HTML of the form.
boolean

isValid()

Checks if the form is valid.
void

setTemplateRoot(string $root)

Sets the template root directory.
boolean

setTemplate(string $template)

Sets the template file.

Private Method Summary

void

printPage()

Prints the form.
string

buildLayout([ integer $node_id, mixed $width ])

Recursively builds the page from the layout tree.
void

getElement(string $elname)

Warning: documentation is missing.
object IntegratedTemplateExtension

getTemplateObject()

Returns a IT[X] template object.
void

addElement(array $element_data)

Adds an element to the form object.Warning: documentation is missing.

Fields inherited from form

$defaults, $elements, $element_names, $element_prefix, $validation_flags, $validation_msg, $hidden_elements, $radio_elements, $js_name, $js_mode, $js_error_prefix, $js_error_postfix, $method, $flag_loader, $flag_contains_file

Fields inherited from form_commonobject

$cr_html, $cr_js, $exception

Private Field Summary

string

$tpl

IT[X] template object used to render custom elments.
string

$tpl_root

IT[X] template root directory.
string

$tpl_file

IT[X] template file with the layout of custom form elements.
array

$tables

Linked list of M-trees used to save the layout structure.
string

$parent_node

Current parent node id.

Public Method Details

form_flow_layout

public void form_flow_layout( [ string $tpl_root, string $tpl_file ] )

  Sets the template file and template root directory

Parameter
string $tpl_root = >>""<<
root directory
string $tpl_file = >>""<<
file
Returns void


addBreak

public void addBreak( )

  Starts a new row / adds a row to the layout.

Returns void


startGroup

public void startGroup( string $label )

  Starts a fieldset/group.
A group is a list of elements rendered in a box with a label. The box lookslike a HTML 4 fieldset box (not avaiable in NS 4).A template with a blind table is used to render the box.Note that you have to end / close a group with endGroup().

Parameter
string $label
label
Returns void

Throws form_error
See Also endGroup()

endGroup

public void endGroup( )

  Ends a group.

Returns void

See Also startGroup()

getPage

public string getPage( )

  Returns the HTML of the form.

Returns string


isValid

public boolean isValid( )

  Checks if the form is valid.

Returns boolean


setTemplateRoot

public void setTemplateRoot( string $root )

  Sets the template root directory.

Parameter
string $root
root path
Returns void


setTemplate

public boolean setTemplate( string $template )

  Sets the template file.
The IT[X] template file contains blocks with the layout of customelements. The blocks include a placeholder for the help and error messageas well as for the label of the element.

Parameter
string $template
file
Returns boolean

Throws form_error

Private Method Details

printPage

private void printPage( )

  Prints the form.

Returns void


buildLayout

private string buildLayout( [ integer $node_id, mixed $width ] )

  Recursively builds the page from the layout tree.

Parameter
integer $node_id = >>0<<
of the layout tree node to start with
mixed $width = >>""<<
width attribute value
Returns string

HTML


getElement

private void getElement( string $elname )

 

Warning: documentation is missing.

Parameter
string $elname
name
Returns void

Throws form_error

getTemplateObject

private object IntegratedTemplateExtension getTemplateObject( )

  Returns a IT[X] template object.

Returns object IntegratedTemplateExtension


addElement

private void addElement( array $element_data )

  Adds an element to the form object.

Warning: documentation is missing.

Parameter
array $element_data
Returns void

Throws form_error

Private Field Details

$tpl

private string $tpl

>>""<<

IT[X] template object used to render custom elments.


$tpl_root

private string $tpl_root

>>""<<

IT[X] template root directory.


$tpl_file

private string $tpl_file

>><<

IT[X] template file with the layout of custom form elements.

See Also form_flow_layout(), setTemplate()

$tables

private array $tables

>>array()<<

Linked list of M-trees used to save the layout structure.


$parent_node

private string $parent_node

>>NULL<<

Current parent node id.



Packageindex Classtrees Modulegroups Elementlist Report XML Files
PHPDoc 1.0beta