source: extensions/Front2Back/maintain.inc.php

Last change on this file was 11217, checked in by mistic100, 13 years ago

clean code, add some options

File size: 1.2 KB
Line 
1<?php
2if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
3
4function plugin_install()
5{
6  global $conf;
7
8  if (!isset($conf['Front2Back'])) {
9    $q = 'INSERT INTO ' . CONFIG_TABLE . ' (param,value,comment)
10      VALUES ("Front2Back", ",thumbnail/verso/,pwg_high/verso/,", "Parametres Front2Back");';
11    pwg_query($q);
12  }
13}
14
15function plugin_activate()
16{
17  global $conf;
18
19  if (!isset($conf['Front2Back'])) {
20    $q = 'INSERT INTO ' . CONFIG_TABLE . ' (param,value,comment)
21      VALUES ("Front2Back", ",thumbnail/verso/,pwg_high/verso/,", "Parametres Front2Back");';
22    pwg_query($q);
23  } else {
24    $conf['Front2Back'] = explode(',', $conf['Front2Back']);
25    if (!isset($conf['Front2Back'][4])) {
26      $conf['Front2Back'][4] = 'top';
27      $conf['Front2Back'][5] = 'click';
28      $conf['Front2Back'][6] = 'none';
29      $conf['Front2Back'][7] = serialize(array('default'=>null));
30      conf_update_param('Front2Back', implode (',', $conf['Front2Back'])); 
31    }
32  }
33}
34
35function plugin_uninstall()
36{
37  global $conf;
38
39  if (isset($conf['Front2Back'])) {
40    pwg_query('DELETE FROM ' . CONFIG_TABLE . ' WHERE param="Front2Back";');
41  }
42}
43
44?>
Note: See TracBrowser for help on using the repository browser.