Index: trunk/CHANGELOG
===================================================================
--- trunk/CHANGELOG	(revision 559)
+++ trunk/CHANGELOG	(revision 560)
@@ -13,6 +13,7 @@
 ------------------------------------- 2.7.0 -------------------------------------
 
 18-Jan-2008 Matthias Gallas
+!	Updated form modul with features from the advanced form modul
 #	Fixed hardcoded /pages issue in intro page feature
 +	Added example .htaccess to parse .html files, fixed bug in changeset 555
 !	Revoked parts of changeset 547 and again introduced changeset 540
Index: trunk/wb/upgrade-script.php
===================================================================
--- trunk/wb/upgrade-script.php	(revision 559)
+++ trunk/wb/upgrade-script.php	(revision 560)
@@ -198,8 +198,104 @@
 }
 
 
+//******************************************************************************
+//The following lines upgrades the form modul from 2.6.x to the andvanced version from 2.7.x
+//******************************************************************************
 
+$database = new database(DB_URL);
 
+echo "<BR><B>Adding new field to database table mod_form_settings</B><BR>";
+
+if($database->query("ALTER TABLE `".TABLE_PREFIX."mod_form_settings` ADD `success_email_subject` VARCHAR(255) NOT NULL AFTER `success_message`")) {
+	echo 'Database Field success_email_subject added successfully<br />';
+}
+echo mysql_error().'<br />';
+
+if($database->query("ALTER TABLE `".TABLE_PREFIX."mod_form_settings` ADD `success_email_text` TEXT NOT NULL AFTER `success_message`")) {
+	echo 'Database Field success_email_text added successfully<br />';
+}
+echo mysql_error().'<br />';
+
+if($database->query("ALTER TABLE `".TABLE_PREFIX."mod_form_settings` ADD `success_email_from` VARCHAR(255) NOT NULL AFTER `success_message`")) {
+	echo 'Database Field success_email_from added successfully<br />';
+}
+echo mysql_error().'<br />';
+
+if($database->query("ALTER TABLE `".TABLE_PREFIX."mod_form_settings` ADD `success_email_to` TEXT NOT NULL AFTER `success_message`")) {
+	echo 'Database Field success_email_to added successfully<br />';
+}
+echo mysql_error().'<br />';
+
+if($database->query("ALTER TABLE `".TABLE_PREFIX."mod_form_settings` ADD `success_page` TEXT NOT NULL AFTER `success_message`")) {
+	echo 'Database Field success_page added successfully<br />';
+}
+echo mysql_error().'<br />';
+
+echo "<BR><B>Deleting field success_message from table mod_form_settings</B><BR>";
+
+if($database->query("ALTER TABLE `".TABLE_PREFIX."mod_form_settings` DROP `success_message`")) {
+	echo 'Database field success_message droped successfully<br>';
+}
+echo mysql_error().'<br />';
+
+
+// UPDATING DATA INTO FIELDS
+echo "<BR>";
+
+// These are the default setting
+$success_page = 'none';
+$success_email_to = '';
+$success_email_text = 'Thank you for submitting your form on '.WEBSITE_TITLE;
+$success_email_text = addslashes($success_email_text);
+$success_email_subject = 'You have submitted a form';
+
+// Insert default settings into database
+$query_dates = $database->query("SELECT * FROM ".TABLE_PREFIX."mod_form_settings where section_id != 0 and page_id != 0");
+while($result = $query_dates->fetchRow()) {
+	
+	echo "<B>Add default settings data to database for form section_id= ".$result['section_id']."</b><BR>";
+	$section_id = $result['section_id'];
+
+	if($database->query("UPDATE `".TABLE_PREFIX."mod_form_settings` SET `success_page` = '$success_page' WHERE `section_id` = $section_id")) {
+		echo 'Database data success_page added successfully<br>';
+	}
+	echo mysql_error().'<br />';
+	
+	if($database->query("UPDATE `".TABLE_PREFIX."mod_form_settings` SET `success_email_to` = '$success_email_to' WHERE `section_id` = $section_id")) {
+		echo 'Database data success_email_to added successfully<br>';
+	}
+	echo mysql_error().'<br />';
+	
+	if($database->query("UPDATE `".TABLE_PREFIX."mod_form_settings` SET `success_email_text` = '$success_email_text' WHERE `section_id` = $section_id")) {
+		echo 'Database data success_email_text added successfully<br>';
+	}
+	echo mysql_error().'<br />';
+	
+	if($database->query("UPDATE `".TABLE_PREFIX."mod_form_settings` SET `success_email_subject` = '$success_email_subject' WHERE `section_id` = $section_id")) {
+		echo 'Database data success_email_subject added successfully<br>';
+	}
+	echo mysql_error().'<br />';
+	
+}
+
+// copy field email_to to success_email_from
+$query_dates = $database->query("SELECT * FROM ".TABLE_PREFIX."mod_form_settings where section_id != 0 and page_id != 0");
+while($result = $query_dates->fetchRow()) {
+	
+	echo "<B>Copying field email_to to success_email_from for form section_id= ".$result['section_id']."</B><BR>";
+	$section_id = $result['section_id'];
+
+	$success_email_from = $result['email_to'];
+	if($database->query("UPDATE `".TABLE_PREFIX."mod_form_settings` SET `success_email_from` = '$success_email_from' WHERE `section_id` = $section_id")) {
+		echo 'Copyied field email_to to success_email_from successfully<br>';
+	}
+	echo mysql_error().'<br />';
+}
+
+//******************************************************************************
+//End of upgrade script for the form modul
+//******************************************************************************
+
 echo "<br /><br />Done<br />";
 
 ?>
Index: trunk/wb/modules/form/modify_field.php
===================================================================
--- trunk/wb/modules/form/modify_field.php	(revision 559)
+++ trunk/wb/modules/form/modify_field.php	(revision 560)
@@ -60,34 +60,37 @@
 <input type="hidden" name="page_id" value="<?php echo $page_id; ?>">
 <input type="hidden" name="field_id" value="<?php echo $field_id; ?>">
 
