You are here

function jq_maphilight_menu in jQuery Map Hilight 5

Same name and namespace in other branches
  1. 6 jq_maphilight.module \jq_maphilight_menu()
  2. 7 jq_maphilight.module \jq_maphilight_menu()

implement hook_menu

File

./jq_maphilight.module, line 11
Configurable javascript based image map hilighting using the jquery map hilight plugin.

Code

function jq_maphilight_menu($may_cache) {
  $available = _jq_maphilight_available();
  if ($available !== FALSE) {
    $script = "\$(document).ready(function() { \$.fn.maphilight.defaults = { " . "fill: " . variable_get('jq_maphilight_fill', 'true') . "," . "fillColor: '" . variable_get('jq_maphilight_fillcolor', 'ff0000') . "'," . "fillOpacity: " . variable_get('jq_maphilight_fillopacity', '2') / 10 . "," . "stroke: " . variable_get('jq_maphilight_stroke', 'true') . "," . "strokeColor: '" . variable_get('jq_maphilight_strokecolor', 'D51910') . "'," . "strokeOpacity: " . variable_get('jq_maphilight_strokeopacity', '10') / 10 . "," . "strokeWidth: " . variable_get('jq_maphilight_strokewidth', '2') . "," . "fade: " . variable_get('jq_maphilight_fade', 'true') . "," . "alwaysOn: false}; " . "\$('.jq_maphilight').maphilight();});";
    jquery_plugin_add('metadata');
    jquery_plugin_add('maphilight');
    drupal_add_js($script, 'inline');
  }
  $items = array();
  if ($may_cache) {
    $items[] = array(
      'path' => 'admin/settings/jq_maphilight',
      'title' => t('JQuery Map Hilight'),
      'description' => t('Javascript image map highlighting using the jQuery Map Hilight plugin.'),
      'callback' => 'drupal_get_form',
      'callback arguments' => array(
        'jq_maphilight_admin_settings',
      ),
      'access' => user_access('access administration pages'),
      'type' => MENU_NORMAL_ITEM,
    );
  }
  return $items;
}