1 | <?php |
---|
2 | |
---|
3 | defined('PHPWG_ROOT_PATH') or die('Hacking attempt!'); |
---|
4 | |
---|
5 | class Fotorama_maintain extends PluginMaintain |
---|
6 | { |
---|
7 | private $installed = false; |
---|
8 | |
---|
9 | private $default_conf = array( |
---|
10 | 'allowfullscreen' => 'native', |
---|
11 | 'fit' => 'scaledown', |
---|
12 | 'transition' => 'slide', |
---|
13 | 'shadows' => false, |
---|
14 | 'autoplay' => true, |
---|
15 | 'stopautoplayontouch' => false, |
---|
16 | 'loop' => true, |
---|
17 | 'nav' => 'false', |
---|
18 | 'fullscreen_nav' => 'false', |
---|
19 | 'only_fullscreen' => false, |
---|
20 | 'enable_caption' => false, |
---|
21 | ); |
---|
22 | |
---|
23 | function __construct($plugin_id) |
---|
24 | { |
---|
25 | parent::__construct($plugin_id); |
---|
26 | } |
---|
27 | |
---|
28 | function install($plugin_version, &$errors=array()) |
---|
29 | { |
---|
30 | global $conf; |
---|
31 | |
---|
32 | if (empty($conf['Fotorama'])) |
---|
33 | { |
---|
34 | $conf['Fotorama'] = serialize($this->default_conf); |
---|
35 | conf_update_param('Fotorama', $conf['Fotorama']); |
---|
36 | } |
---|
37 | else |
---|
38 | { |
---|
39 | $new_conf = is_string($conf['Fotorama']) ? unserialize($conf['Fotorama']) : $conf['Fotorama']; |
---|
40 | |
---|
41 | $conf['Fotorama'] = serialize($new_conf); |
---|
42 | conf_update_param('Fotorama', $conf['Fotorama']); |
---|
43 | } |
---|
44 | |
---|
45 | $this->installed = true; |
---|
46 | } |
---|
47 | |
---|
48 | function activate($plugin_version, &$errors=array()) |
---|
49 | { |
---|
50 | if (!$this->installed) |
---|
51 | { |
---|
52 | $this->install($plugin_version, $errors); |
---|
53 | } |
---|
54 | } |
---|
55 | |
---|
56 | function deactivate() |
---|
57 | { |
---|
58 | } |
---|
59 | |
---|
60 | function uninstall() |
---|
61 | { |
---|
62 | conf_delete_param('Fotorama'); |
---|
63 | } |
---|
64 | } |
---|
65 | |
---|
66 | ?> |
---|