// cache
$ret = array();
$cacheUsed = false;
if($forceRefresh == 'false' && $this->validCacheExists($this->mailbox)) {
$emailSettings = $current_user->getPreference('emailSettings', 'Emails');
// cn: default to a low number until user specifies otherwise
if(empty($emailSettings['showNumInList'])) {
$emailSettings['showNumInList'] = 20;
}
//*****THIS IS THE FIX: modification to address issue where email list wasn't sorting correctly
$sort = 'date';
$direction = 'desc';
//*****END OF THE FIX
$ret = $this->getCacheValue($this->mailbox, $emailSettings['showNumInList'], $page, $sort, $direction);
$cacheUsed = true;
}
$out = $this->displayFetchedSortedListXML($ret, $mbox);
$metadata = array();
$metadata['mbox'] = $mbox;
$metadata['ieId'] = $this->id;
$metadata['name'] = $this->name;
$metadata['fromCache'] = $cacheUsed ? 1 : 0;
$metadata['out'] = $out;
return $metadata;
}
/**
* For a group email account, create subscriptions for all users associated with the
Bookmarks