function modules_implement_hook

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!

13 calls to modules_implement_hook()
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.
content_save in modules/content/content.module
Save the content to the database.
fp_clear_cache in includes/misc.inc
Call all modules which implement hook_clear_cache
fp_get_form in includes/render.inc
This function gets the form array, where the callback is the same as form_id. It will also look for modules which may want to alter the form, using hook_form_alter, and go ahead and apply that.

... See full list

File

includes/misc.inc, line 2313
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;
}