Project

General

Profile

« Previous | Next » 

Revision 220

Added by stefan about 19 years ago

Some changes and fixes to menu code

View differences:

frontend.functions.php
67 67

  
68 68
// Old menu call invokes new menu function
69 69
if (!function_exists('page_menu')) {
70
	function page_menu($parent = 0, $menu_number = 1, $item_template = '<li><span[class]>[a][menu_title][/a]</span>', $menu_header = '<ul>', $menu_footer = '</ul>', $default_class = ' class="menu_default"', $current_class = ' class="menu_current"', $recurse = LEVEL) {
70
	function page_menu($parent = 0, $menu_number = 1, $item_template = '<li[class]>[a][menu_title][/a]</li>', $menu_header = '<ul>', $menu_footer = '</ul>', $default_class = ' class="menu_default"', $current_class = ' class="menu_current"', $recurse = LEVEL) {
71 71
		global $wb;
72 72
		$wb->menu_number=$menu_number;
73 73
		$wb->menu_item_template=$item_template;
74
		$wb->menu_item_footer='';
74 75
		$wb->menu_parent = $parent;
75 76
		$wb->menu_header = $menu_header; 
76 77
		$wb->menu_footer = $menu_footer;
......
78 79
		$wb->menu_current_class = $current_class;
79 80
		$wb->menu_recurse = $recurse+2; 	
80 81
		$wb->menu();
82
		unset($wb->menu_parent);
83
		unset($wb->menu_number);
84
		unset($wb->menu_item_template);
85
		unset($wb->menu_item_footer);
86
		unset($wb->menu_header);
87
		unset($wb->menu_footer);
88
		unset($wb->menu_default_class);
89
		unset($wb->menu_current_class);
90
		unset($wb->menu_start_level);
91
		unset($wb->menu_collapse);
92
		unset($wb->menu_recurse);
81 93
	}
82 94
}
83 95

  
96
if (!function_exists('show_menu')) {
97
	function show_menu($menu_number = NULL, $start_level=NULL, $recurse = NULL, $collapse = NULL, $item_template = NULL, $item_footer = NULL, $menu_header = NULL, $menu_footer = NULL, $default_class = NULL, $current_class = NULL, $parent = NULL) {
98
		global $wb;
99
		if (isset($menu_number))
100
			$wb->menu_number=$menu_number;
101
		if (isset($start_level))
102
			$wb->menu_start_level=$start_level;
103
		if (isset($recurse))
104
			$wb->menu_recurse=$recurse;
105
		if (isset($collapse))
106
			$wb->menu_collapse=$collapse;
107
		if (isset($item_template))
108
			$wb->menu_item_template=$item_template;
109
		if (isset($item_footer))
110
			$wb->menu_item_footer=$item_footer;
111
		if (isset($menu_header))
112
			$wb->menu_header=$menu_header;
113
		if (isset($menu_footer))
114
			$wb->menu_footer=$menu_footer;
115
		if (isset($default_class))
116
			$wb->menu_default_class=$default_class;
117
		if (isset($current_class))
118
			$wb->menu_current_class=$current_class;
119
		if (isset($parent))
120
			$wb->menu_parent=$parent;
121
		$wb->menu();
122
		unset($wb->menu_recurse);
123
		unset($wb->menu_parent);
124
		unset($wb->menu_start_level);
125
	}
126
}
127

  
84 128
if (!function_exists('page_content')) {
85 129
	function page_content($block = 1) {
86 130
		// Get outside objects

Also available in: Unified diff