-<table cellpadding="4" cellspacing="0" border="0" width="100%">
-<tr>
-	<td width="80"><?php echo $TEXT['TITLE']; ?>:</td>
-	<td>
-		<input type="text" name="title" value="<?php echo htmlspecialchars(($form['title'])); ?>" style="width: 100%;" maxlength="255" />
-	</td>
-</tr>
-<tr>
-	<td><?php echo $TEXT['TYPE']; ?>:</td>
-	<td>
-		<select name="type" style="width: 100%;">
-			<option value=""><?php echo $TEXT['PLEASE_SELECT']; ?>...</option>
-			<option value="heading"<?php if($type == 'heading') { echo ' selected'; } ?>><?php echo $TEXT['HEADING']; ?></option>
-			<option value="textfield"<?php if($type == 'textfield') { echo ' selected'; } ?>><?php echo $TEXT['SHORT'].' '.$TEXT['TEXT']; ?> (Textfield)</option>
-			<option value="textarea"<?php if($type == 'textarea') { echo ' selected'; } ?>><?php echo $TEXT['LONG'].' '.$TEXT['TEXT']; ?> (Textarea)</option>
-			<option value="select"<?php if($type == 'select') { echo ' selected'; } ?>><?php echo $TEXT['SELECT_BOX']; ?></option>
-			<option value="checkbox"<?php if($type == 'checkbox') { echo ' selected'; } ?>><?php echo $TEXT['CHECKBOX_GROUP']; ?></option>
-			<option value="radio"<?php if($type == 'radio') { echo ' selected'; } ?>><?php echo $TEXT['RADIO_BUTTON_GROUP']; ?></option>
-			<option value="email"<?php if($type == 'email') { echo ' selected'; } ?>><?php echo $TEXT['EMAIL_ADDRESS']; ?></option>
-		</select>
-	</td>
-</tr>
+<table class="row_a" cellpadding="2" cellspacing="0" border="0" width="100%">
+	<tr>
+		<td colspan="2"><strong><?php echo $TEXT['MODIFY'].' '.$TEXT['FIELD']; ?></strong></td>
+	</tr>
+	<tr>
+		<td width="20%"><?php echo $TEXT['TITLE']; ?>:</td>
+		<td>
+			<input type="text" name="title" value="<?php echo htmlspecialchars(($form['title'])); ?>" style="width: 98%;" maxlength="255" />
+		</td>
+	</tr>
+	<tr>
+		<td><?php echo $TEXT['TYPE']; ?>:</td>
+		<td>
+			<select name="type" style="width: 98%;">
+				<option value=""><?php echo $TEXT['PLEASE_SELECT']; ?>...</option>
+				<option value="heading"<?php if($type == 'heading') { echo ' selected'; } ?>><?php echo $TEXT['HEADING']; ?></option>
+				<option value="textfield"<?php if($type == 'textfield') { echo ' selected'; } ?>><?php echo $TEXT['SHORT'].' '.$TEXT['TEXT']; ?> (Textfield)</option>
+				<option value="textarea"<?php if($type == 'textarea') { echo ' selected'; } ?>><?php echo $TEXT['LONG'].' '.$TEXT['TEXT']; ?> (Textarea)</option>
+				<option value="select"<?php if($type == 'select') { echo ' selected'; } ?>><?php echo $TEXT['SELECT_BOX']; ?></option>
+				<option value="checkbox"<?php if($type == 'checkbox') { echo ' selected'; } ?>><?php echo $TEXT['CHECKBOX_GROUP']; ?></option>
+				<option value="radio"<?php if($type == 'radio') { echo ' selected'; } ?>><?php echo $TEXT['RADIO_BUTTON_GROUP']; ?></option>
+				<option value="email"<?php if($type == 'email') { echo ' selected'; } ?>><?php echo $TEXT['EMAIL_ADDRESS']; ?></option>
+			</select>
+		</td>
+	</tr>
 <?php if($type != 'none' AND $type != 'email') { ?>
 	<?php if($type == 'heading') { ?>
 	<tr>
 		<td valign="top"><?php echo $TEXT['TEMPLATE']; ?>:</td>
 		<td>
-		<textarea name="template" style="width: 100%; height: 20px;"><?php echo htmlspecialchars(($form['extra'])); ?></textarea>
+			<textarea name="template" style="width: 98%; height: 20px;"><?php echo htmlspecialchars(($form['extra'])); ?></textarea>
 		</td>
 	</tr>
 	<?php } elseif($type == 'textfield') { ?>
@@ -94,13 +97,13 @@
 	<tr>
 		<td><?php echo $TEXT['LENGTH']; ?>:</td>
 		<td>
-			<input type="text" name="length" value="<?php echo $form['extra']; ?>" style="width: 100%;" maxlength="3" />
+			<input type="text" name="length" value="<?php echo $form['extra']; ?>" style="width: 98%;" maxlength="3" />
 		</td>
 	</tr>
 	<tr>
 		<td><?php echo $TEXT['DEFAULT_TEXT']; ?>:</td>
 		<td>
-			<input type="text" name="value" value="<?php echo $form['value']; ?>" style="width: 100%;" />
+			<input type="text" name="value" value="<?php echo $form['value']; ?>" style="width: 98%;" />
 		</td>
 	</tr>
 	<?php } elseif($type == 'textarea') { ?>
@@ -107,7 +110,7 @@
 	<tr>
 		<td valign="top"><?php echo $TEXT['DEFAULT_TEXT']; ?>:</td>
 		<td>
-			<textarea name="value" style="width: 100%; height: 100px;"><?php echo $form['value']; ?></textarea>
+			<textarea name="value" style="width: 98%; height: 100px;"><?php echo $form['value']; ?></textarea>
 		</td>
 	</tr>
 	<?php } elseif($type == 'select' OR $type = 'radio' OR $type = 'checkbox') { ?>
@@ -153,7 +156,7 @@
 		<td><?php echo $TEXT['SIZE']; ?>:</td>
 		<td>
 			<?php $form['extra'] = explode(',',$form['extra']); ?>
-			<input type="text" name="size" value="<?php echo trim($form['extra'][0]); ?>" style="width: 100%;" maxlength="3" />
+			<input type="text" name="size" value="<?php echo trim($form['extra'][0]); ?>" style="width: 98%;" maxlength="3" />
 		</td>
 	</tr>
 	<tr>
@@ -174,41 +177,48 @@
 	<tr>
 		<td valign="top"><?php echo $TEXT['SEPERATOR']; ?>:</td>
 		<td>
-			<input type="text" name="seperator" value="<?php echo $form['extra']; ?>" style="width: 100%;" />
+			<input type="text" name="seperator" value="<?php echo $form['extra']; ?>" style="width: 98%;" />
 		</td>
 	</tr>
 	<?php } ?>
 <?php } ?>
 <?php if($type != 'heading' AND $type != 'none') { ?>
-<tr>
-	<td><?php echo $TEXT['REQUIRED']; ?>:</td>
-	<td>
-		<input type="radio" name="required" id="required_true" value="1" <?php if($form['required'] == 1) { echo ' checked'; } ?> />
-		<a href="#" onclick="javascript: document.getElementById('required_true').checked = true;">
-		<?php echo $TEXT['YES']; ?>
-		</a>
-		&nbsp;
-		<input type="radio" name="required" id="required_false" value="0" <?php if($form['required'] == 0) { echo ' checked'; } ?> />
-		<a href="#" onclick="javascript: document.getElementById('required_false').checked = true;">
-		<?php echo $TEXT['NO']; ?>
-		</a>
-	</td>
-</tr>
+	<tr>
+		<td><?php echo $TEXT['REQUIRED']; ?>:</td>
+		<td>
+			<input type="radio" name="required" id="required_true" value="1" <?php if($form['required'] == 1) { echo ' checked'; } ?> />
+			<a href="#" onclick="javascript: document.getElementById('required_true').checked = true;">
+			<?php echo $TEXT['YES']; ?>
+			</a>
+			&nbsp;
+			<input type="radio" name="required" id="required_false" value="0" <?php if($form['required'] == 0) { echo ' checked'; } ?> />
+			<a href="#" onclick="javascript: document.getElementById('required_false').checked = true;">
+			<?php echo $TEXT['NO']; ?>
+			</a>
+		</td>
+	</tr>
 <?php } ?>
 </table>
 
 <table cellpadding="0" cellspacing="0" border="0" width="100%">
-<tr>
-	<td width="90">&nbsp;
-		
-	</td>
-	<td align="left">
-		<input name="save" type="submit" value="<?php echo $TEXT['SAVE'].' '.$TEXT['FIELD']; ?>" style="width: 200px; margin-top: 5px;"></form>
-	</td>
-	<td align="right">
-		<input type="button" value="<?php echo $TEXT['CLOSE']; ?>" onclick="javascript: window.location = '<?php echo ADMIN_URL; ?>/pages/modify.php?page_id=<?php echo $page_id; ?>';" style="width: 100px; margin-top: 5px;" />
-	</td>
-</tr>
+	<tr>
+		<td align="left">
+			<input name="save" type="submit" value="<?php echo $TEXT['SAVE']; ?>" style="width: 100px; margin-top: 5px;"></form>
+		</td>
+		<?php
+		// added by John Maats, PCWacht, 12 januar 2006
+		if ($type<>'none') {
+		?>
+		<td align="center">
+			<input type="button" value="<?php echo $TEXT['ADD'].' '.$TEXT['FIELD']; ?>" onclick="javascript: window.location = '<?php echo WB_URL; ?>/modules/form/add_field.php?page_id=<?php echo $page_id; ?>&section_id=<?php echo $section_id; ?>';" style="width: 200px; margin-top: 5px;" />
+		</td>
+		<?php } 
+		// end addition
+		?>
+		<td align="right">
+			<input type="button" value="<?php echo $TEXT['CLOSE']; ?>" onclick="javascript: window.location = '<?php echo ADMIN_URL; ?>/pages/modify.php?page_id=<?php echo $page_id; ?>';" style="width: 100px; margin-top: 5px;" />
+		</td>
+	</tr>
 </table>
 
 <?php

Property changes on: trunk/wb/modules/form/modify_field.php
___________________________________________________________________
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Deleted: svn:keywords
## -1 +0,0 ##
-Id
\ No newline at end of property
Index: trunk/wb/modules/form/info.php
===================================================================
--- trunk/wb/modules/form/info.php	(revision 559)
+++ trunk/wb/modules/form/info.php	(revision 560)
@@ -28,12 +28,52 @@
 for his contributions to this module - adding extra field types
 */
 
+/*
+revision:
+2.6.2.0 21 jan 2007
+	minor fixes in the search tabel entries
+2.6.1.9 24 dez 2006
+	adapted all files to be compatible with 2.6.5
+2.6.1.8 03 oct 2006
+	fixed double )) in save_field.php line 76
+2.6.1.7 24 jan 2006
+	added header to modify_fields
+	removed a typo (captcha)
+2.6.1.6 23 jan 2006
+	added exit(0); after each header("Location: ...) call
+	added language text for 'none' thanks to Ruebenwurzel
+2.6.1.5 23 jan 2006
+    added anti caching to captcha
+    changed the way thankyou page works, if chosen page is none, mail still could be sent, thank you message is shown!
+    
+2.6.1.4 22 jan 2006
+    added email to mailto/from selected fields  -> Ticket #118 
+    removed last separator in radiobutton and checkbox 
+2.6.1.3 21 jan 2006
+    restored thankyou text
+    fixed mail lines, format of maillines -> Ticket #86
+    fixed max_submissions -> Ticket #115
+    fixed mailto/from selected fields (only textfields) -> Ticket #118 
+2.6.1.2 16 jan 2006
+    fixed ' in websitetitle
+2.6.1.1 14 jan 2006
+    changed thank you text to thank you page 
+    added thank you mail
+    changed behaviour of adding fields
+*/
+/*
+todo:
+- display of fieldlengths as variable, 
+- back after error with filled in stuff?
+- validation link for submissions???
+*/ 
+
 $module_directory = 'form';
 $module_name = 'Form';
 $module_function = 'page';
-$module_version = '2.6';
+$module_version = '2.6.2.0';
 $module_platform = '2.6.x';
-$module_author = 'Ryan Djurovich & Rudolph Lartey';
+$module_author = 'Ryan Djurovich & Rudolph Lartey - additions John Maats - PCWacht';
 $module_license = 'GNU General Public License';
 $module_description = 'This module allows you to create customised online forms, such as a feedback form. '.
 'Thank-you to Rudolph Lartey who help enhance this module, providing code for extra field types, etc.';

Property changes on: trunk/wb/modules/form/info.php
___________________________________________________________________
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Deleted: svn:keywords
## -1 +0,0 ##
-Id
\ No newline at end of property
Index: trunk/wb/modules/form/add_field.php
===================================================================
--- trunk/wb/modules/form/add_field.php	(revision 559)
+++ trunk/wb/modules/form/add_field.php	(revision 560)

