summaryrefslogtreecommitdiff
path: root/program/steps
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2010-05-02 15:09:36 +0000
committeralecpl <alec@alec.pl>2010-05-02 15:09:36 +0000
commitb62c4869f7c43804601b7786809e7e7a2508566d (patch)
treea2912d83818b22b0f64ed9cb8e466e386a8e7d26 /program/steps
parentd44571bde1db578e69d82ad0121e9b44a89991a0 (diff)
- Allow columns order change per user - drag&drop (#1485795)
Diffstat (limited to 'program/steps')
-rw-r--r--program/steps/mail/func.inc23
-rw-r--r--program/steps/mail/list.inc2
2 files changed, 14 insertions, 11 deletions
diff --git a/program/steps/mail/func.inc b/program/steps/mail/func.inc
index bd7fa9c43..6a56d2a75 100644
--- a/program/steps/mail/func.inc
+++ b/program/steps/mail/func.inc
@@ -154,13 +154,16 @@ function rcmail_message_list($attrib)
$attrib['id'] = 'rcubemessagelist';
// define list of cols to be displayed based on parameter or config
- if (empty($attrib['columns']))
- $a_show_cols = is_array($CONFIG['list_cols']) ? $CONFIG['list_cols'] : array('subject');
- else
- $a_show_cols = preg_split('/[\s,;]+/', strip_quotes($attrib['columns']));
+ if (empty($attrib['columns'])) {
+ $a_show_cols = is_array($CONFIG['list_cols']) ? $CONFIG['list_cols'] : array('subject');
+ $OUTPUT->set_env('col_movable', !in_array('list_cols', (array)$CONFIG['dont_override']));
+ }
+ else {
+ $a_show_cols = preg_split('/[\s,;]+/', strip_quotes($attrib['columns']));
+ $attrib['columns'] = $a_show_cols;
+ }
// save some variables for use in ajax list
- $_SESSION['list_columns'] = $a_show_cols;
$_SESSION['list_attrib'] = $attrib;
$mbox = $IMAP->get_mailbox_name();
@@ -220,7 +223,7 @@ function rcmail_message_list($attrib)
$attrib,
html::tag('thead', null, html::tag('tr', null, $thead)) .
html::tag('tbody', null, ''),
- array('style', 'class', 'id', 'cellpadding', 'cellspacing', 'border', 'summary'));
+ array('style', 'class', 'id', 'cellpadding', 'cellspacing', 'border', 'summary'));
}
@@ -232,10 +235,10 @@ function rcmail_js_message_list($a_headers, $insert_top=FALSE, $replace=TRUE, $h
{
global $CONFIG, $IMAP, $OUTPUT;
- if (empty($_SESSION['list_columns']))
- $a_show_cols = is_array($CONFIG['list_cols']) ? $CONFIG['list_cols'] : array('subject');
+ if (!empty($_SESSION['list_attrib']['columns']))
+ $a_show_cols = $_SESSION['list_attrib']['columns'];
else
- $a_show_cols = $_SESSION['list_columns'];
+ $a_show_cols = is_array($CONFIG['list_cols']) ? $CONFIG['list_cols'] : array('subject');
$mbox = $IMAP->get_mailbox_name();
$delim = $IMAP->get_hierarchy_delimiter();
@@ -324,7 +327,7 @@ function rcmail_js_message_list($a_headers, $insert_top=FALSE, $replace=TRUE, $h
if ($browser->ie && $replace)
$OUTPUT->command('offline_message_list', false);
- }
+}
/*
diff --git a/program/steps/mail/list.inc b/program/steps/mail/list.inc
index 89d127cdc..3b8c39fc8 100644
--- a/program/steps/mail/list.inc
+++ b/program/steps/mail/list.inc
@@ -45,7 +45,7 @@ else
if ($cols = get_input_value('_cols', RCUBE_INPUT_GET))
{
$save_arr = array();
- $_SESSION['list_columns'] = $save_arr['list_cols'] = explode(',', $cols);
+ $save_arr['list_cols'] = explode(',', $cols);
}
if ($save_arr)