Changeset 5935 for extensions/AMetaData/maintain.inc.php
- Timestamp:
- Apr 21, 2010, 9:27:51 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/AMetaData/maintain.inc.php
r4905 r5935 20 20 //ini_set('display_errors', true); 21 21 22 include_once('amd_version.inc.php'); // => Don't forget to update this file !! 23 24 22 25 defined('AMD_DIR') || define('AMD_DIR' , basename(dirname(__FILE__))); 23 26 defined('AMD_PATH') || define('AMD_PATH' , PHPWG_PLUGINS_PATH . AMD_DIR . '/'); 24 @include_once(PHPWG_PLUGINS_PATH.'grum_plugins_classes-2/tables.class.inc.php'); 27 include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCCore.class.inc.php'); 28 include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCTables.class.inc.php'); 25 29 26 30 27 global $gpc_installed, $ lang; //needed for plugin manager compatibility31 global $gpc_installed, $gpcNeeded, $lang; //needed for plugin manager compatibility 28 32 29 33 /* ----------------------------------------------------------------------------- 30 AMD needs the Grum Plugin Classe31 ----------------------------------------------------------------------------- */34 * AMD needs the Grum Plugin Classe 35 * -------------------------------------------------------------------------- */ 32 36 $gpc_installed=false; 33 if(file_exists(PHPWG_PLUGINS_PATH.'grum_plugins_classes-2/common_plugin.class.inc.php')) 37 $gpcNeeded="3.0.0"; 38 if(file_exists(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/CommonPlugin.class.inc.php')) 34 39 { 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)) 39 43 { 40 44 @include_once("amd_install.class.inc.php"); … … 45 49 function gpcMsgError(&$errors) 46 50 { 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 } 48 61 } 49 62 // ----------------------------------------------------------------------------- … … 55 68 function plugin_install($plugin_id, $plugin_version, &$errors) 56 69 { 57 global $prefixeTable, $gpc_installed ;70 global $prefixeTable, $gpc_installed, $gpcNeeded; 58 71 if($gpc_installed) 59 72 { 60 73 $amd=new AMD_install($prefixeTable, __FILE__); 61 74 $result=$amd->install(); 75 GPCCore::register($amd->getPluginName(), AMD_VERSION, $gpcNeeded); 62 76 } 63 77 else … … 81 95 function plugin_uninstall($plugin_id) 82 96 { 83 global $prefixeTable, $gpc_installed ;97 global $prefixeTable, $gpc_installed, $gpcNeeded; 84 98 if($gpc_installed) 85 99 { 86 100 $amd=new AMD_install($prefixeTable, __FILE__); 87 101 $result=$amd->uninstall(); 102 GPCCore::unregister($amd->getPluginName()); 88 103 } 89 104 else
Note: See TracChangeset
for help on using the changeset viewer.