Property changes on: trunk/wb/modules/form/add_field.php
___________________________________________________________________
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Deleted: svn:keywords
## -1 +0,0 ##
-Id
\ No newline at end of property
Index: trunk/wb/modules/form/move_down.php
===================================================================
--- trunk/wb/modules/form/move_down.php	(revision 559)
+++ trunk/wb/modules/form/move_down.php	(revision 560)

Property changes on: trunk/wb/modules/form/move_down.php
___________________________________________________________________
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Deleted: svn:keywords
## -1 +0,0 ##
-Id
\ No newline at end of property
Index: trunk/wb/modules/form/edit_css.php
===================================================================
--- trunk/wb/modules/form/edit_css.php	(nonexistent)
+++ trunk/wb/modules/form/edit_css.php	(revision 560)
@@ -0,0 +1,126 @@
+<?php
+
+// $Id:$
+
+######################################################################################################################
+#
+#	PURPOSE OF THIS FILE:
+#	This file contains the routines required to edit the optional module files: frontend.css and backend.css.
+# Nothing needs to be changed in this file. Keep it as is.
+#
+#	INVOKED BY:
+#	This file should be invoked by clicking on a text link shown in modify.php.
+#
+######################################################################################################################
+
+/**
+  Module developed for the Open Source Content Management System Website Baker (http://websitebaker.org)
+  Copyright (C) year, Authors name
+  Contact me: author(at)domain.xxx, http://authorwebsite.xxx
+
+  This module is free software. You can redistribute it and/or modify it 
+  under the terms of the GNU General Public License  - version 2 or later, 
+  as published by the Free Software Foundation: http://www.gnu.org/licenses/gpl.html.
+
+  This module is distributed in the hope that it will be useful, 
+  but WITHOUT ANY WARRANTY; without even the implied warranty of 
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
+  GNU General Public License for more details.
+**/
+
+// include configuration file and admin wrapper script
+require('../../config.php');
+require(WB_PATH.'/modules/admin.php');
+
+// include functions to edit the optional module CSS files (frontend.css, backend.css)
+require_once('css.functions.php');
+
+// check if action is: save or edit
+if(isset($_GET['action']) && $_GET['action'] == 'save' && isset($_POST['edit_file']) && mod_file_exists($_POST['edit_file'])) {
+	/** 
+	SAVE THE UPDATED CONTENTS TO THE CSS FILE
+	*/
+	$css_content = '';
+	if(isset($_POST['css_codepress']) && strlen($_POST['css_codepress']) > 0) {
+		// if Javascript is enabled, take contents from hidden field: css_codepress
+		$css_content = stripslashes($_POST['css_codepress']);
+	} elseif(isset($_POST['css_data']) && strlen($_POST['css_data']) > 0) {
+		// if Javascript is disabled, take contens from textarea: css_data
+		$css_content = stripslashes($_POST['css_data']);
+	}
+
+	$bytes = 0;
+	if ($css_content != '') {
+		// open the module CSS file for writting
+		$mod_file = @fopen(dirname(__FILE__) .'/' .$_POST['edit_file'], "wb");
+		// write new content to the module CSS file
+		$bytes = @fwrite($mod_file, $css_content);
+		// close the file
+		@fclose($mod_file);
+	}
+
+	// write out status message
+	if($bytes == 0 ) {
+		$admin->print_error($TEXT['ERROR'], ADMIN_URL.'/pages/modify.php?page_id='.$page_id);
+	} else {
+		$admin->print_success($TEXT['SUCCESS'], ADMIN_URL.'/pages/modify.php?page_id='.$page_id);
+	}
+
+} else {
+	/** 
+	MODIFY CONTENTS OF THE CSS FILE VIA TEXT AREA 
+	*/
+	
+	// check which module file to edit (frontend.css, backend.css or '')
+	$css_file = '';
+	if(isset($_GET['edit_file'])) $css_file = edit_mod_file($_GET['edit_file']);
+
+	// display output
+	if($css_file == '') {
+		// no valid module file to edit; display error message and backlink to modify.php
+		echo "<h2>Nothing to edit</h2>";
+		echo "<p>No valid module file exists for this module.</p>";
+		$output  = "<a href=\"#\" onclick=\"javascript: window.location = '";
+		$output .= ADMIN_URL ."/pages/modify.php?page_id=" .$page_id ."'\">back</a>";
+		echo $output;
+	} else {
+		// store content of the module file in variable
+		$css_content = @file_get_contents(dirname(__FILE__) .'/' .$css_file);
+		// output content of module file to textareas
+		?>
+
+		<form name="edit_module_file" action="<?php echo $_SERVER['PHP_SELF'] .'?action=save';?>" method="post" style="margin: 0;">
+			<input type="hidden" name="section_id" value="<?php echo $section_id; ?>">
+			<input type="hidden" name="page_id" value="<?php echo $page_id; ?>">
+			<input type="hidden" name="css_codepress" value="" />
+			<input type="hidden" name="edit_file" value="<?php echo $css_file; ?>" />
+
+			<h2><?php echo $HEADING_CSS_FILE .'"' .$css_file; ?>"</h2>
+			<?php 
+				// include the toggle button to switch between frontend.css and backend.css (if both files exists)
+				toggle_css_file($css_file); 
+			?>
+			
+			<p><?php echo $TXT_EDIT_CSS_FILE; ?></p> 
+			
+			<textarea name="css_data" id="css_data" class="codepress css" cols="115" rows="25" wrap="VIRTUAL" style="margin:2px;"><?php echo $css_content; ?></textarea>
+			
+			<table cellpadding="0" cellspacing="0" border="0" width="100%">
+				<tr>
+					<td align="left">
+						<input name="save" type="submit" value="<?php echo $TEXT['SAVE'];?>" onclick="javascript: css_codepress.value = css_data.getCode();" style="width: 100px; margin-top: 5px;" />
+					</td>
+					<td align="right">
+						<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;" />
+					</td>
+				</tr>
+			</table>
+		</form>
+	<?php 
+	}
+}
+
+// Print admin footer
+$admin->print_footer();
+
+?>
\ No newline at end of file

Property changes on: trunk/wb/modules/form/edit_css.php
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: trunk/wb/modules/form/css.functions.php
===================================================================
--- trunk/wb/modules/form/css.functions.php	(nonexistent)
+++ trunk/wb/modules/form/css.functions.php	(revision 560)
@@ -0,0 +1,118 @@
+<?php
+
+// $Id$
+
+######################################################################################################################
+#
+#	PURPOSE OF THIS FILE:
+#	This file contains functions to edit the module CSS files (frontend.css and backend.css)
+#
+#	INVOKED BY:
+# 	This file is invoked when a user clicks on the edit CSS button in the modify.php file
+#
+######################################################################################################################
+
+/**
+  Module developed for the Open Source Content Management System Website Baker (http://websitebaker.org)
+  Copyright (C) year, Authors name
+  Contact me: author(at)domain.xxx, http://authorwebsite.xxx
+
+  This module is free software. You can redistribute it and/or modify it 
+  under the terms of the GNU General Public License  - version 2 or later, 
+  as published by the Free Software Foundation: http://www.gnu.org/licenses/gpl.html.
+
+  This module is distributed in the hope that it will be useful, 
+  but WITHOUT ANY WARRANTY; without even the implied warranty of 
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
+  GNU General Public License for more details.
+**/
+
+// prevent this file from being accesses directly
+if(defined('WB_PATH') == false) {
+	exit("Cannot access this file directly"); 
+}
+
+/**
+DEFINE LANGUAGE DEPENDING OUTPUTS FOR THE EDIT CSS PART
+*/
+$lang_dir = WB_PATH .'/modules/' .basename(dirname(__FILE__)) .'/languages/';
+if(file_exists($lang_dir .LANGUAGE .'.php')) {
+	// try to include custom language file if exists
+	require_once($lang_dir .LANGUAGE .'.php');
+} elseif(file_exists($lang_dir .'EN.php')) {
+	// try to include default module language file
+	require_once($lang_dir .'EN.php');
+}
+
+// set defaults if output varibles are not set in the languages files
+if(!isset($CAP_EDIT_CSS)) $CAP_EDIT_CSS	= 'Edit CSS';
+if(!isset($CAP_TOGGLE_CSS)) $CAP_TOGGLE_CSS	= 'Switch to ';
+if(!isset($HEADING_CSS_FILE))	$HEADING_CSS_FILE = 'Actual module file: ';
+if(!isset($TXT_EDIT_CSS_FILE)) $TXT_EDIT_CSS_FILE = 'Edit the CSS definitions in the textarea below.';
+
+// this function checks if the specified optional module file exists
+if (!function_exists('mod_file_exists')) {
+	function mod_file_exists($mod_file='frontend.css') {
+		// extract the module directory
+		$mod_dir = basename(dirname(__FILE__)) .'/' .$mod_file;
+		return file_exists(WB_PATH .'/modules/' .$mod_dir);
+	}
+}
+
+// this function displays a "Edit CSS" button in modify.php 
+// if the optional module files (module.css, module.js) if exists
+if (!function_exists('css_edit')) {
+	function css_edit() {
+		global $page_id, $section_id, $CAP_EDIT_CSS;
+		// extract the module directory
+		$mod_dir = basename(dirname(__FILE__));
+		$frontend_css = mod_file_exists('frontend.css');
+		$backend_css = mod_file_exists('backend.css');
+		if($frontend_css || $backend_css) {
+			// display link to edit the optional CSS module files
+			$file = $frontend_css ? 'frontend.css' : 'backend.css';
+			$output  = '<div class="mod_' .$mod_dir .'_edit_css"><a href="' .WB_URL .'/modules/' .$mod_dir .'/edit_css.php';
+			$output .= '?page_id=' .$page_id .'&section_id=' .$section_id .'&edit_file=' .$file .'">';
+			$output .= $CAP_EDIT_CSS .'</a></div>';
+			echo $output;
+		}
+	}
+}
+
+// this function returns a secure module file from $_GET['edit_file']
+if (!function_exists('edit_mod_file')) {
+	function edit_mod_file() {
+		$allowed_files = array('frontend.css', 'backend.css');
+		if(isset($_GET['edit_file']) && in_array($_GET['edit_file'], $allowed_files)) {
+			return $_GET['edit_file'];
+		} elseif(mod_file_exists('frontend.css')) {
+			return 'frontend.css';
+		} elseif(mod_file_exists('backend_css')) {
+			return 'backend.css';
+		} else {
+			return '';
+		}
+	}
+}	
+
+// this function displays a button to toggle between the optional module CSS files
+// function is invoked from edit_css.php file
+if (!function_exists('toggle_css_file')) {
+	function toggle_css_file($base_css_file = 'frontend.css') {
+		$allowed_mod_files = array('frontend.css', 'backend.css');
+		if(!in_array($base_css_file, $allowed_mod_files)) return;
+		global $page_id, $section_id, $CAP_TOGGLE_CSS;
+		// extract the module directory
+		$mod_dir = basename(dirname(__FILE__));
+		$toggle_file = ($base_css_file == 'frontend.css') ? 'backend.css' : 'frontend.css';
+		if(mod_file_exists($toggle_file)) {
+			// display button to toggle between the two CSS files: frontend.css, backend.css
+			$output  = '<div class="mod_' .$mod_dir .'_edit_css"><a href="' .WB_URL .'/modules/' .$mod_dir .'/edit_css.php';
+			$output .= '?page_id=' .$page_id .'&section_id=' .$section_id .'&edit_file=' .$toggle_file .'">';
+			$output .= $CAP_TOGGLE_CSS .$toggle_file .'</a></div>';
+			echo $output;
+		}
+	}
+}
+
+?>
\ No newline at end of file

