Account profile menu

Moved profile form out of Account Info and into Profile -> Edit. (DBOINCP-11)
This commit is contained in:
Tristan Olive 2013-09-15 23:31:05 -04:00
parent f387e8a755
commit 20c0df9c45
2 changed files with 33 additions and 3 deletions

View File

@ -530,7 +530,7 @@ function boinc_standard_strongarm() {
),
'user/%/edit/profile' => array(
'weight' => '1',
'action' => 'enabled',
'action' => 'hidden',
'tabtamer_original_path' => 'user/%user_category/edit/profile',
'tabtamer_title' => '',
),

View File

@ -28,11 +28,27 @@ require_once('includes/boincuser.helpers.inc');
*/
function boincuser_menu() {
$items['account/profile'] = array(
'title' => 'Profile',
'title' => '',
'description' => '',
'page callback' => 'boincuser_view_profile',
'access arguments' => array('access content'),
'type' => MENU_NORMAL_ITEM
);
$items['account/profile/view'] = array(
'title' => 'View',
'description' => 'Show a user profile',
'page callback' => 'boincuser_view_profile',
'access arguments' => array('access content'),
'type' => MENU_CALLBACK
'type' => MENU_DEFAULT_LOCAL_TASK,
'weight' => 0
);
$items['account/profile/edit'] = array(
'title' => 'Edit',
'description' => 'Edit a user profile',
'page callback' => 'boincuser_edit_profile',
'access arguments' => array('access content'),
'type' => MENU_LOCAL_TASK,
'weight' => 5
);
$items['join'] = array(
'title' => '',
@ -588,6 +604,20 @@ function boincuser_view_profile($account = null) {
return theme('user_profile', $account);
}
/**
* Page callback for editing a user profile
*/
function boincuser_edit_profile($account = null) {
// Create the user profile form
if (!$account) {
global $user;
$account = $user;
}
// Render the form
module_load_include('pages.inc', 'node', 'node');
return content_profile_page_edit('profile', $account);
}
/**
* Join page menu callback.
* Display instructions on joining for new or existing BOINC users