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

Class: HTMLForm

Source Location: /forms/HTMLForm.class.php

Class Overview

ABSTObject
   |
   --ABSTHTMLTag
      |
      --HTMLForm

A class to generate forms.


Author(s):

Version:

  • 0.5.22

Copyright:

  • Copyright (C) 2003 Daniel Plücken <daniel@debakel.net>

    This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License.

    This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

Variables

Methods


Child classes:

ContactForm
A class to generate contact forms. After submit there will be generate a plaintext email to a recipient.
DBTfillingForm
A class to generate forms to put data in a databasetable.

Inherited Variables

Inherited Methods

Class: ABSTHTMLTag

ABSTHTMLTag::getId()
Returns the value of this tag's "id"-attribute.
ABSTHTMLTag::getName()
Returns the value of this tag's "name"-attribute.
ABSTHTMLTag::HTMLTag()
The Constructor let the script die, cause this is an abstract class!
ABSTHTMLTag::idExists()
Stores all used ids and makes sure that every id in the document is unique. It should called in every get method of classes in the packages forms and html.
ABSTHTMLTag::setAttributes()
This method allows to set the attributes of the tag that are not handled by other methods.
ABSTHTMLTag::setFreeStyle()
Set the value of style definitions that are not handled by implemented methods.
ABSTHTMLTag::setId()
Stores the value of this item's "id"-attribute.
ABSTHTMLTag::setName()
Stores the value of this tag's "name"-attribute.
ABSTHTMLTag::setNoFormat()
Stores that the HTML-elements should not format by "\r\n" in the source.
ABSTHTMLTag::setOnBlur()
Sets the value of the blur-attribute of this html-tag.
ABSTHTMLTag::setOnClick()
Sets the value of the click-attribute of this html-tag.
ABSTHTMLTag::setOnFocus()
Sets the value of the focus-attribute of this html-tag.
ABSTHTMLTag::setOnMouseMove()
Sets the value of the mousemove-attribute of this html-tag.
ABSTHTMLTag::setOnMouseOut()
Sets the value of the mouseout-attribute of this html-tag.
ABSTHTMLTag::setOnMouseOver()
Sets the value of the mouseover-attribute of this html-tag.
ABSTHTMLTag::setOnMouseUp()
Sets the value of the mouseup-attribute of this html-tag.
ABSTHTMLTag::setStyle()
Set the value of the class-attribute of this tag.

Class: ABSTObject

ABSTObject::printComplexData()
Prints out the more complex data by the given array.
ABSTObject::printPrimitiveData()
Prints out the primitive data by the given arrays.
ABSTObject::printStructure()
Prints out the Structure of this Object.
ABSTObject::same()
Checks whether the passed object reference points to this object.
ABSTObject::sameReferences()
Compares two references whether they points to the same object

Class Details

[line 169]
A class to generate forms.



Tags:

author:  Daniel Plücken <daniel@debakel.net>
version:  0.5.22
copyright:  

Copyright (C) 2003 Daniel Plücken <daniel@debakel.net>

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

since:  0.3.0.6
license:  GNU Lesser General Public License


[ Top ]


Class Variables

$dummy_item_arr =

[line 263]

Stores names of dummy items.



Tags:

access:  private

Type:   array


[ Top ]

$formInTag =

[line 227]

Carries the beginning of the form.



Tags:

access:  private

Type:   string


[ Top ]

$formItems =

[line 256]

References to the form's items.



Tags:

access:  private

Type:   array


[ Top ]

$form_body =

[line 234]

The content of the form.



Tags:

access:  private

Type:   string


[ Top ]

$hiddenFormItems =

[line 285]

References to the hidden form's items.



Tags:

access:  private

Type:   array


[ Top ]

$id =  "DP_form"

[line 184]

The id of this form.



Tags:

access:  public

Type:   string
Overrides:   Array


[ Top ]

$js_err_msg =

[line 219]

The error that should be alert if some information is missing.



Tags:

access:  public

Type:   string


[ Top ]

$layout_table =

[line 299]



Tags:

access:  private

Type:   HTMLTable


[ Top ]

$method =  "POST"

[line 212]

The method in which kind the data should be send.



Tags:

access:  private

Type:   string


[ Top ]

$multipart =  false

[line 311]



Tags:

access:  private

Type:   boolean


