You are here

function panelizer_get_plugins_with_hook in Panelizer 7.2

Same name and namespace in other branches
  1. 7.3 panelizer.module \panelizer_get_plugins_with_hook()

Fetch handler objects for all plugins that implement the named hook.

These plugins must set $plugin['hooks'][$hook] = TRUE in order to be instantiated.

This is only called for system wide hooks such as hook_menu and hook_menu_alter; entity specific hooks will always be called.

11 calls to panelizer_get_plugins_with_hook()
panelizer_admin_paths in ./panelizer.module
Implements hook_admin_paths().
panelizer_default_page_manager_handlers in ./panelizer.module
Implements hook_default_page_manager_handlers().
panelizer_form_alter in ./panelizer.module
Implements hook_form_alter().
panelizer_menu in ./panelizer.module
Implements hook_menu().
panelizer_menu_alter in ./panelizer.module
Implements hook_menu_alter().

... See full list

File

./panelizer.module, line 421
The Panelizer module attaches panels to entities, providing default panels and allowing each panel to be configured independently by privileged users.

Code

function panelizer_get_plugins_with_hook($hook) {
  $objects = array();
  $plugins = panelizer_get_entity_plugins();
  foreach ($plugins as $entity_type => $plugin) {
    if (!empty($plugin['hooks'][$hook])) {
      if ($handler = panelizer_entity_plugin_get_handler($plugin)) {
        $objects[$entity_type] = $handler;
      }
    }
  }
  return $objects;
}