Ignore:
Timestamp:
Apr 21, 2010, 9:27:51 PM (14 years ago)
Author:
grum
Message:

Update plugin for Piwigo 2.1

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/AMetaData/maintain.inc.php

    r4905 r5935  
    2020//ini_set('display_errors', true);
    2121
     22include_once('amd_version.inc.php'); // => Don't forget to update this file !!
     23
     24
    2225defined('AMD_DIR') || define('AMD_DIR' , basename(dirname(__FILE__)));
    2326defined('AMD_PATH') || define('AMD_PATH' , PHPWG_PLUGINS_PATH . AMD_DIR . '/');
    24 @include_once(PHPWG_PLUGINS_PATH.'grum_plugins_classes-2/tables.class.inc.php');
     27include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCCore.class.inc.php');
     28include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCTables.class.inc.php');
    2529
    2630
    27 global $gpc_installed, $lang; //needed for plugin manager compatibility
     31global $gpc_installed, $gpcNeeded, $lang; //needed for plugin manager compatibility
    2832
    2933/* -----------------------------------------------------------------------------
    30 AMD needs the Grum Plugin Classe
    31 ----------------------------------------------------------------------------- */
     34 * AMD needs the Grum Plugin Classe
     35 * -------------------------------------------------------------------------- */
    3236$gpc_installed=false;
    33 if(file_exists(PHPWG_PLUGINS_PATH.'grum_plugins_classes-2/common_plugin.class.inc.php'))
     37$gpcNeeded="3.0.0";
     38if(file_exists(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/CommonPlugin.class.inc.php'))
    3439{
    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))
     40  @include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/CommonPlugin.class.inc.php');
     41  // need GPC release greater or equal than 3.0.0
     42  if(CommonPlugin::checkGPCRelease(3,0,0))
    3943  {
    4044    @include_once("amd_install.class.inc.php");
     
    4549function gpcMsgError(&$errors)
    4650{
    47   array_push($errors, sprintf(l10n('Grum Plugin Classes is not installed (release >= %s)'), "2.0.4"));
     51  global $gpcNeeded;
     52  $msg=sprintf(l10n('To install this plugin, you need to install Grum Plugin Classes %s before'), $gpcNeeded);
     53  if(is_array($errors))
     54  {
     55    array_push($errors, $msg);
     56  }
     57  else
     58  {
     59    $errors=Array($msg);
     60  }
    4861}
    4962// -----------------------------------------------------------------------------
     
    5568function plugin_install($plugin_id, $plugin_version, &$errors)
    5669{
    57   global $prefixeTable, $gpc_installed;
     70  global $prefixeTable, $gpc_installed, $gpcNeeded;
    5871  if($gpc_installed)
    5972  {
    6073    $amd=new AMD_install($prefixeTable, __FILE__);
    6174    $result=$amd->install();
     75    GPCCore::register($amd->getPluginName(), AMD_VERSION, $gpcNeeded);
    6276  }
    6377  else
     
    8195function plugin_uninstall($plugin_id)
    8296{
    83   global $prefixeTable, $gpc_installed;
     97  global $prefixeTable, $gpc_installed, $gpcNeeded;
    8498  if($gpc_installed)
    8599  {
    86100    $amd=new AMD_install($prefixeTable, __FILE__);
    87101    $result=$amd->uninstall();
     102    GPCCore::unregister($amd->getPluginName());
    88103  }
    89104  else
Note: See TracChangeset for help on using the changeset viewer.