Elgg  Version 2.3
view.php
Go to the documentation of this file.
1 <?php
2 
8 elgg_deprecated_notice("/avatar/view resource view has been deprecated and will be removed. Use elgg_get_inline_url() instead.", '2.2');
9 
10 // page owner library sets this based on URL
12 
13 // Get the size
14 $size = strtolower(elgg_extract('size', $vars));
15 if (!in_array($size, array('master', 'large', 'medium', 'small', 'tiny', 'topbar'))) {
16  $size = 'medium';
17 }
18 
19 $avatar_url = false;
20 
21 if ($user) {
22  $filehandler = new ElggFile();
23  $filehandler->owner_guid = $user->guid;
24  $filehandler->setFilename("profile/{$user->guid}{$size}.jpg");
25  $avatar_url = elgg_get_inline_url($filehandler);
26 }
27 
28 if (!$avatar_url) {
29  $avatar_url = elgg_get_simplecache_url("icons/user/default{$size}.gif");
30 }
31 
$size
Definition: view.php:14
if(!in_array($size, array('master', 'large', 'medium', 'small', 'tiny', 'topbar'))) $avatar_url
Definition: view.php:19
elgg_get_simplecache_url($view, $subview= '')
Get the URL for the cached view.
Definition: cache.php:136
elgg forward
Meant to mimic the php forward() function by simply redirecting the user to another page...
Definition: elgglib.js:425
$vars['entity']
elgg_get_inline_url(\ElggFile $file, $use_cookie=false, $expires= '')
Returns file&#39;s URL for inline display Suitable for displaying cacheable resources, such as user avatars.
Definition: filestore.php:502
$user
Definition: view.php:11
elgg_deprecated_notice($msg, $dep_version, $backtrace_level=1)
Log a notice about deprecated use of a function, view, etc.
Definition: elgglib.php:1098
elgg_get_page_owner_entity()
Gets the owner entity for the current page.
Definition: pageowner.php:56
elgg_extract($key, $array, $default=null, $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
Definition: elgglib.php:1375