function ctools_get_plugins

cis7 ctools_get_plugins($module, $type, $id = NULL)
cle7 ctools_get_plugins($module, $type, $id = NULL)
elmsmedia7 ctools_get_plugins($module, $type, $id = NULL)
icor7 ctools_get_plugins($module, $type, $id = NULL)
meedjum_blog7 ctools_get_plugins($module, $type, $id = NULL)
mooc7 ctools_get_plugins($module, $type, $id = NULL)

Fetch a group of plugins by name.


$module: The name of the module that utilizes this plugin system. It will be used to call hook_ctools_plugin_$plugin() to get more data about the plugin.

$type: The type identifier of the plugin.

$id: If specified, return only information about plugin with this identifier. The system will do its utmost to load only plugins with this id.

Return value

An array of information arrays about the plugins received. The contents of the array are specific to the plugin.

42 calls to ctools_get_plugins()
boxes_block_info in sites/all/modules/ulmus/boxes/boxes.module
Implements hook_block_info().
boxes_block_view in sites/all/modules/ulmus/boxes/boxes.module
Implements hook_block_view().
boxes_menu in sites/all/modules/ulmus/boxes/boxes.module
Implements hook_menu().
context_get_plugin in sites/all/modules/ulmus/context/context.module
Get a plugin handler.
ctools_cache_find_plugin in sites/all/modules/ulmus/ctools/includes/
Take a mechanism and return a plugin and data.

... See full list


sites/all/modules/ulmus/ctools/includes/, line 214
Contains routines to organize and load plugins. It allows a special variation of the hook system so that plugins can be kept in separate .inc files, and can be either loaded all at once or loaded only when necessary.


function ctools_get_plugins($module, $type, $id = NULL) {
  // Store local caches of plugins and plugin info so we don't have to do full
  // lookups everytime.
  $plugins = &drupal_static('ctools_plugins', array());
  $info = ctools_plugin_get_plugin_type_info();

  // Bail out noisily if an invalid module/type combination is requested.
  if (!isset($info[$module][$type])) {
    watchdog('ctools', 'Invalid plugin module/type combination requested: module @module and type @type', array('@module' => $module, '@type' => $type), WATCHDOG_ERROR);
    return array();

  // Make sure our plugins array is populated.
  if (!isset($plugins[$module][$type])) {
    $plugins[$module][$type] = array();

  // Attempt to shortcut this whole piece of code if we already have
  // the requested plugin:
  if ($id && array_key_exists($id, $plugins[$module][$type])) {
    return $plugins[$module][$type][$id];

  // Store the status of plugin loading. If a module plugin type pair is true,
  // then it is fully loaded and no searching or setup needs to be done.
  $setup = &drupal_static('ctools_plugin_setup', array());

  // We assume we don't need to build a cache.
  $build_cache = FALSE;

  // If the plugin info says this can be cached, check cache first.
  if ($info[$module][$type]['cache'] && empty($setup[$module][$type])) {
    $cache = cache_get("plugins:$module:$type", $info[$module][$type]['cache table']);

    if (!empty($cache->data)) {
      // Cache load succeeded so use the cached plugin list.
      $plugins[$module][$type] = $cache->data;
      // Set $setup to true so we know things where loaded.
      $setup[$module][$type] = TRUE;
    else {
      // Cache load failed so store that we need to build and write the cache.
      $build_cache = TRUE;

  // Always load all hooks if we need them. Note we only need them now if the
  // plugin asks for them. We can assume that if we have plugins we've already
  // called the global hook.
  if (!empty($info[$module][$type]['use hooks']) && empty($plugins[$module][$type])) {
    $plugins[$module][$type] = ctools_plugin_load_hooks($info[$module][$type]);

  // Then see if we should load all files. We only do this if we
  // want a list of all plugins or there was a cache miss.
  if (empty($setup[$module][$type]) && ($build_cache || !$id)) {
    $setup[$module][$type] = TRUE;
    $plugins[$module][$type] = array_merge($plugins[$module][$type], ctools_plugin_load_includes($info[$module][$type]));
    // If the plugin can have child plugins, and we're loading all plugins,
    // go through the list of plugins we have and find child plugins.
    if (!$id && !empty($info[$module][$type]['child plugins'])) {
      // If a plugin supports children, go through each plugin and ask.
      $temp = array();
      foreach ($plugins[$module][$type] as $name => $plugin) {
        // The strpos ensures that we don't try to find children for plugins
        // that are already children.
        if (!empty($plugin['get children']) && function_exists($plugin['get children']) && strpos($name, ':') === FALSE) {
          $temp = array_merge($plugin['get children']($plugin, $name), $temp);
        else {
          $temp[$name] = $plugin;
      $plugins[$module][$type] = $temp;

  // If we were told earlier that this is cacheable and the cache was
  // empty, give something back.
  if ($build_cache) {
    cache_set("plugins:$module:$type", $plugins[$module][$type], $info[$module][$type]['cache table']);

  // If no id was requested, we are finished here:
  if (!$id) {
    // Use array_filter because looking for unknown plugins could cause NULL
    // entries to appear in the list later.
    return array_filter($plugins[$module][$type]);

  // Check to see if we need to look for the file
  if (!array_key_exists($id, $plugins[$module][$type])) {
    // If we can have child plugins, check to see if the plugin name is in the
    // format of parent:child and break it up if it is.
    if (!empty($info[$module][$type]['child plugins']) && strpos($id, ':') !== FALSE) {
      list($parent, $child) = explode(':', $id, 2);
    else {
      $parent = $id;

    if (!array_key_exists($parent, $plugins[$module][$type])) {
      $result = ctools_plugin_load_includes($info[$module][$type], $parent);
      // Set to either what was returned or NULL.
      $plugins[$module][$type][$parent] = isset($result[$parent]) ? $result[$parent] : NULL;

    // If we are looking for a child, and have the parent, ask the parent for the child.
    if (!empty($child) && !empty($plugins[$module][$type][$parent]) && function_exists($plugins[$module][$type][$parent]['get child'])) {
      $plugins[$module][$type][$id] = $plugins[$module][$type][$parent]['get child']($plugins[$module][$type][$parent], $parent, $child);

  // At this point we should either have the plugin, or a NULL.
  return $plugins[$module][$type][$id];



Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/ in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/
The website encountered an unexpected error. Please try again later.