You are here

function dynamicload_admin_settings in Javascript Tools 5

Admin settings.

1 string reference to 'dynamicload_admin_settings'
dynamicload_menu in dynamicload/dynamicload.module
Implementation of hook_menu().

File

dynamicload/dynamicload.module, line 94
Enable AJAX-based loading of selected page elements.

Code

function dynamicload_admin_settings() {
  $form = array();
  $form['jstools_history_remote'] = array(
    '#type' => 'radios',
    '#title' => t('History plugin'),
    '#description' => t('Load the history_remote plugin, which ties dynamic loading to browser history. Dynamicload will be missing some functionality if this is disabled. However, the plugin can cause errors in combination with certain other Javascript functionality. Disable to avoid such errors. Note that disabling this setting will affect other modules if you enable them: Active Search and Tabs.'),
    '#default_value' => variable_get('jstools_history_remote', 0),
    '#options' => array(
      t('disabled'),
      t('enabled'),
    ),
  );
  $form['dynamicload_all'] = array(
    '#type' => 'checkbox',
    '#title' => t('Process all links for dynamic loading'),
    '#description' => t('Check this option to make all links on the page dynamically load into the main content area. Links processed through block configuraiton will be skipped. You can also configure by paths, below.'),
    '#default_value' => variable_get('dynamicload_all', 0),
  );
  $form['dynamicload_paths_type'] = array(
    '#type' => 'radios',
    '#title' => t('Path processing'),
    '#options' => array(
      t('Apply dynamic loading to all links except those to the listed pages.'),
      t('Apply dynamic loading only on links to the listed pages.'),
    ),
    '#default_value' => variable_get('dynamicload_paths_type', 0),
  );
  $form['dynamicload_paths'] = array(
    '#type' => 'textarea',
    '#title' => t('Paths'),
    '#default_value' => variable_get('dynamicload_paths', 'admin*'),
    '#description' => t("Enter one page per line as Drupal paths. The '*' character is a wildcard. Example paths are %blog for the blog page and %blog-wildcard for every personal blog and %admin for all admin pages. Put the wildcard at the both ends of a path fragment to match any path containing that fragment. The front page is automatically skipped.", array(
      '%blog' => 'blog',
      '%blog-wildcard' => 'blog/*',
      '%admin' => 'admin*',
    )),
  );
  include_once drupal_get_path('module', 'dynamicload') . '/paths.inc';
  $paths = module_invoke_all('dynamicload_paths');
  if (is_array($paths) && !empty($paths)) {
    $form['dynamicload_paths']['#description'] .= t(' If Path processing is set to "Apply dynamic loading to all links except those to the listed pages" above, the following paths will be used automatically and so don\'t need to be entered here: %paths.', array(
      '%paths' => implode(', ', $paths),
    ));
  }
  $form['dynamicload_regions'] = array(
    '#type' => 'checkboxes',
    '#title' => t('Load region data'),
    '#description' => t('If you wish to refresh block regions with page loads, select the regions here. Only selected regions will be loaded.'),
    '#options' => system_region_list(variable_get('theme_default', 'garland')),
    '#default_value' => variable_get('dynamicload_regions', array()),
  );
  $form = system_settings_form($form);
  return $form;
}