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 | */ |
---|
16 | |
---|
17 | if (!defined('PHPWG_ROOT_PATH')) { die('Hacking attempt!'); } |
---|
18 | |
---|
19 | //ini_set('error_reporting', E_ALL); |
---|
20 | //ini_set('display_errors', true); |
---|
21 | |
---|
22 | defined('AMD_DIR') || define('AMD_DIR' , basename(dirname(__FILE__))); |
---|
23 | defined('AMD_PATH') || define('AMD_PATH' , PHPWG_PLUGINS_PATH . AMD_DIR . '/'); |
---|
24 | @include_once(PHPWG_PLUGINS_PATH.'grum_plugins_classes-2/tables.class.inc.php'); |
---|
25 | |
---|
26 | |
---|
27 | global $gpc_installed, $lang; //needed for plugin manager compatibility |
---|
28 | |
---|
29 | /* ----------------------------------------------------------------------------- |
---|
30 | AMD needs the Grum Plugin Classe |
---|
31 | ----------------------------------------------------------------------------- */ |
---|
32 | $gpc_installed=false; |
---|
33 | if(file_exists(PHPWG_PLUGINS_PATH.'grum_plugins_classes-2/common_plugin.class.inc.php')) |
---|
34 | { |
---|
35 | @include_once(PHPWG_PLUGINS_PATH.'grum_plugins_classes-2/main.inc.php'); |
---|
36 | // need GPC release greater or equal than 2.0.4 |
---|
37 | |
---|
38 | if(checkGPCRelease(2,0,4)) |
---|
39 | { |
---|
40 | @include_once("amd_install.class.inc.php"); |
---|
41 | $gpc_installed=true; |
---|
42 | } |
---|
43 | } |
---|
44 | |
---|
45 | function gpcMsgError(&$errors) |
---|
46 | { |
---|
47 | array_push($errors, sprintf(l10n('Grum Plugin Classes is not installed (release >= %s)'), "2.0.4")); |
---|
48 | } |
---|
49 | // ----------------------------------------------------------------------------- |
---|
50 | |
---|
51 | |
---|
52 | |
---|
53 | load_language('plugin.lang', AMD_PATH); |
---|
54 | |
---|
55 | function plugin_install($plugin_id, $plugin_version, &$errors) |
---|
56 | { |
---|
57 | global $prefixeTable, $gpc_installed; |
---|
58 | if($gpc_installed) |
---|
59 | { |
---|
60 | $amd=new AMD_install($prefixeTable, __FILE__); |
---|
61 | $result=$amd->install(); |
---|
62 | } |
---|
63 | else |
---|
64 | { |
---|
65 | gpcMsgError($errors); |
---|
66 | } |
---|
67 | } |
---|
68 | |
---|
69 | function plugin_activate($plugin_id, $plugin_version, &$errors) |
---|
70 | { |
---|
71 | global $prefixeTable; |
---|
72 | |
---|
73 | $amd=new AMD_install($prefixeTable, __FILE__); |
---|
74 | $result=$amd->activate(); |
---|
75 | } |
---|
76 | |
---|
77 | function plugin_deactivate($plugin_id) |
---|
78 | { |
---|
79 | } |
---|
80 | |
---|
81 | function plugin_uninstall($plugin_id) |
---|
82 | { |
---|
83 | global $prefixeTable, $gpc_installed; |
---|
84 | if($gpc_installed) |
---|
85 | { |
---|
86 | $amd=new AMD_install($prefixeTable, __FILE__); |
---|
87 | $result=$amd->uninstall(); |
---|
88 | } |
---|
89 | else |
---|
90 | { |
---|
91 | gpcMsgError($errors); |
---|
92 | } |
---|
93 | } |
---|
94 | |
---|
95 | |
---|
96 | |
---|
97 | ?> |
---|