* code for task#790.

* add pager for my-story page.
This commit is contained in:
chencongzhi520@gmail.com
2012-05-14 06:14:16 +00:00
parent c600c90706
commit 790796ddb8
2 changed files with 14 additions and 4 deletions
+13 -4
View File
@@ -88,22 +88,31 @@ class my extends control
}
/**
* My stories.
*
* My stories
* @param string $type
* @param int $recTotal
* @param int $recPerPage
* @param int $pageID
* @access public
* @return void
*/
public function story($type = 'assignedto')
public function story($type = 'assignedto', $recTotal = 0, $recPerPage = 20, $pageID = 1)
{
/* Save session. */
$this->session->set('storyList', $this->app->getURI(true));
/* Load pager. */
$this->app->loadClass('pager', $static = true);
$pager = pager::init($recTotal, $recPerPage, $pageID);
/* Assign. */
$this->view->header->title = $this->lang->my->common . $this->lang->colon . $this->lang->my->story;
$this->view->position[] = $this->lang->my->story;
$this->view->stories = $this->loadModel('story')->getUserStories($this->app->user->account, $type);
$this->view->stories = $this->loadModel('story')->getUserStories($this->app->user->account, $type, 'id_desc', $pager);
$this->view->users = $this->user->getPairs('noletter');
$this->view->type = $type;
$this->view->pager = $pager;
$this->display();
}
+1
View File
@@ -60,6 +60,7 @@
</tr>
<?php endforeach;?>
</tbody>
<tfoot><tr><td colspan='10'><?php echo $pager->show();?></td></tr></tfoot>
</table>
<script language='javascript'>$("#<?php echo $type;?>Tab").addClass('active');</script>
<?php include '../../common/view/footer.html.php';?>