public function FlexiformAccess::prepareContexts in Flexiform 7
Prepare contexts.
1 call to FlexiformAccess::prepareContexts()
- FlexiformAccess::checkAccess in includes/
flexiform.access.inc - Check the Acces for this flexiforms.
File
- includes/
flexiform.access.inc, line 33 - Contains FlexiformAccess
Class
- FlexiformAccess
- Control access conditions for Flexiforms.
Code
public function prepareContexts($base_entity = NULL) {
ctools_include('context');
$contexts = array();
// Build the base entity context.
if (empty($base_entity)) {
$context = ctools_context_create_empty('entity:' . $this->flexiform->base_entity);
}
else {
$context = ctools_context_create('entity:' . $this->flexiform->base_entity, $base_entity);
}
$contexts['base_entity'] = $context;
$contexts['base_entity']->identifier = t('Base Entity');
return $contexts;
}