Permalink
Browse files

feature(routing): Render profile pages with views

  • Loading branch information...
ewinslow committed May 28, 2015
1 parent ec060fb commit 125844aa1ac63ee9aaf38ea3ebf1475714ce27d0
Showing with 14 additions and 7 deletions.
  1. +3 −7 mod/profile/start.php
  2. +11 −0 mod/profile/views/default/resources/profile/view.php
View
@@ -73,16 +73,12 @@ function profile_page_handler($page) {
if ($action == 'edit') {
// use the core profile edit page
- $base_dir = elgg_get_root_path();
- require "{$base_dir}pages/profile/edit.php";
+ echo elgg_view('resources/profile/edit');
return true;
}
- $content = elgg_view('profile/layout', array('entity' => $user));
- $body = elgg_view_layout('one_column', array(
- 'content' => $content
- ));
- echo elgg_view_page($user->name, $body);
+ set_input('username', $page[0]);
+ echo elgg_view('resources/profile/view');
return true;
}
@@ -0,0 +1,11 @@
+<?php
+
+$username = get_input('username');
+$user = get_user_by_username($username);
+elgg_set_page_owner_guid($user->guid);
+
+$content = elgg_view('profile/layout', array('entity' => $user));
+$body = elgg_view_layout('one_column', array(
+ 'content' => $content
+));
+echo elgg_view_page($user->name, $body);

0 comments on commit 125844a

Please sign in to comment.