aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2011-09-26 23:32:32 -0300
committerSilvio Rhatto <rhatto@riseup.net>2011-09-26 23:32:32 -0300
commitfa79ee7ea6e3c06bb68b44cf4c78fb7f339b5f06 (patch)
tree662587dd5b9542a657c3cced55b71fca62b87c55
parent804ed5f81b4e89a66e3e232d641360be23722902 (diff)
downloadmuamba-fa79ee7ea6e3c06bb68b44cf4c78fb7f339b5f06.tar.gz
muamba-fa79ee7ea6e3c06bb68b44cf4c78fb7f339b5f06.tar.bz2
Implementing hook_privatemsg_view_alter()
-rw-r--r--muamba.js2
-rw-r--r--muamba.module16
-rw-r--r--muamba.theme.inc18
3 files changed, 35 insertions, 1 deletions
diff --git a/muamba.js b/muamba.js
index 6d52867..5d1c4db 100644
--- a/muamba.js
+++ b/muamba.js
@@ -10,7 +10,7 @@
// append the required parameters
// TODO: there might be already a ? at the url,
// in that case use & instead
- var newUrl = oldUrl + '?width=500&height=500&template=colorbox';
+ var newUrl = oldUrl + '&template=colorbox';
// update the links href
$(this).attr('href', newUrl);
});
diff --git a/muamba.module b/muamba.module
index 6476093..eabd4db 100644
--- a/muamba.module
+++ b/muamba.module
@@ -135,6 +135,13 @@ function muamba_theme($existing, $type, $theme, $path) {
),
'file' => 'muamba.theme.inc',
),
+ 'muamba_colorbox_link' => array(
+ 'variables' => array(
+ 'path' => NULL,
+ 'text' => NULL,
+ ),
+ 'file' => 'muamba.theme.inc',
+ ),
);
}
@@ -167,3 +174,12 @@ function muamba_block_view($delta = '') {
}
return $block;
}
+
+/**
+ * Implements hook_privatemsg_view_alter()
+ *
+ * @todo
+ */
+function muamba_privatemsg_view_alter(&$content) {
+ $content['participants']['#markup'] = $content['participants']['#markup'] . 'TODO: Add here request management bar.';
+}
diff --git a/muamba.theme.inc b/muamba.theme.inc
index e5f9180..c8db199 100644
--- a/muamba.theme.inc
+++ b/muamba.theme.inc
@@ -44,6 +44,10 @@ function theme_muamba_transactions($variables) {
'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'],
@@ -63,3 +67,17 @@ function theme_muamba_transactions($variables) {
return $output;
}
+
+/**
+ * Theme callback.
+ */
+function theme_muamba_colorbox_link($variables) {
+ $path = $variables['path'];
+ $text = $variables['text'];
+
+ $output = '<a href="'. $path .'?width=500&height=500&iframe=true';
+ $output .= '" class="colorbox-ajax colorbox-load">';
+ $output .= $text .'</a>';
+
+ return $output;
+}