Index: branches/2.8.x/CHANGELOG
===================================================================
--- branches/2.8.x/CHANGELOG	(revision 1717)
+++ branches/2.8.x/CHANGELOG	(revision 1718)
@@ -13,6 +13,9 @@
 
 
 
+29 Aug-2012 Build 1718 Dietmar Woellbrink (Luisehahne)
+! update headerinfo
+! change multi-dimensional arrays (variables) to similar arrays
 29 Aug-2012 Build 1717 Dietmar Woellbrink (Luisehahne)
 ! update droplets uninstall, upgrade
 ! add $database=WbDatabase::getInstance();
Index: branches/2.8.x/wb/admin/interface/version.php
===================================================================
--- branches/2.8.x/wb/admin/interface/version.php	(revision 1717)
+++ branches/2.8.x/wb/admin/interface/version.php	(revision 1718)
@@ -51,5 +51,5 @@
 
 // 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.3');
-if(!defined('REVISION')) define('REVISION', '1717');
+if(!defined('REVISION')) define('REVISION', '1718');
 if(!defined('SP')) define('SP', '');
Index: branches/2.8.x/wb/search/search.php
===================================================================
--- branches/2.8.x/wb/search/search.php	(revision 1717)
+++ branches/2.8.x/wb/search/search.php	(revision 1718)
@@ -3,9 +3,8 @@
  *
  * @category        frontend
  * @package         search
- * @author          WebsiteBaker Project
- * @copyright       2004-2009, Ryan Djurovich
- * @copyright       2009-2011, Website Baker Org. e.V.
+ * @author          yan Djurovich, WebsiteBaker Project
+ * @copyright       2009-2012, WebsiteBaker Org. e.V.
  * @link			http://www.websitebaker2.org/
  * @license         http://www.gnu.org/licenses/gpl.html
  * @platform        WebsiteBaker 2.8.x
@@ -153,7 +152,7 @@
 			if($i++ > 0) {
 				$search_path_SQL .= ' $op';
 			}
-			$search_path_SQL .= " link $not LIKE '".$p."%'";			
+			$search_path_SQL .= " link $not LIKE '".$p."%'";
 		}
 		$search_path_SQL .= ' )';
 	}
