Project

General

Profile

« Previous | Next » 

Revision 1003

Added by Ruud over 15 years ago

Fixed a bug in Menu_link module that made childpages of the menu_link page not selectable. (thnx to Luisehahne)

View differences:

trunk/CHANGELOG
11 11
! = Update/Change
12 12

  
13 13
------------------------------------- 2.8.0 -------------------------------------
14
22-June-2009 Ruud Eisinga
15
#	Fixed a bug in Menu_link module that made childpages of the menu_link page 
16
	not selectable. (thnx to Luisehahne)
14 17
21-June-2009 Matthias Gallas
15 18
#	Fixed small bug introduced in changeset [999]
16 19
19-June-2009 Matthias Gallas
trunk/wb/modules/menu_link/modify.php
45 45
$anchor = $sql_row['anchor'];
46 46
$sel = ' selected';
47 47

  
48
// Get list of all visible pages, except actual one, and build a page-tree
48
// Get list of all visible pages and build a page-tree
49 49

  
50 50
// this function will fetch the page_tree, recursive
51 51
if(!function_exists('menulink_make_tree')) {
......
55 55
	// get list of page-trails, recursive
56 56
	if($query_page = $database->query("SELECT * FROM `$table_p` WHERE `parent`=$parent ORDER BY `position`")) {
57 57
		while($page = $query_page->fetchRow()) {
58
			if($admin->page_is_visible($page) && $page['page_id']!=$link_pid) {
58
			if($admin->page_is_visible($page) ) {
59 59
				$pids = explode(',', $page['page_trail']);
60 60
				$entry = '';
61
				foreach($pids as $pid)
61
				foreach($pids as $pid) {
62 62
					$entry .= $menulink_titles[$pid].' / ';
63
				$tree[$page['page_id']] = rtrim($entry, '/ ');
64
				$tree = menulink_make_tree($page['page_id'], $link_pid, $tree);
63
					$tree[$page['page_id']] = rtrim($entry, '/ ');
64
					$tree = menulink_make_tree($page['page_id'], $link_pid, $tree);
65
				}
65 66
			}
66 67
		}
67 68
	}
68 69
	return($tree);
69 70
}
70 71
}
72

  
71 73
// get list of all page_ids and page_titles
72 74
global $menulink_titles;
73 75
$menulink_titles = array();
......
172 174
			<option value="0"<?php echo $target_page_id=='0'?$sel:''?>><?php echo $TEXT['PLEASE_SELECT']; ?></option>
173 175
			<option value="-1"<?php echo $target_page_id=='-1'?$sel:''?>><?php echo $MOD_MENU_LINK['EXTERNAL_LINK']; ?></option>
174 176
			<?php foreach($links AS $pid=>$link) {
175
				echo "<option value=\"$pid\" ".($target_page_id==$pid?$sel:'').">$link</option>";
177
				if ($pid == $page_id)  // Display current page with selection disabled
178
					echo "<option value=\"$pid\" disabled=\"disabled\">$link *</option>";
179
				else
180
					echo "<option value=\"$pid\" ".($target_page_id==$pid?$sel:'').">$link</option>";
176 181
			} ?>
177 182
		</select>
178 183
		&nbsp;

Also available in: Unified diff