[9784] | 1 | <?php |
---|
| 2 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
| 3 | |
---|
| 4 | function plugin_install() |
---|
| 5 | { |
---|
[11217] | 6 | global $conf; |
---|
[9784] | 7 | |
---|
[11217] | 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 | } |
---|
[9784] | 13 | } |
---|
| 14 | |
---|
[10165] | 15 | function plugin_activate() |
---|
| 16 | { |
---|
[11217] | 17 | global $conf; |
---|
[10165] | 18 | |
---|
[11217] | 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 | } |
---|
[10165] | 33 | } |
---|
| 34 | |
---|
[9784] | 35 | function plugin_uninstall() |
---|
| 36 | { |
---|
[11217] | 37 | global $conf; |
---|
[9784] | 38 | |
---|
[11217] | 39 | if (isset($conf['Front2Back'])) { |
---|
| 40 | pwg_query('DELETE FROM ' . CONFIG_TABLE . ' WHERE param="Front2Back";'); |
---|
| 41 | } |
---|
[9784] | 42 | } |
---|
| 43 | |
---|
| 44 | ?> |
---|