Class Form

Description

TPLN Form Plugin

Located in /plugin/form/form.class.php (line 6)

Image
   |
   --Rss
      |
      --Mail
         |
         --Form
Direct descendents
Class Description
 class Db TPLN Database Plugin
Variable Summary
Method Summary
 void addError ([string $obj = ''], [string $message = ''])
 void alpha (string $obj, [string $except = ''])
 void alphaNumeric (string $obj, [string $except = ''])
 void charLength ([string $obj = ''], int $length)
 void date (string $obj, string $format)
 boolean delCaptcha ()
 void email ([string $obj = ''])
 void equal ([string $obj = ''], string $value)
 boolean errorCustom ()
 void fileControl (string $obj, [boolean $required = ''], [string $size = ''], [string $mimes = ''], [string $ext = ''])
 void formInit (array $arr)
 void formIsValid ()
 void formParse (string $elements, string $source)
 void formSetDisplayMode (string $mode)
 void formSetLang (string $lang)
 void formSetName (string $formName)
 void formSetObjectNames ([array $objects_name = array()])
 void formXEntities (array $arr, [bool $x_html_entities = true], [bool $x_protect_vars = true])
 void generateCaptcha ()
 string getCaptcha ()
 string getMessage (int $index, [array $parameters = array()])
 void imgControlHeight ([string $obj = ''], string $operator, int $width)
 void imgControlWidth ([string $obj = ''], string $operator, int $width)
 void imgStrictDimension ([string $obj = ''], [int $w = ''], [int $h = ''])
 void inList ([string $obj = ''], array $value)
 boolean isDate (string $obj, string $format)
 void isEqual ([string $obj = ''], string $value)
 void isInList ([string $obj = ''], array $arr_value, [boolean $case_sensitive = false])
 void maxLength ([string $obj = ''], int $length)
 void minLength ([string $obj = ''], int $length)
 void notEmpty ([string $obj = ''], [string $msg = ''])
 void onlyDigit ([string $obj = ''], [boolean $float_accepted = 0])
 void onlyLetter ([string $obj = ''])
 void regexControl (string $pattern, [string $obj = ''], string $mess)
 boolean rules (string $obj)
 void setCaptchaMax (int $nb)
 void setMessage (string $msg)
 void url (string $obj, [string $format = 'http://|https://|ftp://'])
Variables
mixed $captcha = 0 (line 19)
  • access: protected
mixed $captcha_max = 3 (line 1942)
mixed $custom_msg = '' (line 13)
  • access: protected
mixed $error_display_mode = 'I' (line 18)
  • access: protected
string $formErrorColor = "#FF4444" (line 24)
  • var: Form error color
  • access: public
mixed $formErrorLang = TPLN_LANG (line 14)
  • access: protected
string $formInputHtmlEntitiesCharset = TPLN_OUTPUT_CHARSET (line 1749)

Default charset for input protection

  • access: public
array $formInputProtectionException = array() (line 1743)

No protection for these values

  • access: public
mixed $formName = '' (line 15)
  • access: protected
bool $formXEntitiesPostDone = false (line 128)

Verify if treatment protection has be done

  • access: private
mixed $init = 0 (line 16)
  • access: protected
mixed $last_obj = '' (line 10)
  • access: protected
mixed $msg_err = array() (line 9)
  • access: protected
mixed $new_objects_name = array() (line 8)
  • access: protected
mixed $objError = array() (line 11)
  • access: protected
mixed $objErrorMsg = array() (line 12)
  • access: protected
mixed $row_val = array() (line 17)
  • access: protected

Inherited Variables

Inherited from Mail

Mail::$bcc
Mail::$body
Mail::$cc
Mail::$charset
Mail::$confirm
Mail::$files
Mail::$format
Mail::$from
Mail::$fromLabel
Mail::$mailErr
Mail::$replyTo
Mail::$subject
Mail::$to
Mail::$urgent

Inherited from Image

Image::$new_name
Image::$obj
Image::$path
Methods
addError (line 913)

method allows you to turn an object as error.

  • author: H2LSOFT
  • access: public
void addError ([string $obj = ''], [string $message = ''])
  • string $obj
  • string $message
alpha (line 618)

This method allows to control if object countains only alphabetic caracters

  • author: H2LSOFT
  • access: public
void alpha (string $obj, [string $except = ''])
  • string $obj
  • string $except
alphaNumeric (line 650)

This method allows to control if object countains only alphanumeric characters

  • author: H2LSOFT
  • access: public
