--- websnapr.module 2008-06-26 16:02:49.000000000 +0200 +++ websnapr.module 2008-06-26 16:01:33.000000000 +0200 @@ -1,5 +1,5 @@ '. t('The WebSnapr Preview Bubble module is a simple, unobtrusive script used to display an overlay bubble showing a hyperlink target thumbnail using WebSnapr. It\'s a snap to setup and works on all modern browsers. Check the demo at: http://www.websnapr.com/previewbubble/'); $output .= '
'. t('WebSnapr - Preview Bubble Javascript by Juan Xavier Larrea') .'
'; break; case 'admin/settings/websnapr': - $output .= ''. t('Bubbles are always enabled for hyperlinks having class previewlink, irrespective of any configuration below. Configure permissions for user roles to view WebSnapr Preview Bubbles.', array('!url' => url('admin/user/access', NULL, 'module-websnapr'))) .'
'; + $output .= ''. t('Bubbles are always enabled for hyperlinks having class previewlink, irrespective of any configuration below. Configure permissions for user roles to view WebSnapr Preview Bubbles.', array('!url' => url('admin/user/permissions', array('fragment' => 'module-websnapr')))) .'
'; } return $output; } /** - * Implementation of hook_menu(). + * Implementation of hook_init(). */ -function websnapr_menu($may_cache) { - $items = array(); - - if ($may_cache) { - $items[] = array( - 'path' => 'admin/settings/websnapr', - 'title' => t('WebSnapr Preview Bubble'), - 'description' => t('Toggle site-wide usage of WebSnapr Preview Bubbles.'), - 'callback' => 'drupal_get_form', - 'callback arguments' => array('websnapr_settings'), - 'access' => user_access('administer site configuration'), - 'type' => MENU_NORMAL_ITEM, - ); - } - // Check permission. - else if(user_access('view websnapr preview bubble')) { +function websnapr_init() { + if (user_access('view websnapr preview bubble')) { // Load the JS for WebSnapr websnapr_load_script(); } +} +/** + * Implementation of hook_menu(). + */ +function websnapr_menu() { + $items = array(); + + $items['admin/settings/websnapr'] = array( + 'title' => 'WebSnapr Preview Bubble', + 'description' => 'Toggle site-wide usage of WebSnapr Preview Bubbles.', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('websnapr_settings'), + 'access callback' => 'user_access', + 'access arguments' => array('administer site configuration'), + 'type' => MENU_NORMAL_ITEM, + ); return $items; } --- websnapr.info 2008-06-26 16:04:37.000000000 +0200 +++ websnapr.info 2008-06-26 15:56:43.000000000 +0200 @@ -1,4 +1,5 @@ -; $Id: websnapr.info,v 1.1.2.1 2007/06/15 03:04:06 Gurpartap Exp $ +; $Id$ name = WebSnapr Preview Bubble description = Displays an overlay bubble on mouse hover, showing a hyperlink target thumbnail, using the WebSnapr service. package = Javascript +core = 6.x