-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMallMapPlugin.php
70 lines (62 loc) · 1.59 KB
/
MallMapPlugin.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<?php
/**
* Mall Map
*
* @copyright Copyright 2007-2012 Roy Rosenzweig Center for History and New Media
* @license http://www.gnu.org/licenses/gpl-3.0.txt GNU GPLv3
*/
/**
* The Mall Map plugin.
*
* @package Omeka\Plugins\Mall
*/
class MallMapPlugin extends Omeka_Plugin_AbstractPlugin
{
protected $_hooks = array(
'define_routes',
'config',
'config_form'
);
protected $_filters = array(
'public_navigation_main',
);
protected $_options = array(
'mall_map_filter_tooltip' => '',
'mall_map_tooltip_button' => 'OK'
);
/**
* Display the plugin config form.
*/
public function hookConfigForm()
{
require dirname(__FILE__) . '/config_form.php';
}
/**
* Set the options from the config form input.
*/
public function hookConfig()
{
set_option('mall_map_filter_tooltip', $_POST['mall_map_filter_tooltip']);
set_option('mall_map_tooltip_button', $_POST['mall_map_tooltip_button']);
}
public function hookDefineRoutes($args)
{
if (is_admin_theme()) {
return;
}
$args['router']->addRoute('mall_map',
new Zend_Controller_Router_Route('map',
array(
'module' => 'mall-map',
'controller' => 'index',
'action' => 'index',
)
)
);
}
public function filterPublicNavigationMain($nav)
{
$nav[] = array('label' => 'Map', 'uri' => url('map'));
return $nav;
}
}