void alphaNumeric (string $obj, [string $except = ''])
  • string $obj
  • string $except
autoVerifyCaptcha (line 2003)

this method verifies automatically captcha

  • author: H2LSOFT
  • access: protected
void autoVerifyCaptcha ()
charLength (line 512)

this method allows to check that the value is N length.

  • author: H2LSOFT
  • access: public
void charLength ([string $obj = ''], int $length)
  • string $obj
  • int $length
date (line 685)

this method allows to verify a html form object is well filled. Format parameter must be a string composed by :

d -> day m -> month y -> year 2 digits Y -> year 4 digits H -> hour i -> minutes s -> seconds

  • author: H2LSOFT
  • access: public
void date (string $obj, string $format)
  • string $obj
  • string $format
delCaptcha (line 1924)

delete captcha

  • author: H2LSOFT
  • access: protected
boolean delCaptcha ()
email (line 482)

this method allows to check if the value given to the object is an email.

  • author: H2LSOFT
  • access: public
void email ([string $obj = ''])
  • string $obj
equal (line 329)

This method allows you to verify $_POST value is equal

  • author: H2LSOFT
  • access: public
void equal ([string $obj = ''], string $value)
  • string $obj
  • string $value
errorCustom (line 101)

this method tests if there is personalized message error customize error message

  • author: H2LSOFT
  • access: protected
boolean errorCustom ()
fileControl (line 770)

method allows you to control the presence, the size and/or the extention of a file when it will be upload.

Now, you can specify the size by adding Ko or Mo

  • author: H2LSOFT
  • access: public
void fileControl (string $obj, [boolean $required = ''], [string $size = ''], [string $mimes = ''], [string $ext = ''])
  • string $obj
  • boolean $required
  • string $size
  • string $mimes
  • string $ext
formGetTotalError (line 1733)

This method allows to get total errors, it must be palced before the method formIsValid()

  • author: H2LSOFT
  • access: public
int formGetTotalError ()
formGetUserObjectName (line 66)

get the new name of the object

  • access: protected
string formGetUserObjectName ()
formInit (line 192)

This method initializes data of HTML form by convertion of php parameter.

It is usefull for editing a record of a table.

  • author: H2LSOFT
  • access: public
void formInit (array $arr)
  • array $arr
formIsValid (line 1797)

method allows to post the all prospective errors. The parameter is a boolean which allows to generate javascript.

The javascript will allow to keep the data in the form during a post.

  • author: H2LSOFT
  • access: public
void formIsValid ()
formParse (line 1284)

treatment of the formulaire directly in PHP

  • author: H2LSOFT
  • access: public
void formParse (string $elements, string $source)
  • string $elements
  • string $source
formSetDisplayMode (line 80)

This method allows you to chose the place of form error messages T:

display messages on top (bloc form_error obliged) I (by default): display messages below html widget

  • author: H2LSOFT
  • access: public
void formSetDisplayMode (string $mode)
  • string $mode
formSetLang (line 902)

this method allows to modify the language in which the error messages will be posted.

  • author: H2LSOFT
  • access: public
void formSetLang (string $lang)
  • string $lang
formSetName (line 90)

This method allows you to modify form name.

  • author: H2LSOFT
  • access: public
void formSetName (string $formName)
  • string $formName
formSetObjectNames (line 56)

rewrite a new name object

  • access: public
void formSetObjectNames ([array $objects_name = array()])
  • array $objects_name
formXEntities (line 1760)

protect data agains user attacks

  • access: public
void formXEntities (array $arr, [bool $x_html_entities = true], [bool $x_protect_vars = true])
  • array $arr
  • bool $x_html_entities
  • bool $x_protect_vars
generateCaptcha (line 1958)

generate captcha

  • author: H2LSOFT
  • access: public
void generateCaptcha ()
getCaptcha (line 1904)

This method allows to add a captcha verification useful to fight against spam attacks

  • author: H2LSOFT
  • access: public
string getCaptcha ()
getMessage (line 33)

Return formatted message

  • access: public
string getMessage (int $index, [array $parameters = array()])
  • int $index
  • array $parameters
imgControlHeight (line 1191)

This method allows you to control the height of uploaded image.

The list of supported operator is : - '<' - '<=' - '=' - '>' - '>='

  • author: H2LSOFT
  • access: public
void imgControlHeight ([string $obj = ''], string $operator, int $width)
  • string $obj
  • string $operator
  • int $width
imgControlWidth (line 1091)

This method allows to control the width of uploaded image.

