]> gitweb.fluxo.info Git - drupal/muamba.git/commitdiff
Logic goes to muamba_get_transactions()
authorSilvio Rhatto <rhatto@riseup.net>
Mon, 26 Sep 2011 21:28:59 +0000 (18:28 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Mon, 26 Sep 2011 21:28:59 +0000 (18:28 -0300)
muamba.business.inc
muamba.theme.inc

index a9da7281e03ec33956c952577206e1c4317d2b8a..d48efcb5f9842413351e615a0d81793ccfbf6623 100644 (file)
@@ -110,7 +110,15 @@ function muamba_get_transactions($uid, $type = 'sent', $status = MUAMBA_REQUESTE
       ->fields('m', array('mid', 'uid', 'owner', 'thread_id'));
   }
 
-  return $query->execute()->fetchAll();
+  $rows    = array();
+  $results = $query->execute()->fetchAll();
+
+  // Sanitize the data before handing it off to the theme layer.
+  foreach ($results as $entry) {
+    $rows[] = array_map('check_plain', (array) $entry);
+  }
+
+  return $rows;
 }
 
 /**
index 481941ff03463da6c2bc9a9e01c333314b525628..c13a15f45cf1557771379b798604c62704d32a52 100644 (file)
@@ -10,15 +10,9 @@ function theme_muamba_transactions($variables) {
   $output       = '<div class="muamba-transactions">';
   $output      .= '<h2>'. t('Transactions') .'</h2>';
 
-  $rows = array();
-  foreach ($transactions as $entry) {
-    // Sanitize the data before handing it off to the theme layer.
-    $rows[] = array_map('check_plain', (array) $entry);
-  }
-
   // Make a table for them.
   $header = array(t('Id'), t('uid'), t('Owner'), t('Thread'));
-  $output .= theme('table', array('header' => $header, 'rows' => $rows));  
+  $output .= theme('table', array('header' => $header, 'rows' => $transactions));  
   $output .= '</div>';
 
   return $output;