aboutsummaryrefslogtreecommitdiff
path: root/muamba.theme.inc
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2011-09-26 20:34:59 -0300
committerSilvio Rhatto <rhatto@riseup.net>2011-09-26 20:34:59 -0300
commit8bc407811575c36fc24dda235e263e9366efbe1e (patch)
tree5cd9e5d65c19925362f1be80f0678e9e997ab0a5 /muamba.theme.inc
parentcfadf58b293e7c6c030184a8f2bd1d93688fe85a (diff)
downloadmuamba-8bc407811575c36fc24dda235e263e9366efbe1e.tar.gz
muamba-8bc407811575c36fc24dda235e263e9366efbe1e.tar.bz2
Sketching muamba_actions()
Diffstat (limited to 'muamba.theme.inc')
-rw-r--r--muamba.theme.inc32
1 files changed, 29 insertions, 3 deletions
diff --git a/muamba.theme.inc b/muamba.theme.inc
index c13a15f..771c80b 100644
--- a/muamba.theme.inc
+++ b/muamba.theme.inc
@@ -6,13 +6,39 @@
*/
function theme_muamba_transactions($variables) {
+ $rows = array();
+ $type = $variables['type'];
$transactions = $variables['transactions'];
+
$output = '<div class="muamba-transactions">';
- $output .= '<h2>'. t('Transactions') .'</h2>';
+
+ if ($type == 'sent') {
+ $title = t('Items I requested from people');
+ }
+ else {
+ $title = t('My items that people requested');
+ }
+
+ $output .= '<h2>'. $title .'</h2>';
+
+ if (empty($transactions)) {
+ $output .= t('There are no transactions.');
+ $output .= '</div>';
+ return $output;
+ }
+
+ foreach($transactions as $transaction) {
+ $rows[] = array(
+ 'asset' => $transaction['node']->title,
+ 'user' => $transaction['user']->name,
+ 'status' => muamba_statuses($transaction['status']),
+ 'actions' => 'accept', // TODO
+ );
+ }
// Make a table for them.
- $header = array(t('Id'), t('uid'), t('Owner'), t('Thread'));
- $output .= theme('table', array('header' => $header, 'rows' => $transactions));
+ $header = array(t('Asset'), t('User'), t('Status'), t('Actions'));
+ $output .= theme('table', array('header' => $header, 'rows' => $rows));
$output .= '</div>';
return $output;