aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2011-09-26 18:28:59 -0300
committerSilvio Rhatto <rhatto@riseup.net>2011-09-26 18:28:59 -0300
commit554b31a26576d3d1d0da8c91cc000202962403e2 (patch)
tree197e379009c2f02a72ac1eee8306ce5f4a52c1f1
parentdfb96366348a72498b45e3c324fddde100296f43 (diff)
downloadmuamba-554b31a26576d3d1d0da8c91cc000202962403e2.tar.gz
muamba-554b31a26576d3d1d0da8c91cc000202962403e2.tar.bz2
Logic goes to muamba_get_transactions()
-rw-r--r--muamba.business.inc10
-rw-r--r--muamba.theme.inc8
2 files changed, 10 insertions, 8 deletions
diff --git a/muamba.business.inc b/muamba.business.inc
index a9da728..d48efcb 100644
--- a/muamba.business.inc
+++ b/muamba.business.inc
@@ -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;
}
/**
diff --git a/muamba.theme.inc b/muamba.theme.inc
index 481941f..c13a15f 100644
--- a/muamba.theme.inc
+++ b/muamba.theme.inc
@@ -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;