1 | <?php |
---|
2 | /* |
---|
3 | * ----------------------------------------------------------------------------- |
---|
4 | * Plugin Name: Advanced MetaData |
---|
5 | * ----------------------------------------------------------------------------- |
---|
6 | * Author : Grum |
---|
7 | * email : grum@piwigo.org |
---|
8 | * website : http://photos.grum.fr |
---|
9 | * PWG user : http://forum.piwigo.org/profile.php?id=3706 |
---|
10 | * |
---|
11 | * << May the Little SpaceFrog be with you ! >> |
---|
12 | * |
---|
13 | * ----------------------------------------------------------------------------- |
---|
14 | * |
---|
15 | * See main.inc.php for release information |
---|
16 | * |
---|
17 | * ----------------------------------------------------------------------------- |
---|
18 | */ |
---|
19 | |
---|
20 | if (!defined('PHPWG_ROOT_PATH')) { die('Hacking attempt!'); } |
---|
21 | |
---|
22 | global $prefixeTable, $template; |
---|
23 | |
---|
24 | load_language('plugin.lang', AMD_PATH); |
---|
25 | |
---|
26 | $main_plugin_object = get_plugin_data($plugin_id); |
---|
27 | |
---|
28 | |
---|
29 | |
---|
30 | |
---|
31 | |
---|
32 | if(CommonPlugin::checkGPCRelease(AMD_GPC_NEEDED)) |
---|
33 | { |
---|
34 | $config=Array(); |
---|
35 | GPCCore::loadConfig('amd', $config); |
---|
36 | |
---|
37 | |
---|
38 | if(!isset($config['installed'])) $config['installed']='00.04.00'; |
---|
39 | if($config['installed']!=AMD_VERSION2) |
---|
40 | { |
---|
41 | /* the plugin was updated without being deactivated |
---|
42 | * deactivate + activate the plugin to process the database upgrade |
---|
43 | */ |
---|
44 | include(AMD_PATH."amd_install.class.inc.php"); |
---|
45 | $amd=new AMD_install($prefixeTable, dirname(__FILE__)); |
---|
46 | $amd->deactivate(); |
---|
47 | $amd->activate(); |
---|
48 | $template->delete_compiled_templates(); |
---|
49 | $config['newInstall']='n'; |
---|
50 | } |
---|
51 | |
---|
52 | /* |
---|
53 | * if the plugin is newly installed, display a special configuration page |
---|
54 | * otherwise, display normal page |
---|
55 | */ |
---|
56 | if($config['newInstall']=='n') |
---|
57 | { |
---|
58 | include(AMD_PATH."amd_aip.class.inc.php"); |
---|
59 | $plugin_ai = new AMD_AIP($prefixeTable, $main_plugin_object->getFileLocation());} |
---|
60 | else |
---|
61 | { |
---|
62 | include(AMD_PATH."amd_aip_install.class.inc.php"); |
---|
63 | $plugin_ai = new AMD_AIPInstall($prefixeTable, $main_plugin_object->getFileLocation()); |
---|
64 | } |
---|
65 | } |
---|
66 | else |
---|
67 | { |
---|
68 | /* |
---|
69 | * plugin was upgraded, but GPC was not |
---|
70 | * display a page to inform user to upgrade GPC |
---|
71 | */ |
---|
72 | include(AMD_PATH."amd_aip_release.class.inc.php"); |
---|
73 | $plugin_ai = new AMD_AIPRelease($prefixeTable, $main_plugin_object->getFileLocation()); |
---|
74 | } |
---|
75 | |
---|
76 | $plugin_ai->manage(); |
---|
77 | |
---|
78 | |
---|
79 | |
---|
80 | |
---|
81 | ?> |
---|