You are here

function entityreference_get_accessible_behavior_plugins in Entity reference 7

Get all accessible behavior plugins.

1 call to entityreference_get_accessible_behavior_plugins()
_entityreference_get_behavior_elements in ./entityreference.module
Get the field or instance elements for the field configuration.

File

./entityreference.module, line 680
Entityreference primary module file.

Code

function entityreference_get_accessible_behavior_plugins($field, $instance) {
  ctools_include('plugins');
  $plugins = array(
    'field' => array(),
    'instance' => array(),
  );
  foreach (ctools_get_plugins('entityreference', 'behavior') as $name => $plugin) {
    $handler = _entityreference_get_behavior_handler($name);
    $level = $plugin['behavior type'];
    if ($handler
      ->access($field, $instance)) {
      $plugins[$level][$name] = $plugin;
    }
  }
  return $plugins;
}