From a7d2dc7637a923f4b5ba5530b7328e8a55f22985 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Tue, 22 Nov 2011 18:20:33 -0200 Subject: Messages icon in actions handler --- muamba.theme.inc | 36 ++++++++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) (limited to 'muamba.theme.inc') 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; } -- cgit v1.2.3