You are here

function panels_optional_context::select in Panels 6.2

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

Overrides panels_required_context::select

File

includes/plugins.inc, line 128
plugins.inc

Class

panels_optional_context

Code

function select($contexts, $context) {
  $this
    ->add_empty($contexts);
  if (empty($context)) {
    return $contexts['empty'];
  }
  $result = parent::select($contexts, $context);

  // Don't flip out if it can't find the context; this is optional, put
  // in an empty.
  if ($result == FALSE) {
    $result = $contexts['empty'];
  }
  return $result;
}