function 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 415
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;
}