Elgg  Version 2.3
edit.php
Go to the documentation of this file.
1 <?php
7 
9 if (!$user) {
10  register_error(elgg_echo("profile:notfound"));
11  forward();
12 }
13 
14 // check if logged in user can edit this profile
15 if (!$user->canEdit()) {
16  register_error(elgg_echo("profile:noaccess"));
17  forward();
18 }
19 
20 elgg_push_context('settings');
21 elgg_push_context('profile_edit');
22 
23 $title = elgg_echo('profile:edit');
24 
25 $content = elgg_view_form('profile/edit', array(), array('entity' => $user));
26 
27 $params = array(
28  'content' => $content,
29  'title' => $title,
30 );
31 $body = elgg_view_layout('one_sidebar', $params);
32 
elgg_echo($message_key, $args=array(), $language="")
Given a message key, returns an appropriately translated full-text string.
Definition: languages.php:21
elgg_view_form($action, $form_vars=array(), $body_vars=array())
Definition: views.php:1345
elgg_view_layout($layout_name, $vars=array())
Displays a layout with optional parameters.
Definition: views.php:689
elgg forward
Meant to mimic the php forward() function by simply redirecting the user to another page...
Definition: elgglib.js:425
if(!elgg_instanceof($entity, 'user')||!$entity->canEdit()) $content
Definition: edit.php:20
elgg_gatekeeper()
Used at the top of a page to mark it as logged in users only.
Definition: pagehandler.php:58
elgg echo
Translates a string.
Definition: languages.js:48
elgg_get_page_owner_entity()
Gets the owner entity for the current page.
Definition: pageowner.php:56
$body
Definition: edit.php:31
$title
Definition: edit.php:12
elgg_push_context($context)
Push a context onto the top of the stack.
Definition: pageowner.php:215
elgg register_error
Wrapper function for system_messages.
Definition: elgglib.js:399
$user
Definition: edit.php:8
if($entity->hasIcon('master')) $params
Definition: edit.php:27
elgg_view_page($title, $body, $page_shell= 'default', $vars=array())
Assembles and outputs a full page.
Definition: views.php:447