You are here

function popups_render_as_json in Popups API (Ajax Dialogs) 6

Same name and namespace in other branches
  1. 5 popups.module \popups_render_as_json()
  2. 6.2 popups.module \popups_render_as_json()

Render the page contents in a custom json wrapper.

Parameters

$content: themed html.:

Return value

$content in a json wrapper with metadata.

1 call to popups_render_as_json()
popups_init in ./popups.module
Implementation of hook_init().

File

./popups.module, line 158
This module provides a hook_popups for links to be openned in an Ajax Popup Dialog.

Code

function popups_render_as_json($content) {
  $path = $_GET['q'];

  // Get current path from params.
  return drupal_json(array(
    'title' => drupal_get_title(),
    'messages' => theme('status_messages'),
    'path' => $path,
    'content' => $content,
  ));
}