-
Notifications
You must be signed in to change notification settings - Fork 2
/
UserCountryMapIslandora.php
61 lines (54 loc) · 2.1 KB
/
UserCountryMapIslandora.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
<?php
/**
* Piwik - free/libre analytics platform
*
* @link https://matomo.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*
*/
namespace Piwik\Plugins\UserCountryMapIslandora;
use \Piwik\FrontController;
use \Piwik\Piwik;
use \Piwik\Plugins\UserCountryMap;
/**
*/
class UserCountryMapIslandora extends \Piwik\Plugin
{
public function postLoad()
{
Piwik::addAction('Template.leftColumnUserCountry', array('Piwik\Plugins\UserCountryMapIslandora\UserCountryMapIslandora', 'insertMapInLocationReport'));
}
public static function insertMapInLocationReport(&$out)
{
$out = '<h2>' . Piwik::translate('UserCountryMapIslandora_VisitorMap') . '</h2>';
$out .= FrontController::getInstance()->fetchDispatch('UserCountryMapIslandora', 'visitorMap');
}
public function registerEvents()
{
$hooks = array(
'AssetManager.getJavaScriptFiles' => 'getJsFiles',
'AssetManager.getStylesheetFiles' => 'getStylesheetFiles',
'Translate.getClientSideTranslationKeys' => 'getClientSideTranslationKeys'
);
return $hooks;
}
public function getJsFiles(&$jsFiles)
{
$jsFiles[] = "libs/bower_components/visibilityjs/lib/visibility.core.js";
$jsFiles[] = "plugins/UserCountryMapIslandora/javascripts/vendor/raphael.min.js";
$jsFiles[] = "plugins/UserCountryMapIslandora/javascripts/vendor/jquery.qtip.min.js";
$jsFiles[] = "plugins/UserCountryMapIslandora/javascripts/vendor/kartograph.min.js";
$jsFiles[] = "libs/bower_components/chroma-js/chroma.min.js";
$jsFiles[] = "plugins/UserCountryMapIslandora/javascripts/visitor-map.js";
}
public function getStylesheetFiles(&$stylesheets)
{
$stylesheets[] = "plugins/UserCountryMapIslandora/stylesheets/visitor-map.less";
}
public function getClientSideTranslationKeys(&$translationKeys)
{
$translationKeys[] = 'UserCountryMapIslandora_WithUnknownRegion';
$translationKeys[] = 'UserCountryMapIslandora_WithUnknownCity';
$translationKeys[] = 'General_UserId';
}
}