source: extensions/Fotorama/maintain.inc.php @ 29593

Last change on this file since 29593 was 29593, checked in by JanisV, 10 years ago

Added new parameter for thumbnails height

File size: 1.3 KB
Line 
1<?php
2
3defined('PHPWG_ROOT_PATH') or die('Hacking attempt!');
4
5class 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  );
23
24  function __construct($plugin_id)
25  {
26    parent::__construct($plugin_id);
27  }
28
29  function install($plugin_version, &$errors=array())
30  {
31    global $conf;
32
33    if (empty($conf['Fotorama']))
34    {
35      $conf['Fotorama'] = serialize($this->default_conf);
36      conf_update_param('Fotorama', $conf['Fotorama']);
37    }
38    else
39    {
40      $new_conf = is_string($conf['Fotorama']) ? unserialize($conf['Fotorama']) : $conf['Fotorama'];
41
42      $conf['Fotorama'] = serialize($new_conf);
43      conf_update_param('Fotorama', $conf['Fotorama']);
44    }
45   
46    $this->installed = true;
47  }
48
49  function activate($plugin_version, &$errors=array())
50  {
51    if (!$this->installed)
52    {
53      $this->install($plugin_version, $errors);
54    }
55  }
56
57  function deactivate()
58  {
59  }
60
61  function uninstall()
62  {
63    conf_delete_param('Fotorama');
64  }
65}
66
67?>
Note: See TracBrowser for help on using the repository browser.