@@ -187,7 +186,7 @@
 $search_url_string = ''; // for $_GET -- ATTN: unquoted! Will become urldecoded later
 $string = '';
 if(isset($_REQUEST['string'])) {
-	if($match!='exact') { // $string will be cleaned below 
+	if($match!='exact') { // $string will be cleaned below
 		$string=str_replace(',', '', $_REQUEST['string']);
 	} else {
 		$string=$_REQUEST['string'];
@@ -357,7 +356,7 @@
 				continue; // there is no search_func for this module
 			}
 			// get each section for $module_name
-			$table_s = TABLE_PREFIX."sections";	
+			$table_s = TABLE_PREFIX."sections";
 			$table_p = TABLE_PREFIX."pages";
 			$sections_query = $database->query("
 				SELECT s.section_id, s.page_id, s.module, s.publ_start, s.publ_end,
@@ -622,7 +621,7 @@
 						if(isset($seen_pages[$module_name][$page['page_id']]) || isset($pages_listed[$page['page_id']])) {
 							continue;
 						}
-						
+
 						// don't list pages with visibility == none|deleted and check if user is allowed to see the page
 						$p_table = TABLE_PREFIX."pages";
 						$viewquery = $database->query("
@@ -654,7 +653,7 @@
 								}
 							}
 						}
-	
+
 						// Get page link
 						$link = page_link($page['link']);
 						// Add search string for highlighting
@@ -705,5 +704,3 @@
 echo $search_results_footer;
 // Show search footer
 echo $search_footer;
-
-?>
Index: branches/2.8.x/wb/search/index.php
===================================================================
--- branches/2.8.x/wb/search/index.php	(revision 1717)
+++ branches/2.8.x/wb/search/index.php	(revision 1718)
@@ -3,9 +3,8 @@
  *
  * @category        frontend
  * @package         search
- * @author          WebsiteBaker Project
- * @copyright       2004-2009, Ryan Djurovich
- * @copyright       2009-2011, Website Baker Org. e.V.
+ * @author          Ryan Djurovich, WebsiteBaker Project
+ * @copyright       2009-2012, WebsiteBaker Org. e.V.
  * @link			http://www.websitebaker2.org/
  * @license         http://www.gnu.org/licenses/gpl.html
  * @platform        WebsiteBaker 2.8.x
@@ -19,11 +18,12 @@
 // Include the config file
 require('../config.php');
 
+$page_id = (isset($_SESSION['PAGE_ID']) && ($_SESSION['PAGE_ID']!='') ? $_SESSION['PAGE_ID'] : 0);
+
 // Required page details
-$page_id = 0;
 $page_description = '';
 $page_keywords = '';
-define('PAGE_ID', 0);
+define('PAGE_ID', $page_id);
 define('ROOT_PARENT', 0);
 define('PARENT', 0);
 define('LEVEL', 0);
@@ -52,5 +52,3 @@
 
 // Include index (wrapper) file
 require(WB_PATH.'/index.php');
-
-?>
\ No newline at end of file
Index: branches/2.8.x/wb/modules/captcha_control/install.php
===================================================================
--- branches/2.8.x/wb/modules/captcha_control/install.php	(revision 1717)
+++ branches/2.8.x/wb/modules/captcha_control/install.php	(revision 1718)
@@ -4,7 +4,7 @@
  * @category        modules
  * @package         captcha_control
  * @author          WebsiteBaker Project
- * @copyright       2009-2011, Website Baker Org. e.V.
+ * @copyright       2009-2012, WebsiteBaker Org. e.V.
  * @link            http://www.websitebaker2.org/
  * @license         http://www.gnu.org/licenses/gpl.html
  * @platform        WebsiteBaker 2.8.x
@@ -20,7 +20,7 @@
 if(defined('WB_PATH') == false)
 {
 	// Stop this file being access directly
-		die('<head><title>Access denied</title></head><body><h2 style="color:red;margin:3em auto;text-align:center;">Cannot access this file directly</h2></body></html>');
+		die('<h2 style="color:red;margin:3em auto;text-align:center;">Cannot access this file directly</h2>');
 }
 /* -------------------------------------------------------- */
 
Index: branches/2.8.x/wb/modules/news/modify.php
===================================================================
--- branches/2.8.x/wb/modules/news/modify.php	(revision 1717)
+++ branches/2.8.x/wb/modules/news/modify.php	(revision 1718)
@@ -4,7 +4,7 @@
  * @category        modules
  * @package         news
  * @author          WebsiteBaker Project
- * @copyright       2009-2011, Website Baker Org. e.V.
+ * @copyright       2009-2012, WebsiteBaker Org. e.V.
  * @link			http://www.websitebaker2.org/
  * @license         http://www.gnu.org/licenses/gpl.html
  * @platform        WebsiteBaker 2.8.x
@@ -20,13 +20,14 @@
 if(defined('WB_PATH') == false)
 {
 	// Stop this file being access directly
-		die('<head><title>Access denied</title></head><body><h2 style="color:red;margin:3em auto;text-align:center;">Cannot access this file directly</h2></body></html>');
+		die('<h2 style="color:red;margin:3em auto;text-align:center;">Cannot access this file directly</h2>');
 }
 /* -------------------------------------------------------- */
+// fixed escaping malformed URI reference
+$TEXT['ARE_YOU_SURE'] = str_replace(' ','%20',$TEXT['ARE_YOU_SURE']);
+$database->query("DELETE FROM ".TABLE_PREFIX."mod_news_posts  WHERE page_id = '$page_id' and section_id = '$section_id' and title=''");
+$database->query("DELETE FROM ".TABLE_PREFIX."mod_news_groups  WHERE page_id = '$page_id' and section_id = '$section_id' and title=''");
 
-$database->query("DELETE FROM ".TABLE_PREFIX."mod_news_posts  WHERE page_id = '$page_id' and section_id = '$section_id' and title=''"); 
-$database->query("DELETE FROM ".TABLE_PREFIX."mod_news_groups  WHERE page_id = '$page_id' and section_id = '$section_id' and title=''"); 
-
 //overwrite php.ini on Apache servers for valid SESSION ID Separator
 if(function_exists('ini_set')) {
 	ini_set('arg_separator.output', '&amp;');
@@ -129,7 +130,7 @@
 			<?php } ?>
 			</td>
 			<td width="20">
-				<a href="javascript: confirm_link('<?php echo $TEXT['ARE_YOU_SURE']; ?>', '<?php echo WB_URL; ?>/modules/news/delete_post.php?page_id=<?php echo $page_id; ?>&amp;section_id=<?php echo $section_id; ?>&amp;post_id=<?php echo $pid; ?>');" title="<?php echo $TEXT['DELETE']; ?>">
+				<a href="javascript:confirm_link('<?php echo $TEXT['ARE_YOU_SURE']; ?>','<?php echo WB_URL; ?>/modules/news/delete_post.php?page_id=<?php echo $page_id; ?>&amp;section_id=<?php echo $section_id; ?>&amp;post_id=<?php echo $pid; ?>');" title="<?php echo $TEXT['DELETE']; ?>">
 					<img src="<?php echo THEME_URL; ?>/images/delete_16.png" border="0" alt="X" />
 				</a>
 			</td>
@@ -171,7 +172,7 @@
 				<a href="<?php echo WB_URL; ?>/modules/news/modify_group.php?page_id=<?php echo $page_id; ?>&amp;section_id=<?php echo $section_id; ?>&amp;group_id=<?php echo $gid; ?>" title="<?php echo $TEXT['MODIFY']; ?>">
 					<img src="<?php echo THEME_URL; ?>/images/modify_16.png" border="0" alt="Modify - " />
 				</a>
-			</td>		
+			</td>
 			<td width="50" style="text-align: right;">
 				<?php echo $group['group_id'] ?>
 			</td>
Index: branches/2.8.x/wb/modules/admin.php
===================================================================
--- branches/2.8.x/wb/modules/admin.php	(revision 1717)
+++ branches/2.8.x/wb/modules/admin.php	(revision 1718)
@@ -4,7 +4,7 @@
  * @category        backend
  * @package         modules
  * @author          WebsiteBaker Project
- * @copyright       2009-2010, Website Baker Org. e.V.
+ * @copyright       2009-2012, WebsiteBaker Org. e.V.
  * @link			http://www.websitebaker2.org/
  * @license         http://www.gnu.org/licenses/gpl.html
  * @platform        WebsiteBaker 2.8.x
@@ -13,12 +13,12 @@
  * @filesource		$HeadURL$
  * @lastmodified    $Date$
  *
-*/
+ */
 
 // Stop this file being access directly
 if(defined('WB_PATH') == false)
 {
-	die('<head><title>Access denied</title></head><body><h2 style="color:red;margin:3em auto;text-align:center;">Cannot access this file directly</h2></body></html>');
+	die('<h2 style="color:red;margin:3em auto;text-align:center;">Cannot access this file directly</h2>');
 }
 
 // Get page id
@@ -53,7 +53,7 @@
 // Get perms
 // unset($admin_header);
 
-$page = $admin->get_page_details($page_id,ADMIN_URL.'/pages/index.php' );
+$page = $admin->get_page_details($page_id, ADMIN_URL.'/pages/index.php' );
 
 $old_admin_groups = explode(',', str_replace('_', '', $page['admin_groups']));
 $old_admin_users = explode(',', str_replace('_', '', $page['admin_users']));
@@ -68,7 +68,7 @@
 if((!$in_group) && !is_numeric(array_search($admin->get_user_id(), $old_admin_users))) {
 	print $admin->get_group_id().$admin->get_user_id();
 	// print_r ($old_admin_groups);
-	$admin->print_error($MESSAGE['PAGES']['INSUFFICIENT_PERMISSIONS']);
+	$admin->print_error($MESSAGE['PAGES_INSUFFICIENT_PERMISSIONS']);
 }
 
 // some additional security checks:
@@ -77,7 +77,7 @@
 	$section = $admin->get_section_details($section_id,ADMIN_URL.'/pages/index.php');
 	if (!$admin->get_permission($section['module'], 'module'))
 	{
-		$admin->print_error($MESSAGE['PAGES']['INSUFFICIENT_PERMISSIONS']);
+		$admin->print_error($MESSAGE['PAGES_INSUFFICIENT_PERMISSIONS']);
 	}
 }
 
