1 | <?php |
---|
2 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
3 | |
---|
4 | global $template, $page; |
---|
5 | |
---|
6 | $piwecard = get_plugin_data($plugin_id); |
---|
7 | |
---|
8 | if (isset($_POST['submit'])) { |
---|
9 | $piwecard->my_config['validity_default'] = $_POST['ecard_validity_default']; |
---|
10 | $piwecard->my_config['sender_copy'] = isset($_POST['ecard_sender_copy']); |
---|
11 | $piwecard->my_config['sender_email_change'] = isset($_POST['ecard_sender_email_change']); |
---|
12 | |
---|
13 | $ecard_email_format_array = array(); |
---|
14 | foreach($_POST['ecard_email_format'] as $ecard_email_format) { |
---|
15 | array_push($ecard_email_format_array, $ecard_email_format); |
---|
16 | } |
---|
17 | $piwecard->my_config['ecard_email_format'] = $ecard_email_format_array; |
---|
18 | $piwecard->my_config['show_image_infos'] = isset($_POST['ecard_show_image_infos']); |
---|
19 | $piwecard->my_config['default_guest_email'] = $_POST['ecard_default_guest_email']; |
---|
20 | $piwecard->my_config['email_subject'] = htmlspecialchars($_POST['ecard_email_subject']); |
---|
21 | $piwecard->my_config['email_message']['text'] = htmlspecialchars($_POST['ecard_email_text']); |
---|
22 | $piwecard->my_config['email_message']['html'] = stripslashes($_POST['ecard_email_html']); |
---|
23 | $piwecard->save_config(); |
---|
24 | array_push($page['infos'], l10n('ecard_admin_saveOK')); |
---|
25 | } |
---|
26 | |
---|
27 | foreach($piwecard->my_config['validity'] as $validity) { |
---|
28 | $template->append('ecard_validity', array( |
---|
29 | 'id' => $validity, |
---|
30 | 'name' => ($validity == 0) ? l10n('ecard_nolimit') : $validity.' '.l10n('ecard_days'), |
---|
31 | 'selected' => (($piwecard->my_config['validity_default'] == $validity) ? 'selected' : ''), |
---|
32 | ) |
---|
33 | ); |
---|
34 | } |
---|
35 | $template->assign('ecard_sender_copy', $piwecard->my_config['sender_copy'] ? 'checked="checked"' : ''); |
---|
36 | $template->assign('ecard_sender_email_change', $piwecard->my_config['sender_email_change'] ? 'checked="checked"' : ''); |
---|
37 | foreach($piwecard->my_config['email_format'] as $email_format) { |
---|
38 | $template->append('ecard_email_format', array( |
---|
39 | 'id' => $email_format, |
---|
40 | 'selected' => (($piwecard->my_config['email_format_default'] == $email_format) ? 'checked="checked"' : ''), |
---|
41 | ) |
---|
42 | ); |
---|
43 | } |
---|
44 | $template->assign('ecard_show_image_infos', $piwecard->my_config['show_image_infos'] ? 'checked="checked"' : ''); |
---|
45 | $template->assign('ecard_default_guest_email', $piwecard->my_config['default_guest_email']); |
---|
46 | $template->assign('ecard_email_subject', htmlspecialchars_decode($piwecard->my_config['email_subject'])); |
---|
47 | $template->assign('ecard_email_message_text', htmlspecialchars_decode($piwecard->my_config['email_message']['text'])); |
---|
48 | $template->assign('ecard_email_message_html', htmlspecialchars_decode($piwecard->my_config['email_message']['html'])); |
---|
49 | |
---|
50 | // Use FCK Editor |
---|
51 | if (function_exists('set_fckeditor_instance')) |
---|
52 | { |
---|
53 | set_fckeditor_instance('ecard_email_message_html', 'Full', '99%', '250px'); |
---|
54 | } |
---|
55 | |
---|
56 | $template->set_filename('plugin_admin_content', dirname(__FILE__) . '/template/admin_params.tpl'); |
---|
57 | $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content'); |
---|
58 | ?> |
---|