You are here

function ds_plugins_retrieve in Display Suite 6.2

Same name and namespace in other branches
  1. 6 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 = array();
  $source = module_invoke_all('ds_plugins');
  foreach ($source as $plugin => $data) {
    if ($data['target'] == 'all' || is_array($data['target']) && in_array($module, $data['target'])) {
      $data['key'] = $plugin;
      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;
}