Property changes on: trunk/wb/modules/form/css.functions.php
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: trunk/wb/modules/form/save_field.php
===================================================================
--- trunk/wb/modules/form/save_field.php	(revision 559)
+++ trunk/wb/modules/form/save_field.php	(revision 560)

Property changes on: trunk/wb/modules/form/save_field.php
___________________________________________________________________
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Deleted: svn:keywords
## -1 +0,0 ##
-Id
\ No newline at end of property
Index: trunk/wb/modules/form/delete.php
===================================================================
--- trunk/wb/modules/form/delete.php	(revision 559)
+++ trunk/wb/modules/form/delete.php	(revision 560)

Property changes on: trunk/wb/modules/form/delete.php
___________________________________________________________________
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Deleted: svn:keywords
## -1 +0,0 ##
-Id
\ No newline at end of property
Index: trunk/wb/modules/form/search.php
===================================================================
--- trunk/wb/modules/form/search.php	(revision 559)
+++ trunk/wb/modules/form/search.php	(revision 560)

Property changes on: trunk/wb/modules/form/search.php
___________________________________________________________________
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Deleted: svn:keywords
## -1 +0,0 ##
-Id
\ No newline at end of property
Index: trunk/wb/modules/form/delete_field.php
===================================================================
--- trunk/wb/modules/form/delete_field.php	(revision 559)
+++ trunk/wb/modules/form/delete_field.php	(revision 560)

Property changes on: trunk/wb/modules/form/delete_field.php
___________________________________________________________________
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Deleted: svn:keywords
## -1 +0,0 ##
-Id
\ No newline at end of property
Index: trunk/wb/modules/form/install.php
===================================================================
--- trunk/wb/modules/form/install.php	(revision 559)
+++ trunk/wb/modules/form/install.php	(revision 560)
@@ -54,7 +54,11 @@
 		. ' `email_to` TEXT NOT NULL ,'
 		. ' `email_from` VARCHAR(255) NOT NULL DEFAULT \'\' ,'
 		. ' `email_subject` VARCHAR(255) NOT NULL DEFAULT \'\' ,'
-		. ' `success_message` TEXT NOT NULL ,'
+		. ' `success_page` TEXT NOT NULL ,'
+		. ' `success_email_to` TEXT NOT NULL ,'
+		. ' `success_email_from` VARCHAR(255) NOT NULL DEFAULT \'\' ,'
+		. ' `success_email_text` TEXT NOT NULL ,'
+		. ' `success_email_subject` VARCHAR(255) NOT NULL DEFAULT \'\' ,'
 		. ' `stored_submissions` INT NOT NULL DEFAULT \'0\' ,'
 		. ' `max_submissions` INT NOT NULL DEFAULT \'0\' ,'
 		. ' `use_captcha` INT NOT NULL DEFAULT \'0\' ,'
@@ -61,6 +65,7 @@
 		. ' PRIMARY KEY ( `section_id` ) '
 		. ' )';
 	$database->query($mod_form);
+	
 	$database->query("DROP TABLE IF EXISTS `".TABLE_PREFIX."mod_form_submissions`");
 	$mod_form = 'CREATE TABLE `'.TABLE_PREFIX.'mod_form_submissions` ( `submission_id` INT NOT NULL AUTO_INCREMENT,'
 		. ' `section_id` INT NOT NULL DEFAULT \'0\' ,'

Property changes on: trunk/wb/modules/form/install.php
___________________________________________________________________
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Deleted: svn:keywords
## -1 +0,0 ##
-Id
\ No newline at end of property
Index: trunk/wb/modules/form/modify_settings.php
===================================================================
--- trunk/wb/modules/form/modify_settings.php	(revision 559)
+++ trunk/wb/modules/form/modify_settings.php	(revision 560)
@@ -33,6 +33,18 @@
 // Include WB admin wrapper script
 require(WB_PATH.'/modules/admin.php');
 
+// include functions to edit the optional module CSS files (frontend.css, backend.css)
+require_once('css.functions.php');
+
+// check if module language file exists for the language set by the user (e.g. DE, EN)
+if(!file_exists(WB_PATH .'/modules/form/languages/'.LANGUAGE .'.php')) {
+	// no module language file exists for the language set by the user, include default module language file EN.php
+	require_once(WB_PATH .'/modules/form/languages/EN.php');
+} else {
+	// a module language file exists for the language defined by the user, load it
+	require_once(WB_PATH .'/modules/form/languages/'.LANGUAGE .'.php');
+}
+
 // Get header and footer
 $query_content = $database->query("SELECT * FROM ".TABLE_PREFIX."mod_form_settings WHERE section_id = '$section_id'");
 $setting = $query_content->fetchRow();
@@ -41,48 +53,87 @@
 $raw = array('<', '>');
 $friendly = array('&lt;', '&gt;');
 
+// check if backend.css file needs to be included into the <body></body> of modify.php
+if(!method_exists($admin, 'register_backend_modfiles') && file_exists(WB_PATH ."/modules/form/backend.css")) {
+	echo '<style type="text/css">';
+	include(WB_PATH .'/modules/form/backend.css');
+	echo "\n</style>\n";
+}
+
 ?>
+<h2><?php echo $MOD_FORM['SETTINGS']; ?></h2>
+<?php
+	// include the button to edit the optionla module CSS files
+	// Note: CSS styles for the button are defined in backend.css (div class="mod_moduledirectory_edit_css")
+	css_edit();
+?>
 
-<style type="text/css">
-.setting_name {
-	vertical-align: top;
-}
-</style>
-
 <form name="edit" action="<?php echo WB_URL; ?>/modules/form/save_settings.php" method="post" style="margin: 0;">
 
 <input type="hidden" name="page_id" value="<?php echo $page_id; ?>">
 <input type="hidden" name="section_id" value="<?php echo $section_id; ?>">
 
