Index: branches/2.8.x/CHANGELOG
===================================================================
--- branches/2.8.x/CHANGELOG	(revision 1221)
+++ branches/2.8.x/CHANGELOG	(revision 1222)
@@ -11,6 +11,9 @@
 ! = Update/Change
 
 ------------------------------------- 2.8.1 -------------------------------------
+28-Dec-2009 Dietmar Woellbrink (Luisehahne)
+!	change page_title to menu_title in dropdown list
+!	validate code
 23-Dec-2009 Dietmar Woellbrink (Luisehahne)
 !	check if revision $id will be updated
 21-Dec-2009 Moritz Stapelfeldt
Index: branches/2.8.x/wb/modules/menu_link/save.php
===================================================================
--- branches/2.8.x/wb/modules/menu_link/save.php	(revision 1221)
+++ branches/2.8.x/wb/modules/menu_link/save.php	(revision 1222)
@@ -1,59 +1,98 @@
-<?php
-
-// $Id$
-
-/*
-
- Website Baker Project <http://www.websitebaker.org/>
- Copyright (C) 2004-2009, 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
-
-*/
-
-require_once('../../config.php');
-
-// Include WB admin wrapper script
-$update_when_modified = true; // Tells script to update when this page was last updated
-require(WB_PATH.'/modules/admin.php');
-
-// Update id, anchor and target
-if(isset($_POST['page_link'])) {
-	$foreign_page_id = $admin->add_slashes($_POST['page_link']);
-	$page_target = $admin->add_slashes($_POST['page_target']);
-	$url_target = $admin->add_slashes($_POST['target']);
-	$r_type = $admin->add_slashes($_POST['r_type']);
-	if(isset($_POST['extern']))
-		$extern = $admin->add_slashes($_POST['extern']);
-	else
-		$extern='';
-
-	$table_pages = TABLE_PREFIX.'pages';
-	$table_mod = TABLE_PREFIX.'mod_menu_link';
-	$database->query("UPDATE `$table_pages` SET `target` = '$url_target' WHERE `page_id` = '$page_id'");
-	$database->query("UPDATE `$table_mod` SET `target_page_id` = '$foreign_page_id', `anchor` = '$page_target', `extern` = '$extern', `redirect_type` = '$r_type' WHERE `page_id` = '$page_id'");
-}
-
-// Check if there is a database error, otherwise say successful
-if($database->is_error()) {
-	$admin->print_error($database->get_error(), $js_back);
-} else {
-	$admin->print_success($MESSAGE['PAGES']['SAVED'], ADMIN_URL.'/pages/modify.php?page_id='.$page_id);
-}
-
-// Print admin footer
-$admin->print_footer();
-
+<?php
+/***************************************************************************
+* SVN Version information:
+*
+* $Id$
+*
+*****************************************************************************
+*
+*                          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
+*
+* 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
+* of the License, or (at your option) any later version.
+*
+* WebsiteBaker 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 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     modules
+ * @package      menu_link
+ * @author       Ryan Djurovich
+ * @copyright    2004-2009, Ryan Djurovich
+ * @copyright    2009, 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
+ *
+ *
+ */
+
+require_once('../../config.php');
+
+// Include WB admin wrapper script
+$update_when_modified = true; // Tells script to update when this page was last updated
+require(WB_PATH.'/modules/admin.php');
+
+// Update id, anchor and target
+if(isset($_POST['menu_link'])) {
+	$foreign_page_id = $admin->add_slashes($_POST['menu_link']);
+	$page_target = $admin->add_slashes($_POST['page_target']);
+	$url_target = $admin->add_slashes($_POST['target']);
+	$r_type = $admin->add_slashes($_POST['r_type']);
+	if(isset($_POST['extern']))
+		$extern = $admin->add_slashes($_POST['extern']);
+	else
+		$extern='';
+
+	$table_pages = TABLE_PREFIX.'pages';
+	$table_mod = TABLE_PREFIX.'mod_menu_link';
+	$database->query("UPDATE `$table_pages` SET `target` = '$url_target' WHERE `page_id` = '$page_id'");
+	$database->query("UPDATE `$table_mod` SET `target_page_id` = '$foreign_page_id', `anchor` = '$page_target', `extern` = '$extern', `redirect_type` = '$r_type' WHERE `page_id` = '$page_id'");
+}
+
+// Check if there is a database error, otherwise say successful
+if($database->is_error()) {
+	$admin->print_error($database->get_error(), $js_back);
+} else {
+	$admin->print_success($MESSAGE['PAGES']['SAVED'], ADMIN_URL.'/pages/modify.php?page_id='.$page_id);
+}
+
+// Print admin footer
+$admin->print_footer();
+
 ?>
