You are here

function panels_ajax_render in Panels 6.2

Same name and namespace in other branches
  1. 5.2 panels.module \panels_ajax_render()

Simple render function to make sure output is what we want.

Related topics

10 calls to panels_ajax_render()
panels_ajax_add_pane_choose in includes/display-edit.inc
Entry point for AJAX: 'Add Content' modal form, from which the user selects the type of pane to add.
panels_ajax_add_pane_config in includes/display-edit.inc
AJAX entry point for to configure a pane that has just been added.
panels_ajax_cache_method in includes/display-edit.inc
Entry point for AJAX modal: configure pane cache method
panels_ajax_cache_settings in includes/display-edit.inc
Handle the cache settings form
panels_ajax_configure_pane in includes/display-edit.inc
AJAX entry point for to configure a pane that has just been added.

... See full list

File

includes/ajax.inc, line 96
Miscellaneous AJAX helper routines

Code

function panels_ajax_render($output = NULL, $title = NULL, $url = NULL) {
  if (!is_object($output)) {
    $temp = new stdClass();
    $temp->output = $output;
    switch ($output) {
      case 'dismiss':
        $temp->type = $output;
        break;
      default:
        $temp->type = 'display';
    }
    $temp->title = $title;
    $temp->url = $url;
    $output = $temp;
  }
  if (!$output->output || !$output->type) {
    $output->output = t('The input was invalid');
    $output->type = 'display';
    $output->title = t('Error');
  }
  drupal_json($output);
  exit;
}