You are here

function formtips_menu in Form Tips 5

Same name and namespace in other branches
  1. 6.2 formtips.module \formtips_menu()
  2. 6 formtips.module \formtips_menu()
  3. 7 formtips.module \formtips_menu()

Implements hook_menu().

File

./formtips.module, line 33
Form tips module uses JS to move form descriptions to tooltips.

Code

function formtips_menu($may_cache) {
  $items = array();
  if ($may_cache) {
    $items[] = array(
      'path' => 'admin/settings/formtips',
      'title' => t('Formtips'),
      'description' => t('Configure the formtip module'),
      'callback' => 'drupal_get_form',
      'callback arguments' => 'formtips_settings_form',
      'access' => user_access('administer site configuration'),
      'type' => MENU_NORMAL_ITEM,
    );
  }
  static $formtipsettings;

  // prevent double add
  if (!isset($formtipsettings)) {
    $module_path = drupal_get_path('module', 'formtips');
    if (variable_get('formtips_hoverintent', 1)) {
      drupal_add_js($module_path . '/hoverintent.minified.js');
    }
    drupal_add_js($module_path . '/formtips.js');
    drupal_add_css($module_path . '/formtips.css');
    $formtipsettings = formtips_js_settings();
    drupal_add_js($formtipsettings, 'setting');
  }
  return $items;
}