Constructor & Destructor Documentation
__construct |
( |
|
$user_id, |
|
|
|
$username = NULL |
|
) |
| |
|
protected |
Constructs a new Avatar object belonging to a user with the given id.
- Parameters
-
string | the user's id |
string | the user's username (optional) |
- Returns
- void
Member Function Documentation
Creates thumbnails from an image.
- Parameters
-
string | filename of the image to create thumbnails from |
- Returns
- void
createFromUpload |
( |
|
$userfile | ) |
|
Creates all the different sized thumbnails for an uploaded file.
- Parameters
-
string | the key of the uploaded file, see documentation about $_FILES |
- Returns
- void
- Exceptions
-
several | Exceptions if the uploaded file does not satisfy the requirements |
static error_handler |
( |
|
$errno, |
|
|
|
$errstr, |
|
|
|
$errfile, |
|
|
|
$errline |
|
) |
| |
|
static |
static getAvatar |
( |
|
$user_id, |
|
|
|
$username = NULL |
|
) |
| |
|
static |
Returns an avatar object of the appropriate class.
- Parameters
-
string | the user's id |
string | the user's username (optional) |
- Returns
- mixed the user's avatar.
getAvatarDirectoryPath |
( |
| ) |
|
getAvatarDirectoryUrl |
( |
| ) |
|
Returns the CSS class to use for this avatar image.
- Parameters
-
string | one of the constants Avatar::(NORMAL|MEDIUM|SMALL) |
- Returns
- string CSS class to use for the avatar
Reimplemented in CourseAvatar.
getCustomAvatarPath |
( |
|
$size, |
|
|
|
$ext = 'png' |
|
) |
| |
getCustomAvatarUrl |
( |
|
$size, |
|
|
|
$ext = 'png' |
|
) |
| |
Return the dimension of a size
- Parameters
-
string | the dimension of a size |
- Returns
- array a tupel of integers [width, height]
Reimplemented in CourseAvatar.
getFilename |
( |
|
$size, |
|
|
|
$ext = 'png' |
|
) |
| |
Returns the file name of a user's avatar.
- Parameters
-
string | one of the constants Avatar::(NORMAL|MEDIUM|SMALL) |
string | an optional extension of the avatar |
- Returns
- string the absolute file path to the avatar
Constructs a desired HTML image tag for an Avatar. Additional html attributes may also be specified using the $opt parameter.
- Parameters
-
string | one of the constants Avatar::(NORMAL|MEDIUM|SMALL) |
array | array of attributes to add to the HTML image tag |
- Returns
- string returns the HTML image tag
getURL |
( |
|
$size, |
|
|
|
$ext = 'png' |
|
) |
| |
Returns the URL of a user's picture.
- Parameters
-
string | one of the constants Avatar::(NORMAL|MEDIUM|SMALL) |
string | an optional extension of the user's picture |
- Returns
- string the URL to the user's picture
Returns whether a user has uploaded a custom picture.
- Returns
- boolean returns TRUE if the user customized her picture, FALSE otherwise.
Removes all uploaded pictures of a user.
- Returns
- void
Field Documentation
const MAX_FILE_SIZE = 716800 |
This constant represents the maximal size of a user picture in bytes.
This constant stands for a medium size of a user picture.
This constant holds the username and ID of the "nobody" avatar.
This constant stands for the maximal size of a user picture.
This constant stands for an icon size of a user picture.
The documentation for this class was generated from the following file: