Changeset 16974


Ignore:
Timestamp:
Jul 24, 2012, 4:23:15 PM (8 years ago)
Author:
plg
Message:

avoid automatic add/removal of map.php when an account deactivate RV Gmaps

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/rv_gmaps/trunk/maintain.inc.php

    r13092 r16974  
    2424function plugin_activate()
    2525{
    26   $dir_name = basename( dirname(__FILE__) );
    27   $c = <<<EOD
     26  global $conf;
     27
     28  if (!isset($conf['rv_gmaps_add_map.php']) or $conf['rv_gmaps_add_map.php'])
     29  {
     30    $dir_name = basename( dirname(__FILE__) );
     31    $c = <<<EOD
    2832<?php
    2933define('PHPWG_ROOT_PATH','./');
     
    3135?>
    3236EOD;
    33   $fp = fopen( PHPWG_ROOT_PATH.'map.php', 'w' );
    34   fwrite( $fp, $c);
    35   fclose( $fp );
     37    $fp = fopen( PHPWG_ROOT_PATH.'map.php', 'w' );
     38    fwrite( $fp, $c);
     39    fclose( $fp );
     40  }
    3641
    3742        $old = dirname(__FILE__).'/_rvgm_config.dat';
     
    5156function plugin_deactivate()
    5257{
    53   @unlink( PHPWG_ROOT_PATH.'map.php' );
     58  global $conf;
     59
     60  if (!isset($conf['rv_gmaps_remove_map.php']) or $conf['rv_gmaps_remove_map.php'])
     61  {
     62    @unlink( PHPWG_ROOT_PATH.'map.php' );
     63  }
     64 
    5465  rvm_invalidate_cache();
    5566}
Note: See TracChangeset for help on using the changeset viewer.