You are here

function crumbs_get_plugin_engine in Crumbs, the Breadcrumbs suite 7

Same name and namespace in other branches
  1. 6.2 crumbs.module \crumbs_get_plugin_engine()

Loads and instantiates the plugin engine.

Return value

An instance of crumbs_PluginEngine.

3 calls to crumbs_get_plugin_engine()
crumbs_build_breadcrumb in ./crumbs.module
Builds the breadcrumb based on the provided trail.
crumbs_debug_page in admin/crumbs.debug.inc
crumbs_get_parent_finder in ./crumbs.module
Loads and instantiates the parent finder.

File

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

Code

function crumbs_get_plugin_engine() {
  static $plugin_engine;
  if (!isset($plugin_engine)) {
    list($plugins, $disabled_keys) = crumbs_get_plugins();
    $weights = crumbs_get_weights();
    foreach ($disabled_keys as $key => $disabled) {
      if (!isset($weights[$key])) {
        $weights[$key] = FALSE;
      }
    }
    $plugin_engine = new crumbs_PluginEngine($plugins, $weights);
  }
  return $plugin_engine;
}