From e9b5a6c2d55f1fc31715ad7ff05aed631cc12699 Mon Sep 17 00:00:00 2001 From: thomascube Date: Tue, 8 Jun 2010 20:50:15 +0000 Subject: Unify directory/mailbox list actions --- program/include/rcube_template.php | 31 ++++++----------- program/localization/de_CH/labels.inc | 1 + program/localization/de_DE/labels.inc | 1 + program/localization/en_US/labels.inc | 1 + skins/default/addressbook.css | 53 ----------------------------- skins/default/common.css | 56 ++++++++++++++++++++++++++++++- skins/default/functions.js | 10 +++++- skins/default/settings.css | 15 +++++++-- skins/default/templates/addressbook.html | 2 +- skins/default/templates/editidentity.html | 9 ++--- skins/default/templates/identities.html | 9 ++--- skins/default/templates/mail.html | 23 +++++++++---- skins/default/templates/message.html | 4 ++- 13 files changed, 121 insertions(+), 94 deletions(-) diff --git a/program/include/rcube_template.php b/program/include/rcube_template.php index 2f1740dc9..fec12ae19 100755 --- a/program/include/rcube_template.php +++ b/program/include/rcube_template.php @@ -770,7 +770,6 @@ class rcube_template extends rcube_html_page */ public function button($attrib) { - static $sa_buttons = array(); static $s_button_count = 100; // these commands can be called directly via url @@ -787,26 +786,11 @@ class rcube_template extends rcube_html_page else { $attrib['type'] = ($attrib['image'] || $attrib['imagepas'] || $attrib['imageact']) ? 'image' : 'link'; } + $command = $attrib['command']; - // take the button from the stack - if ($attrib['name'] && $sa_buttons[$attrib['name']]) { - $attrib = $sa_buttons[$attrib['name']]; - } - else if($attrib['image'] || $attrib['imageact'] || $attrib['imagepas'] || $attrib['class']) { - // add button to button stack - if (!$attrib['name']) { - $attrib['name'] = $command; - } - if (!$attrib['image']) { - $attrib['image'] = $attrib['imagepas'] ? $attrib['imagepas'] : $attrib['imageact']; - } - $sa_buttons[$attrib['name']] = $attrib; - } - else if ($command && $sa_buttons[$command]) { - // get saved button for this command/name - $attrib = $sa_buttons[$command]; - } + if ($attrib['task']) + $command = $attrib['task'] . '.' . $command; if (!$attrib['id']) { $attrib['id'] = sprintf('rcmbtn%d', $s_button_count++); @@ -849,6 +833,9 @@ class rcube_template extends rcube_html_page if (in_array($attrib['command'], rcmail::$main_tasks)) { $attrib['href'] = rcmail_url(null, null, $attrib['command']); } + else if ($attrib['task'] && in_array($attrib['task'], rcmail::$main_tasks)) { + $attrib['href'] = rcmail_url($attrib['command'], null, $attrib['task']); + } else if (in_array($attrib['command'], $a_static_commands)) { $attrib['href'] = rcmail_url($attrib['command']); } @@ -861,7 +848,11 @@ class rcube_template extends rcube_html_page if (!$attrib['href']) { $attrib['href'] = '#'; } - if ($command && !$attrib['onclick']) { + if ($attrib['task']) { + if ($attrib['classact']) + $attrib['class'] = $attrib['classact']; + } + else if ($command && !$attrib['onclick']) { $attrib['onclick'] = sprintf( "return %s.command('%s','%s',this)", JS_OBJECT_NAME, diff --git a/program/localization/de_CH/labels.inc b/program/localization/de_CH/labels.inc index 84b47d414..1fc42dcf7 100644 --- a/program/localization/de_CH/labels.inc +++ b/program/localization/de_CH/labels.inc @@ -148,6 +148,7 @@ $labels['listcolumns'] = 'Spalten'; $labels['listsorting'] = 'Sortierung'; $labels['listorder'] = 'Ordnung'; $labels['listmode'] = 'Anzeigemodus'; +$labels['folderactions'] = 'Ordneraktionen...'; $labels['compact'] = 'Packen'; $labels['empty'] = 'Leeren'; $labels['purge'] = 'Aufräumen'; diff --git a/program/localization/de_DE/labels.inc b/program/localization/de_DE/labels.inc index d7a88b957..659d8ddf8 100644 --- a/program/localization/de_DE/labels.inc +++ b/program/localization/de_DE/labels.inc @@ -148,6 +148,7 @@ $labels['listcolumns'] = 'Spalten'; $labels['listsorting'] = 'Sortierung'; $labels['listorder'] = 'Ordnung'; $labels['listmode'] = 'Anzeigemodus'; +$labels['folderactions'] = 'Ordneraktionen...'; $labels['compact'] = 'Packen'; $labels['empty'] = 'Leeren'; $labels['purge'] = 'Bereinigen'; diff --git a/program/localization/en_US/labels.inc b/program/localization/en_US/labels.inc index b669c919e..5700d4aaf 100644 --- a/program/localization/en_US/labels.inc +++ b/program/localization/en_US/labels.inc @@ -177,6 +177,7 @@ $labels['listsorting'] = 'Sorting column'; $labels['listorder'] = 'Sorting order'; $labels['listmode'] = 'List view mode'; +$labels['folderctions'] = 'Folder actions...'; $labels['compact'] = 'Compact'; $labels['empty'] = 'Empty'; $labels['purge'] = 'Purge'; diff --git a/skins/default/addressbook.css b/skins/default/addressbook.css index 02a7a68e1..cdc86e934 100644 --- a/skins/default/addressbook.css +++ b/skins/default/addressbook.css @@ -110,65 +110,12 @@ overflow: hidden; } -#directorylistwarp -{ - position: absolute; - top: 20px; - bottom: 22px; - left: 0; - right: 0; - overflow-y: auto; - overflow-x: hidden; -} - -#groups-title -{ - position: absolute; - top: 0; - left: 0; - right: 0; -} - #directorylistbox input { display: absolute; margin: 2px; } -#directorylistbuttons -{ - display: block; - position: absolute; - bottom: 0px; - left: 0px; - right: 0px; - height: 22px; - border-top: 1px solid #999; - background: url('images/listheader.gif') top left repeat-x #CCC; -} - -#directorylistbuttons a.button, -#directorylistbuttons a.buttonPas -{ - display: block; - float: left; - width: 34px; - height: 22px; - padding: 0px; - margin: 0; - overflow: hidden; - background: url('images/icons/groupactions.png') 0 0 no-repeat transparent; - opacity: 0.99; /* this is needed to make buttons appear correctly in Chrome */ -} - -#directorylistbuttons a.groupactions { - background-position: 0 -26px; -} - -#directorylistbuttons a.buttonPas { - opacity: 0.35; -} - #addresslist { position: absolute; diff --git a/skins/default/common.css b/skins/default/common.css index 41b234a37..8591ab7f7 100644 --- a/skins/default/common.css +++ b/skins/default/common.css @@ -389,7 +389,59 @@ img background-color: #c00; } - +#directorylist-title +{ + position: absolute; + top: 0; + left: 0; + right: 0; +} + +#directorylistwarp +{ + position: absolute; + top: 20px; + bottom: 22px; + left: 0; + right: 0; + overflow-y: auto; + overflow-x: hidden; +} + +#directorylistbuttons +{ + display: block; + position: absolute; + bottom: 0px; + left: 0px; + right: 0px; + height: 22px; + border-top: 1px solid #999; + background: url('images/listheader.gif') top left repeat-x #CCC; +} + +#directorylistbuttons a.button, +#directorylistbuttons a.buttonPas +{ + display: block; + float: left; + width: 34px; + height: 22px; + padding: 0px; + margin: 0; + overflow: hidden; + background: url('images/icons/groupactions.png') 0 0 no-repeat transparent; + opacity: 0.99; /* this is needed to make buttons appear correctly in Chrome */ +} + +#directorylistbuttons a.groupactions { + background-position: 0 -26px; +} + +#directorylistbuttons a.buttonPas { + opacity: 0.35; +} + /***** common table settings ******/ @@ -655,6 +707,7 @@ ul.toolbarmenu li img margin: 0 2px; } +div.popupmenu ul li.separator_below, ul.toolbarmenu li.separator_below { border-bottom: 1px solid #ccc; @@ -662,6 +715,7 @@ ul.toolbarmenu li.separator_below padding-bottom: 2px; } +div.popupmenu ul li.separator_above, ul.toolbarmenu li.separator_above { border-top: 1px solid #ccc; diff --git a/skins/default/functions.js b/skins/default/functions.js index e1edee1e8..3a37b6d8d 100644 --- a/skins/default/functions.js +++ b/skins/default/functions.js @@ -131,7 +131,8 @@ function rcube_mail_ui() messagemenu:'messagemenu', listmenu:'listmenu', dragmessagemenu:'dragmessagemenu', - groupmenu:'groupoptionsmenu' + groupmenu:'groupoptionsmenu', + mailboxmenu:'mailboxoptionsmenu' }; var obj; @@ -173,6 +174,11 @@ show_groupmenu: function(show) this.show_popupmenu(this.groupmenu, 'groupactionslink', show, true); }, +show_mailboxmenu: function(show) +{ + this.show_popupmenu(this.mailboxmenu, 'mboxactionslink', show, true); +}, + show_searchmenu: function(show) { if (typeof show == 'undefined') @@ -289,6 +295,8 @@ body_mouseup: function(evt, p) this.dragmessagemenu.hide(); else if (this.groupmenu && this.groupmenu.is(':visible') && target != rcube_find_object('groupactionslink')) this.show_groupmenu(false); + else if (this.mailboxmenu && this.mailboxmenu.is(':visible') && target != rcube_find_object('mboxactionslink')) + this.show_mailboxmenu(false); else if (this.listmenu && this.listmenu.is(':visible') && target != rcube_find_object('listmenulink')) { var menu = rcube_find_object('listmenu'); while (target.parentNode) { diff --git a/skins/default/settings.css b/skins/default/settings.css index a9c5e7b38..20de7e1b3 100644 --- a/skins/default/settings.css +++ b/skins/default/settings.css @@ -75,11 +75,22 @@ span.tablink-selected a #identities-list { - bottom: 60px; + bottom: 30px; width: 420px; border: 1px solid #999999; } +#identitieslistwarp +{ + position: absolute; + top: 0px; + bottom: 22px; + left: 0; + right: 0; + overflow-y: auto; + overflow-x: hidden; +} + #listbuttons { position: absolute; @@ -192,7 +203,7 @@ span.tablink-selected a top: 95px; left: 450px; right: 20px; - bottom: 60px; + bottom: 30px; border: 1px solid #999999; overflow: auto; background-color: #F2F2F2; diff --git a/skins/default/templates/addressbook.html b/skins/default/templates/addressbook.html index 34a78314a..e15bf5fb1 100644 --- a/skins/default/templates/addressbook.html +++ b/skins/default/templates/addressbook.html @@ -35,7 +35,7 @@
-
+
diff --git a/skins/default/templates/editidentity.html b/skins/default/templates/editidentity.html index 0cfec60d9..71b691bb8 100644 --- a/skins/default/templates/editidentity.html +++ b/skins/default/templates/editidentity.html @@ -12,12 +12,13 @@
+
- -

- -

+
+ +
+
diff --git a/skins/default/templates/identities.html b/skins/default/templates/identities.html index 395da1cfc..81822ae9a 100644 --- a/skins/default/templates/identities.html +++ b/skins/default/templates/identities.html @@ -12,12 +12,13 @@
+
- -

- -

+
+ +
+
diff --git a/skins/default/templates/mail.html b/skins/default/templates/mail.html index b28dcffeb..504d07efb 100644 --- a/skins/default/templates/mail.html +++ b/skins/default/templates/mail.html @@ -26,21 +26,21 @@
-
+
+
+
+ --> + +
+
-
- - - - -
@@ -161,6 +161,15 @@
+
+
    +
  • +
  • +
  • + +
+
+
diff --git a/skins/default/templates/message.html b/skins/default/templates/message.html index b12e5c027..bd3291b9f 100644 --- a/skins/default/templates/message.html +++ b/skins/default/templates/message.html @@ -34,10 +34,12 @@
-
+
+
+
-- cgit v1.2.3