source: trunk/themes/smartpocket/admin/maintain.inc.php @ 28494

Last change on this file since 28494 was 26627, checked in by flop25, 10 years ago

smartpocket: Thememaintain class used in maintain.inc.php-> no more issue on 2.6 installation (tested)

File size: 1.2 KB
Line 
1<?php
2class smartpocket_maintain extends ThemeMaintain
3{
4  private $installed = false;
5 
6  private $default_conf = array(
7    'loop'            => true,//true - false
8    'autohide'            => 5000,//5000 - 0
9  );
10 
11  function activate($theme_version, &$errors=array())
12  {
13    global $conf, $prefixeTable;
14
15    if (empty($conf['smartpocket']))
16    {
17      $conf['smartpocket'] = serialize($this->default_conf);
18      $query = "
19  INSERT INTO " . CONFIG_TABLE . " (param,value,comment)
20  VALUES ('smartpocket' , '".pwg_db_real_escape_string($conf['smartpocket'])."' , 'loop#autohide');";
21      pwg_query($query);
22    }
23    elseif (count(unserialize( $conf['smartpocket'] ))!=2)
24    {
25      $conff=unserialize($conf['smartpocket']);
26      $config = array(
27        'loop'            => (!empty($conff['loop'])) ? $conff['loop'] :true,
28        'autohide'            => (!empty($conff['autohide'])) ? $conff['autohide'] :5000,
29      );
30      conf_update_param('smartpocket', pwg_db_real_escape_string(serialize($config)));
31      load_conf_from_db();
32    }
33    $this->installed = true;
34  }
35
36  function deactivate()
37  { }
38
39  function delete()
40  {
41    // delete configuration
42    conf_delete_param('smartpocket');
43  }
44}
45?>
Note: See TracBrowser for help on using the repository browser.