\ No newline at end of file
Index: branches/2.8.x/wb/modules/menu_link/index.php
===================================================================
--- branches/2.8.x/wb/modules/menu_link/index.php	(revision 1221)
+++ branches/2.8.x/wb/modules/menu_link/index.php	(revision 1222)
@@ -1,28 +1,65 @@
-<?php
-
-// $Id$
-
-/*
-
- Website Baker Project <http://www.websitebaker.org/>
- Copyright (C) 2004-2009, 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
-
-*/
-
-header('Location: ../index.php');
-
+<?php
+/***************************************************************************
+* SVN Version information:
+*
+* $Id$
+*
+*****************************************************************************
+*                          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
+*
+* 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
+* of the License, or (at your option) any later version.
+*
+* WebsiteBaker 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 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     modules
+ * @package      menu_link
+ * @author       Ryan Djurovich
+ * @copyright    2004-2009, Ryan Djurovich
+ * @copyright    2009, 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
+ *
+ *
+ */
+
+header('Location: ../index.php');
+
 ?>
\ No newline at end of file
Index: branches/2.8.x/wb/modules/menu_link/modify.php
===================================================================
--- branches/2.8.x/wb/modules/menu_link/modify.php	(revision 1221)
+++ branches/2.8.x/wb/modules/menu_link/modify.php	(revision 1222)
@@ -1,28 +1,66 @@
 <?php
+/***************************************************************************
+* SVN Version information:
+*
+* $Id$
+*
+*****************************************************************************
+*                          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
+*
+* 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
+* of the License, or (at your option) any later version.
+*
+* WebsiteBaker 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 this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+****************************************************************************
+*
+*****************************************************************************
+*                   WebsiteBaker Extra Information
+*
+*
+*
+*
+*****************************************************************************/
 
-// $Id$
+/**
+ *
+ * @category     modules
+ * @package      menu_link
+ * @author       Ryan Djurovich
+ * @copyright    2004-2009, Ryan Djurovich
+ * @copyright    2009, 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
+ *
+ *
+ */
 
-/*
-
- Website Baker Project <http://www.websitebaker.org/>
- Copyright (C) 2004-2009, 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
-
-*/
-
 // Must include code to stop this file being accessed directly
 if(defined('WB_PATH') == false) { exit("Cannot access this file directly"); }
 
@@ -43,7 +81,7 @@
 $r_type = $sql_row['redirect_type'];
 $extern = $sql_row['extern'];
 $anchor = $sql_row['anchor'];
-$sel = ' selected';
+$sel = ' selected="selected"';
 
 // Get list of all visible pages and build a page-tree
 
@@ -73,9 +111,9 @@
 global $menulink_titles;
 $menulink_titles = array();
 $table_p = TABLE_PREFIX."pages";
-if($query_page = $database->query("SELECT `page_id`,`page_title` FROM `$table_p`")) {
+if($query_page = $database->query("SELECT `page_id`,`menu_title` FROM `$table_p`")) {
 	while($page = $query_page->fetchRow())
-		$menulink_titles[$page['page_id']] = $page['page_title'];
+		$menulink_titles[$page['page_id']] = $page['menu_title'];
 }
 // now get the tree
 $links = array();
@@ -116,12 +154,13 @@
 
 // script for target-select-box
 ?>
-<script type="text/javascript">
+<script language="JavaScript" type="text/javascript">
+/*<![CDATA[*/
 	function populate() {
-		o=document.getElementById('page_link');
+		o=document.getElementById('menu_link');
 		d=document.getElementById('page_target');
 		e=document.getElementById('extern');
-		if(!d){return;}			
+		if(!d){return;}
 		var mitems=new Array();
 		mitems['0']=[' ','0'];
 		mitems['-1']=[' ','0'];
@@ -151,7 +190,7 @@
 			d.options[j].text=cur[i];
 			d.options[j++].value=cur[i+1];
 		}
-		
+
 		if(o.value=='-1') {
 			e.disabled = false;
 		} else {
@@ -158,8 +197,9 @@
 			e.disabled = true;
 		}
 	}
