? links.theme.patch
Index: links_related.module
===================================================================
RCS file: /cvs/drupal/contributions/modules/links/links_related.module,v
retrieving revision 1.15.2.1
diff -u -p -r1.15.2.1 links_related.module
--- links_related.module	28 Jan 2007 03:39:24 -0000	1.15.2.1
+++ links_related.module	3 Feb 2007 01:24:07 -0000
@@ -299,6 +299,30 @@ function theme_links_related_embedded_fo
 }
 
 /**
+ * Accepts a list of predefined HTML links (as returned from l() typically)
+ * and returns the list HTML around them plus an optional level-2 heading
+ * at the top of the list. The entire thing is surrounded by a DIV tag
+ * with a class of "links_related_endnotes" to make it more themeable.
+ */
+function theme_links_related_format_list($list, $heading='') {
+  // Trivial rejection
+  if (count($list) < 1) {
+    return '';
+  }
+  $html = '<div id="links_related_endnotes">';
+  if (! empty($heading)) {
+    $html .= '<h2>' . $heading . '</h2>';
+  }
+  $html .= '<ul>';
+  foreach ($list as $link) {
+    $html .= '<li>' . l($link['title'], $link['href'], $link['attributes']);
+  }
+  $html .= '</ul>'; 
+  $html .= '</div>';
+  return $html;
+}
+
+/**
  * Implementation of hook_block()
  */
 function links_related_block($op = 'list', $delta = 0, $edit = array()) {
@@ -432,7 +456,7 @@ function _links_related_prep_view(&$node
     $html = '';
     if ($do_related) {
       $list = _links_related_list($node, TRUE, FALSE);
-      $html .=  _links_related_format_list($list, t('Related Links'));
+      $html .=  theme('links_related_format_list', $list, t('Related Links'));
     }
     if ($do_embed) {
       $html .= _links_related_embedded($node, FALSE);
@@ -442,30 +466,6 @@ function _links_related_prep_view(&$node
 }
 
 /**
- * Accepts a list of predefined HTML links (as returned from l() typically)
- * and returns the list HTML around them plus an optional level-2 heading
- * at the top of the list. The entire thing is surrounded by a DIV tag
- * with a class of "links_related_endnotes" to make it more themeable.
- */
-function _links_related_format_list($list, $heading='') {
-  // Trivial rejection
-  if (count($list) < 1) {
-    return '';
-  }
-  $html = '<div id="links_related_endnotes">';
-  if (! empty($heading)) {
-    $html .= '<h2>' . $heading . '</h2>';
-  }
-  $html .= '<ul>';
-  foreach ($list as $link) {
-    $html .= '<li>' . l($link['title'], $link['href'], $link['attributes']);
-  }
-  $html .= '</ul>'; 
-  $html .= '</div>';
-  return $html;
-}
-
-/**
  * Displays the standalone "links" tab for a node
  */
 function _links_related_tab() {
@@ -542,7 +542,7 @@ function _links_related_format_embedded_
     $attribs = array('title'=>t('Matched text: %match', array('%match'=>$link['matched'])));
     $list[] = array('title'=>$display_text, 'href'=>$url, 'attribs'=>$attribs);
   }
-  return _links_related_format_list($list, t('Links from Article Text'));
+  return theme('links_related_format_list', $list, t('Links from Article Text'));
 }
 
 /**
