- Allow setting attachment col position in 'list_cols' option
- Allow override 'list_cols' via skin (#1485577)
- Fix: allow empty attribs in templates
| | |
| | | CHANGELOG RoundCube Webmail |
| | | --------------------------- |
| | | |
| | | 2008/11/23 (alec) |
| | | ---------- |
| | | - Allow setting attachment col position in 'list_cols' option |
| | | - Allow override 'list_cols' via skin (#1485577) |
| | | |
| | | 2008/11/21 (alec) |
| | | ---------- |
| | | - Fix 'cache' table cleanup on session destroy (#1485516) |
| | |
| | | // How many seconds must pass between emails sent by a user |
| | | $rcmail_config['sendmail_delay'] = 0; |
| | | |
| | | // These cols are shown in the message list |
| | | // available cols are: subject, from, to, cc, replyto, date, size, encoding, flag |
| | | $rcmail_config['list_cols'] = array('subject', 'from', 'date', 'size', 'flag'); |
| | | // These cols are shown in the message list. Available cols are: |
| | | // subject, from, to, cc, replyto, date, size, encoding, flag, attachment |
| | | $rcmail_config['list_cols'] = array('subject', 'from', 'date', 'size', 'flag', 'attachment'); |
| | | |
| | | // Includes should be interpreted as PHP files |
| | | $rcmail_config['skin_include_php'] = FALSE; |
| | |
| | | function parse_attrib_string($str) |
| | | { |
| | | $attrib = array(); |
| | | preg_match_all('/\s*([-_a-z]+)=(["\'])??(?(2)([^\2]+)\2|(\S+?))/Ui', stripslashes($str), $regs, PREG_SET_ORDER); |
| | | preg_match_all('/\s*([-_a-z]+)=(["\'])??(?(2)([^\2]*)\2|(\S+?))/Ui', stripslashes($str), $regs, PREG_SET_ORDER); |
| | | |
| | | // convert attributes to an associative array (name => value) |
| | | if ($regs) |
| | |
| | | break; |
| | | |
| | | // set table header class |
| | | if (header = document.getElementById('rcmHead'+this.env.sort_col)) |
| | | if (header = document.getElementById('rcm'+this.env.sort_col)) |
| | | this.set_classname(header, 'sorted'+(this.env.sort_order.toUpperCase()), false); |
| | | if (header = document.getElementById('rcmHead'+sort_col)) |
| | | if (header = document.getElementById('rcm'+sort_col)) |
| | | this.set_classname(header, 'sorted'+sort_order, true); |
| | | |
| | | // save new sort properties |
| | |
| | | else |
| | | cell.innerHTML = this.get_label(this.coltypes[n]); |
| | | |
| | | cell.id = 'rcmHead'+col; |
| | | cell.id = 'rcm'+col; |
| | | } |
| | | else if (col == 'subject' && this.message_list) |
| | | this.message_list.subject_col = n+1; |
| | |
| | | else if(this.env.unflaggedicon) |
| | | col.innerHTML = '<img src="'+this.env.unflaggedicon+'" alt="" />'; |
| | | } |
| | | else if (c=='attachment') |
| | | col.innerHTML = attachment && this.env.attachmenticon ? '<img src="'+this.env.attachmenticon+'" alt="" />' : ''; |
| | | else |
| | | col.innerHTML = cols[c]; |
| | | |
| | | row.appendChild(col); |
| | | } |
| | | |
| | | col = document.createElement('TD'); |
| | | col.className = 'icon'; |
| | | col.innerHTML = attachment && this.env.attachmenticon ? '<img src="'+this.env.attachmenticon+'" alt="" />' : ''; |
| | | row.appendChild(col); |
| | | |
| | | this.message_list.insert_row(row, attop); |
| | | |
| | |
| | | |
| | | $out = '<table' . $attrib_str . ">\n"; |
| | | |
| | | // define list of cols to be displayed |
| | | // 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 = explode(',', strip_quotes($attrib['columns'])); |
| | | |
| | | // store column list in a session-variable |
| | | $_SESSION['list_columns'] = $a_show_cols; |
| | | |
| | | // define sortable columns |
| | | $a_sort_cols = array('subject', 'date', 'from', 'to', 'size'); |
| | | |
| | | $mbox = $IMAP->get_mailbox_name(); |
| | |
| | | $out .= '<col class="icon" />'; |
| | | |
| | | foreach ($a_show_cols as $col) |
| | | $out .= sprintf('<col class="%s" />', $col); |
| | | $out .= ($col!='attachment') ? sprintf('<col class="%s" />', $col) : '<col class="icon" />'; |
| | | |
| | | $out .= '<col class="icon" />'; |
| | | $out .= "</colgroup>\n"; |
| | | |
| | | // add table title |
| | |
| | | foreach ($a_show_cols as $col) |
| | | { |
| | | // get column name |
| | | $col_name = $col != 'flag' ? Q(rcube_label($col)) : sprintf($image_tag, $skin_path, $attrib['unflaggedicon'], ''); |
| | | switch ($col) |
| | | { |
| | | case 'flag': |
| | | $col_name = sprintf($image_tag, $skin_path, $attrib['unflaggedicon'], ''); |
| | | break; |
| | | case 'attachment': |
| | | $col_name = sprintf($image_tag, $skin_path, $attrib['attachmenticon'], ''); |
| | | break; |
| | | default: |
| | | $col_name = Q(rcube_label($col)); |
| | | } |
| | | |
| | | // make sort links |
| | | $sort = ''; |
| | |
| | | $sort_class = $col==$sort_col ? " sorted$sort_order" : ''; |
| | | |
| | | // put it all together |
| | | $out .= '<td class="'.$col.$sort_class.'" id="rcmHead'.$col.'">' . "$col_name$sort</td>\n"; |
| | | if ($col!='attachment') |
| | | $out .= '<td class="'.$col.$sort_class.'" id="rcm'.$col.'">' . "$col_name$sort</td>\n"; |
| | | else |
| | | $out .= '<td class="icon" id="rcm'.$col.'">' . "$col_name$sort</td>\n"; |
| | | } |
| | | |
| | | $out .= '<td class="icon">'.($attrib['attachmenticon'] ? sprintf($image_tag, $skin_path, $attrib['attachmenticon'], '') : ' ')."</td>\n"; |
| | | $out .= "</tr></thead>\n<tbody>\n"; |
| | | |
| | | // no messages in this mailbox |
| | |
| | | else |
| | | $cont = Q($header->$col); |
| | | |
| | | if ($col!='attachment') |
| | | $out .= '<td class="'.$col.'">' . $cont . "</td>\n"; |
| | | else |
| | | $out .= sprintf("<td class=\"icon\">%s</td>\n", $attach_icon ? sprintf($image_tag, $skin_path, $attach_icon, '') : ''); |
| | | } |
| | | |
| | | $out .= sprintf("<td class=\"icon\">%s</td>\n", $attach_icon ? sprintf($image_tag, $skin_path, $attach_icon, '') : ''); |
| | | $out .= "</tr>\n"; |
| | | |
| | | if (sizeof($js_row_arr)) |
| | |
| | | { |
| | | global $CONFIG, $IMAP, $OUTPUT; |
| | | |
| | | if (empty($_SESSION['list_columns'])) |
| | | $a_show_cols = is_array($CONFIG['list_cols']) ? $CONFIG['list_cols'] : array('subject'); |
| | | else |
| | | $a_show_cols = $_SESSION['list_columns']; |
| | | |
| | | $mbox = $IMAP->get_mailbox_name(); |
| | | |
| | | // show 'to' instead of from in sent messages |
| | |
| | | if (!empty($header->charset)) |
| | | $IMAP->set_charset($header->charset); |
| | | |
| | | // remove 'attachment' and 'flag' columns, we don't need them here |
| | | if(($key = array_search('attachment', $a_show_cols)) !== FALSE) |
| | | unset($a_show_cols[$key]); |
| | | if(($key = array_search('flag', $a_show_cols)) !== FALSE) |
| | | unset($a_show_cols[$key]); |
| | | |
| | | // format each col; similar as in rcmail_message_list() |
| | | foreach ($a_show_cols as $col) |
| | | { |
| | |
| | | <roundcube:object name="messages" |
| | | id="messagelist" |
| | | cellspacing="0" |
| | | columns="" |
| | | summary="Message list" |
| | | messageIcon="/images/icons/dot.png" |
| | | unreadIcon="/images/icons/unread.png" |