Fix for Using CTools

  1. function example_test_modal_callback($js = FALSE) {
  2.   if ($js) {
  3.     ctools_include('ajax');
  4.     ctools_include('modal');
  5.     $form_state = array(
  6.       'ajax' => TRUE,
  7.       'title' => t('Login'),
  8.     );
  9.     $output = ctools_modal_form_wrapper('user_login', $form_state);
  10.     if (empty($output)) {
  11.       $output[] = ctools_modal_command_loading();
  12.       $output[] = ctools_ajax_command_redirect('user');
  13.     }
  14.     ctools_ajax_render($output);
  15.   }
  16.   else {
  17.     return drupal_get_form('user_login');
  18.   }
  19. }

Submit Fix

Any tags you'd like to associate with your code, delimitered by commas (example: Views, CCK, Module, etc).
Select the syntax highlighting mode to use.