[ Top ]

$name =  "DP_form"

[line 177]

The name of this form.



Tags:

access:  public

Type:   string
Overrides:   Array


[ Top ]

$no_format =  false

[line 293]

References to the hidden form's items.



Tags:

access:  private

Type:   boolean
Overrides:   Array


[ Top ]

$onSubmitOrder =

[line 205]

The javascript that should be execute before submitting the form.



Tags:

access:  public

Type:   string


[ Top ]

$requiredItemOutputs =

[line 277]

Carries the error output for each required item.


Type:   array


[ Top ]

$requiredItems =

[line 271]

References to the form's items that are required for a complete set of information.



Tags:

access:  private

Type:   array


[ Top ]

$str_layout =

[line 305]



Tags:

access:  public

Type:   strint


[ Top ]

$targetFile =

[line 191]

The data target of this form.



Tags:

access:  public

Type:   string


[ Top ]

$targetFrame =

[line 198]

The target frame in a frameset for example.



Tags:

access:  public

Type:   string


[ Top ]

$textBeforeItems =

[line 241]

The text content before all items.



Tags:

access:  private

Type:   string


[ Top ]

$textBehindItems =

[line 248]

The text content behind all items.



Tags:

access:  private

Type:   string


[ Top ]



Class Methods


static method getRightRequestData [line 554]

static array getRightRequestData( string $request_input)

Returns raw data from a given request variable; Removes escapings if magic quotes is enabled.



Tags:

author:  Daniel Plücken <daniel@debakel.net>
version:  1.0
since:  0.5.17
access:  public


Parameters:

string   $request_input   The data to be correct.

[ Top ]

static method isFormItem [line 495]

static void isFormItem( object &$ref, [string $no_debug = false])

Adds references of form-items to this object.



Tags:

author:  Daniel Plücken <daniel@debakel.net>
version:  1.33
since:  0.4.0
access:  public


Parameters:

object   &$ref  
string   $no_debug  

[ Top ]

constructor HTMLForm [line 327]

void HTMLForm( [string $name = "DP_form"], [string $onSubmitOrder = ""], [string $targetFile = ""], [string $method = "POST"])

Constructor



Tags:

author:  Daniel Plücken <daniel@debakel.net>
version:  1.3
since:  0.1.0
access:  public


Parameters:

string   $name  
string   $onSubmitOrder  
string   $targetFile  
string   $method  

[ Top ]

method addDummyItem [line 1203]

void addDummyItem( string|object $name)

Adds dummy-form-item to this object. It doesn't apear on the website.

It is only to inform the form about a custum generatet input field, for example to add the FCKeditor to the form.




Tags:

author:  Daniel Plücken <daniel@debakel.net>
version:  1.0
since:  0.4.1
access:  public


Parameters:

string|object    $name  

[ Top ]

method addFormBodyText [line 1079]

void addFormBodyText( string $text, [string $where = "BEFOREITEMS"])

Adds text into the form.



Tags:

author:  Daniel Plücken <daniel@debakel.net>
version:  1.1
since:  0.2.4
access:  public


Parameters:

string   $text  
string   $where   Possible values are:
  • BEFOREITEMS
  • BEHINDITEMS

[ Top ]

method addFormItem [line 1100]

mixed &addFormItem( &$item, [string $requireJSOutput = ""], object $item)

Adds references of form-items to this object.



Tags:

return:  The reference to the added form item.
author:  Daniel Plücken <daniel@debakel.net>
version:  1.23
since:  0.1.0
access:  public


Parameters:

object   $item  
string   $requireJSOutput  
   &$item  

[ Top ]

method addHiddenFormItem [line 1155]

void addHiddenFormItem( string|object $name, [string $value = ""])

Adds hidden-form-items to this object.



Tags:

author:  Daniel Plücken <daniel@debakel.net>
version:  1.4
since:  0.1.0
access:  public


Parameters:

string|object    $name  
string   $value  

[ Top ]

method changeHiddenFormItem [line 1240]

void changeHiddenFormItem( $name, $value)

Changes the value of the hidden form item with the given namen.



Tags:

author:  Daniel Plücken <daniel@debakel.net
version:  1.0
since:  0.1.2
access:  public


Parameters:

   $name  
   $value  

[ Top ]

method disable [line 1279]

void disable( )

