Packageindex Classtrees Modulegroups Elementlist Report XML Files
 
File: c:/www/apache/doc2//form/template_bridge.inc
PHPLib Form Rewrite 2001/03/01 - Form

template_bridge

form_commonobject
   |
  +-- template_bridge

Joins OOH Forms and Template to build automatically complex one column forms

 

private class template_bridge extends form_commonobject

Joins OOH Forms and Template to build automatically complex one column forms
FIXME

AuthorsUlf Wendel <ulf.wendel@phpdoc.de>
Version$Id: $

 

Methods inherited from form_commonobject

introspection

Public Method Summary

void

template_bridge([ string $form, string $template, mixed $template_files ])

Constructor.
bool

setTemplatePath(string $template)

Sets the path to the template
bool

setTemplateFiles(mixed $template_files)

Sets the template files
void

setForm(mixed $form)

Defines the form to use
bool

isValid()

Are there errors in this form?
void

setMethod([ string $method ])

Set the method used in the form. Form needs it for autoloadValues().
bool

setImagepath(string $path)

Were are the images stored?
bool

setImages(array $images)

If you want to use images to assign the status of a field, define them.
bool

dropImages(array $images)

Drop some images
bool

addElement(array $element_data)

Adds a new element to the template
bool

addComment(string $comment, [ string $bgcolor ])

Adds a comment to the form
bool

addSubmit(string $name)

Define a submit button - today there's always just on submit button
bool

addReset(string $name)

Define a reset button
bool

addNext(string $name)

Define a next step submit button, tribute to tab styled forms
bool

addPrev(string $name)

Define a previous step submit button, tribute to tab styled forms
string

dumpForm()

Dumps a form to the template. This is no replacement for a custom init()
void

Start([ string $js_name, mixed $method, string $action, string $target ])

Generate <form>-Tag
boolean

setStart(string $html)

Sets the opening form tag
string

Finish([ string $additional_html, mixed $sess ])

Generate closing </form>-Tag
bool

setFinish(string $html)

Sets the closing form tag
string

get()

Returns the Form
string

show()

Show the generated form

Private Method Summary

bool

newTemplate()

Create a new instance of template
string

colorFlash(int $counter, array $data, string $error)

If you want to cycle colors on per row or per type base
string

StatusImage(array $data, mixed $type, [ string $error ])

Return a status image if available
void

Init()

Warning: documentation is missing.

Fields inherited from form_commonobject

$cr_html, $exceptions

Private Field Summary

string

$template

Path to the template files, set by the constructor.
string

$unknowns

How to handle unknown placeholder.
array

$template_files

Template files.
object template

$tpl

Template object
array

$colors

Array of background colors, override it in your class.
array

$images

Status Images.
string

$imagepath

Path to the Images
array

$elements

Array of all elements.
object form

$form

Object of form we're working on.
string

$start_form

Opening form tag. Eigther generated by Start() or set by the user with setStart().
string

$end_form

Closing form tag. Eighter generated by Finish() or set by the use with setFinish().

Public Method Details

template_bridge

public void template_bridge( [ string $form, string $template, mixed $template_files ] )

  Constructor.

Parameter
string $form = >>""<<
to template file
string $template = >>""<<
unknowns?
mixed $template_files = >>""<<
files
Returns void

See Also $template_files, $tpl

setTemplatePath

public bool setTemplatePath( string $template )

  Sets the path to the template

Parameter
string $template
Returns bool $ok

Throws runtime_wrongparam
See Also $template

setTemplateFiles

public bool setTemplateFiles( mixed $template_files )

  Sets the template files

Parameter
mixed $template_files
Returns bool $ok

Throws runtime_wrongparam
See Also $template_files

setForm

public void setForm( mixed $form )

  Defines the form to use

Parameter
mixed $form
Returns void

Throws runtime_wrongparam
See Also $form

isValid

public bool isValid( )

  Are there errors in this form?

Returns bool $ok


setMethod

public void setMethod( [ string $method ] )

  Set the method used in the form. Form needs it for autoloadValues().
You set the method eighter by Start() or be setMethod()

Parameter
string $method = >>"POST"<<
Returns void


setImagepath

public bool setImagepath( string $path )

  Were are the images stored?

Parameter
string $path
Returns bool $ok

Throws runtime_wrongparam

setImages

public bool setImages( array $images )

  If you want to use images to assign the status of a field, define them.

Parameter
array $images
Returns bool $ok

Throws runtime_wrongparam
See Also $images, dropImages()

dropImages

public bool dropImages( array $images )

  Drop some images

