[Svn] r2544 - in trunk/roundcubemail/program: include js steps/mail

trac at roundcube.net trac at roundcube.net
Tue May 26 15:21:57 CEST 2009


Author: thomasb
Date: 2009-05-26 08:21:57 -0500 (Tue, 26 May 2009)
New Revision: 2544

Modified:
   trunk/roundcubemail/program/include/rcube_template.php
   trunk/roundcubemail/program/js/app.js
   trunk/roundcubemail/program/steps/mail/show.inc
Log:
Re-enable the permalink command (allows one to choose right-click and open-in-new-tab)

Modified: trunk/roundcubemail/program/include/rcube_template.php
===================================================================
--- trunk/roundcubemail/program/include/rcube_template.php	2009-05-26 13:02:43 UTC (rev 2543)
+++ trunk/roundcubemail/program/include/rcube_template.php	2009-05-26 13:21:57 UTC (rev 2544)
@@ -797,6 +797,9 @@
             else if (in_array($attrib['command'], $a_static_commands)) {
                 $attrib['href'] = rcmail_url($attrib['command']);
             }
+            else if ($attrib['command'] == 'permaurl' && !empty($this->env['permaurl'])) {
+                $attrib['href'] = $this->env['permaurl'];
+            }
         }
 
         // overwrite attributes

Modified: trunk/roundcubemail/program/js/app.js
===================================================================
--- trunk/roundcubemail/program/js/app.js	2009-05-26 13:02:43 UTC (rev 2543)
+++ trunk/roundcubemail/program/js/app.js	2009-05-26 13:21:57 UTC (rev 2544)
@@ -150,6 +150,9 @@
     // enable general commands
     this.enable_command('logout', 'mail', 'addressbook', 'settings', true);
     
+    if (this.env.permaurl)
+      this.enable_command('permaurl', true);
+    
     switch (this.task)
       {
       case 'mail':
@@ -559,14 +562,21 @@
         this.switch_task(command);
         break;
 
+      case 'permaurl':
+        if (obj && obj.href && obj.target)
+          return true;
+        else if (this.env.permaurl)
+          parent.location.href = this.env.permaurl;
+        break;
+
       case 'open':
-	var uid;
+        var uid;
         if (uid = this.get_single_uid())
-	  {
-	  obj.href = '?_task='+this.env.task+'&_action=show&_mbox='+urlencode(this.env.mailbox)+'&_uid='+uid;
-	  return true;
-          }
-	break;
+        {
+          obj.href = '?_task='+this.env.task+'&_action=show&_mbox='+urlencode(this.env.mailbox)+'&_uid='+uid;
+          return true;
+        }
+        break;
 
       // misc list commands
       case 'list':

Modified: trunk/roundcubemail/program/steps/mail/show.inc
===================================================================
--- trunk/roundcubemail/program/steps/mail/show.inc	2009-05-26 13:02:43 UTC (rev 2543)
+++ trunk/roundcubemail/program/steps/mail/show.inc	2009-05-26 13:21:57 UTC (rev 2544)
@@ -65,6 +65,7 @@
   // set environement
   $OUTPUT->set_env('safemode', $MESSAGE->is_safe);
   $OUTPUT->set_env('sender', $MESSAGE->sender['string']);
+  $OUTPUT->set_env('permaurl', rcmail_url('show', array('_uid' => $MESSAGE->uid, '_mbox' => $mbox_name)));
   $OUTPUT->set_env('mailbox', $mbox_name);
   if ($CONFIG['trash_mbox'])
     $OUTPUT->set_env('trash_mailbox', $CONFIG['trash_mbox']);

_______________________________________________
http://lists.roundcube.net/mailman/listinfo/svn



More information about the Svn mailing list