? .DS_Store
? a.patch
? modules/.DS_Store
? sites/.DS_Store
? sites/default/.DS_Store
? sites/default/files
? sites/default/settings.php
Index: includes/common.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/common.inc,v
retrieving revision 1.824
diff -u -p -r1.824 common.inc
--- includes/common.inc	11 Nov 2008 22:39:58 -0000	1.824
+++ includes/common.inc	15 Nov 2008 22:47:20 -0000
@@ -3109,6 +3109,21 @@ function element_children($element) {
 }
 
 /**
+ * Determine whether help topics for a given module exist.
+ *
+ * @param $module
+ *   The name of the module (without the .module extension).
+ * @return
+ *   TRUE if the help module is installed & enabled and the given module provides help topics.
+ */
+function help_exists($module) {
+  if (drupal_function_exists('help_get_topics') && module_exists($module)) {
+    $topics = help_get_topics();
+    return isset($topics[$module]);
+  }
+}
+
+/**
  * Provide theme registration for themes across .inc files.
  */
 function drupal_common_theme() {
@@ -3177,8 +3192,8 @@ function drupal_common_theme() {
     'item_list' => array(
       'arguments' => array('items' => array(), 'title' => NULL, 'type' => 'ul', 'attributes' => NULL),
     ),
-    'more_help_link' => array(
-      'arguments' => array('url' => NULL),
+    'help_link' => array(
+      'arguments' => array('module' => NULL, 'topic' => NULL, 'title' => 'More help', 'popup' => NULL, 'attributes' => NULL),
     ),
     'xml_icon' => array(
       'arguments' => array('url' => NULL),
Index: includes/menu.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/menu.inc,v
retrieving revision 1.304
diff -u -p -r1.304 menu.inc
--- includes/menu.inc	11 Nov 2008 22:39:58 -0000	1.304
+++ includes/menu.inc	15 Nov 2008 22:47:23 -0000
@@ -1228,8 +1228,8 @@ function menu_get_active_help() {
       }
       // Add "more help" link on admin pages if the module provides a
       // standalone help page.
-      if ($arg[0] == "admin" && module_exists('help') && module_invoke($name, 'help', 'admin/help#' . $arg[2], $empty_arg) && $help) {
-        $output .= theme("more_help_link", url('admin/help/' . $arg[2]));
+      if ($arg[0] == "admin" && help_exists($arg[2]) && $help) {
+        $output .= theme("help_link", $arg[2]);
       }
     }
   }
Index: includes/theme.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/theme.inc,v
retrieving revision 1.450
diff -u -p -r1.450 theme.inc
--- includes/theme.inc	10 Nov 2008 15:40:03 -0000	1.450
+++ includes/theme.inc	15 Nov 2008 22:47:23 -0000
@@ -1560,10 +1560,51 @@ function theme_item_list($items = array(
 }
 
 /**
- * Returns code that emits the 'more help'-link.
- */
-function theme_more_help_link($url) {
-  return '<div class="more-help-link">' . t('<a href="@link">More help</a>', array('@link' => check_url($url))) . '</div>';
+ * Returns code that emits a 'more help' link with an icon, to view the topic, optionally in a popup.
+ *
+ * @param $module
+ *   The module that owns this help topic.
+ * @param $topic
+ *   Optional identifier for the topic.
+ * @param $title
+ *   Optional title or label for the link. Default is "More help".
+ * @param $popup
+ *   Optional boolean value to open the link in a popup.
+ * @param $attributes
+ *   An array of attributes to include in hyperlink.
+ */
+function theme_help_link($module, $topic = NULL, $title = 'More help', $popup = TRUE, $attributes = array()) {
+  if (module_exists('help')) {
+    static $js_added = FALSE;
+    if ($popup) {
+      $popup_class = !empty($attributes['class']) ? $attributes['class'] . ' help-link-popup' : 'help-link-popup';
+      // Set a class for links to be opened in a popup; degrades in the absence of JS.
+      $attributes += array('class' => $popup_class);
+    }
+     
+    // Fetch the topic information.
+    drupal_function_exists('help_get_topic');
+    $info = help_get_topic($module, $topic);
+     
+    // Return empty is the specified topic doesn't exist.
+    if (isset($topic) && !$info) {
+      return;
+    }
+ 
+    // Set the topic title as hyperlink title attribute.
+    $attributes += array('title' => $info['title']);
+ 
+    if (!$js_added) {
+      // Include the javascript for launching popup for hyperlinks with class 'help-link-popup'.
+      drupal_add_js('modules/help/help.js');
+      $js_added = TRUE;
+    }
+  }
+ 
+  // Trim the trailing slash if no topic is specified.
+  $output = l(t($title), trim("admin/help/$module/$topic", '/'), array('attributes' => $attributes));
+   
+  return '<div class="more-help-link">' . $output . '</div>';
 }
 
 /**
Index: modules/system/system.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.admin.inc,v
retrieving revision 1.104
diff -u -p -r1.104 system.admin.inc
--- modules/system/system.admin.inc	11 Nov 2008 22:39:59 -0000	1.104
+++ modules/system/system.admin.inc	15 Nov 2008 22:47:31 -0000
@@ -88,7 +88,6 @@ function system_admin_by_module() {
 
   $modules = module_rebuild_cache();
   $menu_items = array();
-  $help_arg = module_exists('help') ? drupal_help_arg() : FALSE;
 
   foreach ($modules as $file) {
     $module = $file->name;
@@ -102,7 +101,7 @@ function system_admin_by_module() {
     if (count($admin_tasks)) {
 
       // Check for help links.
-      if ($help_arg && module_invoke($module, 'help', "admin/help#$module", $help_arg)) {
+      if (help_exists($module)) {
         $admin_tasks[100] = l(t('Get help'), "admin/help/$module");
       }
 
@@ -634,9 +633,6 @@ function system_modules($form_state = ar
   $modules = array();
   $form['modules'] = array('#tree' => TRUE);
 
-  // Used when checking if module implements a help page.
-  $help_arg = module_exists('help') ? drupal_help_arg() : FALSE;
-
   // Iterate through each of the modules.
   foreach ($files as $filename => $module) {
     $extra = array();
@@ -657,11 +653,9 @@ function system_modules($form_state = ar
       }
     }
     // Generate link for module's help page, if there is one.
-    if ($help_arg && $module->status && in_array($filename, module_implements('help'))) {
-      if (module_invoke($filename, 'help', "admin/help#$filename", $help_arg)) {
-        // Module has a help page.
-        $extra['help'] = theme('more_help_link', url("admin/help/$filename"));
-      }
+    if (help_exists($filename)) {
+      // Module has a help page.
+      $extra['help'] = theme('help_link', $filename);
     }
     // Mark dependents disabled so user can not remove modules being depended on.
     $dependents = array();
