Project

General

Profile

« Previous | Next » 

Revision 593

Added by thorn almost 17 years ago

Generate filename in pages/ from page_title instead of menu_title.

View differences:

trunk/CHANGELOG
10 10
# = Bugfix
11 11
! = Update/Change
12 12

  
13
------------------------------------- 2.7.0 -------------------------------------
13
------------------------------------- 2.7.0 -------------------------------------
14
24-Jan-2008 Thomas Hornik
15
!	Generate filename in pages/ from page_title instead of menu_title.
14 16
24-Jan-2008 Christian Sommer
15 17
#	fixed bug in Codepress integration (if codepress framework not installed)
16 18
+	added language support to all integrated modules (except for news and form module)
trunk/wb/upgrade-script.php
349 349
	
350 350
}
351 351

  
352
// some code missing to regenerate page_title from link/filename
353
// for_all_pages: if filename($page_title) != basename($link) {
354
//   rename $page_title to basename($link)
355
// }
356
// This must be done after menu_link-upgrade
357
// 
358
// Should we really do this? - must be checked
352 359

  
353 360

  
354 361
//******************************************************************************
trunk/wb/admin/pages/settings2.php
122 122

  
123 123
// Work-out what the link should be
124 124
if($parent == '0') {
125
	$link = '/'.page_filename($menu_title);
126
	$filename = WB_PATH.PAGES_DIRECTORY.'/'.page_filename($menu_title).PAGE_EXTENSION; 
125
	$link = '/'.page_filename($page_title);
126
	$filename = WB_PATH.PAGES_DIRECTORY.'/'.page_filename($page_title).PAGE_EXTENSION; 
127 127
} else {
128 128
	$parent_section = '';
129 129
	$parent_titles = array_reverse(get_parent_titles($parent));
......
131 131
		$parent_section .= page_filename($parent_title).'/';
132 132
	}
133 133
	if($parent_section == '/') { $parent_section = ''; }
134
	$link = '/'.$parent_section.page_filename($menu_title);
135
	$filename = WB_PATH.PAGES_DIRECTORY.'/'.$parent_section.page_filename($menu_title).PAGE_EXTENSION;  
134
	$link = '/'.$parent_section.page_filename($page_title);
135
	$filename = WB_PATH.PAGES_DIRECTORY.'/'.$parent_section.page_filename($page_title).PAGE_EXTENSION;  
136 136
}
137 137

  
138 138
// Check if a page with same page filename exists
trunk/wb/framework/functions.php
709 709
			$admin->print_error($MESSAGE['PAGES']['CANNOT_DELETE_ACCESS_FILE']);
710 710
		} else {
711 711
			unlink($filename);
712
			if(file_exists($directory) && rtrim($directory,'/')!=WB_PATH.PAGES_DIRECTORY) {
712
			if(file_exists($directory) && rtrim($directory,'/')!=WB_PATH.PAGES_DIRECTORY && substr($link, 0, 1) != '.') {
713 713
				rm_full_dir($directory);
714 714
			}
715 715
		}
trunk/wb/modules/menu_link/modify.php
41 41
if($query_page = $database->query("SELECT DISTINCT p.* FROM $table_p AS p INNER JOIN $table_s AS s ON p.page_id=s.page_id WHERE s.module != 'menu_link' AND p.page_id != '$page_id' AND parent = '0' ORDER BY position")) {
42 42
	while($page = $query_page->fetchRow()) {
43 43
		if($admin->page_is_visible($page)) {
44
			$links[$page['page_id']]='/'.$page['menu_title'];
44
			$links[$page['page_id']]='/'.$page['page_title'];
45 45
			if($query_subpage = $database->query("SELECT DISTINCT p.* FROM $table_p AS p INNER JOIN $table_s AS s ON p.page_id=s.page_id WHERE s.module != 'menu_link' AND p.page_id != '$page_id' AND root_parent = '{$page['page_id']}' ORDER BY level")) {
46 46
				while($sub = $query_subpage->fetchRow()) {
47 47
					if($admin->page_is_visible($sub)) {
48 48
						$parent_link = (array_key_exists($sub['parent'],$links))?$links[$sub['parent']]:"";
49
						$links[$sub['page_id']]=$parent_link.'/'.$sub['menu_title'];
49
						$links[$sub['page_id']]=$parent_link.'/'.$sub['page_title'];
50 50
					}
51 51
				}
52 52
			}

Also available in: Unified diff