You are here

function _menu_token_plugin_info in Menu Token 7

Builds and returns information about the menu token plugins and their types.

File

./menu_token.module, line 350
Main module file for the Menu Token module.

Code

function _menu_token_plugin_info() {
  $cache =& drupal_static(__FUNCTION__);
  if (!isset($cache)) {
    ctools_include('plugins');
    $cache = (object) array(
      'plugins' => array(),
      'types' => array(),
    );
    $info = token_get_info();
    foreach (ctools_get_plugins('menu_token', 'plugins') as $plugin) {
      if (isset($info['types'][$plugin['type']]) && ($class = ctools_plugin_get_class($plugin, 'handler'))) {
        $cache->plugins[$plugin['name']] = $plugin;
        $cache->plugins[$plugin['name']]['class'] = $class;
        $cache->types[$plugin['type']][$plugin['name']] = $plugin['label'];
      }
    }
  }
  return $cache;
}