1 | <?php |
---|
2 | if (!defined('CONTACT_FORM_PATH')) die('Hacking attempt!'); |
---|
3 | |
---|
4 | // save config |
---|
5 | if (isset($_POST['save_config'])) |
---|
6 | { |
---|
7 | $was_ready = $conf['ContactForm']['cf_ready']; |
---|
8 | |
---|
9 | $conf['ContactForm'] = array( |
---|
10 | 'cf_must_initialize' => false, |
---|
11 | 'cf_menu_link' => isset($_POST['cf_menu_link']), |
---|
12 | 'cf_subject_prefix' => trim($_POST['cf_subject_prefix']), |
---|
13 | 'cf_default_subject' => trim($_POST['cf_default_subject']), |
---|
14 | 'cf_allow_guest' => isset($_POST['cf_allow_guest']), |
---|
15 | 'cf_mandatory_mail' => isset($_POST['cf_mandatory_mail']), |
---|
16 | 'cf_mandatory_name' => isset($_POST['cf_mandatory_name']), |
---|
17 | 'cf_mail_type' => $_POST['cf_mail_type'], |
---|
18 | 'cf_redirect_url' => ($_POST['cf_redirect_url']!='http://') ? $_POST['cf_redirect_url'] : null, |
---|
19 | 'cf_theme' => $_POST['cf_theme'], |
---|
20 | ); |
---|
21 | $conf['ContactForm_before'] = $_POST['cf_before']; |
---|
22 | $conf['ContactForm_after'] = $_POST['cf_after']; |
---|
23 | |
---|
24 | conf_update_param('ContactForm', serialize($conf['ContactForm'])); |
---|
25 | conf_update_param('ContactForm_before', $conf['ContactForm_before']); |
---|
26 | conf_update_param('ContactForm_after', $conf['ContactForm_after']); |
---|
27 | |
---|
28 | $conf['ContactForm']['cf_ready'] = $was_ready; |
---|
29 | |
---|
30 | array_push($page['infos'], l10n('Information data registered in database')); |
---|
31 | } |
---|
32 | |
---|
33 | |
---|
34 | // display config |
---|
35 | $template->assign($conf['ContactForm']); |
---|
36 | $template->assign(array( |
---|
37 | 'cf_before' => stripslashes($conf['ContactForm_before']), |
---|
38 | 'cf_after' => stripslashes($conf['ContactForm_after']), |
---|
39 | )); |
---|
40 | |
---|
41 | $template->set_filename('contact_form', realpath(CONTACT_FORM_PATH . 'admin/template/config.tpl')); |
---|
42 | |
---|
43 | ?> |
---|