-<table cellpadding="2" cellspacing="0" border="0" width="100%">
-<tr>
-	<td class="setting_name" width="220"><?php echo $TEXT['HEADER']; ?>:</td>
-	<td class="setting_name">
-		<textarea name="header" style="width: 100%; height: 80px;"><?php echo ($setting['header']); ?></textarea>
-	</td>
-</tr>
-<tr>
-	<td class="setting_name"><?php echo $TEXT['FIELD'].' '.$TEXT['LOOP']; ?>:</td>
-	<td class="setting_name">
-		<textarea name="field_loop" style="width: 100%; height: 60px;"><?php echo ($setting['field_loop']); ?></textarea>
-	</td>
-</tr>
-<tr>
-	<td class="setting_name"><?php echo $TEXT['FOOTER']; ?>:</td>
-	<td class="setting_name">
-		<textarea name="footer" style="width: 100%; height: 80px;"><?php echo str_replace($raw, $friendly, ($setting['footer'])); ?></textarea>
-	</td>
-</tr>
-<tr>
-	<td class="setting_name"><?php echo $TEXT['EMAIL'].' '.$TEXT['TO']; ?>:</td>
-	<td class="setting_name">
-		<textarea name="email_to" style="width: 100%; height: 30px;"><?php echo str_replace($raw, $friendly, ($setting['email_to'])); ?></textarea>
-	</td>
-</tr>
-<tr>
-	<td class="setting_name"><?php echo $TEXT['EMAIL'].' '.$TEXT['FROM']; ?>:</td>
-	<td class="setting_name">
-		<select name="email_from_field" style="width: 100%;">
+<table class="row_a" cellpadding="2" cellspacing="0" border="0" width="100%">
+	<tr>
+		<td colspan="2"><strong><?php echo $HEADING['GENERAL_SETTINGS']; ?></strong></td>
+	</tr>
+	<?php if(extension_loaded('gd') AND function_exists('imageCreateFromJpeg')) { /* Make's sure GD library is installed */ ?>
+	<tr>
+		<td class="setting_name" width="30%"><?php echo $TEXT['CAPTCHA_VERIFICATION']; ?>:</td>
+		<td>
+			<input type="radio" name="use_captcha" id="use_captcha_true" value="1"<?php if($setting['use_captcha'] == true) { echo ' checked'; } ?> />
+			<label for="use_captcha_true"><?php echo $TEXT['ENABLED']; ?></label>
+			<input type="radio" name="use_captcha" id="use_captcha_false" value="0"<?php if($setting['use_captcha'] == false) { echo ' checked'; } ?> />
+			<label for="use_captcha_false"><?php echo $TEXT['DISABLED']; ?></label>
+		</td>
+	</tr>
+	<?php } ?>
+	<tr>
+		<td class="setting_name" width="30%"><?php echo $TEXT['MAX_SUBMISSIONS_PER_HOUR']; ?>:</td>
+		<td class="setting_name">
+			<input type="text" name="max_submissions" style="width: 30px;" maxlength="255" value="<?php echo str_replace($raw, $friendly, ($setting['max_submissions'])); ?>" />
+		</td>
+	</tr>
+	<tr>
+		<td class="setting_name"><?php echo $TEXT['SUBMISSIONS_STORED_IN_DATABASE']; ?>:</td>
+		<td class="setting_name">
+			<input type="text" name="stored_submissions" style="width: 30px;" maxlength="255" value="<?php echo str_replace($raw, $friendly, ($setting['stored_submissions'])); ?>" />
+		</td>
+	</tr>
+	<tr>
+		<td class="setting_name"><?php echo $TEXT['HEADER']; ?>:</td>
+		<td class="setting_name">
+			<textarea name="header" style="width: 98%; height: 80px;"><?php echo ($setting['header']); ?></textarea>
+		</td>
+	</tr>
+	<tr>
+		<td class="setting_name"><?php echo $TEXT['FIELD'].' '.$TEXT['LOOP']; ?>:</td>
+		<td class="setting_name">
+			<textarea name="field_loop" style="width: 98%; height: 80px;"><?php echo ($setting['field_loop']); ?></textarea>
+		</td>
+	</tr>
+	<tr>
+		<td class="setting_name"><?php echo $TEXT['FOOTER']; ?>:</td>
+		<td class="setting_name">
+			<textarea name="footer" style="width: 98%; height: 80px;"><?php echo str_replace($raw, $friendly, ($setting['footer'])); ?></textarea>
+		</td>
+	</tr>
+</table>	
+
+<table class="row_a" cellpadding="2" cellspacing="0" border="0" width="100%" style="margin-top: 3px;">
+	<tr>
+		<td colspan="2"><strong><?php echo $TEXT['EMAIL'].' '.$TEXT['SETTINGS']; ?></strong></td>
+	</tr>
+	<tr>
+		<td class="setting_name" width="30%"><?php echo $TEXT['EMAIL'].' '.$TEXT['TO']; ?>:</td>
+		<td class="setting_name">
+			<input type="text" name="email_to" style="width: 98%;" maxlength="255" value="<?php echo str_replace($raw, $friendly, ($setting['email_to'])); ?>" />
+		</td>
+	</tr>
+	<tr>
+		<td class="setting_name"><?php echo $TEXT['EMAIL'].' '.$TEXT['FROM']; ?>:</td>
+		<td class="setting_name">
+			<select name="email_from_field" style="width: 98%;">
 			<option value="" onclick="javascript: document.getElementById('email_from').style.display = 'block';"><?php echo $TEXT['CUSTOM']; ?>:</option>
 			<?php
 			$email_from_value = str_replace($raw, $friendly, ($setting['email_from']));
@@ -97,59 +148,97 @@
 				}
 			}
 			?>
-		</select>
-		<input type="text" name="email_from" id="email_from" style="width: 100%; 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; } ?>" />
-	</td>
-</tr>
-<tr>
-	<td class="setting_name"><?php echo $TEXT['EMAIL'].' '.$TEXT['SUBJECT']; ?>:</td>
-	<td class="setting_name">
-		<input type="text" name="email_subject" style="width: 100%;" maxlength="255" value="<?php echo str_replace($raw, $friendly, ($setting['email_subject'])); ?>" />
-	</td>
-</tr>
-<tr>
-	<td class="setting_name"><?php echo $TEXT['SUCCESS'].' '.$TEXT['MESSAGE']; ?>:</td>
-	<td class="setting_name">
-		<textarea name="success_message" style="width: 100%; height: 80px;"><?php echo str_replace($raw, $friendly, ($setting['success_message'])); ?></textarea>
-	</td>
-</tr>
-<tr>
-	<td class="setting_name"><?php echo $TEXT['MAX_SUBMISSIONS_PER_HOUR']; ?>:</td>
-	<td class="setting_name">
-		<input type="text" name="max_submissions" style="width: 100%;" maxlength="255" value="<?php echo str_replace($raw, $friendly, ($setting['max_submissions'])); ?>" />
-	</td>
-</tr>
-<tr>
-	<td class="setting_name"><?php echo $TEXT['SUBMISSIONS_STORED_IN_DATABASE']; ?>:</td>
-	<td class="setting_name">
-		<input type="text" name="stored_submissions" style="width: 100%;" maxlength="255" value="<?php echo str_replace($raw, $friendly, ($setting['stored_submissions'])); ?>" />
-	</td>
-</tr>
-<?php if(extension_loaded('gd') AND function_exists('imageCreateFromJpeg')) { /* Make's sure GD library is installed */ ?>
-<tr>
-	<td class="setting_name"><?php echo $TEXT['CAPTCHA_VERIFICATION']; ?>:</td>
-	<td>
-		<input type="radio" name="use_captcha" id="use_captcha_true" value="1"<?php if($setting['use_captcha'] == true) { echo ' checked'; } ?> />
-		<label for="use_captcha_true"><?php echo $TEXT['ENABLED']; ?></label>
-		<input type="radio" name="use_captcha" id="use_captcha_false" value="0"<?php if($setting['use_captcha'] == false) { echo ' checked'; } ?> />
-		<label for="use_captcha_false"><?php echo $TEXT['DISABLED']; ?></label>
-	</td>
-</tr>
-<?php } ?>
+			</select>
+			<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; } ?>" />
+		</td>
+	</tr>
+	<tr>
+		<td class="setting_name"><?php echo $TEXT['EMAIL'].' '.$TEXT['SUBJECT']; ?>:</td>
+		<td class="setting_name">
+			<input type="text" name="email_subject" style="width: 98%;" maxlength="255" value="<?php echo str_replace($raw, $friendly, ($setting['email_subject'])); ?>" />
+		</td>
+	</tr>
+</table>	
+
+<table class="row_a" cellpadding="2" cellspacing="0" border="0" width="100%" style="margin-top: 3px;">
+	<tr>
+		<td colspan="2"><strong><?php echo $TEXT['SUCCESS'].' '.$TEXT['SETTINGS']; ?></strong></td>
+	</tr>
+	<tr>
+		<td class="setting_name" width="30%"><?php echo $TEXT['EMAIL'].' '.$TEXT['TO']; ?>:</td>
+		<td class="setting_name">
+			<select name="success_email_to" style="width: 98%;">
+			<option value="" onclick="javascript: document.getElementById('success_email_to').style.display = 'block';"><?php echo $TEXT['NONE']; ?></option>
+			<?php
+			$success_email_to = str_replace($raw, $friendly, ($setting['success_email_to']));
+			$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");
+			if($query_email_fields->numRows() > 0) {
+				while($field = $query_email_fields->fetchRow()) {
+					?>
+					<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';">
+						<?php echo $TEXT['FIELD'].': '.$field['title']; ?>
+					</option>
+					<?php
+				}
+			}
+			?>
+			</select>
+		</td>
+	</tr>
+	<tr>
+		<td class="setting_name"><?php echo $TEXT['EMAIL'].' '.$TEXT['FROM']; ?>:</td>
+		<td class="setting_name">
+			<input type="text" name="success_email_from" style="width: 98%;" maxlength="255" value="<?php echo str_replace($raw, $friendly, ($setting['success_email_from'])); ?>" />
+		</td>
+	</tr>
+	<tr>
+		<td class="setting_name"><?php echo $TEXT['EMAIL'].' '.$TEXT['SUBJECT']; ?>:</td>
+		<td class="setting_name">
+			<input type="text" name="success_email_subject" style="width: 98%;" maxlength="255" value="<?php echo str_replace($raw, $friendly, ($setting['success_email_subject'])); ?>" />
+		</td>
+	</tr>
+	<tr>
+		<td class="setting_name"><?php echo $TEXT['EMAIL'].' '.$TEXT['TEXT']; ?>:</td>
+		<td class="setting_name">
+			<textarea name="success_email_text" style="width: 98%; height: 80px;"><?php echo str_replace($raw, $friendly, ($setting['success_email_text'])); ?></textarea>
+		</td>
+	</tr>
+	<tr>
+		<td class="newsection"><?php echo $TEXT['SUCCESS'].' '.$TEXT['PAGE']; ?>:</td>
+		<td class="newsection">
+			<select name="success_page">
+			<option value="none"><?php echo $TEXT['NONE']; ?></option>
+			<?php 
+			// Get exisiting pages and show the pagenames
+			$query = $database->query("SELECT * FROM ".TABLE_PREFIX."pages WHERE visibility <> 'deleted'");
+			while($mail_page = $query->fetchRow()) {
+				$mail_pagename = $mail_page['menu_title'];		
+				$success_page = $mail_page['page_id'];
+				echo $success_page.':'.$setting['success_page'].':';
+				if($setting['success_page'] == $success_page) {
+					$selected = ' selected';
+				} else { 
+					$selected = '';
+				}
+				echo '<option value="'.$success_page.'"'.$selected.'>'.$mail_pagename.'</option>';
+		 	}
+			?>
+			</select>
+		</td>
+	</tr>
 </table>
