/
PaginatePlugin.php
40 lines (31 loc) · 1015 Bytes
/
PaginatePlugin.php
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
30
31
32
33
34
35
36
37
38
39
40
<?php
/**
* Plugin to paginage results on the show action of the collections controller.
*/
class PaginatePlugin extends Omeka_Plugin_AbstractPlugin
{
/**
* @var array Hooks for the plugin.
*/
// NB: The following overrides default requests for collections#show pages
protected $_hooks = array('define_routes');
protected $_filters = array('public_navigation_main');
public function hookDefineRoutes($args)
{
$router = $args['router'];
$paginate_route = new Zend_Controller_Router_Route(
'collections/show/:id',
array('module' => 'paginate',
'controller' => 'paginate',
'action' => 'show'));
$router -> addRoute('paginate_show', $paginate_route);
}
public function filterPublicNavigationMain($navArray)
{
$navArray["Show Paginate"] = array(
"label" => __("Show Paginate"),
"uri" => url("paginate")
);
return $navArray;
}
}