Index: branches/2.8.x/CHANGELOG
===================================================================
--- branches/2.8.x/CHANGELOG	(revision 1408)
+++ branches/2.8.x/CHANGELOG	(revision 1409)
@@ -11,6 +11,8 @@
 ! = Update/Change
 
 ------------------------------------- 2.8.2 -------------------------------------
+23 Jan-2011 Build 1409 Frank Heyne (FrankH)
++ Ticket 1058 added warn_page_leave (currently only in wysiwyg) 
 23 Jan-2011 Build 1408 Werner v.d.Decken(DarkViper)
 # small changes in sm2menu() [SM2_NO_TITLE + SM2_XHTML_STRICT]
 22 Jan-2011 Build 1407 Frank Heyne (FrankH)
Index: branches/2.8.x/wb/upgrade-script.php
===================================================================
--- branches/2.8.x/wb/upgrade-script.php	(revision 1408)
+++ branches/2.8.x/wb/upgrade-script.php	(revision 1409)
@@ -270,6 +270,18 @@
 }
 
 /**********************************************************
+ *  - Adding field warn_page_leave to settings table
+ */
+echo "<br />Adding warn_page_leave to settings table<br />";
+$cfg = array(
+	'warn_page_leave' => '1'
+);
+
+foreach($cfg as $key=>$value) {
+	db_add_key_value($key, $value);
+}
+
+/**********************************************************
  *  - install droplets
  */
     $drops = (!in_array ( "mod_droplets", $all_tables)) ? "<br />Install droplets<br />" : "<br />Upgrade droplets<br />";
Index: branches/2.8.x/wb/admin/interface/version.php
===================================================================
--- branches/2.8.x/wb/admin/interface/version.php	(revision 1408)
+++ branches/2.8.x/wb/admin/interface/version.php	(revision 1409)
@@ -52,6 +52,6 @@
 
 // check if defined to avoid errors during installation (redirect to admin panel fails if PHP error/warnings are enabled)
 if(!defined('VERSION')) define('VERSION', '2.8.2.RC5');
-if(!defined('REVISION')) define('REVISION', '1408');
+if(!defined('REVISION')) define('REVISION', '1409');
 
 ?>
Index: branches/2.8.x/wb/admin/settings/index.php
===================================================================
--- branches/2.8.x/wb/admin/settings/index.php	(revision 1408)
+++ branches/2.8.x/wb/admin/settings/index.php	(revision 1409)
@@ -363,6 +363,14 @@
 	        $template->set_var('PAGE_LANGUAGES_DISABLED', ' checked="checked"');
 	}
 
