From 518103ef61141f65ee0200494519cfa8407a7d00 Mon Sep 17 00:00:00 2001 From: PhilW Date: Wed, 17 Oct 2012 20:20:11 +0100 Subject: [PATCH] seperate export all/selected options in menu --- program/js/app.js | 21 +++++++++++++-------- program/localization/en_GB/labels.inc | 2 ++ program/localization/en_US/labels.inc | 2 ++ skins/classic/addressbook.css | 8 ++++++++ skins/classic/templates/addressbook.html | 12 +++++++++++- skins/larry/styles.css | 5 +++++ skins/larry/templates/addressbook.html | 12 +++++++++++- 7 files changed, 52 insertions(+), 10 deletions(-) mode change 100644 => 100755 skins/classic/templates/addressbook.html diff --git a/program/js/app.js b/program/js/app.js index 837d214fff4..2b0b8044e8a 100755 --- a/program/js/app.js +++ b/program/js/app.js @@ -1064,12 +1064,15 @@ function rcube_webmail() this.goto_url('import', (this.env.source ? '_target='+urlencode(this.env.source)+'&' : '')); break; - case 'export': + case 'export-all': if (this.contact_list.rowcount > 0) { - if (this.contact_list.get_selection().length > 0) - this.goto_url('export', { _source: this.env.source, _gid: this.env.group, _cid: this.contact_list.get_selection().join(',') }); - else - this.goto_url('export', { _source: this.env.source, _gid: this.env.group, _search: this.env.search_request }); + this.goto_url('export', { _source: this.env.source, _gid: this.env.group, _search: this.env.search_request }); + } + break; + + case 'export-selected': + if (this.contact_list.rowcount > 0) { + this.goto_url('export', { _source: this.env.source, _gid: this.env.group, _cid: this.contact_list.get_selection().join(',') }); } break; @@ -4030,6 +4033,7 @@ function rcube_webmail() // thend we can enable the group-remove-selected command this.enable_command('group-remove-selected', this.env.group && list.selection.length > 0); this.enable_command('compose', this.env.group || list.selection.length > 0); + this.enable_command('export-selected', list.selection.length > 0); this.enable_command('edit', id && writable); this.enable_command('delete', list.selection.length && writable); @@ -4291,7 +4295,7 @@ function rcube_webmail() list.insert_row(row); - this.enable_command('export', list.rowcount > 0); + this.enable_command('export-all', list.rowcount > 0); }; this.init_contact_form = function() @@ -6120,7 +6124,8 @@ function rcube_webmail() } this.enable_command('compose', (uid && this.contact_list.rows[uid])); this.enable_command('delete', 'edit', writable); - this.enable_command('export', (this.contact_list && this.contact_list.rowcount > 0)); + this.enable_command('export-all', (this.contact_list && this.contact_list.rowcount > 0)); + this.enable_command('export-selected', false); } case 'moveto': @@ -6166,7 +6171,7 @@ function rcube_webmail() } } else if (this.task == 'addressbook') { - this.enable_command('export', (this.contact_list && this.contact_list.rowcount > 0)); + this.enable_command('export-all', (this.contact_list && this.contact_list.rowcount > 0)); if (response.action == 'list' || response.action == 'search') { this.enable_command('search-create', this.env.source == ''); diff --git a/program/localization/en_GB/labels.inc b/program/localization/en_GB/labels.inc index cb9c25c97df..020fb9a187d 100644 --- a/program/localization/en_GB/labels.inc +++ b/program/localization/en_GB/labels.inc @@ -279,6 +279,8 @@ $labels['composeto'] = 'Compose mail to'; $labels['contactsfromto'] = 'Contacts $from to $to of $count'; $labels['print'] = 'Print'; $labels['export'] = 'Export'; +$labels['exportall'] = 'Export all'; +$labels['exportsel'] = 'Export selected'; $labels['exportvcards'] = 'Export contacts in vCard format'; $labels['newcontactgroup'] = 'Create new contact group'; $labels['grouprename'] = 'Rename group'; diff --git a/program/localization/en_US/labels.inc b/program/localization/en_US/labels.inc index fbc154b8879..49b14253db8 100644 --- a/program/localization/en_US/labels.inc +++ b/program/localization/en_US/labels.inc @@ -330,6 +330,8 @@ $labels['composeto'] = 'Compose mail to'; $labels['contactsfromto'] = 'Contacts $from to $to of $count'; $labels['print'] = 'Print'; $labels['export'] = 'Export'; +$labels['exportall'] = 'Export all'; +$labels['exportsel'] = 'Export selected'; $labels['exportvcards'] = 'Export contacts in vCard format'; $labels['newcontactgroup'] = 'Create new contact group'; $labels['grouprename'] = 'Rename group'; diff --git a/skins/classic/addressbook.css b/skins/classic/addressbook.css index a398325b43f..1bb1e2c615a 100644 --- a/skins/classic/addressbook.css +++ b/skins/classic/addressbook.css @@ -67,6 +67,14 @@ background-position: -128px -32px; } +#abooktoolbar a.exportAll { + background-position: -128px 0; +} + +#abooktoolbar a.exportAllSel { + background-position: -128px -32px; +} + #abooktoolbar span.separator { width: 5px; background-position: -162px 0; diff --git a/skins/classic/templates/addressbook.html b/skins/classic/templates/addressbook.html old mode 100644 new mode 100755 index d77bb38d93e..96ff8b8bec8 --- a/skins/classic/templates/addressbook.html +++ b/skins/classic/templates/addressbook.html @@ -27,7 +27,10 @@   - + + + + @@ -38,6 +41,13 @@ +
+
    +
  • +
  • +
+
+
  • diff --git a/skins/larry/styles.css b/skins/larry/styles.css index 34068807883..19232df0bb4 100644 --- a/skins/larry/styles.css +++ b/skins/larry/styles.css @@ -1496,6 +1496,11 @@ ul.proplist li { background-position: center -1054px; } +.toolbar a.button.export-all { + min-width: 64px; + background-position: left -1054px; +} + a.menuselector { display: inline-block; border: 1px solid #ababab; diff --git a/skins/larry/templates/addressbook.html b/skins/larry/templates/addressbook.html index c39c2fe879c..8f5a2e0bebc 100644 --- a/skins/larry/templates/addressbook.html +++ b/skins/larry/templates/addressbook.html @@ -13,7 +13,11 @@
    - + + + + + @@ -75,6 +79,12 @@

    +
    +
      +
    • +
    • +
    +