-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
29 lines (23 loc) · 747 Bytes
/
index.php
File metadata and controls
29 lines (23 loc) · 747 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php
if (!defined('PHPWS_SOURCE_DIR')) {
include '../../config/core/404.html';
exit();
}
//PHPWS_Core::initModClass('testing', 'Note.php');
PHPWS_Core::initModClass('testing', 'Pager.php');
$p = new Pager();
$p->setHeading("My fancy pager!");
$d = new DbDataSet();
$d->_db = new PHPWS_DB('test');
$d->_db->setIndexBy('id');
$p->setData($d);
$p->setParser(function($item){
return "item: ".$item['value'];
});
$p->setLinker(function($index, $window, $count){
return ($index*$window->getCount()+1).'-'.(($index+1)*$window->getCount()).($index < $count-1 ? ', ' : '');
});
Layout::add($p->getContent());
Layout::add("<p>Pages: ".$p->getPageCount()."</p>");
Layout::add("<p>Links: ".$p->getPageLinks()."</p>");
?>