You are here

function advanced_forum_get_plugins in Advanced Forum 6.2

Same name and namespace in other branches
  1. 6 advf-plugins.inc \advanced_forum_get_plugins()
  2. 7.2 includes/plugins.inc \advanced_forum_get_plugins()

Fetch a group of plugins by name.

Parameters

$plugin: This is the name of the plugin, and also the name of the directory.

$hook: This is the hook to call to get the info for the plugin.

Return value

An array of information arrays about the plugins received.

2 calls to advanced_forum_get_plugins()
advanced_forum_get_style in includes/plugins.inc
Fetch an advanced forum style plugin
advanced_forum_get_styles in includes/plugins.inc
Collate information about all available advanced_forum styles.

File

includes/plugins.inc, line 49
Allows modules to contribute styles.

Code

function advanced_forum_get_plugins($plugin, $hook, $id = NULL) {
  static $plugins = array();
  static $all_hooks = array();

  // Always load all hooks if we need them.
  if (!isset($all_hooks[$plugin])) {
    $all_hooks[$plugin] = TRUE;
    $plugins[$plugin] = advanced_forum_load_hooks($hook);
  }

  // If a specific plugin $id is being requested, return it.
  if ($id && array_key_exists($id, $plugins[$plugin])) {
    return $plugins[$plugin][$id];
  }

  // If no $id was requested, return the lot.
  if (!$id) {
    return $plugins[$plugin];
  }
}