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