name == 'profile_display') { // Forcefully set the user page context condition. // @TODO: Try to refactor this as to not require this hack. if ($view->current_display === 'page_1' && isset($view->args[0]) && $account = user_load($view->args[0])) { $edit = array(); context_user('view', $edit, $account); } // Remove email display if site is in public mode. if (variable_get('user_register', 0)) { $fields = $view->display_handler->get_option('fields'); if (isset($fields['mail'])) { unset($fields['mail']); $view->display_handler->set_option('fields', $fields); } } } } /** * Implementation of hook_context_links_alter(). */ function atrium_profile_context_links_alter(&$links) { global $user; if (module_exists('spaces') && ($space = spaces_get_space()) && $space->type == 'user' && $space->id == $user->uid && node_access('create', 'profile')) { $prepend = array( 'profile' => array( 'title' => t('Edit my profile'), 'href' => "user/{$space->id}/edit/profile", 'custom' => TRUE, ), ); $links = $prepend + $links; } }