Elgg  Version 1.9
edit.php
Go to the documentation of this file.
1 <?php
6 // Only logged in users
8 
9 elgg_push_context('settings');
10 elgg_push_context('profile_edit');
11 
12 $title = elgg_echo('avatar:edit');
13 
15 if (!elgg_instanceof($entity, 'user') || !$entity->canEdit()) {
16  register_error(elgg_echo('avatar:noaccess'));
18 }
19 
20 $content = elgg_view('core/avatar/upload', array('entity' => $entity));
21 
22 // only offer the crop view if an avatar has been uploaded
23 if (isset($entity->icontime)) {
24  $content .= elgg_view('core/avatar/crop', array('entity' => $entity));
25 }
26 
27 $params = array(
28  'content' => $content,
29  'title' => $title,
30 );
31 $body = elgg_view_layout('one_sidebar', $params);
32 
register_error($error)
Display an error on next page load.
Definition: elgglib.php:605
const REFERER
Definition: elgglib.php:2162
forward($location="", $reason='system')
Forward to $location.
Definition: elgglib.php:79
elgg_echo($message_key, $args=array(), $language="")
Given a message key, returns an appropriately translated full-text string.
Definition: languages.php:21
elgg_instanceof($entity, $type=null, $subtype=null, $class=null)
Checks if $entity is an ElggEntity and optionally for type and subtype.
Definition: entities.php:1886
elgg_gatekeeper()
Used at the top of a page to mark it as logged in users only.
Definition: pagehandler.php:58
elgg_get_page_owner_entity()
Gets the owner entity for the current page.
Definition: pageowner.php:53
elgg_push_context($context)
Push a context onto the top of the stack.
Definition: pageowner.php:243
$body
Definition: edit.php:31
if(isset($entity->icontime)) $params
Definition: edit.php:27
$entity
Definition: edit.php:14
$title
Definition: edit.php:12
if(!elgg_instanceof($entity, 'user')||! $entity->canEdit()) $content
Definition: edit.php:20
elgg_view_layout($layout_name, $vars=array())
Displays a layout with optional parameters.
Definition: views.php:617
elgg_view_page($title, $body, $page_shell='default', $vars=array())
Assembles and outputs a full page.
Definition: views.php:437
elgg_view($view, $vars=array(), $bypass=false, $ignored=false, $viewtype='')
Return a parsed view.
Definition: views.php:354