You are here

function linkit_linkit_plugin_entities_alter in Linkit 7.2

Implements hook_linkit_plugin_entities_alter().

The default behavior for entities is that they will use the default entity plugin class, which will provide them with the basic methods they need.

Tho there is some plugins that will extend those basic method with more advanced once, therefor the handlers for those plugins will have to be changed.

Parameters

array $plugins: An array of all entity plugins processed within Linkit entity plugin.

File

./linkit.module, line 1017
Main file for linkit module.

Code

function linkit_linkit_plugin_entities_alter(&$plugins) {
  $alter_plugins = array(
    'entity:node',
    'entity:user',
    'entity:taxonomy_term',
    'entity:file',
  );
  $path = drupal_get_path('module', 'linkit') . '/plugins/linkit_plugins';
  foreach ($alter_plugins as $plugin) {
    if (isset($plugins[$plugin])) {
      $handler = array(
        'class' => 'LinkitPlugin' . drupal_ucfirst($plugins[$plugin]['entity_type']),
        'file' => 'linkit-plugin-' . $plugins[$plugin]['entity_type'] . '.class.php',
        'path' => $path,
      );
      $plugins[$plugin]['handler'] = $handler;
    }
  }
}