You are here

function ctools_entity_bundle_ctools_access_get_children in Chaos Tool Suite (ctools) 7

1 call to ctools_entity_bundle_ctools_access_get_children()
ctools_entity_bundle_ctools_access_get_child in plugins/access/entity_bundle.inc
1 string reference to 'ctools_entity_bundle_ctools_access_get_children'
entity_bundle.inc in plugins/access/entity_bundle.inc
Plugin to provide access control based upon entity bundle.

File

plugins/access/entity_bundle.inc, line 30
Plugin to provide access control based upon entity bundle.

Code

function ctools_entity_bundle_ctools_access_get_children($plugin, $parent) {
  $entities = entity_get_info();
  $plugins = array();
  foreach ($entities as $entity_type => $entity) {
    $plugin['title'] = t('@entity: Bundle', array(
      '@entity' => $entity['label'],
    ));
    $plugin['keyword'] = $entity_type;
    $plugin['description'] = t('Control access by @entity entity bundle.', array(
      '@entity' => $entity_type,
    ));
    $plugin['name'] = $parent . ':' . $entity_type;
    $plugin['required context'] = new ctools_context_required(t(ucfirst($entity_type)), $entity_type);
    $plugins[$parent . ':' . $entity_type] = $plugin;
  }
  return $plugins;
}