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

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

New mode: only fullscreen

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