You are here

function page_manager_user_view in Chaos Tool Suite (ctools) 6

Entry point for our overridden user view.

This function asks its assigned handlers who, if anyone, would like to run with it. If no one does, it passes through to Drupal core's user view, which is user_page_view().

1 string reference to 'page_manager_user_view'
page_manager_user_view_menu_alter in page_manager/plugins/tasks/user_view.inc
Callback defined by page_manager_user_view_page_manager_tasks().

File

page_manager/plugins/tasks/user_view.inc, line 67

Code

function page_manager_user_view($account) {

  // Load my task plugin:
  $task = page_manager_get_task('user_view');

  // Load the account into a context.
  ctools_include('context');
  ctools_include('context-task-handler');
  $contexts = ctools_context_handler_get_task_contexts($task, '', array(
    $account,
  ));
  $output = ctools_context_handler_render($task, '', $contexts, array(
    $account->uid,
  ));
  if ($output === FALSE) {

    // Fall back!
    module_load_include('inc', 'user', 'user.pages');
    $output = user_view($account);
  }
  else {

    //fire off "view" op so that triggers still work
    $array = array();
    user_module_invoke('view', $array, $account);
  }
  return $output;
}