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


Public Member Functions | |
| __construct (stdClass $user) | |
| get_url (moodle_page $page, renderer_base $renderer=null) | |
Static Public Member Functions | |
| static | fields ($tableprefix= '', array $extrafields=NULL, $idalias= 'id', $fieldprefix= '') |
| static | unalias (stdClass $record, array $extrafields=null, $idalias='id', $fieldprefix='') |
Data Fields | |
| $user | |
| $courseid | |
| $link = true | |
| $size = 35 | |
| $alttext = true | |
| $popup = false | |
| $class = 'userpicture' | |
Static Protected Attributes | |
| static | $fields = array('id', 'picture', 'firstname', 'lastname', 'imagealt', 'email') |
Data structure representing a user picture.
Definition at line 103 of file outputcomponents.php.
| __construct | ( | stdClass $ | user | ) |
User picture constructor.
| object | $user | user record with at least id, picture, imagealt, firstname and lastname set. |
| array | $options | such as link, size, link, ... |
Definition at line 146 of file outputcomponents.php.

| static fields | ( | $ | tableprefix = '', |
| array $ | extrafields = NULL, |
||
| $ | idalias = 'id', |
||
| $ | fieldprefix = '' |
||
| ) | [static] |
Returns a list of required user fields, useful when fetching required user info from db.
In some cases we have to fetch the user data together with some other information, the idalias is useful there because the id would otherwise override the main id of the result record. Please note it has to be converted back to id before rendering.
| string | $tableprefix | name of database table prefix in query |
| array | $extrafields | extra fields to be included in result (do not include TEXT columns because it would break SELECT DISTINCT in MSSQL and ORACLE) |
| string | $idalias | alias of id field |
| string | $fieldprefix | prefix to add to all columns in their aliases, does not apply to 'id' |
Definition at line 184 of file outputcomponents.php.

| get_url | ( | moodle_page $ | page, |
| renderer_base $ | renderer = null |
||
| ) |
Works out the URL for the users picture.
This method is recommended as it avoids costly redirects of user pictures if requests are made for non-existent files etc.
| renderer_base | $renderer |
Definition at line 272 of file outputcomponents.php.


| static unalias | ( | stdClass $ | record, |
| array $ | extrafields = null, |
||
| $ | idalias = 'id', |
||
| $ | fieldprefix = '' |
||
| ) | [static] |
Extract the aliased user fields from a given record
Given a record that was previously obtained using self::fields() with aliases, this method extracts user related unaliased fields.
| stdClass | $record | containing user picture fields |
| array | $extrafields | extra fields included in the $record |
| string | $idalias | alias of the id field |
| string | $fieldprefix | prefix added to all columns in their aliases, does not apply to 'id' |
Definition at line 231 of file outputcomponents.php.

| $alttext = true |
Definition at line 130 of file outputcomponents.php.
| $class = 'userpicture' |
Definition at line 138 of file outputcomponents.php.
Definition at line 117 of file outputcomponents.php.
Definition at line 107 of file outputcomponents.php.
| $link = true |
Definition at line 121 of file outputcomponents.php.
| $popup = false |
Definition at line 134 of file outputcomponents.php.
| $size = 35 |
Definition at line 125 of file outputcomponents.php.
| $user |
Definition at line 112 of file outputcomponents.php.