From 8bc407811575c36fc24dda235e263e9366efbe1e Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Mon, 26 Sep 2011 20:34:59 -0300 Subject: Sketching muamba_actions() --- muamba.theme.inc | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) (limited to 'muamba.theme.inc') 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 = '
'; - $output .= '

'. t('Transactions') .'

'; + + if ($type == 'sent') { + $title = t('Items I requested from people'); + } + else { + $title = t('My items that people requested'); + } + + $output .= '

'. $title .'

'; + + if (empty($transactions)) { + $output .= t('There are no transactions.'); + $output .= '
'; + 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 .= ''; return $output; -- cgit v1.2.3