@@ -97,7 +97,7 @@
 
 	// Setup template object, parse vars to it, then parse it
 	// Create new template object
-	$template = new Template(dirname($admin->correct_theme_source('pages_modify.htt')));
+	$template = new Template(dirname($admin->correct_theme_source('pages_modify.htt')),'keep');
 	// $template->debug = true;
 	$template->set_file('page', 'pages_modify.htt');
 	$template->set_block('page', 'main_block', 'main');
@@ -116,10 +116,12 @@
 
 	$template->set_var(array(
 				'MODIFIED_BY' => $user['display_name'],
+				'TEXT_LAST_MODIFIED' => $TEXT['LAST_UPDATED_BY'],
 				'MODIFIED_BY_USERNAME' => $user['username'],
 				'MODIFIED_WHEN' => $modified_ts,
-				'LAST_MODIFIED' => $MESSAGE['PAGES']['LAST_MODIFIED'],
-				));
+				'LAST_MODIFIED' => $MESSAGE['PAGES_LAST_MODIFIED'],
+				'TEXT_MANAGE_SECTIONS' => $HEADING['MANAGE_SECTIONS']
+			));
 
 	$template->set_block('main_block', 'show_modify_block', 'show_modify');
 	if($modified_ts == 'Unknown')
@@ -133,10 +135,45 @@
 	}
 
 	// Work-out if we should show the "manage sections" link
