You are here

function menu_position_get_plugins in Menu Position 7

Same name and namespace in other branches
  1. 6 menu_position.module \menu_position_get_plugins()
  2. 7.2 menu_position.module \menu_position_get_plugins()

Retrieves a list of information about every rule plugin.

2 calls to menu_position_get_plugins()
menu_position_get_condition_callback in ./menu_position.module
Loads the include file containing a condition's callback function definition.
menu_position_rule_form in ./menu_position.admin.inc
Returns form to add or edit a menu position rule.

File

./menu_position.module, line 592
Provides dynamic menu links based on configurable rules.

Code

function menu_position_get_plugins() {
  $plugins =& drupal_static(__FUNCTION__, array());
  if (empty($plugins)) {
    foreach (module_implements('menu_position_rule_plugins') as $module) {
      $function = $module . '_menu_position_rule_plugins';
      if (function_exists($function)) {

        // Register each module's plugin while setting baseline defaults.
        foreach ($function() as $name => $plugin) {
          $plugins[$name] = $plugin + array(
            'module' => $module,
            'file' => '',
            'form_callback' => $module . '_menu_position_rule_' . $name . '_form',
            'condition_callback' => $module . '_menu_position_condition_' . $name,
          );
        }
      }
    }
  }
  return $plugins;
}