Changeset 5549 for extensions/UserStat/maintain.inc.php
- Timestamp:
- Apr 1, 2010, 9:06:01 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/UserStat/maintain.inc.php
r5433 r5549 14 14 //ini_set('display_errors', true); 15 15 16 include_once('userstat_version.inc.php'); // => Don't forget to update this file !! 17 16 18 if (!defined('PHPWG_ROOT_PATH')) { die('Hacking attempt!'); } 17 19 … … 20 22 21 23 22 global $gpc_installed, $ lang; //needed for plugin manager compatibility24 global $gpc_installed, $gpcNeeded, $lang; //needed for plugin manager compatibility 23 25 24 26 /* ----------------------------------------------------------------------------- … … 26 28 ----------------------------------------------------------------------------- */ 27 29 $gpc_installed=false; 28 if(file_exists(PHPWG_PLUGINS_PATH.'grum_plugins_classes-2/common_plugin.class.inc.php')) 30 $gpcNeeded="3.0.0"; 31 if(file_exists(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/CommonPlugin.class.inc.php')) 29 32 { 30 @include_once(PHPWG_PLUGINS_PATH.' grum_plugins_classes-2/main.inc.php');31 // need GPC release greater or equal than 2.0.532 if( checkGPCRelease(2,0,5))33 @include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/CommonPlugin.class.inc.php'); 34 // need GPC release greater or equal than 3.0.0 35 if(CommonPlugin::checkGPCRelease(3,0,0)) 33 36 { 34 37 @include_once("userstat_aim.class.inc.php"); … … 39 42 function gpcMsgError(&$errors) 40 43 { 41 array_push($errors, sprintf(l10n('us_gpc2_not_installed'), "2.0.5")); 44 global $gpcNeeded; 45 $msg=sprintf(l10n('To install this plugin, you need to install Grum Plugin Classes %s before'), $gpcNeeded); 46 if(is_array($errors)) 47 { 48 array_push($errors, $msg); 49 } 50 else 51 { 52 $errors=Array($msg); 53 } 42 54 } 43 55 // ----------------------------------------------------------------------------- … … 48 60 function plugin_install($plugin_id, $plugin_version, &$errors) 49 61 { 50 global $prefixeTable, $gpc_installed ;62 global $prefixeTable, $gpc_installed, $gpcNeeded; 51 63 if($gpc_installed) 52 64 { 53 65 $obj = new UserStat_AIM($prefixeTable, __FILE__); 54 $obj->delete_config(); 55 $obj->init_config(); 56 $obj->save_config(); 66 $obj->deleteConfig(); 67 $obj->initConfig(); 68 $obj->my_config['installed']=USERSTAT_VERSION2; 69 $obj->saveConfig(); 70 GPCCore::register($obj->getPluginName(), USERSTAT_VERSION, $gpcNeeded); 57 71 } 58 72 else … … 64 78 function plugin_activate($plugin_id, $plugin_version, &$errors) 65 79 { 66 global $prefixeTable, $gpc_installed ;80 global $prefixeTable, $gpc_installed, $gpcNeeded; 67 81 if($gpc_installed) 68 82 { 69 83 $obj = new UserStat_AIM($prefixeTable, __FILE__); 70 $obj->init_config(); 71 $obj->load_config(); 72 $obj->save_config(); 84 $obj->initConfig(); 85 $obj->loadConfig(); 86 $obj->my_config['installed']=USERSTAT_VERSION2; 87 $obj->saveConfig(); 73 88 } 74 89 else … … 88 103 { 89 104 $obj = new UserStat_AIM($prefixeTable, __FILE__); 90 $obj->delete_config(); 105 $obj->deleteConfig(); 106 GPCCore::unregister($obj->getPluginName()); 91 107 } 92 108 else
Note: See TracChangeset
for help on using the changeset viewer.