function ctools_ajax_sample_login

cis7 ctools_ajax_sample.module ctools_ajax_sample_login($js = NULL)
cle7 ctools_ajax_sample.module ctools_ajax_sample_login($js = NULL)
elmsmedia7 ctools_ajax_sample.module ctools_ajax_sample_login($js = NULL)
icor7 ctools_ajax_sample.module ctools_ajax_sample_login($js = NULL)
meedjum_blog7 ctools_ajax_sample.module ctools_ajax_sample_login($js = NULL)
mooc7 ctools_ajax_sample.module ctools_ajax_sample_login($js = NULL)

A modal login callback.

1 string reference to 'ctools_ajax_sample_login'
ctools_ajax_sample_menu in sites/all/modules/ulmus/ctools/ctools_ajax_sample/ctools_ajax_sample.module
Implementation of hook_menu()

File

sites/all/modules/ulmus/ctools/ctools_ajax_sample/ctools_ajax_sample.module, line 257
Sample AJAX functionality so people can see some of the CTools AJAX features in use.

Code

function ctools_ajax_sample_login($js = NULL) {
  // Fall back if $js is not set.
  if (!$js) {
    return drupal_get_form('user_login');
  }

  ctools_include('modal');
  ctools_include('ajax');
  $form_state = array(
    'title' => t('Login'),
    'ajax' => TRUE,
  );
  $output = ctools_modal_form_wrapper('user_login', $form_state);
  if (!empty($form_state['executed'])) {
    // We'll just overwrite the form output if it was successful.
    $output = array();
    $inplace = ctools_ajax_text_button(t('remain here'), 'ctools_ajax_sample/nojs/login/inplace', t('Go to your account'));
    $account = ctools_ajax_text_button(t('your account'), 'ctools_ajax_sample/nojs/login/user', t('Go to your account'));
    $output[] = ctools_modal_command_display(t('Login Success'), '<div class="modal-message">Login successful. You can now choose whether to ' . $inplace . ', or go to ' . $account . '.</div>');
  }
  print ajax_render($output);
  exit;
}
Error | ELMSLN API

Error

×

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/api.elmsln.org/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/api.elmsln.org/sites/all/modules/apc/drupal_apc_cache.inc).
The website encountered an unexpected error. Please try again later.