You are here

function page_manager_esi_get_context_arguments in ESI: Edge Side Includes 6.2

Implementation of hook_esi_get_context, provided for page_manager.

File

./esi.module, line 646
Adds support for ESI (Edge-Side-Include) integration, allowing blocks to be\ delivered by ESI, with support for per-block cache times.

Code

function page_manager_esi_get_context_arguments($task_name) {
  switch ($task_name) {

    // The blog, poll, and contact_site tasks don't provide default context.
    case 'blog':
    case 'poll':
    case 'contact_site':
      return array();

    // The blog_user, and contact_user tasks provide a user-object.
    case 'blog_user':
    case 'contact_user':
      $uid = arg(1);
      $account = user_load($uid);
      return array(
        $account,
      );

    // The comment_reply task provide a node object and a comment CID.
    case 'comment_reply':

      // Path is comment/reply/%node
      $nid = arg(2);
      $pid = arg(3);
      $node = node_load($nid);
      return array(
        $node,
        $pid,
      );

    // The node_edit and node_view tasks provide a node object.
    case 'node_edit':
    case 'node_view':
      $nid = arg(1);
      $node = node_load($nid);
      return array(
        $node,
      );
    case 'search':

    // @TODO.
    // return array($keys);
    case 'term_view':
  }
}