You are here

function panels_plugin_get_function in Panels 6.2

Same name and namespace in other branches
  1. 5.2 includes/plugins.inc \panels_plugin_get_function()
  2. 6.3 includes/plugins.inc \panels_plugin_get_function()
  3. 7.3 includes/plugins.inc \panels_plugin_get_function()

Get a function from a plugin, if it exists.

Parameters

$plugin: The type of plugin

$which: Either the loaded plugin object (or the same data in array form) or a string with the name of the desired the specific plugin.

$function_name: The identifier of the function. For example, 'settings form'.

Return value

The actual name of the function to call, or NULL if the function does not exist.

27 calls to panels_plugin_get_function()
panels_ajax_cache_method in includes/display-edit.inc
Entry point for AJAX modal: configure pane cache method
panels_argument_choose_display in includes/plugins.inc
Pick which display an argument wants to use
panels_argument_get_context in includes/plugins.inc
Get a context from an argument
panels_clear_cached_content in includes/plugins.inc
Clear all cached content for a display.
panels_content_config_form in includes/display-edit.inc
Master FAPI definition for all pane add/edit configuration forms.

... See full list

File

includes/plugins.inc, line 1306
plugins.inc

Code

function panels_plugin_get_function($plugin, $which, $function_name) {
  if (is_object($which) || is_array($which)) {
    $plugin_data = $which;
  }
  else {
    $hook = "panels_{$plugin}";
    $plugin_data = panels_get_plugins($plugin, $hook, $which);
  }
  if (isset($plugin_data[$function_name]) && function_exists($plugin_data[$function_name])) {
    return $plugin_data[$function_name];
  }
}