You are here

function panels_argument_get_context in Panels 6.2

Same name and namespace in other branches
  1. 5.2 includes/plugins.inc \panels_argument_get_context()

Get a context from an argument

3 calls to panels_argument_get_context()
panels_argument_get_contexts in includes/plugins.inc
Retrieve a list of empty contexts for all arguments
panels_argument_load_contexts in includes/plugins.inc
Load the contexts for a given panel.
_panels_page_construct_argument_contexts in panels_page/panels_page.module
Extracts context data from provided URLs; helper function for _panels_page_master_loader().

File

includes/plugins.inc, line 764
plugins.inc

Code

function panels_argument_get_context($argument, $arg, $empty = FALSE) {
  if ($function = panels_plugin_get_function('arguments', $argument['name'], 'context')) {
    if (!isset($argument['argument_settings'])) {
      $argument['argument_settings'] = array();
    }
    $context = $function($arg, $argument['argument_settings'], $empty);
    if (is_object($context)) {
      $context->identifier = $argument['identifier'];
      $context->page_title = isset($argument['title']) ? $argument['title'] : '';
      $context->keyword = $argument['keyword'];
    }
    return $context;
  }
}