You are here

function modal_forms_init in Modal forms (with ctools) 6

Same name and namespace in other branches
  1. 7 modal_forms.module \modal_forms_init()

Implements hook_init().

File

./modal_forms.module, line 11
Modal Forms allows you to activate a Ctools based ajax modal on common Drupal forms

Code

function modal_forms_init() {

  // These function calls must be made in this order.
  // If not the modal js code will not be loaded correctly.
  _modal_forms_doheader();

  // Include the CTools tools that we need.
  ctools_include('ajax');
  ctools_include('modal');

  // Add CTools' javascript to the page.
  ctools_modal_add_js();

  // Add modal_forms own js and CSS.
  ctools_add_css('modal_forms_popup', 'modal_forms');
  ctools_add_js('modal_forms_popup', 'modal_forms');
}