You are here

function panels_load_includes in Panels 6.2

Same name and namespace in other branches
  1. 5.2 includes/ \panels_load_includes()
  2. 5 panels.module \panels_load_includes()

Load plugins from a directory.


$plugin_type: The plugin type, as well as the panels directory where the plugin is kept. A list of additional directories to search for relevant plugins is generated by invoking hook_panels_include_directory();

$hook: The name of the hook to be invoked.

$file: The file to load if we're looking for just one particular plugin.

Return value

An array of information created for this plugin.

1 call to panels_load_includes()
panels_get_plugins in includes/
Fetch a group of plugins by name.


includes/, line 1338


function panels_load_includes($plugin_type, $hook, $file = NULL) {

  // Load all our plugins.
  $directories = panels_get_directories($plugin_type);
  $file_list = array();
  foreach ($directories as $module => $path) {
    $file_list[$module] = drupal_system_listing("{$file}" . '.inc$', $path, 'name', 0);
  $info = array();
  foreach (array_filter($file_list) as $module => $files) {
    foreach ($files as $file) {
      require_once './' . $file->filename;
      $result = _panels_process_plugin($module, $module . '_' . $file->name, dirname($file->filename), $hook);
      if (is_array($result)) {
        $info = array_merge($info, $result);
  return $info;