+
 <table cellpadding="0" cellspacing="0" border="0" width="100%">
-<tr>
-	<td width="225">&nbsp;</td>
-	<td align="left">
-		<input name="save" type="submit" value="<?php echo $TEXT['SAVE'].' '.$TEXT['SETTINGS']; ?>" style="width: 200px; margin-top: 5px;"></form>
-	</td>
-	<td align="right">
-		<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;" />
-	</td>
-</tr>
+	<tr>
+		<td align="left">
+			<input name="save" type="submit" value="<?php echo $TEXT['SAVE']; ?>" style="width: 100px; margin-top: 5px;"></form>
+		</td>
+		<td align="right">
+			<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;" />
+		</td>
+	</tr>
 </table>
 
-
 <?php
 
 // Print admin footer

Property changes on: trunk/wb/modules/form/modify_settings.php
___________________________________________________________________
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Deleted: svn:keywords
## -1 +0,0 ##
-Id
\ No newline at end of property
Index: trunk/wb/modules/form/index.php
===================================================================
--- trunk/wb/modules/form/index.php	(revision 559)
+++ trunk/wb/modules/form/index.php	(revision 560)

Property changes on: trunk/wb/modules/form/index.php
___________________________________________________________________
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Deleted: svn:keywords
## -1 +0,0 ##
-Id
\ No newline at end of property
Index: trunk/wb/modules/form/uninstall.php
===================================================================
--- trunk/wb/modules/form/uninstall.php	(nonexistent)
+++ trunk/wb/modules/form/uninstall.php	(revision 560)
@@ -0,0 +1,41 @@
+<?php
+
+// $Id$
+
+/*
+
+ Website Baker Project <http://www.websitebaker.org/>
+ Copyright (C) 2004-2008, Ryan Djurovich
+
+ Website Baker is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ Website Baker is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Website Baker; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+*/
+
+/*
+The Website Baker Project would like to thank Rudolph Lartey <www.carbonect.com>
+for his contributions to this module - adding extra field types
+*/
+
+// Must include code to stop this file being access directly
+if(defined('WB_PATH') == false) { exit("Cannot access this file directly"); }
+
+$database->query("DELETE FROM ".TABLE_PREFIX."search WHERE name = 'module' AND value = 'form'");
+$database->query("DELETE FROM ".TABLE_PREFIX."search WHERE extra = 'form'");
+
+$database->query("DROP TABLE IF EXISTS `".TABLE_PREFIX."mod_form_fields`");
+$database->query("DROP TABLE IF EXISTS `".TABLE_PREFIX."mod_form_settings`");
+$database->query("DROP TABLE IF EXISTS `".TABLE_PREFIX."mod_form_submissions`");
+
+?>
\ No newline at end of file

Property changes on: trunk/wb/modules/form/uninstall.php
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: trunk/wb/modules/form/view.php
===================================================================
--- trunk/wb/modules/form/view.php	(revision 559)
+++ trunk/wb/modules/form/view.php	(revision 560)
@@ -31,7 +31,15 @@
 // Must include code to stop this file being access directly
 if(defined('WB_PATH') == false) { exit("Cannot access this file directly"); }
 
+// check if frontend.css file needs to be included into the <body></body> of view.php
+if((!function_exists('register_frontend_modfiles') || !defined('MOD_FRONTEND_CSS_REGISTERED')) &&  file_exists(WB_PATH .'/modules/form/frontend.css')) {
+   echo '<style type="text/css">';
+   include(WB_PATH .'/modules/form/frontend.css');
+   echo "\n</style>\n";
+} 
+
 // Function for generating an optionsfor a select field
+if (!function_exists(make_option)) {
 function make_option(&$n) {
 	// start option group if it exists
 	if (substr($n,0,2) == '[=') {
@@ -42,8 +50,9 @@
 		$n = '<option value="'.$n.'">'.$n.'</option>';
 	}
 }
-
+}
 // Function for generating a checkbox
+if (!function_exists(make_checkbox)) {
 function make_checkbox(&$n, $idx, $params) {
 	$field_id = $params[0];
 	$seperator = $params[1];
@@ -50,8 +59,9 @@
 	//$n = '<input class="field_checkbox" type="checkbox" id="'.$n.'" name="field'.$field_id.'" value="'.$n.'">'.'<font class="checkbox_label" onclick="javascript: document.getElementById(\''.$n.'\').checked = !document.getElementById(\''.$n.'\').checked;">'.$n.'</font>'.$seperator;
 	$n = '<input class="field_checkbox" type="checkbox" id="'.$n.'" name="field'.$field_id.'['.$idx.']" value="'.$n.'">'.'<font class="checkbox_label" onclick="javascript: document.getElementById(\''.$n.'\').checked = !document.getElementById(\''.$n.'\').checked;">'.$n.'</font>'.$seperator;
 }
-
+}
 // Function for generating a radio button
+if (!function_exists(make_radio)) {
 function make_radio(&$n, $idx, $params) {
 	$field_id = $params[0];
 	$group = $params[1];
@@ -58,7 +68,7 @@
 	$seperator = $params[2];
 	$n = '<input class="field_radio" type="radio" id="'.$n.'" name="field'.$field_id.'" value="'.$n.'">'.'<font class="radio_label" onclick="javascript: document.getElementById(\''.$n.'\').checked = true;">'.$n.'</font>'.$seperator;
 }
-
+}
 // Generate temp submission id
 function new_submission_id() {
 	$submission_id = '';
@@ -80,53 +90,6 @@
 // Set new submission ID in session
 $_SESSION['form_submission_id'] = new_submission_id();
 
-?>
-<style type="text/css">
-.required {
-	color: #FF0000;
-}
-.field_title {
-	font-size: 12px;
-	width: 100px;
-	vertical-align: top;
-	text-align:right;
-}
-.textfield {
-	font-size: 12px;
-	width: 200px;
-}
-.textarea {
-	font-size: 12px;
-	width: 90%;
-	height: 100px;
-}
-.field_heading {
-	font-size: 12px;
-	font-weight: bold;
-	border-bottom-width: 2px;
-	border-bottom-style: solid;
-	border-bottom-color: #666666;
-	padding-top: 10px;
-	color: #666666;
-}
-.select {
-	font-size: 12px;
-}
-.checkbox_label {
-	font-size: 11px;
-	cursor: pointer;
-}
-.radio_label {
-	font-size: 11px;
-	cursor: pointer;
-}
-.email {
-	font-size: 12px;
-	width: 200px;
-}
-</style>
-<?php
-
 // Get settings
 $query_settings = $database->query("SELECT header,field_loop,footer,use_captcha FROM ".TABLE_PREFIX."mod_form_settings WHERE section_id = '$section_id'");
 if($query_settings->numRows() > 0) {
@@ -141,9 +104,14 @@
 	$footer = '';
 }
 
+$java_fields = '';
+$java_titles = '';
+$java_tween = ''; // I know kinda stupid, anyone better idea?
+$java_mailcheck = '';
+
 // Add form starter code
 ?>
-<form name="form" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
+<form name="form" onsubmit="return formCheck(this);" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
 <input type="hidden" name="submission_id" value="<?php echo $_SESSION['form_submission_id']; ?>" />
 <?php
 
@@ -162,6 +130,9 @@
 		$values = array($field['title']);
 		if($field['required'] == 1) {
 			$values[] = '<font class="required">*</font>';
+			$java_fields .= $java_tween.'"field'.$field_id.'"';
+			$java_titles .= $java_tween.'"'.$field['title'].'"';
+			$java_tween = ', ';
 		} else {
 			$values[] = '';
 		}
@@ -186,15 +157,18 @@
 			$vars[] = '{FIELD}';
 			$options = explode(',', $value);
 			array_walk($options, 'make_checkbox',array($field_id,$field['extra']));
+			$options[count($options)-1]=substr($options[count($options)-1],0,strlen($options[count($options)-1])-strlen($field['extra']));
 			$values[] = implode($options);
 		} elseif($field['type'] == 'radio') {
 			$vars[] = '{FIELD}';
 			$options = explode(',', $value);
 			array_walk($options, 'make_radio',array($field_id,$field['title'],$field['extra']));
+			$options[count($options)-1]=substr($options[count($options)-1],0,strlen($options[count($options)-1])-strlen($field['extra']));
 			$values[] = implode($options);
 		} elseif($field['type'] == 'email') {
 			$vars[] = '{FIELD}';
-			$values[] = '<input type="text" name="field'.$field_id.'" id="field'.$field_id.'" maxlength="'.$field['extra'].'" class="email" />';
+			$values[] = '<input type="text" name="field'.$field_id.'" onChange="return checkmail(this.form.field'.$field_id.')"  id="field'.$field_id.'" maxlength="'.$field['extra'].'" class="email" />';
+			$java_mailcheck .= 'onChange="return checkmail(this.form'.$field_id.'" ';
 		}
 		if($field['type'] != '') {
 			echo str_replace($vars, $values, $field_loop);
@@ -217,7 +191,90 @@
 	</td></tr>
 	<?php
 }
