Index: branches/2.8.x/CHANGELOG
===================================================================
--- branches/2.8.x/CHANGELOG	(revision 1254)
+++ branches/2.8.x/CHANGELOG	(revision 1255)
@@ -9,9 +9,11 @@
 - = Removed
 # = Bugfix
 ! = Update/Change
-
+ 
 ------------------------------------- 2.8.1 -------------------------------------
 21-Jan-2010 Dietmar Woellbrink (Luisehahne)
+#	Ticket #912 fix Search Template bug
+21-Jan-2010 Dietmar Woellbrink (Luisehahne)
 #	Ticket #915 fix bug in search (utf-8 characters corrupted)(thanks to Thorn)
 19-Jan-2010 Dietmar Woellbrink (Luisehahne)
 #	fix some more small css-errors in WB Backend (thanks to Ruebenwurzel)
Index: branches/2.8.x/wb/admin/interface/version.php
===================================================================
--- branches/2.8.x/wb/admin/interface/version.php	(revision 1254)
+++ branches/2.8.x/wb/admin/interface/version.php	(revision 1255)
@@ -27,7 +27,8 @@
  * This file is where the WB release version is stored.
  *
  */
- /**
+/**
+ *
  * @category     	admin
  * @package      	interface
  * @filesource		$HeadURL$
@@ -43,7 +44,7 @@
  * @revision     	$Revision$
  * @platform     	WebsiteBaker 2.8.x
  * @requirements 	PHP 4.3.4 and higher
- * @lastmodified    $Date: $
+ * @lastmodified    $Date$
  * 
  */
 
@@ -54,6 +55,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.1');
-if(!defined('REVISION')) define('REVISION', '1254');
+if(!defined('REVISION')) define('REVISION', '1255');
 
 ?>
\ No newline at end of file

Property changes on: branches/2.8.x/wb/admin/interface/version.php
___________________________________________________________________
Modified: svn:keywords
## -1,3 +1,4 ##
 Id
 Revision
-HeadURL
\ No newline at end of property
+HeadURL
+Date
\ No newline at end of property
Index: branches/2.8.x/wb/admin/settings/save.php
===================================================================
--- branches/2.8.x/wb/admin/settings/save.php	(revision 1254)
+++ branches/2.8.x/wb/admin/settings/save.php	(revision 1255)
@@ -1,28 +1,14 @@
 <?php
-/****************************************************************************
-* SVN Version information:
+/*
 *
-* $Id$
+*                       About WebsiteBaker
 *
-*****************************************************************************
-*                          WebsiteBaker
-*
-* WebsiteBaker Project <http://www.websitebaker2.org/>
-* Copyright (C) 2009, Website Baker Org. e.V.
-*         http://start.websitebaker2.org/impressum-datenschutz.php
-* Copyright (C) 2004-2009, Ryan Djurovich
-*
-*                        About WebsiteBaker
-*
 * Website Baker is a PHP-based Content Management System (CMS)
 * designed with one goal in mind: to enable its users to produce websites
 * with ease.
 *
-*****************************************************************************
+*                       LICENSE INFORMATION
 *
-*****************************************************************************
-*                        LICENSE INFORMATION
-*
 * WebsiteBaker 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
@@ -36,26 +22,32 @@
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-****************************************************************************
 *
 *                   WebsiteBaker Extra Information
 *
 *
-*
-*
-*****************************************************************************/
+*/
 /**
  *
- * @category     admin
- * @package      settings
- * @author       Ryan Djurovich
- * @copyright    2004-2009, Ryan Djurovich
- * @copyright    2009-2010, Website Baker Org. e.V.
- * @version      $Id$
- * @platform     WebsiteBaker 2.8.x
- * @requirements >= PHP 4.3.4
- * @license      http://www.gnu.org/licenses/gpl.html
+ * @category        admin
+ * @package         settings
+ * @author          Ryan Djurovich
+ * @copyright       2004-2009, Ryan Djurovich
+ * @copyright       2009-2010, Website Baker Org. e.V.
+ * @filesource		$HeadURL$
+ * @author          Ryan Djurovich
+ * @copyright       2004-2009, Ryan Djurovich
  *
+ * @author          WebsiteBaker Project
+ * @link			http://www.websitebaker2.org/
+ * @copyright       2009-2010, Website Baker Org. e.V.
+ * @link			http://start.websitebaker2.org/impressum-datenschutz.php
+ * @license         http://www.gnu.org/licenses/gpl.html
+ * @version         $Id$
+ * @platform        WebsiteBaker 2.8.x
+ * @requirements    PHP 4.3.4 and higher
+ * @lastmodified    $Date$
+ *
  */
 
 // prevent this file from being accessed directly in the browser (would set all entries in DB settings table to '')
