Changeset 7560 for extensions/lmt/maintain.inc.php
- Timestamp:
- Nov 1, 2010, 10:51:58 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/lmt/maintain.inc.php
r5548 r7560 14 14 if (!defined('PHPWG_ROOT_PATH')) { die('Hacking attempt!'); } 15 15 16 include_once('lmt_version.inc.php'); // => Don't forget to update this file !! 17 16 18 if(!defined('LMT_DIR')) define('LMT_DIR' , basename(dirname(__FILE__))); 17 19 if(!defined('LMT_PATH')) define('LMT_PATH' , PHPWG_PLUGINS_PATH . LMT_DIR . '/'); … … 20 22 //ini_set('display_errors', true); 21 23 22 global $gpc _installed, $gpcNeeded, $lang; //needed for plugin manager compatibility24 global $gpcInstalled, $lang; //needed for plugin manager compatibility 23 25 24 26 /* ----------------------------------------------------------------------------- 25 LMT needs the Grum Plugin Classe 27 LMT needs the Grum Plugin Classes 26 28 ----------------------------------------------------------------------------- */ 27 $gpc_installed=false; 28 $gpcNeeded="3.0.0"; 29 $gpcInstalled=false; 29 30 if(file_exists(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/CommonPlugin.class.inc.php')) 30 31 { 31 32 @include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/CommonPlugin.class.inc.php'); 32 // need GPC release greater or equal than 3.0.033 if(CommonPlugin::checkGPCRelease( 3,0,0))33 // need GPC release greater or equal than ... 34 if(CommonPlugin::checkGPCRelease(LMT_GPC_NEEDED)) 34 35 { 35 36 @include_once('lmt_install.class.inc.php'); 36 $gpc _installed=true;37 $gpcInstalled=true; 37 38 } 38 39 } 40 39 41 40 42 function gpcMsgError(&$errors) … … 61 63 function plugin_install($plugin_id, $plugin_version, &$errors) 62 64 { 63 global $prefixeTable, $gpc_installed, $gpcNeeded; 65 global $prefixeTable, $gpcInstalled; 66 if(!$gpcInstalled) 67 { 68 gpcMsgError($errors, 'gpc'); 69 return(false); 70 } 64 71 65 if($gpc_installed) 72 $obj = new LMT_Install($prefixeTable, __FILE__); 73 $result=$obj->install(); 74 } 75 76 77 78 function plugin_activate($plugin_id, $plugin_version, &$errors) 79 { 80 global $prefixeTable, $gpcInstalled; 81 82 if($gpcInstalled) 66 83 { 67 84 $obj = new LMT_Install($prefixeTable, __FILE__); 68 $result=$obj->install(); 69 if(!$result) 70 { 71 array_push($errors, "error"); 72 } 73 GPCCore::register($obj->getPluginName(), LMT_VERSION, $gpcNeeded); 74 } 75 else 76 { 77 gpcMsgError($errors); 85 $result=$obj->activate(); 78 86 } 79 87 } 80 88 81 function plugin_activate($plugin_id, $plugin_version, &$errors)82 {83 global $prefixeTable, $gpc_installed;84 85 if($gpc_installed)86 {87 $obj = new LMT_Install($prefixeTable, __FILE__);88 $result=$obj->activate();89 if($result===false or $result!='')90 {91 if(is_string($result))92 {93 array_push($errors, $result);94 }95 else96 {97 array_push($errors, "");98 }99 }100 }101 else102 {103 gpcMsgError($errors);104 }105 }106 89 107 90 function plugin_deactivate($plugin_id) 108 91 { 109 /* global $prefixeTable; 110 $obj = new install_mypolls($prefixeTable, __FILE__); 111 $obj->deactivate(); */ 92 global $prefixeTable, $gpcInstalled; 93 94 if($gpcInstalled) 95 { 96 $obj=new LMT_Install($prefixeTable, __FILE__); 97 $obj->deactivate(); 98 } 112 99 } 113 100 114 101 function plugin_uninstall($plugin_id) 115 102 { 116 global $prefixeTable, $gpc _installed;103 global $prefixeTable, $gpcInstalled; 117 104 118 if($gpc _installed)105 if($gpcInstalled) 119 106 { 120 107 $obj = new LMT_Install($prefixeTable, __FILE__); 121 108 $obj->uninstall(); 122 GPCCore::unregister($obj->getPluginName());123 }124 else125 {126 gpcMsgError($errors);127 109 } 128 110 }
Note: See TracChangeset
for help on using the changeset viewer.