source: extensions/ColorStat/admin.php @ 27153

Revision 15344, 2.0 KB checked in by grum, 8 years ago (diff)

feature:2639 - Compatibility with Piwigo 2.4

  • Property svn:executable set to *
Line 
1<?php
2/* -----------------------------------------------------------------------------
3  Plugin     : ColorStat
4  Author     : Grum
5    email    : grum@piwigo.org
6    website  : http://photos.grum.fr
7
8    << May the Little SpaceFrog be with you ! >>
9  ------------------------------------------------------------------------------
10  See main.inc.php for release information
11
12  --------------------------------------------------------------------------- */
13
14if (!defined('PHPWG_ROOT_PATH')) { die('Hacking attempt!'); }
15
16global $prefixeTable, $template;
17load_language('plugin.lang', CSTAT_PATH);
18
19$main_plugin_object = get_plugin_data($plugin_id);
20
21
22if(CommonPlugin::checkGPCRelease(3,2,0))
23{
24  $config=Array();
25  GPCCore::loadConfig('cstat', $config);
26
27  if(!isset($config['installed'])) $config['installed']='01.00.01';
28  if($config['installed']!=CSTAT_VERSION2)
29  {
30    /* the plugin was updated without being deactivated
31     * deactivate + activate the plugin to process the database upgrade
32     */
33    include(CSTAT_PATH."cstat_install.class.inc.php");
34    $cstat=new CStat_Install($prefixeTable, dirname(__FILE__));
35    $cstat->deactivate();
36    $cstat->activate();
37    $template->delete_compiled_templates();
38    $config['newInstall']='n';
39  }
40
41  /*
42   * if the plugin is newly installed, display a special configuration page
43   * otherwise, display normal page
44   */
45  if($config['newInstall']=='n')
46  {
47    include(CSTAT_PATH."cstat_aip.class.inc.php");
48    $plugin_ai = new CStat_AIP($prefixeTable, $main_plugin_object->getFileLocation());
49  }
50  else
51  {
52    include(CSTAT_PATH."cstat_aip_install.class.inc.php");
53    $plugin_ai = new CStat_AIPInstall($prefixeTable, $main_plugin_object->getFileLocation());
54  }
55}
56else
57{
58  /*
59   * plugin was upgraded, but GPC was not
60   * display a page to inform user to upgrade GPC
61   */
62  include(CSTAT_PATH."cstat_aip_release.class.inc.php");
63  $plugin_ai = new CStat_AIPRelease($prefixeTable, $main_plugin_object->getFileLocation());
64}
65
66$plugin_ai->manage();
67
68
69
70?>
Note: See TracBrowser for help on using the repository browser.