1 | <?php |
---|
2 | //Initialization |
---|
3 | $conf_file_uploader = unserialize($conf['file_uploader']); |
---|
4 | |
---|
5 | //Save config |
---|
6 | if (isset($_POST['submit'])) { |
---|
7 | //New parameters |
---|
8 | foreach ($conf_file_uploader as $file_uploader_checkbox => $value) { |
---|
9 | if(isset($_POST['file_uploader_checkbox'][$file_uploader_checkbox]) && ($_POST['file_uploader_checkbox'][$file_uploader_checkbox] == 1)) |
---|
10 | $conf_file_uploader[$file_uploader_checkbox] = 1; |
---|
11 | else |
---|
12 | $conf_file_uploader[$file_uploader_checkbox] = 0; |
---|
13 | } |
---|
14 | |
---|
15 | $conf_file_uploader['pdf2tab_extensions'] = $_POST['file_uploader_pdf2tab_extensions']; |
---|
16 | $conf_file_uploader['pdf2tab_extensions'] = explode(',', $conf_file_uploader['pdf2tab_extensions']); |
---|
17 | |
---|
18 | //Save |
---|
19 | conf_update_param('file_uploader', serialize($conf_file_uploader)); |
---|
20 | array_push($page['infos'], l10n('Information data registered in database')); |
---|
21 | } |
---|
22 | |
---|
23 | //Parameters of the template |
---|
24 | foreach ($conf_file_uploader as $file_uploader_key => $value) |
---|
25 | $file_uploader_checked[$file_uploader_key] = (($conf_file_uploader[$file_uploader_key] == 1) ? 'checked = "checked"' : ''); |
---|
26 | $template->assign('file_uploader_checked', $file_uploader_checked); |
---|
27 | |
---|
28 | if ($conf_file_uploader['pdf2tab_extensions'][0]=='') |
---|
29 | $conf_file_uploader['pdf2tab_extensions'] = null; |
---|
30 | $template->assign('file_uploader_pdf2tab_extensions',$conf_file_uploader['pdf2tab_extensions']); |
---|
31 | |
---|
32 | //Add our template to the global template |
---|
33 | $template->set_filenames( |
---|
34 | array( |
---|
35 | 'plugin_admin_content_general' => dirname(__FILE__).'/admin_configuration.tpl' |
---|
36 | ) |
---|
37 | ); |
---|
38 | |
---|
39 | //Assign the template contents to ADMIN_CONTENT |
---|
40 | $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content_general'); |
---|
41 | ?> |
---|