You are here

function crumbs_get_plugins in Crumbs, the Breadcrumbs suite 7

Same name and namespace in other branches
  1. 6.2 crumbs.plugin_engine.inc \crumbs_get_plugins()

Returns an array of loaded plugins and disabled plugin keys.

Return value

An array containing two arrays:

  • An array of loaded plugins keyed by plugin key.
  • An array of disabled plugin keys.
3 calls to crumbs_get_plugins()
crumbs_admin_form_submit in admin/crumbs.admin.inc
crumbs_get_plugin_engine in ./crumbs.module
Loads and instantiates the plugin engine.
_crumbs_get_default_text in admin/crumbs.admin.inc

File

./crumbs.module, line 371
Provides an API for building breadcrumbs.

Code

function crumbs_get_plugins() {
  static $plugins, $disabled_keys;
  if (!isset($plugins)) {
    $modules = array(
      'blog',
      'comment',
      'crumbs',
      'entityreference',
      'menu',
      'path',
      'taxonomy',
      'forum',
      'entityreference_prepopulate',
    );

    // Include Crumbs-provided plugins.
    foreach ($modules as $module) {
      if (module_exists($module)) {
        module_load_include('inc', 'crumbs', 'plugins/crumbs.' . $module);
      }
    }

    // Organic groups is a special case,
    // because 7.x-2.x behaves different from 7.x-1.x.
    if (module_exists('og')) {
      if (function_exists('og_get_group')) {

        // We are using the og-7.x-1.x branch.
        module_load_include('inc', 'crumbs', 'plugins/crumbs.og');
      }
      else {

        // We are using the og-7.x-2.x branch.
        module_load_include('inc', 'crumbs', 'plugins/crumbs.og.2');
      }
    }
    $plugins = array();
    $disabled_keys = array();
    $api = new crumbs_InjectedAPI_hookCrumbsPlugins($plugins, $disabled_keys);
    foreach (module_implements('crumbs_plugins') as $module) {
      $function = $module . '_crumbs_plugins';
      $api
        ->setModule($module);
      $function($api);
    }
  }
  return array(
    $plugins,
    $disabled_keys,
  );
}