You are here

function ajax_links_api_admin in Ajaxify Drupal with JQuery Ajax 7

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

Callback function for admin setting.

1 string reference to 'ajax_links_api_admin'
ajax_links_api_menu in ./ajax_links_api.module
Implements hook_menu().

File

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

Code

function ajax_links_api_admin() {

  // This module will not work if used in overlay paths such as
  // admin/* , node/add etc if user has overlay access.
  if (user_access('access overlay')) {
    $message = t("Overlay module is not compatible with Ajax links API module. To ajaxify admin paths, please check README.txt");
    drupal_set_message($message, 'warning', FALSE);
  }
  $form['ajax_links_api_trigger'] = array(
    '#type' => 'textarea',
    '#title' => t('jQuery selector to trigger ajax (One per line)'),
    '#default_value' => variable_get('ajax_links_api_trigger', '.ajax-link' . "\n" . "!#toolbar a"),
    '#description' => t('Just like jQuery, for example by providing ".content a" will ajaxify all link under .content. You can also exclude some selectors by specifying ! (for example "!#toolbar a")'),
  );
  $form['ajax_links_api_selector'] = array(
    '#type' => 'textfield',
    '#title' => t('Default Target DIV'),
    '#default_value' => variable_get('ajax_links_api_selector', '#content'),
    '#description' => t('This can be override for indivdual link by providing rel. Check Demo.'),
  );
  $form['ajax_links_api_html5'] = array(
    '#type' => 'checkbox',
    '#title' => t('Enable URL and Title change (for HTML5 Only)'),
    '#default_value' => variable_get('ajax_links_api_html5', 1),
    '#description' => t('Change URL and Title according to ajax content. This will work only for HTML5 supported browsers. Tested on latest Chrome,Firefox.'),
  );
  $form['ajax_links_api_scripts_included'] = array(
    '#type' => 'checkbox',
    '#title' => t('Included $scripts in tpl'),
    '#default_value' => variable_get('ajax_links_api_scripts_included', 1),
    '#description' => t('If you removed $scripts from html--ajax.tpl, uncheck this. for details, please check https://drupal.org/node/1923320'),
  );
  $form['ajax_links_api_vpager'] = array(
    '#type' => 'checkbox',
    '#title' => t('Remove ?ajax=1 from Views pager'),
    '#default_value' => variable_get('ajax_links_api_vpager', 1),
    '#description' => t('Remove ?ajax=1 from Views pager. For details, please check http://drupal.org/node/1907376.'),
  );
  return system_settings_form($form);
}