You are here

function jquery_touchpunch_settings_form in jQuery UI Touch Punch 7

Implements hook_requirements().

1 string reference to 'jquery_touchpunch_settings_form'
jquery_touchpunch_menu in ./jquery_touchpunch.module
Implements hook_menu().

File

./jquery_touchpunch.admin.inc, line 11
Admin form and validation.

Code

function jquery_touchpunch_settings_form($form) {

  // Check library installed.
  $library = libraries_detect('jquery.ui.touch-punch');
  $error_message = isset($library['error message']) ? $library['error message'] : '';
  if ($error_message) {
    drupal_set_message(jquery_touchpunch_error_message($error_message, $library), 'error');
  }
  $form['global'] = array(
    '#type' => 'fieldset',
    '#title' => t('Global Settings'),
  );
  $form['global']['jquery_touchpunch_enabled'] = array(
    '#type' => 'checkbox',
    '#title' => t('Enable jQuery Touch Punch'),
    '#default_value' => variable_get('jquery_touchpunch_enabled', JQUERY_TOUCHPUNCH_ENABLED),
    '#description' => t('Uncheck this box to completely disable jQuery Touch Punch plugin.'),
  );
  $form['global']['jquery_touchpunch_variant'] = array(
    '#type' => 'radios',
    '#title' => t('Choose plugin compression type'),
    '#options' => array(
      'minified' => t('Production (Minified)'),
      'source' => t('Development (Uncompressed Code)'),
    ),
    '#default_value' => variable_get('jquery_touchpunch_variant', 'minified'),
  );
  return system_settings_form($form);
}