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

Last change on this file since 3779 was 3681, checked in by grum, 15 years ago

Add plugin Advanced Menu Manager 2.1.0

  • Property svn:executable set to *
File size: 1.9 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@include_once(PHPWG_PLUGINS_PATH.'grum_plugins_classes-2/tables.class.inc.php');
11
12
13global $gpc_installed, $lang; //needed for plugin manager compatibility
14
15/* -----------------------------------------------------------------------------
16AMM needs the Grum Plugin Classe
17----------------------------------------------------------------------------- */
18$gpc_installed=false;
19if(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
31function 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
39load_language('plugin.lang', AMM_PATH);
40
41function 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
57function plugin_activate($plugin_id, $plugin_version, &$errors)
58{
59}
60
61function plugin_deactivate($plugin_id)
62{
63}
64
65function 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?>
Note: See TracBrowser for help on using the repository browser.