Last change
on this file since 19947 was
19811,
checked in by julien1311, 12 years ago
|
add an admin page to choose the extension to handle
|
-
Property svn:eol-style set to
LF
|
File size:
893 bytes
|
Line | |
---|
1 | <?php |
---|
2 | function pdf2tab_install($config) { |
---|
3 | $query = 'INSERT INTO '.CONFIG_TABLE.' (param,value,comment) VALUES ("pdf2tab" ,"'.pwg_db_real_escape_string(serialize($config)).'", "PDF2Tab plugin parameters");'; |
---|
4 | pwg_query($query); |
---|
5 | } |
---|
6 | |
---|
7 | function pdf2tab_update_db() { |
---|
8 | global $conf; |
---|
9 | include(dirname(__FILE__).'/config_default.inc.php'); |
---|
10 | |
---|
11 | $config = array(); |
---|
12 | if (isset($conf['pdf2tab'])) |
---|
13 | $conf_pdf2tab = unserialize($conf['pdf2tab']); |
---|
14 | |
---|
15 | if (isset($conf_pdf2tab)) { |
---|
16 | foreach ($config_default as $key => $value) { |
---|
17 | if (isset($conf_pdf2tab[$key])) |
---|
18 | $config[$key] = $conf_pdf2tab[$key]; |
---|
19 | else |
---|
20 | $config[$key] = $config_default[$key]; |
---|
21 | } |
---|
22 | pdf2tab_delete_conf("pdf2tab"); |
---|
23 | pdf2tab_install($config); |
---|
24 | } else { |
---|
25 | pdf2tab_install($config_default); |
---|
26 | } |
---|
27 | } |
---|
28 | |
---|
29 | function pdf2tab_delete_conf($where) { |
---|
30 | $query = 'DELETE FROM ' . CONFIG_TABLE . ' WHERE (param="'.$where.'");'; |
---|
31 | pwg_query($query); |
---|
32 | } |
---|
33 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.