You are here

function panels_switcher_switch in Panels 5.2

Same name and namespace in other branches
  1. 6.2 includes/plugins.inc \panels_switcher_switch()

Switch one object for another just prior to load.

Parameters

$plugin: The name or loaded plugin to delegate switching to.

$type: The object type. eg, 'panels_page', 'panels_mini', etc.

$name: The name of the object that might be switched.

$candidates: A list of possible objects to switch to. The data conforms to what was set in the settings, and is keyed to the panel.

Return value

The object to switch to. NULL if electing not to switch.

1 call to panels_switcher_switch()
panels_page_view_page in panels_page/panels_page.module
Page callback to view a panel page.

File

includes/plugins.inc, line 1271
plugins.inc

Code

function panels_switcher_switch($plugin, $type, $name, $candidates) {
  $function = panels_plugin_get_function('switchers', $plugin, 'switch');
  if ($function) {
    return $function($type, $name, $candidates);
  }
}