1 system.pages.inc system_token_output()

Page callback to output a token tree as an empty page.

File

core/modules/system/system.pages.inc, line 10
System module non-administrative page callbacks.

Code

function system_token_output() {
  $types = isset($_GET['token_types']) ? backdrop_json_decode($_GET['token_types']) : array();
  $globals = isset($_GET['global_types']) ? backdrop_json_decode($_GET['global_types']) : TRUE;
  $query = backdrop_get_query_parameters();
  $show_restricted = $query['show_restricted'];

  $out = system_token_browser_tree_build_content($types, $globals, $show_restricted);
  $out = backdrop_render($out);

  if (backdrop_is_ajax()) {
    $dialog_options = array(
      'dialogClass' => 'token-browser-dialog',
      'modal' => FALSE,
      'draggable' => TRUE,
      'resizable' => TRUE,
      'autoResize' => FALSE,
      'width' => '800',
      'height' => '600',
    );
    $commands = array(
      ajax_command_open_dialog('#token-dialog', t('Token Browser'), $out, $dialog_options),
    );
    $return = array(
      '#type' => 'ajax',
      '#commands' => $commands,
    );
    return $return;
  }
  else {
    return $out;
  }
}