source: extensions/PayPalShoppingCart/maintain.inc.php @ 19464

Last change on this file since 19464 was 19464, checked in by plg, 11 years ago

Ability to filter the PayPal form on a list of albums

Implements the "automatic update" mechanism from Skeleton plugin.

File size: 2.2 KB
Line 
1<?php
2/*
3  Plugin Panier PayPal Pour Piwigo
4  Copyright (C) 2011 www.queguineur.fr — Tous droits réservés.
5 
6  Ce programme est un logiciel libre ; vous pouvez le redistribuer ou le
7  modifier suivant les termes de la “GNU General Public License” telle que
8  publiée par la Free Software Foundation : soit la version 3 de cette
9  licence, soit (à votre gré) toute version ultérieure.
10 
11  Ce programme est distribué dans l’espoir qu’il vous sera utile, mais SANS
12  AUCUNE GARANTIE : sans même la garantie implicite de COMMERCIALISABILITÉ
13  ni d’ADÉQUATION À UN OBJECTIF PARTICULIER. Consultez la Licence Générale
14  Publique GNU pour plus de détails.
15 
16  Vous devriez avoir reçu une copie de la Licence Générale Publique GNU avec
17  ce programme ; si ce n’est pas le cas, consultez :
18  <http://www.gnu.org/licenses/>.
19*/
20
21if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
22
23defined('PPPPP_ID') or define('PPPPP_ID', basename(dirname(__FILE__)));
24include_once(PHPWG_PLUGINS_PATH.PPPPP_ID.'/include/install.inc.php');
25
26/**
27 * plugin installation
28 *
29 * perform here all needed step for the plugin installation
30 * such as create default config, add database tables,
31 * add fields to existing tables, create local folders...
32 */
33function plugin_install() 
34{
35  ppppp_install();
36  define('ppppp_installed', true);
37}
38
39/**
40 * plugin activation
41 *
42 * this function is triggered adter installation, by manual activation
43 * or after a plugin update
44 * for this last case you must manage updates tasks of your plugin in this function
45 */
46function plugin_activate()
47{
48  if (!defined('ppppp_installed')) // a plugin is activated just after its installation
49  {
50    ppppp_install();
51  }
52}
53
54/**
55 * plugin unactivation
56 *
57 * triggered before uninstallation or by manual unactivation
58 */
59function plugin_unactivate()
60{
61}
62
63function plugin_uninstall()
64{
65  global $prefixeTable;
66 
67  $query = "DROP TABLE ".$prefixeTable."ppppp_size;";
68  pwg_query($query);
69 
70  $query = "DROP TABLE ".$prefixeTable."ppppp_config;"; 
71  pwg_query($query);
72
73  // delete configuration
74  pwg_query('DELETE FROM `'. CONFIG_TABLE .'` WHERE param = "PayPalShoppingCart";');
75 
76  // delete field
77  pwg_query('ALTER TABLE `'. CATEGORIES_TABLE .'` DROP COLUMN paypal_active;');
78}
79?>
Note: See TracBrowser for help on using the repository browser.