->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;
}
/**
$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;