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

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

Added navigation
Added translation

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