Ctools modals without AJAX What's the sanest way to present a Ctools modal to the user while bypassing the normal AJAX workflow? For example, how could I show a completely JavaScript-generated "Are you sure you want to log out?" confirmation prompt to the user in a Ctools modal after the user clicks the "log out" link?

I know I can probably fake a box which would get the same styling as the Ctools modal, but I'd rather avoid silly hacks if not strictly necessary.
This should be possible by invoking Drupal.CTools.Modal.show directly. The function takes one argument (the modal-style), which either can be a string pointing to an object on Drupal.settings or the style-object itself.

After showing the dialog, it is possible to populate title and content using jQuery:

Drupal.CTools.Modal.show('my-modal-style');
$('#modal-title').html('my-title');
$('#modal-content').html('some markup here').scrollTop(0);
Drupal.attachBehaviors();


In your PHP code, you need to ensure that ctools modal.js and also misc/ajax.js gets loaded:

drupal_add_js('misc/ajax.js');

ctools_add_js('modal');
ctools_add_css('modal');

// Add your modal style to the settings. You find the defaults in modal.js near the top:
drupal_add_js(array(
  'my-modal-style' =&gt; array(
    'modalSize' =&gt; array(
      'type' =&gt; 'fixed',
      'width' =&gt; 250,
      'height' =&gt; 250,
    ),
    'closeText' =&gt; 'Dismiss',
    'closeImage' =&gt; ...
  ),
), 'setting');