1 | <?php |
---|
2 | |
---|
3 | if (!defined('PHPWG_ROOT_PATH')) { die('Hacking attempt!'); } |
---|
4 | |
---|
5 | //ini_set('error_reporting', E_ALL); |
---|
6 | //ini_set('display_errors', true); |
---|
7 | |
---|
8 | defined('AMM_DIR') || define('AMM_DIR' , basename(dirname(__FILE__))); |
---|
9 | defined('AMM_PATH') || define('AMM_PATH' , PHPWG_PLUGINS_PATH . AMM_DIR . '/'); |
---|
10 | @include_once(PHPWG_PLUGINS_PATH.'grum_plugins_classes-2/tables.class.inc.php'); |
---|
11 | |
---|
12 | |
---|
13 | global $gpc_installed, $lang; //needed for plugin manager compatibility |
---|
14 | |
---|
15 | /* ----------------------------------------------------------------------------- |
---|
16 | AMM needs the Grum Plugin Classe |
---|
17 | ----------------------------------------------------------------------------- */ |
---|
18 | $gpc_installed=false; |
---|
19 | if(file_exists(PHPWG_PLUGINS_PATH.'grum_plugins_classes-2/common_plugin.class.inc.php')) |
---|
20 | { |
---|
21 | @include_once(PHPWG_PLUGINS_PATH.'grum_plugins_classes-2/main.inc.php'); |
---|
22 | // need GPC release greater or equal than 2.0.3 |
---|
23 | |
---|
24 | if(checkGPCRelease(2,0,3)) |
---|
25 | { |
---|
26 | @include_once("amm_install.class.inc.php"); |
---|
27 | $gpc_installed=true; |
---|
28 | } |
---|
29 | } |
---|
30 | |
---|
31 | function gpcMsgError(&$errors) |
---|
32 | { |
---|
33 | array_push($errors, sprintf(l10n('Grum Plugin Classes is not installed (release >= %s)'), "2.0.3")); |
---|
34 | } |
---|
35 | // ----------------------------------------------------------------------------- |
---|
36 | |
---|
37 | |
---|
38 | |
---|
39 | load_language('plugin.lang', AMM_PATH); |
---|
40 | |
---|
41 | function plugin_install($plugin_id, $plugin_version, &$errors) |
---|
42 | { |
---|
43 | global $prefixeTable, $gpc_installed; |
---|
44 | if($gpc_installed) |
---|
45 | { |
---|
46 | //$menu->register('mbAMM_links', 'Links', 0, 'AMM'); |
---|
47 | //$menu->register('mbAMM_randompict', 'Random pictures', 0, 'AMM'); |
---|
48 | $amm=new AMM_install($prefixeTable, __FILE__); |
---|
49 | $result=$amm->install(); |
---|
50 | } |
---|
51 | else |
---|
52 | { |
---|
53 | gpcMsgError($errors); |
---|
54 | } |
---|
55 | } |
---|
56 | |
---|
57 | function plugin_activate($plugin_id, $plugin_version, &$errors) |
---|
58 | { |
---|
59 | } |
---|
60 | |
---|
61 | function plugin_deactivate($plugin_id) |
---|
62 | { |
---|
63 | } |
---|
64 | |
---|
65 | function plugin_uninstall($plugin_id) |
---|
66 | { |
---|
67 | global $prefixeTable; |
---|
68 | if($gpc_installed) |
---|
69 | { |
---|
70 | $amm=new AMM_install($prefixeTable, __FILE__); |
---|
71 | $result=$amm->uninstall(); |
---|
72 | } |
---|
73 | else |
---|
74 | { |
---|
75 | gpcMsgError($errors); |
---|
76 | } |
---|
77 | } |
---|
78 | |
---|
79 | |
---|
80 | |
---|
81 | ?> |
---|