From b62c4869f7c43804601b7786809e7e7a2508566d Mon Sep 17 00:00:00 2001 From: alecpl Date: Sun, 2 May 2010 15:09:36 +0000 Subject: - Allow columns order change per user - drag&drop (#1485795) --- program/steps/mail/func.inc | 23 +++++++++++++---------- program/steps/mail/list.inc | 2 +- 2 files changed, 14 insertions(+), 11 deletions(-) (limited to 'program/steps') 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) -- cgit v1.2.3