summaryrefslogtreecommitdiff
path: root/program
diff options
context:
space:
mode:
authorthomascube <thomas@roundcube.net>2010-06-08 20:50:15 +0000
committerthomascube <thomas@roundcube.net>2010-06-08 20:50:15 +0000
commite9b5a6c2d55f1fc31715ad7ff05aed631cc12699 (patch)
tree4f6651e0e935c2ca472ce1afc09e790f746bf50b /program
parent349a8e36e581694cb200e4f3097d7af8c8628662 (diff)
Unify directory/mailbox list actions
Diffstat (limited to 'program')
-rwxr-xr-xprogram/include/rcube_template.php31
-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
4 files changed, 14 insertions, 20 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';