edit.php 642 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. /**
  3. * Edit profile page
  4. */
  5. elgg_gatekeeper();
  6. $user = elgg_get_page_owner_entity();
  7. if (!$user) {
  8. register_error(elgg_echo("profile:notfound"));
  9. forward();
  10. }
  11. // check if logged in user can edit this profile
  12. if (!$user->canEdit()) {
  13. register_error(elgg_echo("profile:noaccess"));
  14. forward();
  15. }
  16. elgg_push_context('settings');
  17. elgg_push_context('profile_edit');
  18. $title = elgg_echo('profile:edit');
  19. $content = elgg_view_form('profile/edit', array(), array('entity' => $user));
  20. $params = array(
  21. 'content' => $content,
  22. 'title' => $title,
  23. );
  24. $body = elgg_view_layout('one_sidebar', $params);
  25. echo elgg_view_page($title, $body);