| 1 |
982
|
Ruebenwurz
|
<?php
|
| 2 |
|
|
|
| 3 |
|
|
// $Id$
|
| 4 |
|
|
|
| 5 |
|
|
/*
|
| 6 |
|
|
|
| 7 |
|
|
Website Baker Project <http://www.websitebaker.org/>
|
| 8 |
|
|
Copyright (C) 2004-2009, Ryan Djurovich
|
| 9 |
|
|
|
| 10 |
|
|
Website Baker is free software; you can redistribute it and/or modify
|
| 11 |
|
|
it under the terms of the GNU General Public License as published by
|
| 12 |
|
|
the Free Software Foundation; either version 2 of the License, or
|
| 13 |
|
|
(at your option) any later version.
|
| 14 |
|
|
|
| 15 |
|
|
Website Baker is distributed in the hope that it will be useful,
|
| 16 |
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 17 |
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 18 |
|
|
GNU General Public License for more details.
|
| 19 |
|
|
|
| 20 |
|
|
You should have received a copy of the GNU General Public License
|
| 21 |
|
|
along with Website Baker; if not, write to the Free Software
|
| 22 |
|
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
| 23 |
|
|
|
| 24 |
|
|
*/
|
| 25 |
|
|
|
| 26 |
|
|
/*
|
| 27 |
|
|
The Website Baker Project would like to thank Rudolph Lartey <www.carbonect.com>
|
| 28 |
|
|
for his contributions to this module - adding extra field types
|
| 29 |
|
|
*/
|
| 30 |
|
|
|
| 31 |
|
|
require('../../config.php');
|
| 32 |
|
|
|
| 33 |
|
|
// Include WB admin wrapper script
|
| 34 |
|
|
require(WB_PATH.'/modules/admin.php');
|
| 35 |
|
|
|
| 36 |
|
|
// include core functions of WB 2.7 to edit the optional module CSS files (frontend.css, backend.css)
|
| 37 |
|
|
@include_once(WB_PATH .'/framework/module.functions.php');
|
| 38 |
|
|
|
| 39 |
|
|
// check if module language file exists for the language set by the user (e.g. DE, EN)
|
| 40 |
|
|
if(!file_exists(WB_PATH .'/modules/form/languages/'.LANGUAGE .'.php')) {
|
| 41 |
|
|
// no module language file exists for the language set by the user, include default module language file EN.php
|
| 42 |
|
|
require_once(WB_PATH .'/modules/form/languages/EN.php');
|
| 43 |
|
|
} else {
|
| 44 |
|
|
// a module language file exists for the language defined by the user, load it
|
| 45 |
|
|
require_once(WB_PATH .'/modules/form/languages/'.LANGUAGE .'.php');
|
| 46 |
|
|
}
|
| 47 |
|
|
|
| 48 |
|
|
// Get header and footer
|
| 49 |
|
|
$query_content = $database->query("SELECT * FROM ".TABLE_PREFIX."mod_form_settings WHERE section_id = '$section_id'");
|
| 50 |
|
|
$setting = $query_content->fetchRow();
|
| 51 |
|
|
|
| 52 |
|
|
// Set raw html <'s and >'s to be replace by friendly html code
|
| 53 |
|
|
$raw = array('<', '>');
|
| 54 |
|
|
$friendly = array('<', '>');
|
| 55 |
|
|
|
| 56 |
|
|
// check if backend.css file needs to be included into the <body></body> of modify.php
|
| 57 |
|
|
if(!method_exists($admin, 'register_backend_modfiles') && file_exists(WB_PATH ."/modules/form/backend.css")) {
|
| 58 |
|
|
echo '<style type="text/css">';
|
| 59 |
|
|
include(WB_PATH .'/modules/form/backend.css');
|
| 60 |
|
|
echo "\n</style>\n";
|
| 61 |
|
|
}
|
| 62 |
|
|
|
| 63 |
|
|
?>
|
| 64 |
|
|
<h2><?php echo $MOD_FORM['SETTINGS']; ?></h2>
|
| 65 |
|
|
<?php
|
| 66 |
|
|
// include the button to edit the optional module CSS files
|
| 67 |
|
|
// Note: CSS styles for the button are defined in backend.css (div class="mod_moduledirectory_edit_css")
|
| 68 |
|
|
// Place this call outside of any <form></form> construct!!!
|
| 69 |
|
|
if(function_exists('edit_module_css')) {
|
| 70 |
|
|
edit_module_css('form');
|
| 71 |
|
|
}
|
| 72 |
|
|
?>
|
| 73 |
|
|
|
| 74 |
|
|
<form name="edit" action="<?php echo WB_URL; ?>/modules/form/save_settings.php" method="post" style="margin: 0;">
|
| 75 |
|
|
|
| 76 |
1069
|
Ruebenwurz
|
<input type="hidden" name="page_id" value="<?php echo $page_id; ?>" />
|
| 77 |
|
|
<input type="hidden" name="section_id" value="<?php echo $section_id; ?>" />
|
| 78 |
982
|
Ruebenwurz
|
|
| 79 |
|
|
<table class="row_a" cellpadding="2" cellspacing="0" border="0" width="100%">
|
| 80 |
|
|
<tr>
|
| 81 |
|
|
<td colspan="2"><strong><?php echo $HEADING['GENERAL_SETTINGS']; ?></strong></td>
|
| 82 |
|
|
</tr>
|
| 83 |
|
|
<tr>
|
| 84 |
|
|
<td class="setting_name"><?php echo $TEXT['CAPTCHA_VERIFICATION']; ?>:</td>
|
| 85 |
|
|
<td>
|
| 86 |
1069
|
Ruebenwurz
|
<input type="radio" name="use_captcha" id="use_captcha_true" value="1"<?php if($setting['use_captcha'] == true) { echo ' checked="checked"'; } ?> />
|
| 87 |
982
|
Ruebenwurz
|
<label for="use_captcha_true"><?php echo $TEXT['ENABLED']; ?></label>
|
| 88 |
1069
|
Ruebenwurz
|
<input type="radio" name="use_captcha" id="use_captcha_false" value="0"<?php if($setting['use_captcha'] == false) { echo ' checked="checked"'; } ?> />
|
| 89 |
982
|
Ruebenwurz
|
<label for="use_captcha_false"><?php echo $TEXT['DISABLED']; ?></label>
|
| 90 |
|
|
</td>
|
| 91 |
|
|
</tr>
|
| 92 |
|
|
<tr>
|
| 93 |
|
|
<td class="setting_name"><?php echo $TEXT['MAX_SUBMISSIONS_PER_HOUR']; ?>:</td>
|
| 94 |
|
|
<td class="setting_value">
|
| 95 |
|
|
<input type="text" name="max_submissions" style="width: 30px;" maxlength="255" value="<?php echo str_replace($raw, $friendly, ($setting['max_submissions'])); ?>" />
|
| 96 |
|
|
</td>
|
| 97 |
|
|
</tr>
|
| 98 |
|
|
<tr>
|
| 99 |
|
|
<td class="setting_name"><?php echo $TEXT['SUBMISSIONS_STORED_IN_DATABASE']; ?>:</td>
|
| 100 |
|
|
<td class="setting_value">
|
| 101 |
|
|
<input type="text" name="stored_submissions" style="width: 30px;" maxlength="255" value="<?php echo str_replace($raw, $friendly, ($setting['stored_submissions'])); ?>" />
|
| 102 |
|
|
</td>
|
| 103 |
|
|
</tr>
|
| 104 |
|
|
<tr>
|
| 105 |
|
|
<td class="setting_name"><?php echo $TEXT['HEADER']; ?>:</td>
|
| 106 |
|
|
<td class="setting_value">
|
| 107 |
1069
|
Ruebenwurz
|
<textarea name="header" cols="80" rows="6" style="width: 98%; height: 80px;"><?php echo ($setting['header']); ?></textarea>
|
| 108 |
982
|
Ruebenwurz
|
</td>
|
| 109 |
|
|
</tr>
|
| 110 |
|
|
<tr>
|
| 111 |
|
|
<td class="setting_name"><?php echo $TEXT['FIELD'].' '.$TEXT['LOOP']; ?>:</td>
|
| 112 |
|
|
<td class="setting_value">
|
| 113 |
1069
|
Ruebenwurz
|
<textarea name="field_loop" cols="80" rows="6" style="width: 98%; height: 80px;"><?php echo ($setting['field_loop']); ?></textarea>
|
| 114 |
982
|
Ruebenwurz
|
</td>
|
| 115 |
|
|
</tr>
|
| 116 |
|
|
<tr>
|
| 117 |
|
|
<td class="setting_name"><?php echo $TEXT['FOOTER']; ?>:</td>
|
| 118 |
|
|
<td class="setting_value">
|
| 119 |
1069
|
Ruebenwurz
|
<textarea name="footer" cols="80" rows="6" style="width: 98%; height: 80px;"><?php echo str_replace($raw, $friendly, ($setting['footer'])); ?></textarea>
|
| 120 |
982
|
Ruebenwurz
|
</td>
|
| 121 |
|
|
</tr>
|
| 122 |
|
|
</table>
|
| 123 |
|
|
|
| 124 |
|
|
<table class="row_a" cellpadding="2" cellspacing="0" border="0" width="100%" style="margin-top: 3px;">
|
| 125 |
|
|
<tr>
|
| 126 |
|
|
<td colspan="2"><strong><?php echo $TEXT['EMAIL'].' '.$TEXT['SETTINGS']; ?></strong></td>
|
| 127 |
|
|
</tr>
|
| 128 |
|
|
<tr>
|
| 129 |
|
|
<td class="setting_name"><?php echo $TEXT['EMAIL'].' '.$TEXT['TO']; ?>:</td>
|
| 130 |
|
|
<td class="setting_value">
|
| 131 |
|
|
<input type="text" name="email_to" style="width: 98%;" maxlength="255" value="<?php echo str_replace($raw, $friendly, ($setting['email_to'])); ?>" />
|
| 132 |
|
|
</td>
|
| 133 |
|
|
</tr>
|
| 134 |
|
|
<tr>
|
| 135 |
|
|
<td class="setting_name"><?php echo $TEXT['EMAIL'].' '.$TEXT['FROM']; ?>:</td>
|
| 136 |
|
|
<td class="setting_value">
|
| 137 |
|
|
<select name="email_from_field" style="width: 98%;">
|
| 138 |
|
|
<option value="" onclick="javascript: document.getElementById('email_from').style.display = 'block';"><?php echo $TEXT['CUSTOM']; ?>:</option>
|
| 139 |
|
|
<?php
|
| 140 |
|
|
$email_from_value = str_replace($raw, $friendly, ($setting['email_from']));
|
| 141 |
|
|
$query_email_fields = $database->query("SELECT field_id,title FROM ".TABLE_PREFIX."mod_form_fields WHERE section_id = '$section_id' AND ( type = 'textfield' OR type = 'email' ) ORDER BY position ASC");
|
| 142 |
|
|
if($query_email_fields->numRows() > 0) {
|
| 143 |
|
|
while($field = $query_email_fields->fetchRow()) {
|
| 144 |
|
|
?>
|
| 145 |
|
|
<option value="field<?php echo $field['field_id']; ?>"<?php if($email_from_value == 'field'.$field['field_id']) { echo ' selected'; $selected = true; } ?> onclick="javascript: document.getElementById('email_from').style.display = 'none';">
|
| 146 |
|
|
<?php echo $TEXT['FIELD'].': '.$field['title']; ?>
|
| 147 |
|
|
</option>
|
| 148 |
|
|
<?php
|
| 149 |
|
|
}
|
| 150 |
|
|
}
|
| 151 |
|
|
?>
|
| 152 |
|
|
</select>
|
| 153 |
|
|
<input type="text" name="email_from" id="email_from" style="width: 98%; display: <?php if(isset($selected) AND $selected == true) { echo 'none'; } else { echo 'block'; } ?>;" maxlength="255" value="<?php if(substr($email_from_value, 0, 5) != 'field') { echo $email_from_value; } ?>" />
|
| 154 |
|
|
</td>
|
| 155 |
|
|
</tr>
|
| 156 |
|
|
<tr>
|
| 157 |
|
|
<td class="setting_name"><?php echo $TEXT['EMAIL'].' '.$TEXT['NAME']; ?>:</td>
|
| 158 |
|
|
<td class="setting_value">
|
| 159 |
|
|
<input type="text" name="email_fromname" style="width: 98%;" maxlength="255" value="<?php echo str_replace($raw, $friendly, ($setting['email_fromname'])); ?>" />
|
| 160 |
|
|
</td>
|
| 161 |
|
|
</tr>
|
| 162 |
|
|
<tr>
|
| 163 |
|
|
<td class="setting_name"><?php echo $TEXT['EMAIL'].' '.$TEXT['SUBJECT']; ?>:</td>
|
| 164 |
|
|
<td class="setting_value">
|
| 165 |
|
|
<input type="text" name="email_subject" style="width: 98%;" maxlength="255" value="<?php echo str_replace($raw, $friendly, ($setting['email_subject'])); ?>" />
|
| 166 |
|
|
</td>
|
| 167 |
|
|
</tr>
|
| 168 |
|
|
</table>
|
| 169 |
|
|
|
| 170 |
|
|
<table class="row_a" cellpadding="2" cellspacing="0" border="0" width="100%" style="margin-top: 3px;">
|
| 171 |
|
|
<tr>
|
| 172 |
|
|
<td colspan="2"><strong><?php echo $TEXT['SUCCESS'].' '.$TEXT['SETTINGS']; ?></strong></td>
|
| 173 |
|
|
</tr>
|
| 174 |
|
|
<tr>
|
| 175 |
|
|
<td class="setting_name"><?php echo $TEXT['EMAIL'].' '.$TEXT['TO']; ?>:</td>
|
| 176 |
|
|
<td class="setting_value">
|
| 177 |
|
|
<select name="success_email_to" style="width: 98%;">
|
| 178 |
|
|
<option value="" onclick="javascript: document.getElementById('success_email_to').style.display = 'block';"><?php echo $TEXT['NONE']; ?></option>
|
| 179 |
|
|
<?php
|
| 180 |
|
|
$success_email_to = str_replace($raw, $friendly, ($setting['success_email_to']));
|
| 181 |
|
|
$query_email_fields = $database->query("SELECT field_id,title FROM ".TABLE_PREFIX."mod_form_fields WHERE section_id = '$section_id' AND ( type = 'textfield' OR type = 'email' ) ORDER BY position ASC");
|
| 182 |
|
|
if($query_email_fields->numRows() > 0) {
|
| 183 |
|
|
while($field = $query_email_fields->fetchRow()) {
|
| 184 |
|
|
?>
|
| 185 |
|
|
<option value="field<?php echo $field['field_id']; ?>"<?php if($success_email_to == 'field'.$field['field_id']) { echo ' selected'; $selected = true; } ?> onclick="javascript: document.getElementById('email_from').style.display = 'none';">
|
| 186 |
|
|
<?php echo $TEXT['FIELD'].': '.$field['title']; ?>
|
| 187 |
|
|
</option>
|
| 188 |
|
|
<?php
|
| 189 |
|
|
}
|
| 190 |
|
|
}
|
| 191 |
|
|
?>
|
| 192 |
|
|
</select>
|
| 193 |
|
|
</td>
|
| 194 |
|
|
</tr>
|
| 195 |
|
|
<tr>
|
| 196 |
|
|
<td class="setting_name"><?php echo $TEXT['EMAIL'].' '.$TEXT['FROM']; ?>:</td>
|
| 197 |
|
|
<td class="setting_value">
|
| 198 |
|
|
<input type="text" name="success_email_from" style="width: 98%;" maxlength="255" value="<?php echo str_replace($raw, $friendly, ($setting['success_email_from'])); ?>" />
|
| 199 |
|
|
</td>
|
| 200 |
|
|
</tr>
|
| 201 |
|
|
<tr>
|
| 202 |
|
|
<td class="setting_name"><?php echo $TEXT['EMAIL'].' '.$TEXT['NAME']; ?>:</td>
|
| 203 |
|
|
<td class="setting_value">
|
| 204 |
|
|
<input type="text" name="success_email_fromname" style="width: 98%;" maxlength="255" value="<?php echo str_replace($raw, $friendly, ($setting['success_email_fromname'])); ?>" />
|
| 205 |
|
|
</td>
|
| 206 |
|
|
</tr>
|
| 207 |
|
|
<tr>
|
| 208 |
|
|
<td class="setting_name"><?php echo $TEXT['EMAIL'].' '.$TEXT['SUBJECT']; ?>:</td>
|
| 209 |
|
|
<td class="setting_value">
|
| 210 |
|
|
<input type="text" name="success_email_subject" style="width: 98%;" maxlength="255" value="<?php echo str_replace($raw, $friendly, ($setting['success_email_subject'])); ?>" />
|
| 211 |
|
|
</td>
|
| 212 |
|
|
</tr>
|
| 213 |
|
|
<tr>
|
| 214 |
|
|
<td class="setting_name"><?php echo $TEXT['EMAIL'].' '.$TEXT['TEXT']; ?>:</td>
|
| 215 |
|
|
<td class="setting_value">
|
| 216 |
1069
|
Ruebenwurz
|
<textarea name="success_email_text" cols="80" rows="1" style="width: 98%; height: 80px;"><?php echo str_replace($raw, $friendly, ($setting['success_email_text'])); ?></textarea>
|
| 217 |
982
|
Ruebenwurz
|
</td>
|
| 218 |
|
|
</tr>
|
| 219 |
|
|
<tr>
|
| 220 |
|
|
<td class="newsection"><?php echo $TEXT['SUCCESS'].' '.$TEXT['PAGE']; ?>:</td>
|
| 221 |
|
|
<td class="newsection">
|
| 222 |
|
|
<select name="success_page">
|
| 223 |
|
|
<option value="none"><?php echo $TEXT['NONE']; ?></option>
|
| 224 |
|
|
<?php
|
| 225 |
|
|
// Get exisiting pages and show the pagenames
|
| 226 |
|
|
$query = $database->query("SELECT * FROM ".TABLE_PREFIX."pages WHERE visibility <> 'deleted'");
|
| 227 |
|
|
while($mail_page = $query->fetchRow()) {
|
| 228 |
|
|
if(!$admin->page_is_visible($mail_page))
|
| 229 |
|
|
continue;
|
| 230 |
|
|
$mail_pagename = $mail_page['menu_title'];
|
| 231 |
|
|
$success_page = $mail_page['page_id'];
|
| 232 |
1069
|
Ruebenwurz
|
// echo $success_page.':'.$setting['success_page'].':'; not vailde
|
| 233 |
982
|
Ruebenwurz
|
if($setting['success_page'] == $success_page) {
|
| 234 |
1069
|
Ruebenwurz
|
$selected = ' selected="selected"';
|
| 235 |
982
|
Ruebenwurz
|
} else {
|
| 236 |
|
|
$selected = '';
|
| 237 |
|
|
}
|
| 238 |
|
|
echo '<option value="'.$success_page.'"'.$selected.'>'.$mail_pagename.'</option>';
|
| 239 |
|
|
}
|
| 240 |
|
|
?>
|
| 241 |
|
|
</select>
|
| 242 |
|
|
</td>
|
| 243 |
|
|
</tr>
|
| 244 |
|
|
</table>
|
| 245 |
|
|
|
| 246 |
|
|
<table cellpadding="0" cellspacing="0" border="0" width="100%">
|
| 247 |
|
|
<tr>
|
| 248 |
|
|
<td align="left">
|
| 249 |
1069
|
Ruebenwurz
|
<input name="save" type="submit" value="<?php echo $TEXT['SAVE']; ?>" style="width: 100px; margin-top: 5px;">
|
| 250 |
982
|
Ruebenwurz
|
</td>
|
| 251 |
|
|
<td align="right">
|
| 252 |
|
|
<input type="button" value="<?php echo $TEXT['CANCEL']; ?>" onclick="javascript: window.location = '<?php echo ADMIN_URL; ?>/pages/modify.php?page_id=<?php echo $page_id; ?>';" style="width: 100px; margin-top: 5px;" />
|
| 253 |
|
|
</td>
|
| 254 |
|
|
</tr>
|
| 255 |
|
|
</table>
|
| 256 |
1069
|
Ruebenwurz
|
</form>
|
| 257 |
982
|
Ruebenwurz
|
<?php
|
| 258 |
|
|
|
| 259 |
|
|
// Print admin footer
|
| 260 |
|
|
$admin->print_footer();
|
| 261 |
|
|
|
| 262 |
560
|
Ruebenwurz
|
?>
|