]> gitweb.fluxo.info Git - drupal/muamba.git/commitdiff
Implementing hook_privatemsg_view_alter()
authorSilvio Rhatto <rhatto@riseup.net>
Tue, 27 Sep 2011 02:32:32 +0000 (23:32 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Tue, 27 Sep 2011 02:32:32 +0000 (23:32 -0300)
muamba.js
muamba.module
muamba.theme.inc

index 6d5286708291cf5494913d7c3ca24d4dc1ca9151..5d1c4db096e08c772ecef74e4b964ec0eb8800c8 100644 (file)
--- 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);
         });
index 647609352d5f8ff4c8e02d93f49295da49b03b82..eabd4db2793d573688ad86e3c187ae4cb3bb6e46 100644 (file)
@@ -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.';
+}
index e5f918047630b731e44dfb0b1e255c020ee9f8e7..c8db1995406d95cd18ae90a0b164270c66bcdf4c 100644 (file)
@@ -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;
+}