+
+/*]]>*/
 </script>
-
 <form name="menulink" action="<?php echo WB_URL ?>/modules/menu_link/save.php" method="post">
 <input type="hidden" name="page_id" value="<?php echo $page_id ?>" />
 <input type="hidden" name="section_id" value="<?php echo $section_id ?>" />
@@ -169,14 +209,14 @@
 		<?php echo $TEXT['LINK'].':' ?>
 	</td>
 	<td>
-		<select name="page_link" id="page_link" onchange="populate()" style="width:250px;" />
+		<select name="menu_link" id="menu_link" onchange="populate()" style="width:250px;" >
 			<option value="0"<?php echo $target_page_id=='0'?$sel:''?>><?php echo $TEXT['PLEASE_SELECT']; ?></option>
 			<option value="-1"<?php echo $target_page_id=='-1'?$sel:''?>><?php echo $MOD_MENU_LINK['EXTERNAL_LINK']; ?></option>
 			<?php foreach($links AS $pid=>$link) {
 				if ($pid == $page_id)  // Display current page with selection disabled
-					echo "<option value=\"$pid\" disabled=\"disabled\">$link *</option>";
+					echo "<option value=\"$pid\" disabled=\"disabled\">$link *</option>\n";
 				else
-					echo "<option value=\"$pid\" ".($target_page_id==$pid?$sel:'').">$link</option>";
+					echo "<option value=\"$pid\" ".($target_page_id==$pid?$sel:'').">$link</option>\n";
 			} ?>
 		</select>
 		&nbsp;
@@ -188,8 +228,8 @@
 		<?php echo $TEXT['ANCHOR'].':' ?>
 	</td>
 	<td>
-		<select name="page_target" id="page_target" onfocus="populate()" style="width:250px;" />
-			<option value="<?php echo $anchor ?>" selected><?php echo $anchor=='0'?' ':'#'.$anchor ?></option>
+		<select name="page_target" id="page_target" onfocus="populate()" style="width:250px;" >
+			<option value="<?php echo $anchor ?>" selected="selected"><?php echo $anchor=='0'?' ':'#'.$anchor ?></option>
 		</select>
 	</td>
 </tr>
@@ -198,7 +238,7 @@
 		<?php echo $TEXT['TARGET'].':' ?>
 	</td>
 	<td>
-		<select name="target" style="width:250px;" />
+		<select name="target" style="width:250px;" >
 			<option value="_blank"<?php if($target=='_blank') echo ' selected="selected"'; ?>><?php echo $TEXT['NEW_WINDOW'] ?></option>
 			<option value="_self"<?php if($target=='_self') echo ' selected="selected"'; ?>><?php echo $TEXT['SAME_WINDOW'] ?></option>
 			<option value="_top"<?php if($target=='_top') echo ' selected="selected"'; ?>><?php echo $TEXT['TOP_FRAME'] ?></option>
@@ -210,7 +250,7 @@
 		<?php echo $MOD_MENU_LINK['R_TYPE'].':' ?>
 	</td>
 	<td>
-		<select name="r_type" style="width:250px;" />
+		<select name="r_type" style="width:250px;" >
 			<option value="301"<?php if($r_type=='301') echo ' selected="selected"'; ?>>301</option>
 			<option value="302"<?php if($r_type=='302') echo ' selected="selected"'; ?>>302</option>
 		</select>
@@ -226,7 +266,6 @@
 		<input type="submit" value="<?php echo $TEXT['SAVE'] ?>" style="width: 100px; margin-top: 5px;" />
 	</td>
 	<td align="right">
-		</form>
 		<input type="button" value="<?php echo $TEXT['CANCEL'] ?>" onclick="javascript: window.location = 'index.php';" style="width: 100px; margin-top: 5px;" />
 	</td>
 </tr>
@@ -233,4 +272,3 @@
 </table>
 
 </form>
-
