You are here

function fusion_apply_load_plugins in Fusion Accelerator 7

Same name and namespace in other branches
  1. 7.2 fusion_apply/fusion_apply.module \fusion_apply_load_plugins()

Includes Fusion Apply plugin files for an extension, if any.

Parameters

$extension: The API information for an extension, as returned by fusion_apply_implements().

2 calls to fusion_apply_load_plugins()
fusion_apply_get_group_info in fusion_apply/fusion_apply.module
Retrieves all skin groups registered by modules and themes.
fusion_apply_get_skin_info in fusion_apply/fusion_apply.module
Retrieves all skins registered by modules and themes.

File

fusion_apply/fusion_apply.module, line 337
Handles core Fusion Apply functionality.

Code

function fusion_apply_load_plugins($extension) {
  static $loaded = array();

  // If plugins have already been loaded for this extension, return them.
  if (isset($loaded[$extension['name']])) {
    return $loaded[$extension['name']];
  }
  $loaded[$extension['name']] = array();

  // If the extension defines a plugin directory, scan its plugins.
  if (isset($extension['directory'])) {
    $dir = DRUPAL_ROOT . '/' . $extension['path'] . '/' . $extension['directory'];
    $mask = '@^' . DRUPAL_PHP_FUNCTION_PATTERN . '\\.inc$@';
    $loaded[$extension['name']] = file_scan_directory($dir, $mask, array(
      'key' => 'name',
      'recurse' => TRUE,
      'min_depth' => 1,
      'callback' => 'fusion_apply_include_once',
    ));
  }
  return $loaded[$extension['name']];
}