+echo '
+<script language="JavaScript">
+<!--
 
+/***********************************************
+* Required field(s) validation v1.10- By NavSurf
+* Visit Nav Surf at http://navsurf.com
+* Visit http://www.dynamicdrive.com/ for full source code
+***********************************************/
+
+function formCheck(formobj){
+	// Enter name of mandatory fields
+	var fieldRequired = Array('.$java_fields.');
+	// Enter field description to appear in the dialog box
+	var fieldDescription = Array('.$java_titles.');
+	// dialog message
+	var alertMsg = "'.$MESSAGE['MOD_FORM']['REQUIRED_FIELDS'].':\n";
+	
+	var l_Msg = alertMsg.length;
+	
+	for (var i = 0; i < fieldRequired.length; i++){
+		var obj = formobj.elements[fieldRequired[i]];
+		if (obj){
+			switch(obj.type){
+			case "select-one":
+				if (obj.selectedIndex == -1 || obj.options[obj.selectedIndex].text == ""){
+					alertMsg += " - " + fieldDescription[i] + "\n";
+				}
+				break;
+			case "select-multiple":
+				if (obj.selectedIndex == -1){
+					alertMsg += " - " + fieldDescription[i] + "\n";
+				}
+				break;
+			case "text":
+			case "textarea":
+				if (obj.value == "" || obj.value == null){
+					alertMsg += " - " + fieldDescription[i] + "\n";
+				}
+				break;
+			default:
+			}
+			if (obj.type == undefined){
+				var blnchecked = false;
+				for (var j = 0; j < obj.length; j++){
+					if (obj[j].checked){
+						blnchecked = true;
+					}
+				}
+				if (!blnchecked){
+					alertMsg += " - " + fieldDescription[i] + "\n";
+				}
+			}
+		}
+	}
+
+	if (alertMsg.length == l_Msg){
+		return true;
+	}else{
+		alert(alertMsg);
+		return false;
+	}
+}
+/***********************************************
+* Email Validation script- © Dynamic Drive (www.dynamicdrive.com)
+* This notice must stay intact for legal use.
+* Visit http://www.dynamicdrive.com/ for full source code
+***********************************************/
+
+var emailfilter=/^\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,4}|\d+)$/i
+
+function checkmail(e){
+var returnval=emailfilter.test(e.value);
+if (returnval==false){
+alert("Please enter a valid email address.");
+e.select();
+}
+return returnval;
+}
+-->
+
+</script>';
+
+
 // Print footer
 echo $footer;
 
@@ -236,7 +293,7 @@
 		
 		// Submit form data
 		// First start message settings
-		$query_settings = $database->query("SELECT email_to,email_from,email_subject,success_message,max_submissions,stored_submissions,use_captcha FROM ".TABLE_PREFIX."mod_form_settings WHERE section_id = '$section_id'");
+		$query_settings = $database->query("SELECT * FROM ".TABLE_PREFIX."mod_form_settings WHERE section_id = '$section_id'");
 		if($query_settings->numRows() > 0) {
 			$fetch_settings = $query_settings->fetchRow();
 			$email_to = $fetch_settings['email_to'];
@@ -246,7 +303,15 @@
 				$email_from = $wb->add_slashes($_POST[$email_from]);
 			}
 			$email_subject = $fetch_settings['email_subject'];
-			$success_message = $fetch_settings['success_message'];
+			$success_page = $fetch_settings['success_page'];
+			$success_email_to = $fetch_settings['success_email_to'];
+			if(substr($success_email_to, 0, 5) == 'field') {
+				// Set the success_email to field to what the user entered in the specified field
+				$success_email_to = $wb->add_slashes($_POST[$success_email_to]);
+			}
+			$success_email_from = $fetch_settings['success_email_from'];
+			$success_email_text = $fetch_settings['success_email_text'];
+			$success_email_subject = $fetch_settings['success_email_subject'];		
 			$max_submissions = $fetch_settings['max_submissions'];
 			$stored_submissions = $fetch_settings['stored_submissions'];
 			$use_captcha = $fetch_settings['use_captcha'];
@@ -343,9 +408,27 @@
 					// Now send the email
 					if($email_to != '') {
 						if($email_from != '') {
-							if($wb->mail($email_from,$email_to,$email_subject,$email_body)) { $success = true; }
+							if($wb->mail($email_from,$email_to,$email_subject,$email_body)) {
+								$success = true;
+							}
+						} else {
+							if($wb->mail('',$email_to,$email_subject,$email_body)) { 
+								$success = true; 
+							}
 						}
 					}				
+					if($success_email_to != '') {
+						if($success_email_from != '') {
+							if($wb->mail($success_email_from,$success_email_to,$success_email_subject,$success_email_text)) {
+								$success = true;
+							}
+						} else {
+							if($wb->mail('',$success_email_to,$success_email_subject,$success_email_text)) {
+								$success = true;
+							}
+						}
+					}				
+			
 					// Write submission to database
 					if(isset($admin) AND $admin->get_user_id() > 0) {
 						$admin->get_user_id();
@@ -378,11 +461,18 @@
 	
 	// Now check if the email was sent successfully
 	if(isset($success) AND $success == true) {
-		echo $success_message;
+	    if ($success_page=='none') {
+			echo str_replace("\n","<br />",$success_email_text);
+  		} else {
+			$query_menu = $database->query("SELECT link,target FROM ".TABLE_PREFIX."pages WHERE `page_id` = '$success_page'");
+			if($query_menu->numRows() > 0) {
+  	         	$fetch_settings = $query_menu->fetchRow();
+			    $link = WB_URL.PAGES_DIRECTORY.$fetch_settings['link'].PAGE_EXTENSION;
+			    echo "<script type='text/javascript'>location.href='".$link."';</script>";
+			}    
+		}
 	} else {
-		if(isset($success) AND $success == false) {
-			echo $TEXT['ERROR'];
-		}
+		echo $TEXT['ERROR'];
 	}
 	
 }

Property changes on: trunk/wb/modules/form/view.php
___________________________________________________________________
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Deleted: svn:keywords
## -1 +0,0 ##
-Id
\ No newline at end of property
Index: trunk/wb/modules/form/move_up.php
===================================================================
--- trunk/wb/modules/form/move_up.php	(revision 559)
+++ trunk/wb/modules/form/move_up.php	(revision 560)

Property changes on: trunk/wb/modules/form/move_up.php
___________________________________________________________________
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Deleted: svn:keywords
## -1 +0,0 ##
-Id
\ No newline at end of property
Index: trunk/wb/modules/form/delete_submission.php
===================================================================
--- trunk/wb/modules/form/delete_submission.php	(revision 559)
+++ trunk/wb/modules/form/delete_submission.php	(revision 560)

Property changes on: trunk/wb/modules/form/delete_submission.php
___________________________________________________________________
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Deleted: svn:keywords
## -1 +0,0 ##
-Id
\ No newline at end of property
Index: trunk/wb/modules/form/save_settings.php
===================================================================
--- trunk/wb/modules/form/save_settings.php	(revision 559)
+++ trunk/wb/modules/form/save_settings.php	(revision 560)
@@ -52,7 +52,11 @@
 	$email_from = $admin->add_slashes($_POST['email_from_field']);
 }
 $email_subject = $admin->add_slashes($_POST['email_subject']);
-$success_message = $admin->add_slashes($_POST['success_message']);
+$success_page = $_POST['success_page'];
+$success_email_to = $admin->add_slashes($_POST['success_email_to']);
+$success_email_from = $admin->add_slashes($_POST['success_email_from']);
+$success_email_text = $admin->add_slashes($_POST['success_email_text']);
+$success_email_subject = $admin->add_slashes($_POST['success_email_subject']);
 if(!is_numeric($_POST['max_submissions'])) {
 	$max_submissions = 50;
 } else {
@@ -63,13 +67,13 @@
 } else {
 	$stored_submissions = $_POST['stored_submissions'];
 }
-// Make sure max submissions is not greater than stored submissions
+// Make sure max submissions is not greater than stored submissions if stored_submissions <>0
 if($max_submissions > $stored_submissions) {
 	$max_submissions = $stored_submissions;
 }
 
 // Update settings
