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

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

Added basic customization

File size: 1.2 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  );
18
19  function __construct($plugin_id)
20  {
21    parent::__construct($plugin_id);
22  }
23
24  function install($plugin_version, &$errors=array())
25  {
26    global $conf;
27
28    if (empty($conf['Fotorama']))
29    {
30      $conf['Fotorama'] = serialize($this->default_conf);
31      conf_update_param('Fotorama', $conf['Fotorama']);
32    }
33    else
34    {
35      $new_conf = is_string($conf['Fotorama']) ? unserialize($conf['Fotorama']) : $conf['Fotorama'];
36
37      $conf['Fotorama'] = serialize($new_conf);
38      conf_update_param('Fotorama', $conf['Fotorama']);
39    }
40   
41    $this->installed = true;
42  }
43
44  function activate($plugin_version, &$errors=array())
45  {
46    if (!$this->installed)
47    {
48      $this->install($plugin_version, $errors);
49    }
50  }
51
52  function deactivate()
53  {
54  }
55
56  function uninstall()
57  {
58    conf_delete_param('Fotorama');
59  }
60}
61
62?>
Note: See TracBrowser for help on using the repository browser.