The list of supported operator is : - '<' - '<=' - '=' - '>' - '>='

  • author: H2LSOFT
  • access: public
void imgControlWidth ([string $obj = ''], string $operator, int $width)
  • string $obj
  • string $operator
  • int $width
imgStrictDimension (line 953)

method allows you to control the picture width and height uploaded.

The object name can be forgotten if it has been used in a other method previously.

  • author: H2LSOFT
  • access: public
void imgStrictDimension ([string $obj = ''], [int $w = ''], [int $h = ''])
  • string $obj
  • int $w
  • int $h
inList (line 373)

This method allows to verify $_POST value is in the list

  • author: H2LSOFT
  • access: public
void inList ([string $obj = ''], array $value)
  • string $obj
  • array $value
isDate (line 702)

This method allows to verify a html form object is well filled. Format parameter must be a string composed by :

d -> day m -> month y -> year 2 digits Y -> year 4 digits H -> hour i -> minutes

  • author: H2LSOFT
  • see: Form::date()
  • deprecated:
  • access: public
boolean isDate (string $obj, string $format)
  • string $obj
  • string $format
isEqual (line 344)

This method allows you to verify $_POST value is equal

  • author: H2LSOFT
  • deprecated:
  • access: public
void isEqual ([string $obj = ''], string $value)
  • string $obj
  • string $value
isInList (line 388)

This method allows to verify $_POST value is in the list

  • author: H2LSOFT
  • deprecated:
  • access: public
void isInList ([string $obj = ''], array $arr_value, [boolean $case_sensitive = false])
  • string $obj
  • array $arr_value
  • boolean $case_sensitive
maxLength (line 568)

this method allows you to check that the object does not exceed the N lenght.

  • author: H2LSOFT
  • access: public
void maxLength ([string $obj = ''], int $length)
  • string $obj
  • int $length
minLength (line 540)

method allows you to put lenght minimum for a chain of character.

  • author: H2LSOFT
  • access: public
void minLength ([string $obj = ''], int $length)
  • string $obj
  • int $length
notEmpty (line 223)

this method allows you to ckeck if the object isn't empty.

If that's the case then alarm error is started.

  • author: H2LSOFT
  • access: public
void notEmpty ([string $obj = ''], [string $msg = ''])
  • string $obj
  • string $msg
onlyDigit (line 288)

this method allows to ckeck that the value is a number,

if parameter floatnumber is true, Digit will accept a float number.

  • author: H2LSOFT
  • access: public
void onlyDigit ([string $obj = ''], [boolean $float_accepted = 0])
  • string $obj
  • boolean $float_accepted
onlyLetter (line 454)

this method allows to check if the value contained is only letters characters.

  • author: H2LSOFT
  • access: public
void onlyLetter ([string $obj = ''])
  • string $obj
regexControl (line 599)

method allows to check if the object datas converted as parameters correspond to the pattern converted as parameter.

The last argument(facultative) corresponds to the message in the event of error.

  • author: H2LSOFT
  • access: public
void regexControl (string $pattern, [string $obj = ''], string $mess)
  • string $pattern
  • string $obj
  • string $mess
rules (line 137)

this method

  • author: H2LSOFT
  • access: public
boolean rules (string $obj)
  • string $obj
setCaptchaMax (line 1949)

This method allows to define a number of error for the user, by default 0: illimited

  • author: H2LSOFT
  • access: public
void setCaptchaMax (int $nb)
  • int $nb
setMessage (line 205)

this method allows you to record an error message

which will be posted with the next error.

  • author: H2LSOFT
  • access: public
void setMessage (string $msg)
  • string $msg
url (line 738)

This method allows to control the value of your form is a correct url.

  • author: H2LSOFT
  • access: public
void url (string $obj, [string $format = 'http://|https://|ftp://'])
  • string $obj
  • string $format

Inherited Methods

Inherited From Mail

 Mail::isMail()
 Mail::mailAttachFile()
 Mail::mailBCC()
 Mail::mailBody()
 Mail::mailCC()
 Mail::mailCharset()
 Mail::mailConfirm()
 Mail::mailError()
 Mail::mailFrom()
 Mail::mailReplyTo()
 Mail::mailSend()
 Mail::mailSubject()
 Mail::mailTo()
 Mail::mailUrgent()

Inherited From Rss

 Rss::rssWrite()

Inherited From Image

 Image::fileUpload()
 Image::imgThumbnail()
 Image::imgThumbnailSetOriginal()

Documentation generated on Sat, 06 Mar 2010 21:33:57 +0100 by phpDocumentor 1.4.3