Parameter
array $images
Returns bool $ok

Throws runtime_wrongparam
See Also setImages(), $images

addElement

public bool addElement( array $element_data )

  Adds a new element to the template

Parameter
array $element_data
Returns bool $ok

Throws runtime_wrongparam, notice

addComment

public bool addComment( string $comment, [ string $bgcolor ] )

  Adds a comment to the form

Parameter
string $comment
string $bgcolor = >>""<<
Returns bool $ok

Throws runtime_wrongparam

addSubmit

public bool addSubmit( string $name )

  Define a submit button - today there's always just on submit button

Parameter
string $name
Returns bool $ok

Throws runtime_wrongparam
See Also addReset(), addNext(), addPrev()

addReset

public bool addReset( string $name )

  Define a reset button

Parameter
string $name
Returns bool $ok

Throws runtime_wrongparam
See Also addSubmit(), addNext(), addPrev()

addNext

public bool addNext( string $name )

  Define a next step submit button, tribute to tab styled forms

Parameter
string $name
Returns bool $ok

See Also addReset(), addSubmit(), addPrev()

addPrev

public bool addPrev( string $name )

  Define a previous step submit button, tribute to tab styled forms

Parameter
string $name
Returns bool $ok

Throws runtime_wrongparam
See Also addSubmit(), addReset(), addNext()

dumpForm

public string dumpForm( )

  Dumps a form to the template. This is no replacement for a custom init()
function. Within init() you define labels, hints, comments and buttons. Thiscan't be done with dumpForm.

Returns string $html

Throws runtime

Start

public void Start( [ string $js_name, mixed $method, string $action, string $target ] )

  Generate <form>-Tag

Parameter
string $js_name = >>""<<
mixed $method = >>"POST"<<
string $action = >>""<<
string $target = >>""<<
Returns void

See Also setStart(), Finish(), setFinish()

setStart

public boolean setStart( string $html )

  Sets the opening form tag

Parameter
string $html
Returns boolean

See Also Start(), Finish(), setFinish()

Finish

public string Finish( [ string $additional_html, mixed $sess ] )

  Generate closing </form>-Tag

Parameter
string $additional_html = >>""<<
= ""
mixed $sess = >>""<<
= ""
Returns string $html


setFinish

public bool setFinish( string $html )

  Sets the closing form tag

Parameter
string $html
Returns bool $ok

Throws runtime
See Also Finish(), Start(), setStart()

get

public string get( )

  Returns the Form

Returns string $html

Throws runtime

show

public string show( )

  Show the generated form

Returns string $html


Private Method Details

newTemplate

private bool newTemplate( )

  Create a new instance of template

Returns bool $ok

Throws runtime_wrongparam

colorFlash

private string colorFlash( int $counter, array $data, string $error )

  If you want to cycle colors on per row or per type base
write a function, that returns a bgcolor attribute or anempty stringFIXME

Parameter
int $counter
row number in form
array $data
element data
string $error
validation result
Returns string $bgcolor


StatusImage

private string StatusImage( array $data, mixed $type, [ string $error ] )

  Return a status image if available

Parameter
array $data
mixed $type
string $error = >>""<<
Returns string

Throws runtime_wrongparam

Init

private void Init( )

 

Warning: documentation is missing.

Returns void


Private Field Details

$template

private string $template

>>""<<

Path to the template files, set by the constructor.

See Also template_bridge()

$unknowns

private string $unknowns

>>"remove"<<

How to handle unknown placeholder.

See Also template_bridge()

$template_files

private array $template_files

>>array ( "main" => "form_main.tpl" #"box" => "form_box.html" )<<

Template files.


$tpl

private object template $tpl

>><<

Template object

See Also template_bridge()

$colors

private array $colors

>>array ( "comment" => "", "button" => "" )<<

Array of background colors, override it in your class.


$images

private array $images

>>array()<<

Status Images.

See Also setImages(), dropImages()

$imagepath

private string $imagepath

>>""<<

Path to the Images

See Also setImagepath()

$elements

private array $elements

>>array()<<

Array of all elements.


$form

private object form $form

>><<

Object of form we're working on.


$start_form

private string $start_form

>>""<<

Opening form tag. Eigther generated by Start() or set by the user with setStart().

See Also Start(), setStart(), Finish(), setFinish(), $end_form

$end_form

private string $end_form

>>""<<

Closing form tag. Eighter generated by Finish() or set by the use with setFinish().

See Also Finish(), setFinish(), Start(), setStart(), $start_form


Packageindex Classtrees Modulegroups Elementlist Report XML Files
PHPDoc 1.0beta