[5550] | 1 | <?php |
---|
| 2 | |
---|
| 3 | if (!defined('PHPWG_ROOT_PATH')) { die('Hacking attempt!'); } |
---|
| 4 | |
---|
[7387] | 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 | |
---|
[5550] | 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 !! |
---|
[6106] | 13 | include_once('gpc_install.class.inc.php'); // => Don't forget to update this file !! |
---|
[5550] | 14 | |
---|
| 15 | |
---|
| 16 | |
---|
| 17 | function plugin_install($plugin_id, $plugin_version, &$errors) |
---|
| 18 | { |
---|
[6106] | 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); |
---|
[5550] | 28 | } |
---|
| 29 | |
---|
| 30 | function plugin_activate($plugin_id, $plugin_version, &$errors) |
---|
| 31 | { |
---|
[6975] | 32 | global $prefixeTable; |
---|
| 33 | |
---|
[6902] | 34 | $obj = new GPC_Install($prefixeTable, __FILE__); |
---|
| 35 | $result=$obj->activate(); |
---|
| 36 | if(!$result) |
---|
| 37 | { |
---|
| 38 | array_push($errors, "error"); |
---|
| 39 | } |
---|
| 40 | unset($obj); |
---|
[5550] | 41 | } |
---|
| 42 | |
---|
| 43 | function plugin_deactivate($plugin_id) |
---|
| 44 | { |
---|
[6975] | 45 | global $prefixeTable; |
---|
| 46 | |
---|
| 47 | $obj = new GPC_Install($prefixeTable, __FILE__); |
---|
| 48 | $result=$obj->deactivate(); |
---|
[5550] | 49 | } |
---|
| 50 | |
---|
| 51 | function plugin_uninstall($plugin_id) |
---|
| 52 | { |
---|
[6106] | 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); |
---|
[5550] | 65 | } |
---|
| 66 | |
---|
| 67 | |
---|
| 68 | ?> |
---|