You are here

function panels_renderer_editor::ajax_layout in Panels 7.3

Same name and namespace in other branches
  1. 6.3 plugins/display_renderers/panels_renderer_editor.class.php \panels_renderer_editor::ajax_layout()

AJAX Router function for layout owned AJAX calls.

Layouts like the flexible layout builder need callbacks of their own. This allows those layouts to simply declare their callbacks and use them with $this->get_url('layout', $command).

File

plugins/display_renderers/panels_renderer_editor.class.php, line 1434
Class file to control the main Panels editor.

Class

panels_renderer_editor
@file Class file to control the main Panels editor.

Code

function ajax_layout() {
  $args = func_get_args();
  if (empty($args)) {
    return MENU_NOT_FOUND;
  }
  $command = array_shift($args);
  if (empty($this->plugins['layout']['ajax'][$command]) || !function_exists($this->plugins['layout']['ajax'][$command])) {
    return MENU_NOT_FOUND;
  }

  // Make sure the this is always available to the called functions.
  array_unshift($args, $this);
  return call_user_func_array($this->plugins['layout']['ajax'][$command], $args);
}