*/
function _get_sorted_msgs_list($imapConnection,&$aMailbox) {
$iSetIndx = (isset($aMailbox['SETINDEX'])) ? $aMailbox['SETINDEX'] : 0;
- $bDirection = ($aMailbox['SORT'] % 2);
+ $bDirection = !($aMailbox['SORT'] % 2);
$error = 0;
if (!$aMailbox['SEARCH'][$iSetIndx]) {
$aMailbox['SEARCH'][$iSetIndx] = 'ALL';
$aMailbox['PAGEOFFSET'] + $iLimit - 1 : $aMailbox['EXISTS'];
$iNumberOfMessages = $aMailbox['TOTAL'][$iSetIndx];
+ $iEnd = min ( $iEnd, $iNumberOfMessages );
$php_self = $PHP_SELF;
// FIX ME, before we support multiple templates we must review the names of the vars
-
$aTemplate['color'] = $color;
$aTemplate['form_name'] = "FormMsgs" . $safe_name;
$aTemplate['form_id'] = 'mbx_'.$iFormId;
$aTemplate['alt_index_colors'] = (isset($aProps['config']['alt_index_colors'])) ? $aProps['config']['alt_index_colors'] : false;
$aTemplate['fancy_index_highlite'] = $fancy_index_highlite;
+
return $aTemplate;
}