aboutsummaryrefslogtreecommitdiffstats
path: root/themes/smartpocket/admin/maintain.inc.php
blob: 92fe7b1e3ba8d15bf6d5145b96c380c3cd28bcae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php
class smartpocket_maintain extends ThemeMaintain
{
  private $installed = false;
  
  private $default_conf = array(
    'loop'            => true,//true - false
    'autohide'            => 5000,//5000 - 0
  );
  
  function activate($theme_version, &$errors=array())
  {
    global $conf, $prefixeTable;

    if (empty($conf['smartpocket']))
    {
      conf_update_param('smartpocket', $this->default_conf, true);
    }
    elseif (count(safe_unserialize($conf['smartpocket'])) != 2)
    {
      $conff = safe_unserialize($conf['smartpocket']);
      
      $config = array(
        'loop' => (!empty($conff['loop'])) ? $conff['loop'] :true,
        'autohide' => (!empty($conff['autohide'])) ? $conff['autohide'] :5000,
      );
      
      conf_update_param('smartpocket', $config, true);
    }
    $this->installed = true;
  }

  function deactivate()
  {
  }

  function delete()
  {
    // delete configuration
    conf_delete_param('smartpocket');
  }
}
?>