You are here

function panelizer_entity_plugin_callback_switcher in Panelizer 7.2

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

Callback used for switching callbacks into the proper plugin.

1 string reference to 'panelizer_entity_plugin_callback_switcher'
PanelizerEntityDefault::hook_menu in plugins/entity/PanelizerEntityDefault.class.php
Implements a delegated hook_menu.

File

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

Code

function panelizer_entity_plugin_callback_switcher($entity_type, $switcher_type, $op) {
  $args = func_get_args();
  if (count($args) < 3) {
    return FALSE;
  }
  $entity_type = array_shift($args);
  $switcher_type = array_shift($args);
  $op = array_shift($args);

  // Load the $plugin information
  if ($handler = panelizer_entity_plugin_get_handler($entity_type)) {
    $method = $switcher_type . '_' . $op;
    if (method_exists($handler, $method)) {
      return call_user_func_array(array(
        $handler,
        $method,
      ), $args);
    }
  }
  else {
    return FALSE;
  }
}