1 | <?php |
---|
2 | /* ----------------------------------------------------------------------------- |
---|
3 | Plugin : GMaps |
---|
4 | Author : Grum |
---|
5 | email : grum@piwigo.org |
---|
6 | website : http://photos.grum.fr |
---|
7 | |
---|
8 | << May the Little SpaceFrog be with you ! >> |
---|
9 | ------------------------------------------------------------------------------ |
---|
10 | See main.inc.php for release information |
---|
11 | |
---|
12 | GMaps_root : common classe for admin and public classes |
---|
13 | |
---|
14 | --------------------------------------------------------------------------- */ |
---|
15 | include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/CommonPlugin.class.inc.php'); |
---|
16 | |
---|
17 | class GMaps_root extends CommonPlugin |
---|
18 | { |
---|
19 | protected $css; |
---|
20 | |
---|
21 | public function __construct($prefixeTable, $filelocation) |
---|
22 | { |
---|
23 | $this->setPluginName('GMaps'); |
---|
24 | $this->setPluginNameFiles("gmaps"); |
---|
25 | parent::__construct($prefixeTable, $filelocation); |
---|
26 | $this->section_name=$this->getPluginNameFiles(); |
---|
27 | |
---|
28 | $this->setTablesList(array('maps', 'category_maps')); |
---|
29 | $this->css = new GPCCss(dirname($this->getFileLocation()).'/'.$this->getPluginNameFiles().".css"); |
---|
30 | } |
---|
31 | |
---|
32 | public function __destruct() |
---|
33 | { |
---|
34 | parent::__destruct(); |
---|
35 | } |
---|
36 | |
---|
37 | public function initEvents() |
---|
38 | { |
---|
39 | add_event_handler('blockmanager_register_blocks', array(&$this, 'register_blocks') ); |
---|
40 | } |
---|
41 | |
---|
42 | |
---|
43 | /* |
---|
44 | surchage of CommonPlugin->saveConfig function |
---|
45 | */ |
---|
46 | public function saveConfig() |
---|
47 | { |
---|
48 | if(parent::saveConfig()) |
---|
49 | { |
---|
50 | return(true); |
---|
51 | } |
---|
52 | return(false); |
---|
53 | } |
---|
54 | |
---|
55 | /* |
---|
56 | surchage of CommonPlugin->saveConfig function |
---|
57 | */ |
---|
58 | public function loadConfig() |
---|
59 | { |
---|
60 | parent::loadConfig(); |
---|
61 | } |
---|
62 | |
---|
63 | /* |
---|
64 | intialize default values |
---|
65 | */ |
---|
66 | public function initConfig() |
---|
67 | { |
---|
68 | //global $user; |
---|
69 | $this->config=array( |
---|
70 | ); |
---|
71 | } |
---|
72 | |
---|
73 | |
---|
74 | /** |
---|
75 | * |
---|
76 | */ |
---|
77 | protected function configForTemplate() |
---|
78 | { |
---|
79 | global $template; |
---|
80 | |
---|
81 | $template->assign('gmapsConfig', $this->config); |
---|
82 | } |
---|
83 | |
---|
84 | |
---|
85 | public function getAdminLink($mode='') |
---|
86 | { |
---|
87 | if($mode=='ajax') |
---|
88 | { |
---|
89 | return('plugins/'.basename(dirname($this->getFileLocation())).'/gmaps_ajax.php'); |
---|
90 | } |
---|
91 | else |
---|
92 | { |
---|
93 | return(parent::getAdminLink()); |
---|
94 | } |
---|
95 | } |
---|
96 | |
---|
97 | protected function displayResult($action_msg, $result) |
---|
98 | { |
---|
99 | global $page; |
---|
100 | |
---|
101 | if($result) |
---|
102 | { |
---|
103 | array_push($page['infos'], $action_msg); |
---|
104 | } |
---|
105 | else |
---|
106 | { |
---|
107 | array_push($page['errors'], $action_msg); |
---|
108 | } |
---|
109 | } |
---|
110 | |
---|
111 | |
---|
112 | /* --------------------------------------------------------------------------- |
---|
113 | ajax functions |
---|
114 | --------------------------------------------------------------------------- */ |
---|
115 | |
---|
116 | |
---|
117 | } //class |
---|
118 | |
---|
119 | ?> |
---|