source: extensions/AMenuManager/maintain.inc.php @ 8962

Last change on this file since 8962 was 8962, checked in by grum, 13 years ago

release 3.0.0
fix bug:1716, bug:2128, bug:1296, bug:2052, bug:1910, bug:1723, bug:1709, bug:1680, bug:1477, bug:2129
rewrite plugin core, implement ajax interface, optimize JS

  • Property svn:executable set to *
File size: 2.4 KB
Line 
1<?php
2
3if (!defined('PHPWG_ROOT_PATH')) { die('Hacking attempt!'); }
4
5//ini_set('error_reporting', E_ALL);
6//ini_set('display_errors', true);
7
8defined('AMM_DIR') || define('AMM_DIR' , basename(dirname(__FILE__)));
9defined('AMM_PATH') || define('AMM_PATH' , PHPWG_PLUGINS_PATH . AMM_DIR . '/');
10
11include_once('amm_version.inc.php'); // => Don't forget to update this file !!
12include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCCore.class.inc.php');
13include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCTables.class.inc.php');
14
15
16global $gpcInstalled, $lang; //needed for plugin manager compatibility
17
18/* -----------------------------------------------------------------------------
19AMM needs the Grum Plugin Classe
20----------------------------------------------------------------------------- */
21$gpcInstalled=false;
22if(file_exists(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/CommonPlugin.class.inc.php'))
23{
24  @include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/CommonPlugin.class.inc.php');
25  // need GPC release greater or equal than 3.3.3
26  if(CommonPlugin::checkGPCRelease(3,3,3))
27  {
28    @include_once("amm_install.class.inc.php");
29    $gpcInstalled=true;
30  }
31}
32
33function gpcMsgError(&$errors)
34{
35  $msg=sprintf(l10n('To install this plugin, you need to install Grum Plugin Classes %s before'), AMM_GPC_NEEDED);
36  if(is_array($errors))
37  {
38    array_push($errors, $msg);
39  }
40  else
41  {
42    $errors=Array($msg);
43  }
44}
45// -----------------------------------------------------------------------------
46
47
48
49load_language('plugin.lang', AMM_PATH);
50
51
52
53function plugin_install($plugin_id, $plugin_version, &$errors)
54{
55  global $prefixeTable, $gpcInstalled;
56  if($gpcInstalled)
57  {
58    $amm=new AMM_install($prefixeTable, __FILE__);
59    $result=$amm->install();
60  }
61  else
62  {
63    gpcMsgError($errors);
64  }
65}
66
67function plugin_activate($plugin_id, $plugin_version, &$errors)
68{
69  global $prefixeTable, $gpcInstalled;
70  if($gpcInstalled)
71  {
72    $amm=new AMM_install($prefixeTable, __FILE__);
73    $result=$amm->activate();
74  }
75}
76
77function plugin_deactivate($plugin_id)
78{
79  global $prefixeTable, $gpcInstalled;
80
81  if($gpcInstalled)
82  {
83    $amm=new AMM_install($prefixeTable, __FILE__);
84    $amm->deactivate();
85  }
86}
87
88function plugin_uninstall($plugin_id)
89{
90  global $prefixeTable, $gpcInstalled;
91  if($gpcInstalled)
92  {
93    $amm=new AMM_install($prefixeTable, __FILE__);
94    $result=$amm->uninstall();
95  }
96  else
97  {
98    gpcMsgError($errors);
99  }
100}
101
102
103?>
Note: See TracBrowser for help on using the repository browser.