-$database->query("UPDATE ".TABLE_PREFIX."mod_form_settings SET header = '$header', field_loop = '$field_loop', footer = '$footer', email_to = '$email_to', email_from = '$email_from', email_subject = '$email_subject', success_message = '$success_message', max_submissions = '$max_submissions', stored_submissions = '$stored_submissions', use_captcha = '$use_captcha' WHERE section_id = '$section_id'");
+$database->query("UPDATE ".TABLE_PREFIX."mod_form_settings SET header = '$header', field_loop = '$field_loop', footer = '$footer', email_to = '$email_to', email_from = '$email_from', email_subject = '$email_subject', success_page = '$success_page', success_email_to = '$success_email_to', success_email_from = '$success_email_from', success_email_text = '$success_email_text', success_email_subject = '$success_email_subject', max_submissions = '$max_submissions', stored_submissions = '$stored_submissions', use_captcha = '$use_captcha' WHERE section_id = '$section_id'");
 
 // Check if there is a db error, otherwise say successful
 if($database->is_error()) {

Property changes on: trunk/wb/modules/form/save_settings.php
___________________________________________________________________
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Deleted: svn:keywords
## -1 +0,0 ##
-Id
\ No newline at end of property
Index: trunk/wb/modules/form/frontend.css
===================================================================
--- trunk/wb/modules/form/frontend.css	(nonexistent)
+++ trunk/wb/modules/form/frontend.css	(revision 560)
@@ -0,0 +1,42 @@
+.required {
+	color: #FF0000;
+}
+.field_title {
+	font-size: 12px;
+	width: 100px;
+	vertical-align: top;
+	text-align:right;
+}
+.textfield {
+	font-size: 12px;
+	width: 200px;
+}
+.textarea {
+	font-size: 12px;
+	width: 90%;
+	height: 100px;
+}
+.field_heading {
+	font-size: 12px;
+	font-weight: bold;
+	border-bottom-width: 2px;
+	border-bottom-style: solid;
+	border-bottom-color: #666666;
+	padding-top: 10px;
+	color: #666666;
+}
+.select {
+	font-size: 12px;
+}
+.checkbox_label {
+	font-size: 11px;
+	cursor: pointer;
+}
+.radio_label {
+	font-size: 11px;
+	cursor: pointer;
+}
+.email {
+	font-size: 12px;
+	width: 200px;
+}
\ No newline at end of file

Property changes on: trunk/wb/modules/form/frontend.css
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: trunk/wb/modules/form/languages/NL.php
===================================================================
--- trunk/wb/modules/form/languages/NL.php	(nonexistent)
+++ trunk/wb/modules/form/languages/NL.php	(revision 560)
@@ -0,0 +1,38 @@
+<?php
+
+// $Id$
+
+/*
+
+ Website Baker Project <http://www.websitebaker.org/>
+ Copyright (C) 2004-2008, Ryan Djurovich
+
+ Website Baker is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ Website Baker is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Website Baker; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+*/
+
+//Modul Description
+$module_description = 'This module allows you to create customised online forms, such as a feedback form. '.'Thank-you to Rudolph Lartey who help enhance this module, providing code for extra field types, etc.';
+
+//Variables for the  backend
+$MOD_FORM['SETTINGS'] = 'Form Settings';
+
+// Variables for the module CSS edit outputs
+$CAP_EDIT_CSS = 'Wijzig CSS';
+$CAP_TOGGLE_CSS = 'Wijzig ';
+$HEADING_CSS_FILE = 'Actuele module bestand: ';
+$TXT_EDIT_CSS_FILE = 'Wijzig de CSS definities in het textveld hieronder.';
+
+?>
\ No newline at end of file

Property changes on: trunk/wb/modules/form/languages/NL.php
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: trunk/wb/modules/form/languages/EN.php
===================================================================
--- trunk/wb/modules/form/languages/EN.php	(nonexistent)
+++ trunk/wb/modules/form/languages/EN.php	(revision 560)
@@ -0,0 +1,38 @@
+<?php
+
+// $Id$
+
+/*
+
+ Website Baker Project <http://www.websitebaker.org/>
+ Copyright (C) 2004-2008, Ryan Djurovich
+
+ Website Baker is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ Website Baker is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Website Baker; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+*/
+
+//Modul Description
+$module_description = 'This module allows you to create customised online forms, such as a feedback form. '.'Thank-you to Rudolph Lartey who help enhance this module, providing code for extra field types, etc.';
+
+//Variables for the  backend
+$MOD_FORM['SETTINGS'] = 'Form Settings';
+
+// Variables for the module CSS edit outputs
+$CAP_EDIT_CSS = 'Edit CSS';
+$CAP_TOGGLE_CSS = 'Edit ';
+$HEADING_CSS_FILE = 'Actual module file: ';
+$TXT_EDIT_CSS_FILE = 'Edit the CSS definitions in the textarea below.';
+
+?>
\ No newline at end of file

Property changes on: trunk/wb/modules/form/languages/EN.php
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: trunk/wb/modules/form/languages/DE.php
===================================================================
--- trunk/wb/modules/form/languages/DE.php	(nonexistent)
+++ trunk/wb/modules/form/languages/DE.php	(revision 560)
@@ -0,0 +1,38 @@
+<?php
+
+// $Id$
+
+/*
+
+ Website Baker Project <http://www.websitebaker.org/>
+ Copyright (C) 2004-2008, Ryan Djurovich
+
+ Website Baker is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ Website Baker is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Website Baker; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+*/
+
+//Modulbeschreibung
+$module_description = 'Mit diesem Modul k&ouml;nnen sie ein beliebiges Formular f&uuml;r ihre Seite erzeugen';
+
+//Variablen für backend Texte
+$MOD_FORM['SETTINGS'] = 'Formular Einstellungen';
+
+// Variablen für Textausgabe der frontend.css/backend.css Bearbeitung
+$CAP_EDIT_CSS = 'Bearbeite CSS';
+$CAP_TOGGLE_CSS = 'Wechsle zu ';
+$HEADING_CSS_FILE = 'Aktuelle Moduldatei: ';
+$TXT_EDIT_CSS_FILE = 'Bearbeite die CSS Definitionen im nachfolgenden Textfeld.';
+
+?>
\ No newline at end of file

Property changes on: trunk/wb/modules/form/languages/DE.php
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: trunk/wb/modules/form/view_submission.php
===================================================================
--- trunk/wb/modules/form/view_submission.php	(revision 559)
+++ trunk/wb/modules/form/view_submission.php	(revision 560)

Property changes on: trunk/wb/modules/form/view_submission.php
___________________________________________________________________
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Deleted: svn:keywords
## -1 +0,0 ##
-Id
\ No newline at end of property
Index: trunk/wb/modules/form/modify.php
===================================================================
--- trunk/wb/modules/form/modify.php	(revision 559)
+++ trunk/wb/modules/form/modify.php	(revision 560)

Property changes on: trunk/wb/modules/form/modify.php
___________________________________________________________________
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Deleted: svn:keywords
## -1 +0,0 ##
-Id
\ No newline at end of property
Index: trunk/wb/modules/form/add.php
===================================================================
--- trunk/wb/modules/form/add.php	(revision 559)
+++ trunk/wb/modules/form/add.php	(revision 560)
@@ -40,14 +40,19 @@
 $email_to = $admin->get_email();
 $email_from = '';
 $email_subject = 'Results from form on website...';
-$success_message = 'Thank-you.';
+$success_page = 'none';
+$success_email_to = '';
+$success_email_from = $admin->get_email();
+$success_email_text = 'Thank you for submitting your form on '.WEBSITE_TITLE;
+$success_email_text = addslashes($success_email_text);
+$success_email_subject = 'You have submitted a form';
 $max_submissions = 50;
-$stored_submissions = 100;
+$stored_submissions = 50;
 if(extension_loaded('gd') AND function_exists('imageCreateFromJpeg')) { /* Make's sure GD library is installed */
 	$use_captcha = true;
 } else {
 	$use_captcha = false;
 }
-$database->query("INSERT INTO ".TABLE_PREFIX."mod_form_settings (page_id,section_id,header,field_loop,footer,email_to,email_from,email_subject,success_message,max_submissions,stored_submissions,use_captcha) VALUES ('$page_id','$section_id','$header','$field_loop','$footer','$email_to','$email_from','$email_subject','$success_message','$max_submissions','$stored_submissions','$use_captcha')");
+$database->query("INSERT INTO ".TABLE_PREFIX."mod_form_settings (page_id,section_id,header,field_loop,footer,email_to,email_from,email_subject,success_page,success_email_to,success_email_from,success_email_text,success_email_subject,max_submissions,stored_submissions,use_captcha) VALUES ('$page_id','$section_id','$header','$field_loop','$footer','$email_to','$email_from','$email_subject','$success_page','$success_email_to','$success_email_from','$success_email_text','$success_email_subject','$max_submissions','$stored_submissions','$use_captcha')");
 
 ?>
\ No newline at end of file

Property changes on: trunk/wb/modules/form/add.php
___________________________________________________________________
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Deleted: svn:keywords
## -1 +0,0 ##
-Id
\ No newline at end of property
Index: trunk/wb/modules/form/backend.css
===================================================================
--- trunk/wb/modules/form/backend.css	(nonexistent)
+++ trunk/wb/modules/form/backend.css	(revision 560)
@@ -0,0 +1,20 @@
+.setting_name {
+	vertical-align: top;
+}
+.newsection {
+	border-top: 1px dashed #fff;
+}
+
+div.mod_form_edit_css {
+  width: 100%;
+  margin-top: -20px;
+  margin-bottom: 15px;
+  text-align: right;
+}
+
+div.mod_form_edit_css a {
+  width: 100px;
+  padding: 5px;
+  border: 1px solid;
+  background-color: #F0F0F0;
+}
\ No newline at end of file

Property changes on: trunk/wb/modules/form/backend.css
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
