/** * Creates a new pagination object for the given folder. * * @param integer $id Folder id * * @return Pagination */ protected function getPagination($id) { /* @var Bengine_Game_Model_Collection_Message $messages */ $messages = Game::getCollection("game/message"); $messages->addReceiverFilter(Core::getUser()->get("userid"))->addFolderFilter($id); $pagination = new Pagination(Core::getOptions()->get("MAX_PMS"), $messages->getCalculatedSize(false)); $pagination->setMaxPagesToShow(Core::getConfig()->get("MAX_MESSAGE_PAGES")); return $pagination; }