@@ -78,7 +70,8 @@
 $js_back = "javascript: history.go(-1);";
 
 // Ensure that the specified default email is formally valid
-if(isset($_POST['server_email'])) {
+if(isset($_POST['server_email']))
+{
 	$_POST['server_email'] = strip_tags($_POST['server_email']);
 	if(!eregi("^([0-9a-zA-Z]+[-._+&])*[0-9a-zA-Z]+@([-0-9a-zA-Z]+[.])+[a-zA-Z]{2,6}$", $_POST['server_email'])) {
 		$admin->print_error($MESSAGE['USERS']['INVALID_EMAIL'].
@@ -87,9 +80,11 @@
 }
 
 // Work-out file mode
-if($advanced == '') {
+if($advanced == '')
+{
 	// Check if should be set to 777 or left alone
-	if(isset($_POST['world_writeable']) AND $_POST['world_writeable'] == 'true') {
+	if(isset($_POST['world_writeable']) AND $_POST['world_writeable'] == 'true')
+    {
 		$file_mode = '0777';
 		$dir_mode = '0777';
 	} else {
@@ -164,15 +159,17 @@
 }
 
 // Create new database object
-$database = new database();
+/*$database = new database(); */
 
 // Query current settings in the db, then loop through them and update the db with the new value
 $query = "SELECT name FROM ".TABLE_PREFIX."settings";
 $results = $database->query($query);
-while($setting = $results->fetchRow()) {
+while($setting = $results->fetchRow())
+{
 	$setting_name = $setting['name'];
 	$value = $admin->get_post($setting_name);
-	if ($setting_name!='wb_version') {
+	if ($setting_name!='wb_version')
+    {
 		$allow_tags_in_fields = array('website_header', 'website_footer','wbmailer_smtp_password');
 		if(!in_array($setting_name, $allow_tags_in_fields)) {
 			$value = strip_tags($value);
@@ -204,14 +201,9 @@
 	$old_value = $search_setting['value'];
 	$setting_name = $search_setting['name'];
 	$post_name = 'search_'.$search_setting['name'];
-	if($admin->get_post($post_name) == '')
-    {
-        $value = $old_value;
-    }
-	else
-    {
-        $value = $admin->get_post($post_name);
-    }
+    // hold old value if post is empty
+    // check search template
+    $value = ( ($admin->get_post($post_name) == '') AND ($setting_name != 'template') ) ? $old_value : $admin->get_post($post_name);
 
 	$value = $admin->add_slashes($value);
 	$database->query("UPDATE ".TABLE_PREFIX."search SET value = '$value' WHERE name = '$setting_name'");

Property changes on: branches/2.8.x/wb/admin/settings/save.php
___________________________________________________________________
Modified: svn:keywords
## -1 +1,4 ##
-Id
\ No newline at end of property
+Id
+Revision
+HeadURL
+Date
\ No newline at end of property
Index: branches/2.8.x/wb/admin/settings/index.php
===================================================================
--- branches/2.8.x/wb/admin/settings/index.php	(revision 1254)
+++ branches/2.8.x/wb/admin/settings/index.php	(revision 1255)
@@ -1,28 +1,14 @@
 <?php
-/****************************************************************************
-* SVN Version information:
+/*
 *
-* $Id$
+*                       About WebsiteBaker
 *
-*****************************************************************************
-*                          WebsiteBaker
-*
-* WebsiteBaker Project <http://www.websitebaker2.org/>
-* Copyright (C) 2009, Website Baker Org. e.V.
-*         http://start.websitebaker2.org/impressum-datenschutz.php
-* Copyright (C) 2004-2009, Ryan Djurovich
-*
-*                        About WebsiteBaker
-*
 * Website Baker is a PHP-based Content Management System (CMS)
 * designed with one goal in mind: to enable its users to produce websites
 * with ease.
 *
-*****************************************************************************
+*                       LICENSE INFORMATION
 *
-*****************************************************************************
-*                        LICENSE INFORMATION
-*
 * WebsiteBaker 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
@@ -36,26 +22,32 @@
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-****************************************************************************
 *
 *                   WebsiteBaker Extra Information
 *
 *
-*
-*
-*****************************************************************************/
+*/
 /**
  *
- * @category     admin
- * @package      settings
- * @author       Ryan Djurovich
- * @copyright    2004-2009, Ryan Djurovich
- * @copyright    2009-2010, Website Baker Org. e.V.
- * @version      $Id$
- * @platform     WebsiteBaker 2.8.x
- * @requirements >= PHP 4.3.4
- * @license      http://www.gnu.org/licenses/gpl.html
+ * @category        admin
+ * @package         settings
+ * @author          Ryan Djurovich
+ * @copyright       2004-2009, Ryan Djurovich
+ * @copyright       2009-2010, Website Baker Org. e.V.
+ * @filesource		$HeadURL$
+ * @author          Ryan Djurovich
+ * @copyright       2004-2009, Ryan Djurovich
  *
+ * @author          WebsiteBaker Project
+ * @link			http://www.websitebaker2.org/
+ * @copyright       2009-2010, Website Baker Org. e.V.
+ * @link			http://start.websitebaker2.org/impressum-datenschutz.php
+ * @license         http://www.gnu.org/licenses/gpl.html
+ * @version         $Id$
+ * @platform        WebsiteBaker 2.8.x
+ * @requirements    PHP 4.3.4 and higher
+ * @lastmodified    $Date$
+ *
  */
 
 require('../../config.php');
@@ -304,8 +296,10 @@
 $template->set_var('SELECTED', $selected);
 $template->parse('editor_list', 'editor_list_block', true);  
 $result = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'module' AND function = 'wysiwyg'");
-if($result->numRows() > 0) {
-	while($addon = $result->fetchRow()) {
+if($result->numRows() > 0)
+{
+	while($addon = $result->fetchRow())
+    {
 		$template->set_var('FILE', $addon['directory']);
 		$template->set_var('NAME', $addon['name']);
 		if((defined('WYSIWYG_EDITOR') AND $addon['directory'] == WYSIWYG_EDITOR) ? $selected = ' selected="selected"' : $selected = '');
@@ -316,18 +310,13 @@
 
 // Insert templates for search settings
 $template->set_block('main_block', 'search_template_list_block', 'search_template_list');
-$search_template = ($search_template == DEFAULT_TEMPLATE) ? '' : $search_template;
-if( $search_template == '')
-{
-    $selected = ' selected="selected"';
-}
-else
-{
-  $selected = '';
-}
 
+$search_template = ( ($search_template == DEFAULT_TEMPLATE) OR ($search_template == '') ) ? '' : $search_template;
+
+$selected = ( ($search_template != DEFAULT_TEMPLATE) ) ?  ' selected="selected"' : $selected = '';
+
 $template->set_var(array(
-        'FILE' => DEFAULT_TEMPLATE,
+        'FILE' => '',
         'NAME' => $TEXT['SYSTEM_DEFAULT'],
         'SELECTED' => $selected
     ));
@@ -341,17 +330,9 @@
     {
 		$template->set_var('FILE', $addon['directory']);
 		$template->set_var('NAME', $addon['name']);
+        $selected = ($addon['directory'] == $search_template) ? ' selected="selected"' :  $selected = '';
+		$template->set_var('SELECTED', $selected);
 
-		if($addon['directory'] == $search_template)
-        {
-            $selected = ' selected="selected"';
-        }
-        else
-        {
-            $selected = '';
-        }
-
-		$template->set_var('SELECTED', $selected);
 		$template->parse('search_template_list', 'search_template_list_block', true);
 	}
 }
@@ -362,11 +343,9 @@
 foreach($ER_LEVELS AS $value => $title) {
 	$template->set_var('VALUE', $value);
 	$template->set_var('NAME', $title);
-	if(ER_LEVEL == $value) {
-		$template->set_var('SELECTED', ' selected="selected"');
-	} else {
-		$template->set_var('SELECTED', '');
-	}
+    $selected = (ER_LEVEL == $value) ? ' selected="selected"' : '';
+    $template->set_var('SELECTED', $selected);
+
 	$template->parse('error_reporting_list', 'error_reporting_list_block', true);
 }
 
@@ -377,9 +356,11 @@
 
 // Insert page level limits
 $template->set_block('main_block', 'page_level_limit_list_block', 'page_level_limit_list');
-for($i = 1; $i <= 10; $i++) {
+for($i = 1; $i <= 10; $i++)
+{
 	$template->set_var('NUMBER', $i);
-	if(PAGE_LEVEL_LIMIT == $i) {
+	if(PAGE_LEVEL_LIMIT == $i)
+    {
 		$template->set_var('SELECTED', ' selected="selected"');
 	} else {
 		$template->set_var('SELECTED', '');

Property changes on: branches/2.8.x/wb/admin/settings/index.php
___________________________________________________________________
Modified: svn:keywords
## -1 +1,4 ##
-Id
\ No newline at end of property
+Id
+Revision
+HeadURL
+Date
\ No newline at end of property
