summaryrefslogtreecommitdiff
path: root/program
diff options
context:
space:
mode:
authorthomascube <thomas@roundcube.net>2008-09-12 12:27:46 +0000
committerthomascube <thomas@roundcube.net>2008-09-12 12:27:46 +0000
commit203ee44470707bfe3af16f4ff4146896fa94e140 (patch)
tree83f7fe32ae13796aa4eeaa66d35dc055469458dd /program
parente5686f4a011ea0110bf49ae1d56aa749c75ffc76 (diff)
Add link to open message in new window + tweaked some header styles
Diffstat (limited to 'program')
-rwxr-xr-xprogram/include/rcube_template.php11
-rw-r--r--program/js/app.js9
-rw-r--r--program/localization/de_CH/labels.inc1
-rw-r--r--program/localization/de_DE/labels.inc1
-rw-r--r--program/localization/en_US/labels.inc1
-rw-r--r--program/steps/mail/show.inc20
6 files changed, 30 insertions, 13 deletions
diff --git a/program/include/rcube_template.php b/program/include/rcube_template.php
index 1b61770c0..4441b0a41 100755
--- a/program/include/rcube_template.php
+++ b/program/include/rcube_template.php
@@ -752,10 +752,13 @@ class rcube_template extends rcube_html_page
// make valid href to specific buttons
if (in_array($attrib['command'], rcmail::$main_tasks)) {
- $attrib['href'] = Q(rcmail_url(null, null, $attrib['command']));
+ $attrib['href'] = rcmail_url(null, null, $attrib['command']);
}
else if (in_array($attrib['command'], $a_static_commands)) {
- $attrib['href'] = Q(rcmail_url($attrib['command']));
+ $attrib['href'] = rcmail_url($attrib['command']);
+ }
+ else if ($attrib['command'] == 'permaurl' && !empty($this->env['permaurl'])) {
+ $attrib['href'] = $this->env['permaurl'];
}
}
@@ -817,11 +820,11 @@ class rcube_template extends rcube_html_page
if ($attrib['label']) {
$btn_content .= ' '.$attrib['label'];
}
- $link_attrib = array('href', 'onclick', 'onmouseover', 'onmouseout', 'onmousedown', 'onmouseup', 'title');
+ $link_attrib = array('href', 'onclick', 'onmouseover', 'onmouseout', 'onmousedown', 'onmouseup', 'title', 'target');
}
else if ($attrib['type']=='link') {
$btn_content = $attrib['label'] ? $attrib['label'] : $attrib['command'];
- $link_attrib = array('href', 'onclick', 'title', 'id', 'class', 'style', 'tabindex');
+ $link_attrib = array('href', 'onclick', 'title', 'id', 'class', 'style', 'tabindex', 'target');
}
else if ($attrib['type']=='input') {
$attrib['type'] = 'button';
diff --git a/program/js/app.js b/program/js/app.js
index b724287ef..a6d88aa85 100644
--- a/program/js/app.js
+++ b/program/js/app.js
@@ -122,6 +122,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':
@@ -529,6 +532,12 @@ 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;
// misc list commands
case 'list':
diff --git a/program/localization/de_CH/labels.inc b/program/localization/de_CH/labels.inc
index 31410a83f..761b6c02c 100644
--- a/program/localization/de_CH/labels.inc
+++ b/program/localization/de_CH/labels.inc
@@ -130,6 +130,7 @@ $labels['unknown'] = 'unbekannt';
$labels['unlimited'] = 'unlimitiert';
$labels['quicksearch'] = 'Schnellsuche';
$labels['resetsearch'] = 'Löschen';
+$labels['openinextwin'] = 'In neuem Fenster öffnen';
$labels['compose'] = 'Neue Nachricht verfassen';
$labels['savemessage'] = 'Nachricht speichern';
$labels['sendmessage'] = 'Nachricht jetzt senden';
diff --git a/program/localization/de_DE/labels.inc b/program/localization/de_DE/labels.inc
index 89c28d81b..5d202e3bc 100644
--- a/program/localization/de_DE/labels.inc
+++ b/program/localization/de_DE/labels.inc
@@ -129,6 +129,7 @@ $labels['unknown'] = 'unbekannt';
$labels['unlimited'] = 'unbegrenzt';
$labels['quicksearch'] = 'Schnellsuche';
$labels['resetsearch'] = 'Suche zurücksetzen';
+$labels['openinextwin'] = 'In neuem Fenster öffnen';
$labels['compose'] = 'Neue Nachricht verfassen';
$labels['savemessage'] = 'Nachricht speichern';
$labels['sendmessage'] = 'Nachricht jetzt senden';
diff --git a/program/localization/en_US/labels.inc b/program/localization/en_US/labels.inc
index 6b503ff4c..7e538c2ed 100644
--- a/program/localization/en_US/labels.inc
+++ b/program/localization/en_US/labels.inc
@@ -160,6 +160,7 @@ $labels['unlimited'] = 'unlimited';
$labels['quicksearch'] = 'Quick search';
$labels['resetsearch'] = 'Reset search';
+$labels['openinextwin'] = 'Open in new window';
// message compose
$labels['compose'] = 'Compose a message';
diff --git a/program/steps/mail/show.inc b/program/steps/mail/show.inc
index 256561e0e..0b15c98d9 100644
--- a/program/steps/mail/show.inc
+++ b/program/steps/mail/show.inc
@@ -80,6 +80,7 @@ if ($_GET['_uid']) {
$OUTPUT->set_env('uid', $MESSAGE->uid);
$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)));
// check for unset disposition notification
if ($MESSAGE->headers->mdn_to &&
@@ -152,14 +153,15 @@ function rcmail_message_attachments($attrib)
$ol .= html::tag('li', null, sprintf("%s (%s)", Q($attach_prop->filename), Q(show_bytes($attach_prop->size))));
}
else {
- if (rc_strlen($attach_prop->filename) > 50) {
- $filename = rc_substr($attach_prop->filename, 0, 25) . '...' . rc_substr($attach_prop->filename, strlen($attach_prop->filename)-20, 20);
- $title = $attach_prop->filename;
- } else {
- $filename = $attach_prop->filename;
- $title = '';
- }
-
+ if (rc_strlen($attach_prop->filename) > 50) {
+ $filename = abbreviate_string($attach_prop->filename, 50);
+ $title = $attach_prop->filename;
+ }
+ else {
+ $filename = $attach_prop->filename;
+ $title = '';
+ }
+
$ol .= html::tag('li', null,
html::a(array(
'href' => $MESSAGE->get_part_url($attach_prop->mime_id),
@@ -168,7 +170,7 @@ function rcmail_message_attachments($attrib)
JS_OBJECT_NAME,
$attach_prop->mime_id,
$attach_prop->mimetype),
- 'title' => Q($title),
+ 'title' => Q($title),
),
Q($filename)));
}