From 1baa58bdadaad694ec52e92829da52ae901ab466 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Tue, 22 Nov 2011 14:55:57 -0200 Subject: Enhanced message page --- muamba.embed.inc | 45 +++++++++++++++++++++++++++++++++++++++++++++ muamba.module | 9 ++++++++- muamba.theme.inc | 16 +++++++++++----- 3 files changed, 64 insertions(+), 6 deletions(-) create mode 100644 muamba.embed.inc diff --git a/muamba.embed.inc b/muamba.embed.inc new file mode 100644 index 0000000..944dd2f --- /dev/null +++ b/muamba.embed.inc @@ -0,0 +1,45 @@ +override_path = $_GET['q']; + $output = $view->preview($display, $args); + + if ($return == 'preview') { + // Do not output empty views. + if ($view->result) { + return $output; + } + } + else if ($return == 'output') { + // Return output, even if empty result set. + return $output; + } + else { + return $view; + } +} diff --git a/muamba.module b/muamba.module index b35949d..1a5967d 100644 --- a/muamba.module +++ b/muamba.module @@ -267,18 +267,25 @@ function muamba_privatemsg_view_alter(&$content) { if (!empty($transaction)) { global $user; + include_once('muamba.embed.inc'); + $node = node_load($transaction['nid']); $available = muamba_check_availability($node->nid); $widget = ($node->uid == $user->uid) ? 'owner' : 'requester'; + $info = muamba_embed_view('muambas', array($node->nid), 'info'); + $title = '

'. t('Messages') .'

'; + /* $bar = theme('muamba_widget_'. $widget, array( 'node' => $node, 'transaction' => $transaction, 'available' => $available, 'size' => 'big', )); + */ - $content['participants']['#markup'] = $bar . $content['participants']['#markup']; + //$content['participants']['#markup'] = $bar . $content['participants']['#markup']; + $content['participants']['#markup'] = $info . $title; } } diff --git a/muamba.theme.inc b/muamba.theme.inc index ef169bf..8369e6f 100644 --- a/muamba.theme.inc +++ b/muamba.theme.inc @@ -88,9 +88,7 @@ function theme_muamba_colorbox_link($variables) { * 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)); + return t('Hi, I would like to request this item of yours.'); } /** @@ -189,10 +187,16 @@ function theme_muamba_widget_owner($variables) { * Theme callback. */ function theme_muamba_widget_requester($variables) { - $content = ''; + $output = ''; + $content = ''; $transaction = $variables['transaction']; $size = $variables['size']; + if ($size != 'small') { + $output .= '

'. t('Options') .'

'; + $output .= '
'; + } + foreach (muamba_actions_available('sent', $transaction) as $action) { $content .= theme('muamba_widget_icon', array( 'status' => $action, @@ -201,5 +205,7 @@ function theme_muamba_widget_requester($variables) { )); } - return $content; + if (!empty($content)) { + return $output . $content; + } } -- cgit v1.2.3