function _ctools_entity_field_value_ctools_access_get_child

2 calls to _ctools_entity_field_value_ctools_access_get_child()
ctools_entity_field_value_ctools_access_get_child in plugins/access/entity_field_value.inc
ctools_entity_field_value_ctools_access_get_children in plugins/access/entity_field_value.inc

File

plugins/access/entity_field_value.inc, line 50

Code

function _ctools_entity_field_value_ctools_access_get_child($plugin, $parent, $entity_type, $bundle_type, $field_name, $entity = NULL, $bundle = NULL, $field = NULL) {
    // Check that the entity, bundle and field arrays have a value.
    // If not, load theme using machine names.
    if (empty($entity)) {
        $entity = entity_get_info($entity_type);
    }
    if (empty($bundle)) {
        $bundle = $entity['bundles'][$bundle_type];
    }
    if (empty($field)) {
        $field_instances = field_info_instances($entity_type, $bundle_type);
        $field = $field_instances[$field_name];
    }
    $plugin['title'] = t('@entity @type: @field Field', array(
        '@entity' => $entity['label'],
        '@type' => $bundle_type,
        '@field' => $field['label'],
    ));
    $plugin['keyword'] = $entity_type;
    $plugin['description'] = t('Control access by @entity entity bundle.', array(
        '@entity' => $entity_type,
    ));
    $plugin['name'] = $parent . ':' . $entity_type . ':' . $bundle_type . ':' . $field_name;
    $plugin['required context'] = new ctools_context_required(t(ucfirst($entity_type)), $entity_type, array(
        'type' => $bundle_type,
    ));
    return $plugin;
}