Ignore:
Timestamp:
Sep 20, 2010, 12:44:47 AM (14 years ago)
Author:
grum
Message:

Migration from version 0.4.0 to 0.5.1 implemented

File:
1 edited

Legend:

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

    r6891 r6977  
    2929
    3030
    31 global $gpc_installed, $gpcNeeded, $lang; //needed for plugin manager compatibility
     31global $gpcInstalled, $lang; //needed for plugin manager compatibility
    3232
    3333/* -----------------------------------------------------------------------------
    3434 * AMD needs the Grum Plugin Classe
    3535 * -------------------------------------------------------------------------- */
    36 $gpc_installed=false;
    37 $gpcNeeded="3.2.0";
     36$gpcInstalled=false;
    3837if(file_exists(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/CommonPlugin.class.inc.php'))
    3938{
     
    4342  {
    4443    @include_once("amd_install.class.inc.php");
    45     $gpc_installed=true;
     44    $gpcInstalled=true;
    4645  }
    4746}
     
    4948function gpcMsgError(&$errors)
    5049{
    51   global $gpcNeeded;
    52   $msg=sprintf(l10n('To install this plugin, you need to install Grum Plugin Classes %s before'), $gpcNeeded);
     50  $msg=sprintf(l10n('To install this plugin, you need to install Grum Plugin Classes %s before'), AMD_GPC_NEEDED);
    5351  if(is_array($errors))
    5452  {
     
    6866function plugin_install($plugin_id, $plugin_version, &$errors)
    6967{
    70   global $prefixeTable, $gpc_installed, $gpcNeeded;
    71   if($gpc_installed)
     68  global $prefixeTable, $gpcInstalled;
     69  if($gpcInstalled)
    7270  {
    7371    $amd=new AMD_install($prefixeTable, __FILE__);
    7472    $result=$amd->install();
    75     GPCCore::register($amd->getPluginName(), AMD_VERSION, $gpcNeeded);
    7673  }
    7774  else
     
    8380function plugin_activate($plugin_id, $plugin_version, &$errors)
    8481{
    85   global $prefixeTable, $gpcNeeded;
    86 
    87   $amd=new AMD_install($prefixeTable, __FILE__);
    88   $result=$amd->activate();
    89   GPCCore::register($amd->getPluginName(), AMD_VERSION, $gpcNeeded);
    90   GPCRequestBuilder::register($amd->getPluginName(), dirname($amd->getFileLocation()).'/amd_rb_callback.class.inc.php');
     82  global $prefixeTable, $gpcInstalled;
     83  if($gpcInstalled)
     84  {
     85    $amd=new AMD_install($prefixeTable, __FILE__);
     86    $result=$amd->activate();
     87  }
    9188}
    9289
    9390function plugin_deactivate($plugin_id)
    9491{
    95   global $prefixeTable, $gpcNeeded;
     92  global $prefixeTable, $gpcInstalled;
    9693
    97   $amd=new AMD_install($prefixeTable, __FILE__);
    98   GPCRequestBuilder::unregister($amd->getPluginName());
     94  if($gpcInstalled)
     95  {
     96    $amd=new AMD_install($prefixeTable, __FILE__);
     97    $amd->deactivate();
     98  }
    9999}
    100100
    101101function plugin_uninstall($plugin_id)
    102102{
    103   global $prefixeTable, $gpc_installed, $gpcNeeded;
    104   if($gpc_installed)
     103  global $prefixeTable, $gpcInstalled;
     104  if($gpcInstalled)
    105105  {
    106106    $amd=new AMD_install($prefixeTable, __FILE__);
    107107    $result=$amd->uninstall();
    108     GPCCore::unregister($amd->getPluginName());
    109108  }
    110109  else
Note: See TracChangeset for help on using the changeset viewer.