function ctools_context_optional::add_empty in Chaos Tool Suite (ctools) 6
Same name and namespace in other branches
- 7 includes/context.inc \ctools_context_optional::add_empty()
Add the 'empty' context which is possible for optional
2 calls to ctools_context_optional::add_empty()
- ctools_context_optional::filter in includes/context.inc 
- ctools_context_optional::select in includes/context.inc 
File
- includes/context.inc, line 192 
- 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
function add_empty(&$contexts) {
  $context = new ctools_context('any');
  $context->title = t('No context');
  $context->identifier = t('No context');
  $contexts = array_merge(array(
    'empty' => $context,
  ), $contexts);
}