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

Last change on this file since 13450 was 10255, checked in by grum, 14 years ago

bug:2144
Compatibility with Piwigo 2.2 (fix css problem + GPC 3.5 needed)

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