+	// Work-out if warn_page_leave feature is enabled
+	if (defined('WARN_PAGE_LEAVE') && WARN_PAGE_LEAVE == true)
+	{
+		$template->set_var('WARN_PAGE_LEAVE_ENABLED', ' checked="checked"');
+	} else {
+		$template->set_var('WARN_PAGE_LEAVE_DISABLED', ' checked="checked"');
+	}
+
 	// Work-out if smart login feature is enabled
 	if(defined('SMART_LOGIN') && SMART_LOGIN == true)
 	{
@@ -682,6 +690,7 @@
 								'TEXT_READ' => $TEXT['READ'],
 								'TEXT_WRITE' => $TEXT['WRITE'],
 								'TEXT_EXECUTE' => $TEXT['EXECUTE'],
+								'TEXT_WARN_PAGE_LEAVE' => $TEXT['WARN_PAGE_LEAVE'],
 								'TEXT_SMART_LOGIN' => $TEXT['SMART_LOGIN'],
 								'TEXT_MULTIPLE_MENUS' => $TEXT['MULTIPLE_MENUS'],
 								'TEXT_HOMEPAGE_REDIRECTION' => $TEXT['HOMEPAGE_REDIRECTION'],
Index: branches/2.8.x/wb/templates/wb_theme/templates/settings.htt
===================================================================
--- branches/2.8.x/wb/templates/wb_theme/templates/settings.htt	(revision 1408)
+++ branches/2.8.x/wb/templates/wb_theme/templates/settings.htt	(revision 1409)
@@ -134,6 +134,15 @@
 	</td>
 </tr>
 <tr{DISPLAY_ADVANCED}>
+	<td class="setting_name">{TEXT_WARN_PAGE_LEAVE}:</td>
+	<td class="setting_value" colspan="2">
+		<input type="radio" name="warn_page_leave" id="warn_page_leave_true" style="width: 14px; height: 14px;" value="true"{WARN_PAGE_LEAVE_ENABLED} />
+		<label for="smart_login_true">{TEXT_ENABLED}</label>
+		<input type="radio" name="warn_page_leave" id="warn_page_leave_false" style="width: 14px; height: 14px;" value="false"{WARN_PAGE_LEAVE_DISABLED} />
+		<label for="smart_login_false">{TEXT_DISABLED}</label>
+	</td>
+</tr>
+<tr{DISPLAY_ADVANCED}>
 	<td class="setting_name">{TEXT_SMART_LOGIN}:</td>
 	<td class="setting_value" colspan="2">
 		<input type="radio" name="smart_login" id="smart_login_true" style="width: 14px; height: 14px;" value="true"{SMART_LOGIN_ENABLED} />
Index: branches/2.8.x/wb/templates/argos_theme/templates/settings.htt
===================================================================
--- branches/2.8.x/wb/templates/argos_theme/templates/settings.htt	(revision 1408)
+++ branches/2.8.x/wb/templates/argos_theme/templates/settings.htt	(revision 1409)
@@ -125,6 +125,15 @@
 	</td>
 </tr>
 <tr{DISPLAY_ADVANCED}>
+	<td class="setting_name">{TEXT_WARN_PAGE_LEAVE}:</td>
+	<td class="setting_value" colspan="2">
+		<input type="radio" name="warn_page_leave" id="warn_page_leave_true" style="width: 14px; height: 14px;" value="true"{WARN_PAGE_LEAVE_ENABLED} />
+		<label for="smart_login_true">{TEXT_ENABLED}</label>
+		<input type="radio" name="warn_page_leave" id="warn_page_leave_false" style="width: 14px; height: 14px;" value="false"{WARN_PAGE_LEAVE_DISABLED} />
+		<label for="smart_login_false">{TEXT_DISABLED}</label>
+	</td>
+</tr>
+<tr{DISPLAY_ADVANCED}>
 	<td class="setting_name">{TEXT_SMART_LOGIN}:</td>
 	<td class="setting_value" colspan="3">
 		<input type="radio" name="smart_login" id="smart_login_true" style="width: 14px; height: 14px;" value="true"{SMART_LOGIN_ENABLED} />
Index: branches/2.8.x/wb/install/save.php
===================================================================
--- branches/2.8.x/wb/install/save.php	(revision 1408)
+++ branches/2.8.x/wb/install/save.php	(revision 1409)
@@ -459,6 +459,7 @@
 	." ('default_time_format', 'g:i A'),"
 	." ('redirect_timer', '1500'),"
 	." ('home_folders', 'true'),"
+	." ('warn_page_leave', '1'),"
 	." ('default_template', 'round'),"
 	." ('default_theme', 'wb_theme'),"
 	." ('default_charset', 'utf-8'),"
Index: branches/2.8.x/wb/languages/EN.php
===================================================================
--- branches/2.8.x/wb/languages/EN.php	(revision 1408)
+++ branches/2.8.x/wb/languages/EN.php	(revision 1409)
@@ -363,6 +363,7 @@
 $TEXT['VIEW_DELETED_PAGES'] = 'View Deleted Pages';
 $TEXT['VIEW_DETAILS'] = 'View Details';
 $TEXT['VISIBILITY'] = 'Visibility';
+$TEXT['WARN_PAGE_LEAVE'] = 'Warn when leaving page';
 $TEXT['WBMAILER_DEFAULT_SENDER_MAIL'] = 'Default From Mail';
 $TEXT['WBMAILER_DEFAULT_SENDER_NAME'] = 'Default Sender Name';
 $TEXT['WBMAILER_DEFAULT_SETTINGS_NOTICE'] = 'Please specify a default "FROM" address and "SENDER" name below. It is recommended to use a FROM address like: <strong>admin@yourdomain.com</strong>. Some mail provider (e.g. <em>mail.com</em>) may reject mails with a FROM: address like <em>name@mail.com</em> sent via a foreign relay to avoid spam.<br /><br />The default values are only used if no other values are specified by WebsiteBaker. If your server supports <acronym title="Simple mail transfer protocol">SMTP</acronym>, you may want use this option for outgoing mails.';
Index: branches/2.8.x/wb/languages/DE.php
===================================================================
--- branches/2.8.x/wb/languages/DE.php	(revision 1408)
+++ branches/2.8.x/wb/languages/DE.php	(revision 1409)
@@ -364,6 +364,7 @@
 $TEXT['VIEW_DELETED_PAGES'] = 'gel&ouml;schte Seiten anschauen';
 $TEXT['VIEW_DETAILS'] = 'Details';
 $TEXT['VISIBILITY'] = 'Sichtbarkeit';
+$TEXT['WARN_PAGE_LEAVE'] = 'Warnung bei Seitenwechsel';
 $TEXT['WBMAILER_DEFAULT_SENDER_MAIL'] = 'Standard "VON" Adresse';
 $TEXT['WBMAILER_DEFAULT_SENDER_NAME'] = 'Standard Absender Name';
 $TEXT['WBMAILER_DEFAULT_SETTINGS_NOTICE'] = 'Bitte geben Sie eine Standard "VON" Adresse und einen Sendernamen an. Als Absender Adresse empfiehlt sich ein Format wie: <strong>admin@IhreWebseite.de</strong>. Manche E-Mail Provider (z.B. <em>mail.de</em>) stellen keine E-Mails zu, die nicht &uuml;ber den Provider selbst verschickt wurden, in der Absender Adresse aber den Namen des E-Mail Providers <em>name@mail.de</em> enthalten. Die Standard Werte werden nur verwendet, wenn keine anderen Werte von WebsiteBaker gesetzt wurden. Wenn Ihr Service Provider <acronym title="Simple Mail Transfer Protocol">SMTP</acronym> anbietet, sollten Sie diese Option f&uuml;r ausgehende E-Mails verwenden.';
Index: branches/2.8.x/wb/modules/wysiwyg/modify.php
===================================================================
--- branches/2.8.x/wb/modules/wysiwyg/modify.php	(revision 1408)
+++ branches/2.8.x/wb/modules/wysiwyg/modify.php	(revision 1409)
@@ -46,14 +46,27 @@
 
 ?>
 
-<form name="wysiwyg<?php echo $section_id; ?>" action="<?php echo WB_URL; ?>/modules/wysiwyg/save.php" method="post">
+<script language="javascript" type="text/javascript">
+//<![CDATA[
+  // Added to confirm leaving the page without saving changes first (even if there aren't any)
+  var needToConfirm = <?php echo WARN_PAGE_LEAVE; ?>;
+  window.onbeforeunload = confirmExit;
+  function confirmExit()
+  {
+    if (needToConfirm)
+      return "<?php print(html_entity_decode($MESSAGE['SETTINGS']['MODE_SWITCH_WARNING'], ENT_NOQUOTES, 'UTF-8')); ?>";
+  }
+//]]>
+</script>
 
+<form name="wysiwyg<?php echo $section_id; ?>" action="<?php echo WB_URL; ?>/modules/wysiwyg/save.php" method="post" onclick="needToConfirm=false;">
+
 <input type="hidden" name="page_id" value="<?php echo $page_id; ?>" />
 <input type="hidden" name="section_id" value="<?php echo $section_id; ?>" />
 
 <?php
 echo $admin->getFTAN()."\n"; 
-show_wysiwyg_editor('content'.$section_id,'content'.$section_id,$content,'100%','350px');
+show_wysiwyg_editor('content'.$section_id,'content'.$section_id,$content,'100%','350');
 ?>
 
 <table cellpadding="0" cellspacing="0" border="0" width="100%" style="padding-bottom: 10px;">
