|
Moodle
2.2.1
http://www.collinsharper.com
|


Public Member Functions | |
| __construct ($options) | |
| getImageMin () | |
| getImageMax () | |
| getImageWidth () | |
| getImageHeight () | |
| setImageMin ($options) | |
| setImageMax ($options) | |
| setImageWidth ($options) | |
| setImageHeight ($options) | |
| isValid ($value, $file=null) | |
Data Fields | |
| const | WIDTH_TOO_BIG = 'fileImageSizeWidthTooBig' |
| const | WIDTH_TOO_SMALL = 'fileImageSizeWidthTooSmall' |
| const | HEIGHT_TOO_BIG = 'fileImageSizeHeightTooBig' |
| const | HEIGHT_TOO_SMALL = 'fileImageSizeHeightTooSmall' |
| const | NOT_DETECTED = 'fileImageSizeNotDetected' |
| const | NOT_READABLE = 'fileImageSizeNotReadable' |
Protected Member Functions | |
| _throw ($file, $errorType) | |
Protected Attributes | |
| $_messageTemplates | |
| $_messageVariables | |
| $_minwidth | |
| $_maxwidth | |
| $_minheight | |
| $_maxheight | |
| $_width | |
| $_height | |
Definition at line 35 of file ImageSize.php.
| __construct | ( | $ | options | ) |
Sets validator options
Accepts the following option keys:
| Zend_Config | array | $options |
Definition at line 125 of file ImageSize.php.

| _throw | ( | $ | file, |
| $ | errorType | ||
| ) | [protected] |
Throws an error of the given type
| string | $file | |
| string | $errorType |
Definition at line 355 of file ImageSize.php.


| getImageHeight | ( | ) |
| getImageMax | ( | ) |
| getImageMin | ( | ) |
| getImageWidth | ( | ) |
| isValid | ( | $ | value, |
| $ | file = null |
||
| ) |
Defined by Zend_Validate_Interface
Returns true if and only if the imagesize of $value is at least min and not bigger than max
| string | $value | Real file to check for image size |
| array | $file | File data from Zend_File_Transfer |
Definition at line 308 of file ImageSize.php.

| setImageHeight | ( | $ | options | ) |
Sets the mimimum and maximum image height
| array | $options | The image height dimensions |
Definition at line 290 of file ImageSize.php.

| setImageMax | ( | $ | options | ) |
Sets the maximum image size
| array | $options | The maximum image dimensions |
| Zend_Validate_Exception | When maxwidth is smaller than minwidth |
| Zend_Validate_Exception | When maxheight is smaller than minheight |
Definition at line 241 of file ImageSize.php.

| setImageMin | ( | $ | options | ) |
Sets the minimum image size
| array | $options | The minimum image dimensions |
| Zend_Validate_Exception | When minwidth is greater than maxwidth |
| Zend_Validate_Exception | When minheight is greater than maxheight |
Definition at line 204 of file ImageSize.php.

| setImageWidth | ( | $ | options | ) |
Sets the mimimum and maximum image width
| array | $options | The image width dimensions |
Definition at line 276 of file ImageSize.php.

$_height [protected] |
Definition at line 111 of file ImageSize.php.
$_maxheight [protected] |
Definition at line 97 of file ImageSize.php.
$_maxwidth [protected] |
Definition at line 83 of file ImageSize.php.
$_messageTemplates [protected] |
array( self::WIDTH_TOO_BIG => "Maximum allowed width for image '%value%' should be '%maxwidth%' but '%width%' detected", self::WIDTH_TOO_SMALL => "Minimum expected width for image '%value%' should be '%minwidth%' but '%width%' detected", self::HEIGHT_TOO_BIG => "Maximum allowed height for image '%value%' should be '%maxheight%' but '%height%' detected", self::HEIGHT_TOO_SMALL => "Minimum expected height for image '%value%' should be '%minheight%' but '%height%' detected", self::NOT_DETECTED => "The size of image '%value%' could not be detected", self::NOT_READABLE => "File '%value%' can not be read", )
Reimplemented from Zend_Validate_Abstract.
Definition at line 50 of file ImageSize.php.
$_messageVariables [protected] |
array( 'minwidth' => '_minwidth', 'maxwidth' => '_maxwidth', 'minheight' => '_minheight', 'maxheight' => '_maxheight', 'width' => '_width', 'height' => '_height' )
Reimplemented from Zend_Validate_Abstract.
Definition at line 62 of file ImageSize.php.
$_minheight [protected] |
Definition at line 90 of file ImageSize.php.
$_minwidth [protected] |
Definition at line 76 of file ImageSize.php.
$_width [protected] |
Definition at line 104 of file ImageSize.php.
| const HEIGHT_TOO_BIG = 'fileImageSizeHeightTooBig' |
Definition at line 42 of file ImageSize.php.
| const HEIGHT_TOO_SMALL = 'fileImageSizeHeightTooSmall' |
Definition at line 43 of file ImageSize.php.
| const NOT_DETECTED = 'fileImageSizeNotDetected' |
Definition at line 44 of file ImageSize.php.
| const NOT_READABLE = 'fileImageSizeNotReadable' |
Definition at line 45 of file ImageSize.php.
| const WIDTH_TOO_BIG = 'fileImageSizeWidthTooBig' |
string Error constants
Definition at line 40 of file ImageSize.php.
| const WIDTH_TOO_SMALL = 'fileImageSizeWidthTooSmall' |
Definition at line 41 of file ImageSize.php.