source: extensions/ShareThis/maintain.class.php @ 31051

Last change on this file since 31051 was 31051, checked in by SergeD, 9 years ago

version 1.0.0 - see change log for details

  • Property svn:eol-style set to native
File size: 1.3 KB
Line 
1<?php
2defined('PHPWG_ROOT_PATH') or die('Hacking attempt!');
3
4class sharethis_maintain extends PluginMaintain {
5  private $default_conf = array(
6    'facebook'   => false,
7    'pinterest'  => false,
8    'twitter'    => false,
9    'googleplus' => false
10  );
11
12  function __construct($plugin_id) {
13    parent::__construct($plugin_id); // always call parent constructor
14  }
15
16  /**
17   * Plugin installation
18   */
19  function install($plugin_version, &$errors=array()) {
20    global $conf;
21
22    // add config parameter
23    if (empty($conf['sharethis'])):
24      conf_update_param('sharethis', $this->default_conf, true);
25    else:
26      $old_conf = safe_unserialize($conf['sharethis']);
27
28      //if (empty($old_conf['option3']))
29      //{ // use case: this parameter was added in a new version
30      //  $old_conf['option3'] = 'two';
31      //}
32
33      conf_update_param('sharethis', $old_conf, true);
34    endif;
35  }
36
37  /**
38   * Plugin activation
39   */
40  function activate($plugin_version, &$errors=array()) {
41  }
42
43  /**
44   * Plugin deactivation
45   */
46  function deactivate() {
47  }
48
49  /**
50   * Plugin (auto)update
51   */
52  function update($old_version, $new_version, &$errors=array()) {
53    $this->install($new_version, $errors);
54  }
55
56  /**
57   * Plugin uninstallation
58   */
59  function uninstall() {
60    // delete configuration
61    conf_delete_param('sharethis');
62  }
63}
Note: See TracBrowser for help on using the repository browser.