-	$sql  = 'SELECT `section_id` FROM `'.TABLE_PREFIX.'sections` WHERE `page_id` = '.(int)$page_id.' ';
-	$sql .= 'AND `module` = "menu_link"';
-	$query_sections = $database->query($sql);
+//	$sql  = 'SELECT `section_id` FROM `'.TABLE_PREFIX.'sections` WHERE `page_id` = '.(int)$page_id.' ';
+//	$sql .= 'AND `module` = "menu_link"';
+//	$query_sections = $database->query($sql);
+/*-- workout if we should show the "manage sections" link ------------------------------*/
+	$sql = 'SELECT COUNT(*) FROM `'.TABLE_PREFIX.'sections` '
+	     . 'WHERE `page_id`='.$page_id.' AND `module`=\'menu_link\'';
+	$bIsMenuLink = (intval($database->get_one($sql)) != 0);
+//	if(!$bIsMenuLink && (MANAGE_SECTIONS == true) && $admin->get_permission('pages_add') )
+	if((MANAGE_SECTIONS == true) && $admin->get_permission('pages_add') )
+	{
+		$template->set_var(array(
+				'SECTIONS_LINK_BEFORE' => '<a href="'.ADMIN_URL.'/pages/sections.php?page_id='.$page['page_id'].'">',
+				'SECTIONS_LINK_AFTER' => '</a>',
+				'DISPLAY_MANAGE_SECTIONS' => 'link',
+				));
+	}else {
+//		$oTpl->set_block('show_manage_sections', '');
+		$template->set_var(array(
+				'SECTIONS_LINK_BEFORE' => '<span class="bold grey">',
+				'SECTIONS_LINK_AFTER' => '</span>',
+				'DISPLAY_MANAGE_SECTIONS' => 'link',
+				));
+	}
 
+	if( $admin->get_permission('pages_settings') )
+	{
+		$template->set_var(array(
+				'SETTINGS_LINK_BEFORE' => '<a href="'.ADMIN_URL.'/pages/settings.php?page_id='.$page['page_id'].'">',
+				'SETTINGS_LINK_AFTER' => '</a>',
+				'DISPLAY_MANAGE_SETTINGS' => 'link',
+				));
+	} else {
+		$template->set_var(array(
+				'SETTINGS_LINK_BEFORE' => '<span class="bold grey">',
+				'SETTINGS_LINK_AFTER' => '</span>',
+				'DISPLAY_MANAGE_SECTIONS' => 'link',
+				));
+	}
+/*
 	$template->set_block('main_block', 'show_section_block', 'show_section');
 	if($query_sections->numRows() > 0)
 	{
@@ -154,7 +191,7 @@
 		$template->set_var('DISPLAY_MANAGE_SECTIONS', 'display:none;');
 
 	}
-
+*/
 	// Insert language TEXT
 	$template->set_var(array(
 					'TEXT_CURRENT_PAGE' => $TEXT['CURRENT_PAGE'],
@@ -173,8 +210,7 @@
                  {
 			$block_name = htmlentities(strip_tags($block[$section['block']]));
 		} else {
-			if ($section['block'] == 1)
-                     {
+			if ($section['block'] == 1) {
 				$block_name = $TEXT['MAIN'];
 			} else {
 				$block_name = '#' . (int) $section['block'];
@@ -182,9 +218,9 @@
 		}
 
 		$sec_anchor = (defined( 'SEC_ANCHOR' ) && ( SEC_ANCHOR != '' )  ? 'id="'.SEC_ANCHOR.$section['section_id'].'"' : '');
-		print '<div class="section-info" '.$sec_anchor.' ><b>' . $TEXT['BLOCK'] . ': </b>' . $block_name;
+		print '<div class="section-info" ><b>' . $TEXT['BLOCK'] . ': </b>' . $block_name;
 		print '<b>  Modul: </b>' . $section['module']." ";
-		print '<b>  ID: </b>' . $section_id."</div>\n";
+		print '<b>  ID: </b><a' . $section_id."></a></div>\n";
 	}
 
 } //
