source: extensions/AMetaData/maintain.inc.php @ 4905

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

Commit a first release of the plugin for piwigo using the JpegMetaData classe

  • Property svn:executable set to *
File size: 2.4 KB
Line 
1<?php
2/*
3 * -----------------------------------------------------------------------------
4 * Plugin Name: Advanced MetaData
5 * -----------------------------------------------------------------------------
6 * Author     : Grum
7 *   email    : grum@piwigo.org
8 *   website  : http://photos.grum.fr
9 *   PWG user : http://forum.piwigo.org/profile.php?id=3706
10 *
11 *   << May the Little SpaceFrog be with you ! >>
12 *
13 * -----------------------------------------------------------------------------
14 *
15 */
16
17if (!defined('PHPWG_ROOT_PATH')) { die('Hacking attempt!'); }
18
19//ini_set('error_reporting', E_ALL);
20//ini_set('display_errors', true);
21
22defined('AMD_DIR') || define('AMD_DIR' , basename(dirname(__FILE__)));
23defined('AMD_PATH') || define('AMD_PATH' , PHPWG_PLUGINS_PATH . AMD_DIR . '/');
24@include_once(PHPWG_PLUGINS_PATH.'grum_plugins_classes-2/tables.class.inc.php');
25
26
27global $gpc_installed, $lang; //needed for plugin manager compatibility
28
29/* -----------------------------------------------------------------------------
30AMD needs the Grum Plugin Classe
31----------------------------------------------------------------------------- */
32$gpc_installed=false;
33if(file_exists(PHPWG_PLUGINS_PATH.'grum_plugins_classes-2/common_plugin.class.inc.php'))
34{
35  @include_once(PHPWG_PLUGINS_PATH.'grum_plugins_classes-2/main.inc.php');
36  // need GPC release greater or equal than 2.0.4
37
38  if(checkGPCRelease(2,0,4))
39  {
40    @include_once("amd_install.class.inc.php");
41    $gpc_installed=true;
42  }
43}
44
45function gpcMsgError(&$errors)
46{
47  array_push($errors, sprintf(l10n('Grum Plugin Classes is not installed (release >= %s)'), "2.0.4"));
48}
49// -----------------------------------------------------------------------------
50
51
52
53load_language('plugin.lang', AMD_PATH);
54
55function plugin_install($plugin_id, $plugin_version, &$errors)
56{
57  global $prefixeTable, $gpc_installed;
58  if($gpc_installed)
59  {
60    $amd=new AMD_install($prefixeTable, __FILE__);
61    $result=$amd->install();
62  }
63  else
64  {
65    gpcMsgError($errors);
66  }
67}
68
69function plugin_activate($plugin_id, $plugin_version, &$errors)
70{
71  global $prefixeTable;
72
73  $amd=new AMD_install($prefixeTable, __FILE__);
74  $result=$amd->activate();
75}
76
77function plugin_deactivate($plugin_id)
78{
79}
80
81function plugin_uninstall($plugin_id)
82{
83  global $prefixeTable, $gpc_installed;
84  if($gpc_installed)
85  {
86    $amd=new AMD_install($prefixeTable, __FILE__);
87    $result=$amd->uninstall();
88  }
89  else
90  {
91    gpcMsgError($errors);
92  }
93}
94
95
96
97?>
Note: See TracBrowser for help on using the repository browser.