aboutsummaryrefslogtreecommitdiff
path: root/muamba.theme.inc
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2011-11-22 18:20:33 -0200
committerSilvio Rhatto <rhatto@riseup.net>2011-11-22 18:20:33 -0200
commita7d2dc7637a923f4b5ba5530b7328e8a55f22985 (patch)
tree3d4e95c8146ece52cd248293f992e63445377eb5 /muamba.theme.inc
parent1baa58bdadaad694ec52e92829da52ae901ab466 (diff)
downloadmuamba-a7d2dc7637a923f4b5ba5530b7328e8a55f22985.tar.gz
muamba-a7d2dc7637a923f4b5ba5530b7328e8a55f22985.tar.bz2
Messages icon in actions handler
Diffstat (limited to 'muamba.theme.inc')
-rw-r--r--muamba.theme.inc36
1 files changed, 32 insertions, 4 deletions
diff --git a/muamba.theme.inc b/muamba.theme.inc
index 8369e6f..03d1c1f 100644
--- a/muamba.theme.inc
+++ b/muamba.theme.inc
@@ -141,9 +141,19 @@ function theme_muamba_widget_icon($variables) {
$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';
+
+ if ($status != NULL) {
+ $action = muamba_actions($status);
+ $image = $path .'/images/icons/'. $size .'/'. $action .'.png';
+ $title = ucfirst($action) .' item';
+ $action = 'muamba/'. $action;
+ }
+ else {
+ // Default action.
+ $action = 'messages/view';
+ $image = $path .'/images/icons/'. $size .'/messages.png';
+ $title = t('Messages');
+ }
$icon = theme('image',
array(
@@ -153,7 +163,7 @@ function theme_muamba_widget_icon($variables) {
)
);
- $output = l($icon, 'muamba/'. $action .'/'. $id, array('html' => TRUE));
+ $output = l($icon, $action .'/'. $id, array('html' => TRUE));
return $output;
}
@@ -180,6 +190,15 @@ function theme_muamba_widget_owner($variables) {
));
}
+ // Add a message link.
+ if ($variables['messages'] == TRUE) {
+ $content .= theme('muamba_widget_icon', array(
+ 'status' => NULL,
+ 'id' => $transaction['thread_id'],
+ 'size' => $size,
+ ));
+ }
+
return $content;
}
@@ -205,6 +224,15 @@ function theme_muamba_widget_requester($variables) {
));
}
+ // Add a message link.
+ if ($variables['messages'] == TRUE) {
+ $content .= theme('muamba_widget_icon', array(
+ 'status' => NULL,
+ 'id' => $transaction['thread_id'],
+ 'size' => $size,
+ ));
+ }
+
if (!empty($content)) {
return $output . $content;
}