1 | <?php |
---|
2 | /* ----------------------------------------------------------------------------- |
---|
3 | Plugin : GMaps |
---|
4 | Author : Grum |
---|
5 | email : grum@piwigo.org |
---|
6 | website : http://www.grum.fr |
---|
7 | |
---|
8 | << May the Little SpaceFrog be with you ! >> |
---|
9 | ------------------------------------------------------------------------------ |
---|
10 | See main.inc.php for release information |
---|
11 | |
---|
12 | --------------------------------------------------------------------------- */ |
---|
13 | |
---|
14 | if (!defined('PHPWG_ROOT_PATH')) { die('Hacking attempt!'); } |
---|
15 | |
---|
16 | |
---|
17 | |
---|
18 | global $prefixeTable, $template; |
---|
19 | |
---|
20 | load_language('plugin.lang', ESTAT_PATH); |
---|
21 | |
---|
22 | $main_plugin_object = get_plugin_data($plugin_id); |
---|
23 | |
---|
24 | |
---|
25 | if(CommonPlugin::checkGPCRelease(ESTAT_GPC_NEEDED)) |
---|
26 | { |
---|
27 | $config=Array(); |
---|
28 | GPCCore::loadConfig('estat', $config); |
---|
29 | |
---|
30 | |
---|
31 | if($config['installed']!=ESTAT_VERSION2) |
---|
32 | { |
---|
33 | /* the plugin was updated without being deactivated |
---|
34 | * deactivate + activate the plugin to process the database upgrade |
---|
35 | */ |
---|
36 | include(ESTAT_PATH."estat_install.class.inc.php"); |
---|
37 | $plugin=new EStat_Install($prefixeTable, dirname(__FILE__)); |
---|
38 | $plugin->deactivate(); |
---|
39 | $plugin->activate(); |
---|
40 | $template->delete_compiled_templates(); |
---|
41 | //$config['newInstall']='n'; |
---|
42 | } |
---|
43 | |
---|
44 | |
---|
45 | /* |
---|
46 | * if the plugin is newly installed, display a special configuration page |
---|
47 | * otherwise, display normal page |
---|
48 | */ |
---|
49 | if($config['plugin.newInstall']=='n') |
---|
50 | { |
---|
51 | include(ESTAT_PATH."estat_aip.class.inc.php"); |
---|
52 | $plugin_aip = new EStat_AIP($prefixeTable, $main_plugin_object->getFileLocation()); |
---|
53 | } |
---|
54 | else |
---|
55 | { |
---|
56 | include(ESTAT_PATH."estat_aip_install.class.inc.php"); |
---|
57 | $plugin_aip = new EStat_AIPInstall($prefixeTable, $main_plugin_object->getFileLocation()); |
---|
58 | } |
---|
59 | } |
---|
60 | else |
---|
61 | { |
---|
62 | /* |
---|
63 | * plugin was upgraded, but GPC was not |
---|
64 | * display a page to inform user to upgrade GPC |
---|
65 | */ |
---|
66 | include(ESTAT_PATH."estat_aip_release.class.inc.php"); |
---|
67 | $plugin_aip = new EStat_AIPRelease($prefixeTable, $main_plugin_object->getFileLocation()); |
---|
68 | } |
---|
69 | |
---|
70 | $plugin_aip->manage(); |
---|
71 | |
---|
72 | ?> |
---|