function modules_implement_hook

7.x misc.inc modules_implement_hook($hook = "example_hook_here")
6.x misc.inc modules_implement_hook($hook = "example_hook_here")
4.x misc.inc modules_implement_hook($hook = "example_hook_here")
5.x misc.inc modules_implement_hook($hook = "example_hook_here")

Return an array of enabled modules which implement the provided hook. Do not include the preceeding "_" on the hook name!

12 calls to modules_implement_hook()
blocks_get_available_blocks in modules/blocks/blocks.module
Return an array of blocks which we can assign and display, as defined by other modules' hook_blocks function.
blocks_get_sections_and_regions in modules/blocks/blocks.module
Look through our modules for hook_block_region and assemble them in an array.
content_get_types in modules/content/content.module
Return an array with all the possible content types known to FlightPath
content_load in modules/content/content.module
Load the content from the database and return an array, by calling hook_content_load.
fp_clear_cache in includes/misc.inc
Call all modules which implement hook_clear_cache

... See full list

File

includes/misc.inc, line 1566
This file contains misc functions for FlightPath

Code

function modules_implement_hook($hook = "example_hook_here") {

  // Going to use a global array to keep track of what hooks exist.  
  if (!isset($GLOBALS ['hook_cache'])) {
    $GLOBALS ['hook_cache'] = array();
  }

  // Have we already cached this list previously?
  if (isset($GLOBALS ['hook_cache'][$hook])) {
    return $GLOBALS ['hook_cache'][$hook];
  }

  // We have not already cached this, so let's look for it fresh...  

  $rtn = array();

  // If we are in the install script, the GLOBALS array won't be set up, since there is no
  // settings file yet.  If that's the case, create a blank array so we don't have an issue.
  if (!isset($GLOBALS ['fp_system_settings'])) {
    $GLOBALS ['fp_system_settings'] = array();
  }
  if (!isset($GLOBALS ['fp_system_settings']['modules'])) {
    $GLOBALS ['fp_system_settings']['modules'] = array();
  }


  foreach ($GLOBALS ["fp_system_settings"]["modules"] as $module => $value) {
    if (isset($value ["enabled"]) && $value ["enabled"] != "1") {
      // Module is not enabled.  Skip it.
      continue;
    }
    if (function_exists($module . '_' . $hook)) {
      $rtn [] = $module;
    }
  }

  $GLOBALS ['hook_cache'][$hook] = $rtn;

  return $rtn;
}