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 | 'thumbheight' => 64, |
---|
22 | 'replace_picture' => false, |
---|
23 | 'replace_picture_only_users' => false, |
---|
24 | 'clicktransition_crossfade' => true, |
---|
25 | 'close_button' => false, |
---|
26 | 'resize' => false, |
---|
27 | 'period' => 4000, |
---|
28 | ); |
---|
29 | |
---|
30 | function __construct($plugin_id) |
---|
31 | { |
---|
32 | parent::__construct($plugin_id); |
---|
33 | } |
---|
34 | |
---|
35 | function install($plugin_version, &$errors=array()) |
---|
36 | { |
---|
37 | global $conf; |
---|
38 | |
---|
39 | if (empty($conf['Fotorama'])) |
---|
40 | { |
---|
41 | $conf['Fotorama'] = serialize($this->default_conf); |
---|
42 | conf_update_param('Fotorama', $conf['Fotorama']); |
---|
43 | } |
---|
44 | else |
---|
45 | { |
---|
46 | $new_conf = is_string($conf['Fotorama']) ? unserialize($conf['Fotorama']) : $conf['Fotorama']; |
---|
47 | |
---|
48 | $conf['Fotorama'] = serialize($new_conf); |
---|
49 | conf_update_param('Fotorama', $conf['Fotorama']); |
---|
50 | } |
---|
51 | |
---|
52 | $this->installed = true; |
---|
53 | } |
---|
54 | |
---|
55 | function activate($plugin_version, &$errors=array()) |
---|
56 | { |
---|
57 | if (!$this->installed) |
---|
58 | { |
---|
59 | $this->install($plugin_version, $errors); |
---|
60 | } |
---|
61 | } |
---|
62 | |
---|
63 | function deactivate() |
---|
64 | { |
---|
65 | } |
---|
66 | |
---|
67 | function uninstall() |
---|
68 | { |
---|
69 | conf_delete_param('Fotorama'); |
---|
70 | } |
---|
71 | } |
---|
72 | |
---|
73 | ?> |
---|