Disables all formitems. This function is an alias for the function disableAllFormItems()



Tags:

author:  Daniel Plücken <daniel@debakel.net>
version:  1.0
since:  0.4.9
access:  public


[ Top ]

method disableAllFormItems [line 1261]

void disableAllFormItems( )

Disables all formitems.



Tags:

author:  Daniel Plücken <daniel@debakel.net>
version:  1.0
since:  0.4.9
access:  public


[ Top ]

method get [line 1466]

string get( [HTMLTable $obj_ref = ""], [boolean $php_code = false])

Returns a generated string based on the Attributes of this HTML-Object.



Tags:

author:  Daniel Plücken <daniel@debakel.net>
version:  1.1
since:  0.1.0
access:  public


Overridden in child classes as:

ContactForm::get()
Returns a generated string based on the Attributes of this HTML-Object.

Parameters:

HTMLTable   $obj_ref   A reference of a table by dint of the form should be formatted. The form items will be placed in the table where the string "[item]" appears.
boolean   $php_code   Is this parameter true, the form will be returned as the source-php-code of this object.

[ Top ]

method getFieldsAndValues [line 577]

array getFieldsAndValues( [array $matching_field_arr = ""])

Returns the fieldnames and values of the form by a two dimensional array.



Tags:

author:  Daniel Plücken <daniel@debakel.net>
version:  1.77
since:  0.4.2
access:  public


Overridden in child classes as:

DBTfillingForm::getFieldsAndValues()
Returns the fieldnames and values of the form by a two dimensional array.

Parameters:

array   $matching_field_arr   Only fields who are in this array will be returned. If this parameter isn't set, all fields and their values will be returned.

[ Top ]

method getFormInTag [line 424]

string getFormInTag( )

Builds the tag to introduce the html form.



Tags:

author:  Daniel Plücken <daniel@debakel.net>
version:  1.3
since:  0.1.0
access:  private


[ Top ]

method getFormItemCount [line 1308]

integer getFormItemCount( )

Returns the count of items of this form.



Tags:

author:  Daniel Plücken <daniel@debakel.net>
version:  1.0
since:  0.1.9
access:  public


[ Top ]

method getItemPHPSource [line 1376]

string getItemPHPSource( )

Generates the sourcecode to build this object and returns it.



Tags:

author:  Daniel Plücken <daniel@debakel.net>
version:  1.0
since:  0.2.0
access:  public


[ Top ]

method getJScheckData [line 1322]

string getJScheckData( )

Returns a javascript to validate the input of the form.



Tags:

author:  Daniel Plücken <daniel@debakel.net>
version:  1.0
since:  0.1.7
access:  public


[ Top ]

method getMethod [line 410]

string getMethod( )

Returns the method-attribute of this form.



Tags:

author:  Daniel Plücken <daniel@debakel.net>
version:  1.0
since:  0.1.1
access:  public


[ Top ]

method getName [line 367]

string getName( )

Returns the name of this form.



Tags:

author:  Daniel Plücken <daniel@debakel.net>
version:  1.0
since:  0.1.1
access:  public


