You are here

function wysiwyg_dialog in Wysiwyg 5.2

Same name and namespace in other branches
  1. 6.2 wysiwyg.dialog.inc \wysiwyg_dialog()
  2. 7.2 wysiwyg.dialog.inc \wysiwyg_dialog()

Menu callback; Output a wysiwyg plugin dialog page.

1 string reference to 'wysiwyg_dialog'
wysiwyg_menu in ./wysiwyg.module
Implementation of hook_menu().

File

./wysiwyg.dialog.inc, line 11
Wysiwyg dialog page handling functions.

Code

function wysiwyg_dialog($plugin, $instance) {
  $plugins = wysiwyg_get_all_plugins();
  if (!isset($plugins[$plugin])) {
    return drupal_access_denied();
  }
  $callback = $plugin . '_wysiwyg_dialog';
  if (!function_exists($callback)) {
    return drupal_not_found();
  }

  // Suppress admin menu.
  module_invoke('admin_menu', 'suppress');

  // Add editor instance id to Drupal.settings.
  $settings = array(
    'plugin' => $plugin,
    'instance' => $instance,
  );
  drupal_add_js(array(
    'wysiwyg' => $settings,
  ), 'setting');
  echo theme('wysiwyg_dialog_page', $callback($instance));
}