Index: helptip.info =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/helptip/helptip.info,v retrieving revision 1.1.2.1 diff -u -r1.1.2.1 helptip.info --- helptip.info 5 Jan 2007 21:59:40 -0000 1.1.2.1 +++ helptip.info 21 Dec 2008 22:19:57 -0000 @@ -1,4 +1,5 @@ -; $Id: helptip.info,v 1.1.2.1 2007/01/05 21:59:40 yogadex Exp $ +; $Id$ name = Helptip description = Allows for context-sensitive help messages to appear in blocks. +core = 6.x Index: helptip.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/helptip/helptip.module,v retrieving revision 1.12.2.1 diff -u -r1.12.2.1 helptip.module --- helptip.module 21 May 2007 00:24:04 -0000 1.12.2.1 +++ helptip.module 21 Dec 2008 22:54:23 -0000 @@ -1,5 +1,5 @@ 'node/add/helptip', - 'title' => t('Help Tip'), - 'access' => user_access(HELPTIP_ACCESS_CREATE), - 'type' => MENU_NORMAL_ITEM, - ); - $items[] = array - ( - 'path' => 'helptip/hide', - 'title' => t('Hide Help Tip'), - 'callback' => 'helptip_hide_cb', - 'access' => user_access(HELPTIP_ACCESS_VIEW), - 'type' => MENU_CALLBACK, - ); - $items[] = array - ('path' => 'admin/settings/helptip', - 'title' => t('Helptip Settings'), - 'description' => t('Configure the Helptip module.'), - 'callback' => 'drupal_get_form', - 'callback arguments' => 'helptip_settings_form', - 'access' => user_access(HELPTIP_ACCESS_ADMINISTER), - 'type' => MENU_NORMAL_ITEM, - ); - } + + $items['helptip/hide'] = array ( + 'title' => 'Hide Help Tip', + 'page callback' => 'helptip_hide_cb', + 'access arguments' => array(HELPTIP_ACCESS_VIEW), + 'type' => MENU_CALLBACK, + ); + + $items['admin/settings/helptip'] = array ( + 'title' => 'Helptip Settings', + 'description' => 'Configure the Helptip module.', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('helptip_settings_form'), + 'access arguments' => array(HELPTIP_ACCESS_ADMINISTER), + 'type' => MENU_NORMAL_ITEM, + ); return $items; } + /** * User has requested to hide the given helptip */ @@ -211,8 +201,7 @@ /** * Implementation of hook_access(). */ -function helptip_access($op, $node) { - global $user; +function helptip_access($op, $node, $account) { if (!($ret_val = user_access(HELPTIP_ACCESS_ADMINISTER))) { switch ($op) { @@ -363,6 +352,25 @@ return system_settings_form($form); } + +/** + * implementation of hook_theme + */ +function helptip_theme(){ + return array( + 'helptip_body' => array( + 'arguments' => array('node' => NULL), + ), + 'helptip_links' => array( + 'arguments' => array('node' => NULL), + ), + 'helptip_list' => array( + 'arguments' => array('items' => NULL), + ), + ); +} + + /** * Display the body of the help tip. In this implementation, we show teaser. */ @@ -434,5 +442,6 @@ $paths = array(db_escape_string($_GET['q'])); if ($alias = drupal_lookup_path('alias', $_GET['q'])) $paths[] = db_escape_string($alias); + if(drupal_is_front_page()) $paths[] = ''; return $paths; }