Overrides ABSTHTMLTag::getName() (Returns the value of this tag's "name"-attribute.)

[ Top ]

method getPHPSource [line 1416]

string getPHPSource( )

Generates the sourcecode to build this object and returns it.



Tags:

author:  Daniel Plücken <daniel@debakel.net>
version:  1.1
since:  0.1.8
access:  public


Overridden in child classes as:

ContactForm::getPHPSource()
Generates the sourcecode to build this object and returns it.
DBTfillingForm::getPHPSource()
Generates the sourcecode to build this object and returns it.

[ Top ]

method getSubmitOrder [line 381]

string getSubmitOrder( )

Returns the javascript that should execute on form submit.



Tags:

author:  Daniel Plücken <daniel@debakel.net>
version:  1.0
since:  0.1.1
access:  public


[ Top ]

method getTargetFile [line 396]

string getTargetFile( )

Returns the action-attribute of this form.



Tags:

author:  Daniel Plücken <daniel@debakel.net>
version:  1.0
since:  0.1.1
access:  public


[ Top ]

method overrideWholeFormBody [line 1046]

void overrideWholeFormBody( $string, boolean $bool)

Overides the body of the form with the given custom string.



Tags:

author:  Daniel Plücken <daniel@debakel.net>
version:  1.0
since:  0.1.5
access:  public


Parameters:

boolean   $bool  
   $string  

[ Top ]

method removeHiddenFormItem [line 1218]

void removeHiddenFormItem( string $name)

Removes the hidden item with the given name.



Tags:

author:  Daniel Plücken <daniel@debakel.net>
version:  1.0
since:  0.3.9
access:  public


Parameters:

string   $name  

[ Top ]

method setDisabled [line 1294]

void setDisabled( )

Disables all formitems. This function is an alias for the function disableAllFormItems()



Tags:

author:  Daniel Plücken <daniel@debakel.net>
version:  1.0
since:  0.4.9
access:  public


[ Top ]

method setFormBody [line 819]

void setFormBody( [HTMLTable $obj_ref = ""], [boolean $php_code = false])

Builds the content of this Form andstores it in the attribute form_body.



Tags:

author:  Daniel Plücken <daniel@debakel.net>
version:  1.21
since:  0.1.0
access:  public


Parameters:

HTMLTable   $obj_ref   A reference of a table by dint of the form should be formatted. The form items will be placed in the table where the string "[item]" appears.
boolean   $php_code   Is this parameter true, the form items will be stored as the source-php-code of this object.

[ Top ]

method setJSerrorMessage [line 1031]

void setJSerrorMessage( $string $string)

Sets the javascript error message that appears if user information is missing.



Tags:

author:  Daniel Plücken <daniel@debakel.net>
version:  1.0
since:  0.1.1
access:  public


Parameters:

$string   $string  

[ Top ]

method setLayoutString [line 478]

void setLayoutString( $string, string|object $name, string $value)

Adds the string by dint of the form should be formatted.



Tags:

author:  Daniel Plücken <daniel@debakel.net>
version:  1.01
since:  0.4.7
access:  public


Parameters:

string|object    $name  
string   $value  
   $string  

[ Top ]

method setLayoutTable [line 462]

void setLayoutTable( &$ref, string|object $name, string $value)

Adds the table by dint of the form should be formatted.



Tags:

author:  Daniel Plücken <daniel@debakel.net>
version:  1.0
since:  0.2.0
access:  public


Parameters:

string|object    $name  
string   $value  
   &$ref  

[ Top ]

method setMethod [line 1015]

void setMethod( $string)

Sets the method, how the data should be send; POST or GET.



Tags:

author:  Daniel Plücken <daniel@debakel.net>
version:  1.0
since:  0.1.0
access:  public


Parameters:

   $string  

[ Top ]

method setName [line 958]

void setName( $string)

Sets the name of this form.



Tags:

author:  Daniel Plücken <daniel@debakel.net>
version:  1.0
since:  0.1.0
access:  public


Overrides ABSTHTMLTag::setName() (Stores the value of this tag's "name"-attribute.)

Parameters:

   $string  

[ Top ]

method setNoFormat [line 1061]

void setNoFormat( [boolean $bool = true])

Stores that the HTML-elements should not format by "\r\n" in the source.



Tags:

author:  Daniel Plücken <daniel@debakel.net>
version:  1.0
since:  0.1.2
access:  public


Overrides ABSTHTMLTag::setNoFormat() (Stores that the HTML-elements should not format by "\r\n" in the source.)

Parameters:

boolean   $bool  

[ Top ]

method setSubmitOrder [line 972]

void setSubmitOrder( $string)

Sets the javascript that should execute on submit.



Tags:

author:  Daniel Plücken <daniel@debakel.net>
version:  1.0
since:  0.1.0
access:  public


Parameters:

   $string  

[ Top ]

method setTargetFile [line 986]

void setTargetFile( $string)

Sets the target script of the data; The "action"-attribute.



Tags:

author:  Daniel Plücken <daniel@debakel.net>
version:  1.0
since:  0.1.0
access:  public


Parameters:

   $string  

[ Top ]

method setTargetFrame [line 1001]

void setTargetFrame( $string)

Sets the target frame where the target script should appear; The "target"-attribute.



Tags:

author:  Daniel Plücken <daniel@debakel.net>
version:  1.0
since:  0.1.0
access:  public


Parameters:

   $string  

[ Top ]


Documentation generated on Thu, 05 Jun 2008 19:12:21 +0200 by phpDocumentor 1.4.1