';
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) {
$actions = array();
foreach (muamba_actions_available($type, $transaction) as $action) {
$callback = muamba_actions($action);
$actions[] = l(t($callback), 'muamba/'. $callback .'/'. $transaction['mid']);
}
$rows[] = array(
'asset' => $transaction['node']->title,
'user' => $transaction['user']->name,
'status' => t(muamba_statuses($transaction['status'])),
'actions' => implode($actions, ' | '),
//'thread' => theme('muamba_colorbox_link', array(
// 'path' => '/messages/view/'. $transaction['thread_id'],
// 'text' => t('view messages'),
//)),
'thread' => l(
t('view messages'),
'messages/view/'. $transaction['thread_id'],
array(
'attributes' => array(
//'class' => array('colorbox-ajax', 'colorbox-load')
)
)
)
);
}
// Make a table for them.
$header = array(t('Item'), t('User'), t('Status'), t('Actions'), t('Negotiation'));
$output .= theme('table', array('header' => $header, 'rows' => $rows));
$output .= '';
return $output;
}
/**
* Theme callback.
*/
function theme_muamba_colorbox_link($variables) {
$path = $variables['path'];
$text = $variables['text'];
$output = '';
$output .= $text .'';
return $output;
}
/**
* Theme callback.
*/
function theme_muamba_request_message($transaction = NULL) {
$link = l(t('your requests page'), 'muamba');
return t('Hi, I would like to request this item of yours. Please visit @link to manage this request',
array('@link' => $link));
}
/**
* Theme callback.
*/
function theme_muamba_accept_message($transaction = NULL) {
return t('I accept your item request');
}
/**
* Theme callback.
*/
function theme_muamba_reject_message($transaction = NULL) {
return t('I reject your item request');
}
/**
* Theme callback.
*/
function theme_muamba_cancel_message($transaction = NULL) {
return t('I cancel my item request');
}
/**
* Theme callback.
*/
function theme_muamba_return_message($transaction = NULL) {
return t('I return your item');
}
/**
* Theme callback.
*/
function theme_muamba_recovered_message($transaction = NULL) {
return t('I recovered my item');
}
/**
* Theme callback.
*/
function theme_muamba_lost_message($transaction = NULL) {
return t('I declare that my item is lost');
}
/**
* Theme callback.
*/
function theme_muamba_widget_icon($variables) {
$status = $variables['status'];
$id = $variables['id'];
$size = $variables['size'];
$path = drupal_get_path('module', 'muamba');
$action = muamba_actions($status);
$image = $path .'/images/icons/'. $size .'/'. $action .'.png';
$title = ucfirst($action) .' item';
$icon = theme('image',
array(
'path' => $image,
'alt' => t($title),
'title' => t($title),
)
);
$output = l($icon, 'muamba/'. $action .'/'. $id, array('html' => TRUE));
return $output;
}
/**
* Theme callback.
*/
function theme_muamba_widget_owner($variables) {
$content = '';
$transaction = $variables['transaction'];
$size = $variables['size'];
$requester = user_load($transaction['uid']);
if ($size != 'small') {
$content .= t('Request from @name.', array('@name' => $requester->name));
$content .= '
';
}
foreach (muamba_actions_available('received', $transaction) as $action) {
$content .= theme('muamba_widget_icon', array(
'status' => $action,
'id' => $transaction['mid'],
'size' => $size,
));
}
return $content;
}
/**
* Theme callback.
*/
function theme_muamba_widget_requester($variables) {
$content = '';
$transaction = $variables['transaction'];
$size = $variables['size'];
foreach (muamba_actions_available('sent', $transaction) as $action) {
$content .= theme('muamba_widget_icon', array(
'status' => $action,
'id' => $transaction['mid'],
'size' => $size,
));
}
return $content;
}