Ignore:
Timestamp:
04/01/10 21:03:36 (10 years ago)
Author:
grum
Message:

Update the plugin for compatibility with Piwigo 2.1

File:
1 edited

Legend:

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

    r5427 r5545  
    88defined('AMM_DIR') || define('AMM_DIR' , basename(dirname(__FILE__))); 
    99defined('AMM_PATH') || define('AMM_PATH' , PHPWG_PLUGINS_PATH . AMM_DIR . '/'); 
    10 @include_once(PHPWG_PLUGINS_PATH.'grum_plugins_classes-2/tables.class.inc.php'); 
     10 
     11include_once('amm_version.inc.php'); // => Don't forget to update this file !! 
     12include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCCore.class.inc.php'); 
     13include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCTables.class.inc.php'); 
    1114 
    1215 
    13 global $gpc_installed, $lang; //needed for plugin manager compatibility 
     16global $gpc_installed, $gpcNeeded, $lang; //needed for plugin manager compatibility 
    1417 
    1518/* ----------------------------------------------------------------------------- 
     
    1720----------------------------------------------------------------------------- */ 
    1821$gpc_installed=false; 
    19 if(file_exists(PHPWG_PLUGINS_PATH.'grum_plugins_classes-2/common_plugin.class.inc.php')) 
     22$gpcNeeded="3.0.0"; 
     23if(file_exists(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/CommonPlugin.class.inc.php')) 
    2024{ 
    21   @include_once(PHPWG_PLUGINS_PATH.'grum_plugins_classes-2/main.inc.php'); 
    22   // need GPC release greater or equal than 2.0.5 
    23  
    24   if(checkGPCRelease(2,0,5)) 
     25  @include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/CommonPlugin.class.inc.php'); 
     26  // need GPC release greater or equal than 3.0.0 
     27  if(CommonPlugin::checkGPCRelease(3,0,0)) 
    2528  { 
    2629    @include_once("amm_install.class.inc.php"); 
     
    3134function gpcMsgError(&$errors) 
    3235{ 
    33   array_push($errors, sprintf(l10n('Grum Plugin Classes is not installed (release >= %s)'), "2.0.5")); 
     36  global $gpcNeeded; 
     37  $msg=sprintf(l10n('To install this plugin, you need to install Grum Plugin Classes %s before'), $gpcNeeded); 
     38  if(is_array($errors)) 
     39  { 
     40    array_push($errors, $msg); 
     41  } 
     42  else 
     43  { 
     44    $errors=Array($msg); 
     45  } 
    3446} 
    3547// ----------------------------------------------------------------------------- 
     
    4153function plugin_install($plugin_id, $plugin_version, &$errors) 
    4254{ 
    43   global $prefixeTable, $gpc_installed; 
     55  global $prefixeTable, $gpc_installed, $gpcNeeded; 
    4456  if($gpc_installed) 
    4557  { 
     
    4860    $amm=new AMM_install($prefixeTable, __FILE__); 
    4961    $result=$amm->install(); 
     62    GPCCore::register($amm->getPluginName(), AMM_VERSION, $gpcNeeded); 
    5063  } 
    5164  else 
     
    6982function plugin_uninstall($plugin_id) 
    7083{ 
    71   global $prefixeTable; 
     84  global $prefixeTable, $gpc_installed; 
    7285  if($gpc_installed) 
    7386  { 
    7487    $amm=new AMM_install($prefixeTable, __FILE__); 
    7588    $result=$amm->uninstall(); 
     89    GPCCore::unregister($amm->getPluginName()); 
    7690  } 
    7791  else 
Note: See TracChangeset for help on using the changeset viewer.