function list3Action() { $catalogGuid = $this->_getParam('guid') ? $this->_getParam('guid') : ''; $page = $this->_getParam('page') ? $this->_getParam('page') : 1; $limit = 10; $start = $limit * ($page - 1); sleep(2); $modelCatalog = new Pandamp_Modules_Dms_Catalog_Model_Catalog(); $decorator = new Pandamp_BeanContext_Decorator($modelCatalog); $rowset = $decorator->getCatalogByGuidAsEntity($catalogGuid); $st = $rowset->getShortTitle(); $modelComment = new Pandamp_Modules_Extension_Comment_Model_Comment(); $decorator = new Pandamp_BeanContext_Decorator($modelComment); $rows = $decorator->getCommentByGuidwAjaxAsEntity($catalogGuid, $start, $limit); $tree = new Pandamp_Lib_TuneTree($rows); $items = $tree->get(); $num_rows = $modelComment->getCommentCount($catalogGuid); $numPage = ceil($num_rows / $limit); $pagination = ''; for ($i = 1; $i <= $numPage; $i++) { $pagination .= "<li><a href='/berita/baca/{$catalogGuid}/{$st}/p/{$i}' title='Halaman {$i}' rev='{$i}'>{$i}</a></li>"; } $this->view->rows = $items; // check is AJAX request or not if (!$this->getRequest()->isXmlHttpRequest()) { $this->view->pagination = $pagination; } $this->view->catalogGuid = $catalogGuid; $this->view->parent = $rows ? $rows[0]->getParent() : 0; }