source: extensions/lmt/maintain.inc.php @ 12156

Last change on this file since 12156 was 10974, checked in by grum, 14 years ago

feature:2150 - Compatibility with Piwigo 2.2

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