formtips.admin.inc 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <?php
  2. /**
  3. * @file
  4. * Configuration form for Form tips module.
  5. */
  6. /**
  7. * Admin settings form.
  8. */
  9. function formtips_setting_form($form) {
  10. $form['formtips_trigger_action'] = array(
  11. '#type' => 'select',
  12. '#title' => t('Trigger action'),
  13. '#description' => t('Select the action that will trigger the display of tooltips.'),
  14. '#options' => array(
  15. 'hover' => t('Hover'),
  16. 'click' => t('Click'),
  17. ),
  18. '#default_value' => variable_get('formtips_trigger_action', 'hover'),
  19. );
  20. $form['formtips_selectors'] = array(
  21. '#type' => 'textarea',
  22. '#title' => t('Selectors'),
  23. '#description' => t("Enter some CSS/XPATH selectors (jQuery compatible) for which you don't want to tigger formtips (one per line)."),
  24. '#default_value' => variable_get('formtips_selectors', FORMTIPS_SELECTORS),
  25. );
  26. $form['formtips_max_width'] = array(
  27. '#type' => 'textfield',
  28. '#title' => t('Max-width'),
  29. '#description' => t('Enter a value for the maximum width of the form description tooltip.'),
  30. '#default_value' => variable_get('formtips_max_width', FORMTIPS_MAX_WIDTH),
  31. );
  32. $form['intent'] = array(
  33. '#type' => 'fieldset',
  34. '#title' => t('Hover intent settings'),
  35. '#description' => t('Settings for controlling the hover intent plugin.'),
  36. '#collapsible' => TRUE,
  37. '#collapsed' => TRUE,
  38. );
  39. $form['intent']['formtips_hoverintent'] = array(
  40. '#type' => 'checkbox',
  41. '#title' => t('Add hoverIntent plugin'),
  42. '#description' => t('If the hoverIntent plugin is added by another module or in the theme you can switch this setting off.'),
  43. '#default_value' => variable_get('formtips_hoverintent', 1),
  44. );
  45. $form['intent']['formtips_interval'] = array(
  46. '#type' => 'textfield',
  47. '#title' => t('Interval'),
  48. '#description' => t('The number of milliseconds hoverIntent waits between reading/comparing mouse coordinates. When the user\'s mouse first enters the element its coordinates are recorded. The soonest the "over" function can be called is after a single polling interval. Setting the polling interval higher will increase the delay before the first possible "over" call, but also increases the time to the next point of comparison. Default interval: 100'),
  49. '#default_value' => variable_get('formtips_interval', FORMTIPS_INTERVAL),
  50. );
  51. $form['intent']['formtips_sensitivity'] = array(
  52. '#type' => 'textfield',
  53. '#title' => t('Sensitivity'),
  54. '#description' => t('If the mouse travels fewer than this number of pixels between polling intervals, then the "over" function will be called. With the minimum sensitivity threshold of 1, the mouse must not move between polling intervals. With higher sensitivity thresholds you are more likely to receive a false positive. Default sensitivity: 7'),
  55. '#default_value' => variable_get('formtips_sensitivity', FORMTIPS_SENSITIVITY),
  56. );
  57. $form['intent']['formtips_timeout'] = array(
  58. '#type' => 'textfield',
  59. '#title' => t('Timeout'),
  60. '#description' => t('A simple delay, in milliseconds, before the "out" function is called. If the user mouses back over the element before the timeout has expired the "out" function will not be called (nor will the "over" function be called). This is primarily to protect against sloppy/human mousing trajectories that temporarily (and unintentionally) take the user off of the target element... giving them time to return. Default timeout: 0'),
  61. '#default_value' => variable_get('formtips_timeout', FORMTIPS_TIMEOUT),
  62. );
  63. return system_settings_form($form);
  64. }