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

Last change on this file since 31990 was 29928, checked in by JanisV, 9 years ago

Native proportions for thumbnails can be enabled

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