You are here

public function ctools_context_optional::add_empty in Chaos Tool Suite (ctools) 7

Same name and namespace in other branches
  1. 6 includes/context.inc \ctools_context_optional::add_empty()

Add the 'empty' context to the existing set.

Parameters

array &$contexts: An array of ctools_context objects.

2 calls to ctools_context_optional::add_empty()
ctools_context_optional::filter in includes/context.inc
Filter the contexts to determine which apply in the current environment.
ctools_context_optional::select in includes/context.inc
Select and return one context from the list of applicable contexts.

File

includes/context.inc, line 402
Contains code related to the ctools system of 'context'.

Class

ctools_context_optional
Used to compare to see if a list of contexts match an optional context. This can produce empty contexts to use as placeholders.

Code

public function add_empty(&$contexts) {
  $context = new ctools_context('any');
  $context->title = t('No context');
  $context->identifier = t('No context');
  $contexts['empty'] = $context;
}