Ignore:
Timestamp:
Apr 1, 2010, 9:05:29 PM (14 years ago)
Author:
grum
Message:

Update the plugin for compatibility with Piwigo 2.1

File:
1 edited

Legend:

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

    r5431 r5548  
    2020//ini_set('display_errors', true);
    2121
    22 global $gpc_installed, $lang; //needed for plugin manager compatibility
     22global $gpc_installed, $gpcNeeded, $lang; //needed for plugin manager compatibility
    2323
    2424/* -----------------------------------------------------------------------------
     
    2626----------------------------------------------------------------------------- */
    2727$gpc_installed=false;
    28 if(file_exists(PHPWG_PLUGINS_PATH.'grum_plugins_classes-2/common_plugin.class.inc.php'))
     28$gpcNeeded="3.0.0";
     29if(file_exists(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/CommonPlugin.class.inc.php'))
    2930{
    30   @include_once(PHPWG_PLUGINS_PATH.'grum_plugins_classes-2/main.inc.php');
    31   // need GPC release greater or equal than 2.0.5
    32   if(checkGPCRelease(2,0,5))
     31  @include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/CommonPlugin.class.inc.php');
     32  // need GPC release greater or equal than 3.0.0
     33  if(CommonPlugin::checkGPCRelease(3,0,0))
    3334  {
    3435    @include_once('lmt_install.class.inc.php');
     
    3940function gpcMsgError(&$errors)
    4041{
    41   array_push($errors, sprintf(l10n('lmt_gpc2_not_installed'), "2.0.5"));
     42  global $gpcNeeded;
     43  $msg=sprintf(l10n('To install this plugin, you need to install Grum Plugin Classes %s before'), $gpcNeeded);
     44  if(is_array($errors))
     45  {
     46    array_push($errors, $msg);
     47  }
     48  else
     49  {
     50    $errors=Array($msg);
     51  }
    4252}
    4353// -----------------------------------------------------------------------------
     
    5161function plugin_install($plugin_id, $plugin_version, &$errors)
    5262{
    53   global $prefixeTable, $gpc_installed;
     63  global $prefixeTable, $gpc_installed, $gpcNeeded;
    5464
    5565  if($gpc_installed)
     
    6171      array_push($errors, "error");
    6272    }
     73    GPCCore::register($obj->getPluginName(), LMT_VERSION, $gpcNeeded);
    6374  }
    6475  else
     
    109120    $obj = new LMT_Install($prefixeTable, __FILE__);
    110121    $obj->uninstall();
     122    GPCCore::unregister($obj->getPluginName());
    111123  }
    112124  else
Note: See TracChangeset for help on using the changeset viewer.