Class TFormFile

Description

Basic File Upload Handler

  • version: 03-08-2002 12:00
  • author: Greg MacLellan

Located in /form-file.inc.php (line 12)

TFormElement
   |
   --TFormFile
Direct descendents
Class Description
TFormFileImage Image Upload Handler. Uses ImageMagick to convert variety of image formats to either PNG or JPG and can optionally rescale them.
Variable Summary
mixed $extraData
mixed $extraFields
mixed $htmltype
mixed $maxsize
mixed $required
mixed $type
Method Summary
TFormFile TFormFile (string $name, string $displayname, string $class, bool $required, int $maxsize, [string $extraFields = array()], [bool $store = true])
An getValue ([$display $display = false])
void output ()
True setValue (array $value, [mixed $user = false])
void validate ()
Variables
mixed $extraData (line 25)

Data for extra fields (size/type/etc)


Redefined in descendants as:
mixed $extraFields (line 22)

Fieldnames of extra fields

mixed $htmltype = "file" (line 16)

The HTML element type


Redefinition of:
TFormElement::$htmltype
The HTML element type
mixed $maxsize (line 19)

The file size

mixed $required (line 20)
mixed $type = "file" (line 14)

The type of element


Redefinition of:
TFormElement::$type
The type of element

Redefined in descendants as:

Inherited Variables

Inherited from TFormElement

TFormElement::$alwaysSet
TFormElement::$class
TFormElement::$displayname
TFormElement::$name
TFormElement::$parent
TFormElement::$store
TFormElement::$value
Methods
Constructor TFormFile (line 49)

Creates a new TFormFile element (basic file-upload)

TFormFile TFormFile (string $name, string $displayname, string $class, bool $required, int $maxsize, [string $extraFields = array()], [bool $store = true])
  • string $name: The name of the element. This should correspond to the field names if using with TDBForm, and should not include any spaces or special characters.
  • string $displayname: The name that should show up to the user for this field.
  • string $class: The HTML Class to use for the element
  • bool $required: True if the field has to be filled in
  • int $maxsize: Maximum number of bytes. If 0, then the max is the maximum allowed by the webserver.
  • string $extraFields: An array containing extra fieldnames, if used. Keys can be "size", "type", and "name", for size (bytes), mime type, and user's filename, respectively.
  • bool $store: Whether this value is persistent. Used by TDBForm to decide to save/load this value from database.
getValue (line 127)

Returns a textual description of the current value

  • return: array containing any values for this file
An getValue ([$display $display = false])
  • $display $display: True if the value is going to be used for display

Redefinition of:
TFormElement::getValue()
Returns a textual description of the current value
output (line 143)
void output ()

Redefinition of:
TFormElement::output()
Outputs the HTML for this tag
setValue (line 71)

Sets the value of the field to be the file data.

  • return: if the value was set
True setValue (array $value, [mixed $user = false])
  • array $value: The value to set. Because this is a file type, this is an array containing "name","type","size","tmp_name", as documented in the php manual.

Redefinition of:
TFormElement::setValue()
Sets the value of the field

Redefined in descendants as:
validate (line 56)
void validate ()

Redefinition of:
TFormElement::validate()
Validates the data in this field.

Redefined in descendants as:

Inherited Methods

Inherited From TFormElement

TFormElement::TFormElement()
TFormElement::getValue()
TFormElement::output()
TFormElement::setParent()
TFormElement::setValue()
TFormElement::validate()

Documentation generated on Thu, 27 Nov 2003 14:58:55 -0500 by phpDocumentor 1.2.3