? .cvsignore
? move_functions.patch
Index: privatemsg.module
===================================================================
RCS file: /cvs/drupal/contributions/modules/privatemsg/privatemsg.module,v
retrieving revision 1.151
diff -u -p -r1.151 privatemsg.module
--- privatemsg.module	27 Oct 2010 14:40:59 -0000	1.151
+++ privatemsg.module	8 Nov 2010 22:29:55 -0000
@@ -2278,6 +2278,107 @@ function privatemsg_views_api() {
 }
 
 /**
+ * Returns a table header definition based on the submitted keys.
+ *
+ * Uses @link theming theme patterns @endlink to theme single headers.
+ *
+ * @param $has_posts
+ *   TRUE when there is at least one row. Decides if the select all checkbox
+ *   should be displayed.
+ * @param $keys
+ *   Array with the keys which are present in the query/should be displayed.
+ * @return
+ *   Array with header defintions for tablesort_sql and theme('table').
+ */
+function _privatemsg_list_headers($has_posts, $keys) {
+  $select_header = $has_posts ? theme('table_select_header_cell') : '';
+  $select_header['#weight'] = -50;
+
+  // theme() doesn't include the theme file for patterns, we need to do it manually.
+  include_once drupal_get_path('module', 'privatemsg') .'/privatemsg.theme.inc';
+
+  $header = array($select_header);
+  foreach ($keys as $key) {
+    // First, try to load a specific theme for that header, if not present, use the default.
+    if ($return = theme(array('privatemsg_list_header__'. $key, 'privatemsg_list_header'))) {
+      // The default theme returns nothing, only store the value if we have something.
+      $header[$key] = $return;
+    }
+  }
+  if (count($header) == 1) {
+    // No header definition returned, fallback to the default.
+    $header += _privatemsg_list_headers_fallback($keys);
+  }
+  return $header;
+}
+
+/**
+ * Table header definition for themes that don't support theme patterns.
+ *
+ * @return
+ *   Array with the correct headers.
+ */
+function _privatemsg_list_headers_fallback($keys) {
+  $header = array();
+  foreach ($keys as $key) {
+    $theme_function = 'phptemplate_privatemsg_list_header__' . $key;
+    if (function_exists($theme_function)) {
+      $header[$key] = $theme_function();
+    }
+  }
+
+  return $header;
+}
+
+/**
+ * Formats a row in the message list.
+ *
+ * Uses @link theming theme patterns @endlink to theme single fields.
+ *
+ * @param $thread
+ *   Array with the row data returned by the database.
+ * @return
+ *   Row definition for use with theme('table')
+ */
+function _privatemsg_list_thread($thread) {
+  $row = array('data' => array());
+
+  if (!empty($thread['is_new'])) {
+    // Set the css class in the tr tag.
+    $row['class'] = 'privatemsg-unread';
+  }
+  foreach ($thread as $key => $data) {
+    // First, try to load a specific theme for that field, if not present, use the default.
+    if ($return = theme(array('privatemsg_list_field__'. $key, 'privatemsg_list_field'), $thread)) {
+      // The default theme returns nothing, only store the value if we have something.
+      $row['data'][$key] = $return;
+    }
+  }
+  if (empty($row['data'])) {
+    $row['data'] = _privatemsg_list_thread_fallback($thread);
+  }
+  return $row;
+}
+
+/**
+ * Table row definition for themes that don't support theme patterns.
+ *
+ * @return
+ *   Array with row data.
+ */
+function _privatemsg_list_thread_fallback($thread) {
+  $row_data = array();
+  foreach ($thread as $key => $data) {
+    $theme_function = 'phptemplate_privatemsg_list_field__' . $key;
+    if (function_exists($theme_function)) {
+      $row_data[$key] = $theme_function($thread);
+    }
+  }
+
+  return $row_data;
+}
+
+/**
  * Privatemsg wrapper function for user_load() with a static cache.
  *
  * The function additionaly also adds the privatemsg specific recipient id (uid)
Index: privatemsg.pages.inc
===================================================================
RCS file: /cvs/drupal/contributions/modules/privatemsg/privatemsg.pages.inc,v
retrieving revision 1.19
diff -u -p -r1.19 privatemsg.pages.inc
--- privatemsg.pages.inc	27 Oct 2010 14:41:00 -0000	1.19
+++ privatemsg.pages.inc	8 Nov 2010 22:29:57 -0000
@@ -576,108 +576,6 @@ function _privatemsg_action_form() {
   return $form;
 }
 
-
-/**
- * Returns a table header definition based on the submitted keys.
- *
- * Uses @link theming theme patterns @endlink to theme single headers.
- *
- * @param $has_posts
- *   TRUE when there is at least one row. Decides if the select all checkbox
- *   should be displayed.
- * @param $keys
- *   Array with the keys which are present in the query/should be displayed.
- * @return
- *   Array with header defintions for tablesort_sql and theme('table').
- */
-function _privatemsg_list_headers($has_posts, $keys) {
-  $select_header = $has_posts ? theme('table_select_header_cell') : '';
-  $select_header['#weight'] = -50;
-
-  // theme() doesn't include the theme file for patterns, we need to do it manually.
-  include_once drupal_get_path('module', 'privatemsg') .'/privatemsg.theme.inc';
-
-  $header = array($select_header);
-  foreach ($keys as $key) {
-    // First, try to load a specific theme for that header, if not present, use the default.
-    if ($return = theme(array('privatemsg_list_header__'. $key, 'privatemsg_list_header'))) {
-      // The default theme returns nothing, only store the value if we have something.
-      $header[$key] = $return;
-    }
-  }
-  if (count($header) == 1) {
-    // No header definition returned, fallback to the default.
-    $header += _privatemsg_list_headers_fallback($keys);
-  }
-  return $header;
-}
-
-/**
- * Table header definition for themes that don't support theme patterns.
- *
- * @return
- *   Array with the correct headers.
- */
-function _privatemsg_list_headers_fallback($keys) {
-  $header = array();
-  foreach ($keys as $key) {
-    $theme_function = 'phptemplate_privatemsg_list_header__' . $key;
-    if (function_exists($theme_function)) {
-      $header[$key] = $theme_function();
-    }
-  }
-
-  return $header;
-}
-
-/**
- * Formats a row in the message list.
- *
- * Uses @link theming theme patterns @endlink to theme single fields.
- *
- * @param $thread
- *   Array with the row data returned by the database.
- * @return
- *   Row definition for use with theme('table')
- */
-function _privatemsg_list_thread($thread) {
-  $row = array('data' => array());
-
-  if (!empty($thread['is_new'])) {
-    // Set the css class in the tr tag.
-    $row['class'] = 'privatemsg-unread';
-  }
-  foreach ($thread as $key => $data) {
-    // First, try to load a specific theme for that field, if not present, use the default.
-    if ($return = theme(array('privatemsg_list_field__'. $key, 'privatemsg_list_field'), $thread)) {
-      // The default theme returns nothing, only store the value if we have something.
-      $row['data'][$key] = $return;
-    }
-  }
-  if (empty($row['data'])) {
-    $row['data'] = _privatemsg_list_thread_fallback($thread);
-  }
-  return $row;
-}
-
-/**
- * Table row definition for themes that don't support theme patterns.
- *
- * @return
- *   Array with row data.
- */
-function _privatemsg_list_thread_fallback($thread) {
-  $row_data = array();
-  foreach ($thread as $key => $data) {
-    $theme_function = 'phptemplate_privatemsg_list_field__' . $key;
-    if (function_exists($theme_function)) {
-      $row_data[$key] = $theme_function($thread);
-    }
-  }
-
-  return $row_data;
-}
-
 /**
  * Menu callback for messages/undo/action.
  *
