Class TFormFileImage

Description

Image Upload Handler. Uses ImageMagick to convert variety of image formats to either PNG or JPG and can optionally rescale them.

The constant "IMAGEMAGICK_LOCATION" must be set to the location of the ImageMagick binaries (convert and identify)

  • version: 05-07-2003 16:19
  • author: Greg MacLellan

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

TFormElement
   |
   --TFormFile
      |
      --TFormFileImage
Variable Summary
mixed $extraData
mixed $geometry
mixed $imagetype
mixed $type
Method Summary
TFormFileImage TFormFileImage (string $name, string $displayname, string $class, bool $required, int $geometry, [string $extraFields = null], [bool $store = true])
True setValue (array $value, [mixed $user = false])
void validate ()
Variables
mixed $extraData (line 27)

Data for extra fields (size/type/etc)


Redefinition of:
TFormFile::$extraData
Data for extra fields (size/type/etc)
mixed $geometry (line 24)

ImageMagick geometry options

mixed $imagetype (line 22)

The image type

mixed $type = "file-image" (line 19)

The type of element


Redefinition of:
TFormFile::$type
The type of element

Inherited Variables

Inherited from TFormFile

TFormFile::$extraFields
TFormFile::$htmltype
TFormFile::$maxsize
TFormFile::$required

Inherited from TFormElement

TFormElement::$alwaysSet
TFormElement::$class
TFormElement::$displayname
TFormElement::$name
TFormElement::$parent
TFormElement::$store
TFormElement::$value
Methods
Constructor TFormFileImage (line 59)

Creates a new TFormFileImage element (image upload field.)

TFormFileImage TFormFileImage (string $name, string $displayname, string $class, bool $required, int $geometry, [string $extraFields = null], [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 $geometry: Geometry options for resizing. "500x500" will scale the image to fit in a 500x500 area, so it's longest dimenesion is 500 legnth or 500 width. Specifying "500x500!" will force the image to be resized to 500x500. Specifying only one dimension will scale the other to fit (ie "x500"). Specifying 500x500> will rescale only if the image is larger than the area, and < will resize only if the image is less than the specified size. See ImageMagick documentation for complete details and other options.
  • string $extraFields: An array containing extra fieldnames, if used. Keys can be "size", "type", "name", and "dimensions", for size (bytes), mime type, user's filename, and image dimensions ("320x180") respectively.
  • bool $store: Whether this value is persistent. Used by TDBForm to decide to save/load this value from database.
setValue (line 79)

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:
TFormFile::setValue()
Sets the value of the field to be the file data.
validate (line 65)
void validate ()

Redefinition of:
TFormFile::validate()

Inherited Methods

Inherited From TFormFile

TFormFile::TFormFile()
TFormFile::getValue()
TFormFile::output()
TFormFile::setValue()
TFormFile::validate()

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