Changeset 8970


Ignore:
Timestamp:
Jan 29, 2011, 11:56:17 AM (9 years ago)
Author:
grum
Message:

release 3.0.0
config autoupdated when plugin is updated (not necessary to deactivate/activate the plugin)

Location:
extensions/AMenuManager
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • extensions/AMenuManager/admin/plugin_admin.php

    r8962 r8970  
    1515if (!defined('PHPWG_ROOT_PATH')) { die('Hacking attempt!'); }
    1616
    17 include(AMM_PATH."amm_aip.class.inc.php");
    18 
    1917global $prefixeTable;
    2018
     
    2321$main_plugin_object = get_plugin_data($plugin_id);
    2422
    25 $plugin_ai = new AMM_AIP($prefixeTable, $main_plugin_object->getFileLocation());
     23if(CommonPlugin::checkGPCRelease(AMM_GPC_NEEDED))
     24{
     25  AMM_root::checkPluginRelease();
     26
     27  include(AMM_PATH."amm_aip.class.inc.php");
     28  $plugin_ai = new AMM_AIP($prefixeTable, $main_plugin_object->getFileLocation());
     29}
     30else
     31{
     32  /*
     33   * plugin was upgraded, but GPC was not
     34   * display a page to inform user to upgrade GPC
     35   */
     36  include(AMM_PATH."amm_aip_release.class.inc.php");
     37  $plugin_ai = new AMM_AIPRelease($prefixeTable, $main_plugin_object->getFileLocation());
     38}
     39
    2640$plugin_ai->manage();
    2741
  • extensions/AMenuManager/amm_root.class.inc.php

    r8962 r8970  
    644644
    645645
     646  static public function checkPluginRelease()
     647  {
     648    global $template;
     649
     650    $config=Array();
     651    GPCCore::loadConfig('amm', $config);
     652
     653    if($config['installed']!=AMM_VERSION2)
     654    {
     655      /* the plugin was updated without being deactivated
     656       * deactivate + activate the plugin to process the database upgrade
     657       */
     658      include(AMM_PATH."amm_install.class.inc.php");
     659      $amm=new AMM_Install($prefixeTable, dirname(__FILE__));
     660      $amm->deactivate();
     661      $amm->activate();
     662      $template->delete_compiled_templates();
     663    }
     664  }
    646665
    647666
  • extensions/AMenuManager/language/en_UK/plugin.lang.php

    r8962 r8970  
    120120$lang['g002_album'] = "Album ⇒ menu";
    121121$lang['g002_setting_albums_menus'] = "Albums to convert to menu";
     122$lang['gmaps_gpc_not_up_to_date']="It is necessary for the plugin that the <i>Grum Plugin Classes</i> version %s is installed.
     123Currently, version %s is installed: please proceed with the update version of the plugin <i>Grum Plugin Classes</i>.";
    122124
    123125?>
  • extensions/AMenuManager/language/fr_FR/plugin.lang.php

    r8962 r8970  
    119119$lang['g002_album'] = "Album &rArr; menu";
    120120$lang['g002_setting_albums_menus'] = "Album à convertir en menu";
     121$lang['g002_gpc_not_up_to_date']="Il est nécessaire que le plugin <i>Grum Plugin Classes</i> version %s soit installé.
     122Actuellement, la version %s est installée : merci de procéder à la mise à jour de version du plugin <i>Grum Plugin Classes</i>.";
     123
    121124
    122125/* --- removed keys ---
  • extensions/AMenuManager/main.inc.php

    r8962 r8970  
    170170define('AMM_PATH' , PHPWG_PLUGINS_PATH . AMM_DIR . '/');
    171171
     172include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/CommonPlugin.class.inc.php');
    172173include_once('amm_version.inc.php'); // => Don't forget to update this file !!
     174include_once('amm_root.class.inc.php');
     175
    173176
    174177global $prefixeTable, $page;
     
    185188else
    186189{
    187   //AMM public part loaded and active only if in public page
    188   include_once("amm_pip.class.inc.php");
    189   $obj = new AMM_PIP($prefixeTable, __FILE__);
    190   set_plugin_data($plugin['id'], $obj);
     190  if(CommonPlugin::checkGPCRelease(AMM_GPC_NEEDED))
     191  {
     192    AMM_root::checkPluginRelease();
     193
     194    //AMM public part loaded and active only if in public page
     195    include_once("amm_pip.class.inc.php");
     196    $obj = new AMM_PIP($prefixeTable, __FILE__);
     197    set_plugin_data($plugin['id'], $obj);
     198  }
    191199}
    192200
Note: See TracChangeset for help on using the changeset viewer.