Index: branches/2.8.x/wb/upgrade-script.php
===================================================================
--- branches/2.8.x/wb/upgrade-script.php	(revision 1695)
+++ branches/2.8.x/wb/upgrade-script.php	(revision 1696)
@@ -473,10 +473,11 @@
 	}
 	/**********************************************************
  *  - Add field "redirect_type" to table "mod_menu_link"
+ *  has to be moved later to upgrade.php in modul menu_link, because modul can be removed
  */
 	$table_name = TABLE_PREFIX.'mod_menu_link';
 	$field_name = 'redirect_type';
-	$description = "INT NOT NULL DEFAULT '302' AFTER `target_page_id`";
+	$description = "INT NOT NULL DEFAULT '301' AFTER `target_page_id`";
 	if(!$database->field_exists($table_name,$field_name)) {
 		echo "<br />Adding field redirect_type to mod_menu_link table";
 		echo ($database->field_add($table_name, $field_name, $description) ? " $OK<br />" : " $FAIL!<br />");

Property changes on: branches/2.8.x/wb/upgrade-script.php
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: svn:keywords
## -1,4 +1 ##
-Id
-Revision
-HeadURL
-Date
\ No newline at end of property
+Date Id Revision URL
\ No newline at end of property
Index: branches/2.8.x/wb/index.php
===================================================================
--- branches/2.8.x/wb/index.php	(revision 1695)
+++ branches/2.8.x/wb/index.php	(revision 1696)
@@ -4,7 +4,7 @@
  * @category        frontend
  * @package         page
  * @author          WebsiteBaker Project
- * @copyright       2009-, Website Baker Org. e.V.
+ * @copyright       2009-, WebsiteBaker Org. e.V.
  * @link			http://www.websitebaker2.org/
  * @license         http://www.gnu.org/licenses/gpl.html
  * @platform        WebsiteBaker 2.8.x
@@ -60,61 +60,17 @@
 require(WB_PATH.'/framework/frontend.functions.php');
 
 // redirect menu-link
-$this_page_id = PAGE_ID;
+/**
+ *
+ * Removed the extra handling of menu links in index.php
+ * Moved it to the view.php of module menu links.
+ * Now the extra functionality of this module is seperated from the
+ * core and you can uninstall it if you like.
+ * Freeing the core from unnecessary code.
+ *
+ *
+ */
 
-$php43 = version_compare(phpversion(), '4.3', '>=');
-
-$sql  = 'SELECT `module`, `block` FROM `'.TABLE_PREFIX.'sections` ';
-$sql .= 'WHERE `page_id` = '.(int)$this_page_id.' AND `module` = "menu_link"';
-$query_this_module = $database->query($sql);
-if($query_this_module->numRows() == 1)  // This is a menu_link. Get link of target-page and redirect
-{
-	// get target_page_id
-	$sql  = 'SELECT * FROM `'.TABLE_PREFIX.'mod_menu_link` WHERE `page_id` = '.(int)$this_page_id;
-	$query_tpid = $database->query($sql);
-	if($query_tpid->numRows() == 1)
-	{
-		$res = $query_tpid->fetchRow();
-		$target_page_id = $res['target_page_id'];
-		$redirect_type = $res['redirect_type'];
-		$anchor = ($res['anchor'] != '0' ? '#'.(string)$res['anchor'] : '');
-		$extern = $res['extern'];
-		// set redirect-type
-		if($redirect_type == 301)
-		{
-			if($php43)
-			{
-				@header('HTTP/1.1 301 Moved Permanently', TRUE, 301);
-			}
-			else
-			{
-				@header('HTTP/1.1 301 Moved Permanently');
-			}
-		}
-		if($target_page_id == -1)
-		{
-			if($extern != '')
-			{
-				$target_url = $extern.$anchor;
-				header('Location: '.$target_url);
-				exit;
-			}
-		}
-		else
-		{
-			// get link of target-page
-			$sql  = 'SELECT `link` FROM `'.TABLE_PREFIX.'pages` WHERE `page_id` = '.$target_page_id;
-			$target_page_link = $database->get_one($sql);
-			if($target_page_link != null)
-			{
-				$target_url = WB_URL.PAGES_DIRECTORY.$target_page_link.PAGE_EXTENSION.$anchor;
-				header('Location: '.$target_url);
-				exit;
-			}
-		}
-	}
-}
-//Get pagecontent in buffer for Droplets and/or Filter operations
 ob_start();
 require(WB_PATH.'/templates/'.TEMPLATE.'/index.php');
 $output = ob_get_contents();
Index: branches/2.8.x/wb/modules/menu_link/view.php
===================================================================
--- branches/2.8.x/wb/modules/menu_link/view.php	(revision 1695)
+++ branches/2.8.x/wb/modules/menu_link/view.php	(revision 1696)
@@ -3,21 +3,26 @@
  *
  * @category        modules
  * @package         Menu Link
- * @author          WebsiteBaker Project
- * @copyright       2004-2009, Ryan Djurovich
- * @copyright       2009-2011, Website Baker Org. e.V.
+ * @author          Ryan Djurovich, WebsiteBaker Project, Norbert Heimsath
+ * @copyright       2009-2012, Website Baker Org. e.V.
  * @link			http://www.websitebaker2.org/
  * @license         http://www.gnu.org/licenses/gpl.html
  * @platform        WebsiteBaker 2.8.x
  * @requirements    PHP 5.2.2 and higher
  * @version         $Id$
- * @filesource		$HeadURL: http://svn.websitebaker2.org/branches/2.8.x/wb/modules/wysiwyg/modify.php $
- * @lastmodified    $Date: 2011-01-11 20:29:52 +0100 (Di, 11 Jan 2011) $
+ * @filesource		$HeadURL$
+ * @lastmodified    $Date$
  *
  */
 
 // Must include code to stop this file being access directly
-if(defined('WB_PATH') == false) { die("Cannot access this file directly"); }
+/* -------------------------------------------------------- */
+if(defined('WB_PATH') == false)
+{
+	// Stop this file being access directly
+		die('<h2 style="color:red;margin:3em auto;text-align:center;">Cannot access this file directly</h2>');
+}
+/* -------------------------------------------------------- */
 
 // check if module language file exists for the language set by the user (e.g. DE, EN)
 if(!file_exists(WB_PATH .'/modules/menu_link/languages/'.LANGUAGE .'.php')) {
@@ -28,7 +33,66 @@
 	require_once(WB_PATH .'/modules/menu_link/languages/'.LANGUAGE .'.php');
 }
 
+
+// redirect menu-link
+$this_page_id = PAGE_ID;
+
+$php43 = version_compare(phpversion(), '4.3', '>=');
+
+$sql  = 'SELECT `module`, `block` FROM `'.TABLE_PREFIX.'sections` ';
+$sql .= 'WHERE `page_id` = '.(int)$this_page_id.' AND `module` = "menu_link"';
+$query_this_module = $database->query($sql);
+if($query_this_module->numRows() == 1)  // This is a menu_link. Get link of target-page and redirect
+{
+	// get target_page_id
+	$sql  = 'SELECT * FROM `'.TABLE_PREFIX.'mod_menu_link` WHERE `page_id` = '.(int)$this_page_id;
+	$query_tpid = $database->query($sql);
+	if($query_tpid->numRows() == 1)
+	{
+		$res = $query_tpid->fetchRow();
+		$target_page_id = $res['target_page_id'];
+		$redirect_type = $res['redirect_type'];
+		$anchor = ($res['anchor'] != '0' ? '#'.(string)$res['anchor'] : '');
+		$extern = $res['extern'];
+		// set redirect-type
+		if($redirect_type == 301)
+		{
+			if($php43)
+			{
+				@header('HTTP/1.1 301 Moved Permanently', TRUE, 301);
+			}
+			else
+			{
+				@header('HTTP/1.1 301 Moved Permanently');
+			}
+		}
+		if($target_page_id == -1)
+		{
+			if($extern != '')
+			{
+				$target_url = $extern.$anchor;
+				header('Location: '.$target_url);
+				exit;
+			}
+		}
+		else
+		{
+			// get link of target-page
+			$sql  = 'SELECT `link` FROM `'.TABLE_PREFIX.'pages` WHERE `page_id` = '.$target_page_id;
+			$target_page_link = $database->get_one($sql);
+			if($target_page_link != null)
+			{
+				$target_url = WB_URL.PAGES_DIRECTORY.$target_page_link.PAGE_EXTENSION.$anchor;
+				header('Location: '.$target_url);
+				exit;
+			}
+		}
+	}
+} else {
+
 ?>
+
 <a href="<?php echo WB_URL; ?>">
 <?php echo $MOD_MENU_LINK['TEXT']; ?>
 </a>
+<?php }

Property changes on: branches/2.8.x/wb/modules/menu_link/view.php
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: svn:keywords
## -1 +1 ##
-Id
\ No newline at end of property
+Date Id Revision URL
\ No newline at end of property
Index: branches/2.8.x/wb/modules/menu_link/install.php
===================================================================
--- branches/2.8.x/wb/modules/menu_link/install.php	(revision 1695)
+++ branches/2.8.x/wb/modules/menu_link/install.php	(revision 1696)
@@ -3,9 +3,8 @@
  *
  * @category        modules
  * @package         menu_link
- * @author          WebsiteBaker Project
- * @copyright       2004-2009, Ryan Djurovich
- * @copyright       2009-2011, Website Baker Org. e.V.
+ * @author          Ryan Djurovich, WebsiteBaker Project
+ * @copyright       2009-2012, Website Baker Org. e.V.
  * @link			http://www.websitebaker2.org/
  * @license         http://www.gnu.org/licenses/gpl.html
  * @platform        WebsiteBaker 2.8.x
@@ -21,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>');
 }
 /* -------------------------------------------------------- */
 
@@ -33,7 +32,7 @@
 		`section_id` INT(11) NOT NULL DEFAULT '0',
 		`page_id` INT(11) NOT NULL DEFAULT '0',
 		`target_page_id` INT(11) NOT NULL DEFAULT '0',
-		`redirect_type` INT NOT NULL DEFAULT '302',
+		`redirect_type` INT NOT NULL DEFAULT '301',
 		`anchor` VARCHAR(255) NOT NULL DEFAULT '0' ,
 		`extern` VARCHAR(255) NOT NULL DEFAULT '' ,
 		PRIMARY KEY (`section_id`)

Property changes on: branches/2.8.x/wb/modules/menu_link/install.php
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: svn:keywords
## -1,4 +1 ##
-Id
-Revision
-HeadURL
-Date
\ No newline at end of property
+Date Id Revision URL
\ No newline at end of property
