diff options
Diffstat (limited to 'program')
-rwxr-xr-x | program/include/rcube_template.php | 3 | ||||
-rw-r--r-- | program/js/app.js | 22 | ||||
-rw-r--r-- | program/steps/mail/show.inc | 1 |
3 files changed, 20 insertions, 6 deletions
diff --git a/program/include/rcube_template.php b/program/include/rcube_template.php index d8c217693..51108f143 100755 --- a/program/include/rcube_template.php +++ b/program/include/rcube_template.php @@ -797,6 +797,9 @@ class rcube_template extends rcube_html_page 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 diff --git a/program/js/app.js b/program/js/app.js index b29a3575d..b9fce8b11 100644 --- a/program/js/app.js +++ b/program/js/app.js @@ -150,6 +150,9 @@ function rcube_webmail() // 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 @@ function rcube_webmail() 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': diff --git a/program/steps/mail/show.inc b/program/steps/mail/show.inc index 06c9f53e5..9beb42521 100644 --- a/program/steps/mail/show.inc +++ b/program/steps/mail/show.inc @@ -65,6 +65,7 @@ if ($_GET['_uid']) { // 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']); |