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

Last change on this file since 8975 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
RevLine 
[3681]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
[5545]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');
[3681]14
15
[8962]16global $gpcInstalled, $lang; //needed for plugin manager compatibility
[5545]17
[3681]18/* -----------------------------------------------------------------------------
19AMM needs the Grum Plugin Classe
20----------------------------------------------------------------------------- */
[8962]21$gpcInstalled=false;
[5545]22if(file_exists(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/CommonPlugin.class.inc.php'))
[3681]23{
[5545]24  @include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/CommonPlugin.class.inc.php');
[8962]25  // need GPC release greater or equal than 3.3.3
26  if(CommonPlugin::checkGPCRelease(3,3,3))
[3681]27  {
28    @include_once("amm_install.class.inc.php");
[8962]29    $gpcInstalled=true;
[3681]30  }
31}
32
33function gpcMsgError(&$errors)
34{
[8962]35  $msg=sprintf(l10n('To install this plugin, you need to install Grum Plugin Classes %s before'), AMM_GPC_NEEDED);
[5545]36  if(is_array($errors))
37  {
38    array_push($errors, $msg);
39  }
40  else
41  {
42    $errors=Array($msg);
43  }
[3681]44}
45// -----------------------------------------------------------------------------
46
47
48
49load_language('plugin.lang', AMM_PATH);
50
[8962]51
52
[3681]53function plugin_install($plugin_id, $plugin_version, &$errors)
54{
[8962]55  global $prefixeTable, $gpcInstalled;
56  if($gpcInstalled)
[3681]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{
[8962]69  global $prefixeTable, $gpcInstalled;
70  if($gpcInstalled)
71  {
72    $amm=new AMM_install($prefixeTable, __FILE__);
73    $result=$amm->activate();
74  }
[3681]75}
76
77function plugin_deactivate($plugin_id)
78{
[8962]79  global $prefixeTable, $gpcInstalled;
80
81  if($gpcInstalled)
82  {
83    $amm=new AMM_install($prefixeTable, __FILE__);
84    $amm->deactivate();
85  }
[3681]86}
87
88function plugin_uninstall($plugin_id)
89{
[8962]90  global $prefixeTable, $gpcInstalled;
91  if($gpcInstalled)
[3681]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.