* code for task#790.
* add pager for my-story page.
This commit is contained in:
+13
-4
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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';?>
|
||||
|
||||
Reference in New Issue
Block a user