1 | <?php |
---|
2 | |
---|
3 | if (!defined('PHPWG_ROOT_PATH')) { die('Hacking attempt!'); } |
---|
4 | |
---|
5 | if(!defined('GPC_DIR')) define('GPC_DIR' , basename(dirname(__FILE__))); |
---|
6 | if(!defined('GPC_PATH')) define('GPC_PATH' , PHPWG_PLUGINS_PATH . GPC_DIR . '/'); |
---|
7 | |
---|
8 | |
---|
9 | // ini_set('error_reporting', E_ALL); |
---|
10 | // ini_set('display_errors', true); |
---|
11 | |
---|
12 | include_once('gpc_version.inc.php'); // => Don't forget to update this file !! |
---|
13 | include_once('gpc_install.class.inc.php'); // => Don't forget to update this file !! |
---|
14 | |
---|
15 | |
---|
16 | |
---|
17 | function plugin_install($plugin_id, $plugin_version, &$errors) |
---|
18 | { |
---|
19 | global $prefixeTable; |
---|
20 | |
---|
21 | $obj = new GPC_Install($prefixeTable, __FILE__); |
---|
22 | $result=$obj->install(); |
---|
23 | if(!$result) |
---|
24 | { |
---|
25 | array_push($errors, "error"); |
---|
26 | } |
---|
27 | unset($obj); |
---|
28 | } |
---|
29 | |
---|
30 | function plugin_activate($plugin_id, $plugin_version, &$errors) |
---|
31 | { |
---|
32 | global $prefixeTable; |
---|
33 | |
---|
34 | $obj = new GPC_Install($prefixeTable, __FILE__); |
---|
35 | $result=$obj->activate(); |
---|
36 | if(!$result) |
---|
37 | { |
---|
38 | array_push($errors, "error"); |
---|
39 | } |
---|
40 | unset($obj); |
---|
41 | } |
---|
42 | |
---|
43 | function plugin_deactivate($plugin_id) |
---|
44 | { |
---|
45 | global $prefixeTable; |
---|
46 | |
---|
47 | $obj = new GPC_Install($prefixeTable, __FILE__); |
---|
48 | $result=$obj->deactivate(); |
---|
49 | } |
---|
50 | |
---|
51 | function plugin_uninstall($plugin_id) |
---|
52 | { |
---|
53 | global $prefixeTable; |
---|
54 | |
---|
55 | $obj = new GPC_Install($prefixeTable, __FILE__); |
---|
56 | $result=$obj->uninstall(); |
---|
57 | /* |
---|
58 | * piwigo don't alllow to manage errors during the uninstall process... |
---|
59 | if(!$result or is_string($result)) |
---|
60 | { |
---|
61 | array_push($errors, l10n($result)); |
---|
62 | } |
---|
63 | */ |
---|
64 | unset($obj); |
---|
65 | } |
---|
66 | |
---|
67 | |
---|
68 | ?> |
---|