You are here

function ds_plugins_retrieve in Display Suite 6

Same name and namespace in other branches
  1. 6.2 includes/ds.plugins.inc \ds_plugins_retrieve()

Retrieve all available plugins.

1 call to ds_plugins_retrieve()
ds_plugins in includes/ds.plugins.inc
Menu callback. Registers plugins for a module.

File

includes/ds.plugins.inc, line 57
Administration functions for DS plugins.

Code

function ds_plugins_retrieve($module) {
  $plugins = module_invoke_all('ds_plugins');
  foreach ($plugins as $plugin => $data) {
    if ($data['target'] == 'all' || is_array($data['target']) && isset($data['target'][$module])) {
      $data['key'] = $plugin;
      $data['class'] = $data['class'];
      if (isset($data['file']) && isset($data['path'])) {
        $data['filename'] = $data['path'] . '/' . $data['file'];
      }
      $plugins[$plugin] = $data;
    }
  }

  // Give modules a change to alter plugins.
  drupal_alter('ds_plugins', $plugins);
  return $plugins;
}