Ignore:
Timestamp:
Nov 1, 2010, 10:51:58 PM (13 years ago)
Author:
grum
Message:

fix bug:1487 - LMT image not displayed with IE8
implement feature:1689 - Add possibility to search picture by licence

File:
1 edited

Legend:

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

    r5548 r7560  
    1414if (!defined('PHPWG_ROOT_PATH')) { die('Hacking attempt!'); }
    1515
     16include_once('lmt_version.inc.php'); // => Don't forget to update this file !!
     17
    1618if(!defined('LMT_DIR')) define('LMT_DIR' , basename(dirname(__FILE__)));
    1719if(!defined('LMT_PATH')) define('LMT_PATH' , PHPWG_PLUGINS_PATH . LMT_DIR . '/');
     
    2022//ini_set('display_errors', true);
    2123
    22 global $gpc_installed, $gpcNeeded, $lang; //needed for plugin manager compatibility
     24global $gpcInstalled, $lang; //needed for plugin manager compatibility
    2325
    2426/* -----------------------------------------------------------------------------
    25 LMT needs the Grum Plugin Classe
     27LMT needs the Grum Plugin Classes
    2628----------------------------------------------------------------------------- */
    27 $gpc_installed=false;
    28 $gpcNeeded="3.0.0";
     29$gpcInstalled=false;
    2930if(file_exists(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/CommonPlugin.class.inc.php'))
    3031{
    3132  @include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/CommonPlugin.class.inc.php');
    32   // need GPC release greater or equal than 3.0.0
    33   if(CommonPlugin::checkGPCRelease(3,0,0))
     33  // need GPC release greater or equal than ...
     34  if(CommonPlugin::checkGPCRelease(LMT_GPC_NEEDED))
    3435  {
    3536    @include_once('lmt_install.class.inc.php');
    36     $gpc_installed=true;
     37    $gpcInstalled=true;
    3738  }
    3839}
     40
    3941
    4042function gpcMsgError(&$errors)
     
    6163function plugin_install($plugin_id, $plugin_version, &$errors)
    6264{
    63   global $prefixeTable, $gpc_installed, $gpcNeeded;
     65  global $prefixeTable, $gpcInstalled;
     66  if(!$gpcInstalled)
     67  {
     68    gpcMsgError($errors, 'gpc');
     69    return(false);
     70  }
    6471
    65   if($gpc_installed)
     72  $obj = new LMT_Install($prefixeTable, __FILE__);
     73  $result=$obj->install();
     74}
     75
     76
     77
     78function plugin_activate($plugin_id, $plugin_version, &$errors)
     79{
     80  global $prefixeTable, $gpcInstalled;
     81
     82  if($gpcInstalled)
    6683  {
    6784    $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();
    7886  }
    7987}
    8088
    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       else
    96       {
    97         array_push($errors, "");
    98       }
    99     }
    100   }
    101   else
    102   {
    103     gpcMsgError($errors);
    104   }
    105 }
    10689
    10790function plugin_deactivate($plugin_id)
    10891{
    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  }
    11299}
    113100
    114101function plugin_uninstall($plugin_id)
    115102{
    116   global $prefixeTable, $gpc_installed;
     103  global $prefixeTable, $gpcInstalled;
    117104
    118   if($gpc_installed)
     105  if($gpcInstalled)
    119106  {
    120107    $obj = new LMT_Install($prefixeTable, __FILE__);
    121108    $obj->uninstall();
    122     GPCCore::unregister($obj->getPluginName());
    123   }
    124   else
    125   {
    126     gpcMsgError($errors);
    127109  }
    128110}
Note: See TracChangeset for help on using the changeset viewer.