You are here

function panels_context_get_keywords in Panels 6.2

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

Fetch keywords for use in string substitutions.

Parameters

$contexts: An array of contexts.

Return value

An array of keyword substitutions suitable for @code{strtr()}

1 call to panels_context_get_keywords()
_panels_page_prepare_panels_render in panels_page/panels_page.render.inc

File

includes/plugins.inc, line 1121
plugins.inc

Code

function panels_context_get_keywords($contexts) {
  $keywords = array();
  if (!empty($contexts)) {
    foreach ($contexts as $id => $context) {
      if ($keyword = $context
        ->get_keyword()) {
        $keywords["%{$keyword}"] = $context
          ->get_title();
      }
    }
  }
  return $keywords;
}