You are here

function ajax_links_api_init in Ajaxify Drupal with JQuery Ajax 7

Same name and namespace in other branches
  1. 6 ajax_links_api.module \ajax_links_api_init()

Implements hook_init().

File

./ajax_links_api.module, line 12
Make any links or create new links to load content to particular DIV via jQuery Ajax.

Code

function ajax_links_api_init() {
  $selector = variable_get('ajax_links_api_selector', '#content');

  // get the positive/negative triggers for ajax links
  list($trigger, $negative_trigger) = ajax_links_api_get_triggers();
  $html5 = variable_get('ajax_links_api_html5', 1);
  $scripts_included = variable_get('ajax_links_api_scripts_included', 1);
  $views_pager = variable_get('ajax_links_api_vpager', 1);
  drupal_add_js(array(
    'ajax_links_api' => array(
      'selector' => $selector,
      'trigger' => $trigger,
      'negative_triggers' => $negative_trigger,
      'scripts_included' => $scripts_included,
      'html5' => $html5,
      'vpager' => $views_pager,
    ),
  ), 'setting');
}