forked from vatseek/geopost
-
Notifications
You must be signed in to change notification settings - Fork 0
/
PluginGeopost.class.php
68 lines (61 loc) · 2.22 KB
/
PluginGeopost.class.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
<?php
/*-------------------------------------------------------
*
* LiveStreet Plugin Geopost
* Copyright © 2008 Vadim Gumennyj
*
*--------------------------------------------------------
*
* Official site: www.livestreet.ru
* Contact e-mail: vadim.gumennyj@gmail.com
*
* GNU General Public License, version 2:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
*
---------------------------------------------------------
*/
/**
* Запрещаем напрямую через браузер обращение к этому файлу.
*/
if (!class_exists('Plugin')) {
die('Hacking attempt!');
}
class PluginGeopost extends Plugin
{
protected $aInherits = array(
'action' => array(
'ActionAjax' => '_ActionAjax',
),
'module' => array(
'ModuleTopic' => '_ModuleTopic',
),
'entity' => array(
'ModuleTopic_EntityTopic' => '_ModuleTopic_EntityTopic',
),
'mapper' => array(
'ModuleTopic_MapperTopic' => '_ModuleTopic_MapperTopic',
),
);
public function Activate()
{
if (!$this->isFieldExists(Config::Get('db.table.topic'), 'long')) {
$this->ExportSQL(dirname(__FILE__) . '/install.sql');
}
return true;
}
/**
* Инициализация плагина
*/
public function Init()
{
$this->Viewer_Assign('sGeoPostPluginPath', Plugin::GetTemplatePath(__CLASS__));
$this->Viewer_AppendScript('http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.js');
$this->Viewer_AppendScript(Plugin::GetTemplateWebPath(__CLASS__) . 'js/leaflet.markercluster.js');
$this->Viewer_AppendScript(Plugin::GetTemplateWebPath(__CLASS__) . 'js/geopost.js');
$this->Viewer_AppendStyle('http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css');
$this->Viewer_AppendStyle(Plugin::GetTemplateWebPath(__CLASS__) . 'css/geopost.css');
$this->Viewer_AppendStyle(Plugin::GetTemplateWebPath(__CLASS__) . 'css/cluster.css');
$this->Viewer_AppendScript(Plugin::GetTemplateWebPath(__CLASS__) . 'js/Leaflet.fullscreen.min.js');
$this->Viewer_AppendStyle(Plugin::GetTemplateWebPath(__CLASS__) . 'css/leaflet.fullscreen.css');
}
}