Project

General

Profile

1
<?php
2

    
3
/*
4

    
5
 Website Baker Project <http://www.websitebaker.org/>
6
 Copyright (C) 2004-2005, Ryan Djurovich
7

    
8
 Website Baker is free software; you can redistribute it and/or modify
9
 it under the terms of the GNU General Public License as published by
10
 the Free Software Foundation; either version 2 of the License, or
11
 (at your option) any later version.
12

    
13
 Website Baker is distributed in the hope that it will be useful,
14
 but WITHOUT ANY WARRANTY; without even the implied warranty of
15
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
 GNU General Public License for more details.
17

    
18
 You should have received a copy of the GNU General Public License
19
 along with Website Baker; if not, write to the Free Software
20
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
21

    
22
*/
23

    
24
/*
25
	This file is purely for ensuring compatibility with 3rd party
26
	contributions made for WB version 2.5.2 or below
27
*/
28

    
29
function page_link($link) {
30
	global $wb;
31
	$wb->page_link($link);
32
}
33

    
34

    
35
function page_content($block=1) {
36
	global $wb;
37
	$wb->page_content($block);
38
}
39

    
40
// Old menu call invokes new menu function
41
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) {
42
	global $wb;
43
	$wb->menu($menu_number, 0, -1, true, $item_template, '</li>', $menu_header, $menu_footer, $default_class, $current_class, $parent);
44
//	$wb->page_menu($parent, $menu_number, $item_template.'</li>', $menu_header, $menu_footer, $default_class, $current_class, $recurse);
45
}
46

    
47
// Function for page title
48
function page_title($spacer = ' - ', $template = '[WEBSITE_TITLE][SPACER][PAGE_TITLE]') {
49
	global $wb;
50
	$wb->page_title($spacer,$template);
51
}
52

    
53
// Function for page description
54
function page_description() {
55
	global $wb;
56
	$wb->page_description();
57
}
58
// Function for page keywords
59
function page_keywords() {
60
	global $wb;
61
	$wb->page_keywords();
62
}
63
// Function for page header
64
function page_header($date_format = 'Y') {
65
	global $wb;
66
	$wb->page_header($date_format);
67
}
68
// Function for page footer
69
function page_footer($date_format = 'Y') {
70
	global $wb;
71
	$wb->page_footer($date_format);
72
}
73

    
74
// references to objects and variables that changed their names
75

    
76
$admin = &$wb;
77

    
78
$default_link=&$wb->default_link;
79

    
80
$page_trail=&$wb->page_trail;
81
$page_description=&$wb->page_description;
82
$page_keywords=&$wb->page_keywords;
83
$page_link=&$wb->link;
84

    
85
$extra_sql=&$wb->extra_sql;
86
$extra_where_sql=&$wb->extra_where_sql;
87

    
88

    
89
// Begin WB < 2.4.x template compatibility code
90
	// Make extra_sql accessable through private_sql
91
	$private_sql = $extra_sql;
92
	$private_where_sql = $extra_where_sql;
93
	// Query pages for menu
94
	$menu1 = $database->query("SELECT page_id,menu_title,page_title,link,target,visibility$extra_sql FROM ".TABLE_PREFIX."pages WHERE parent = '0' AND $extra_where_sql ORDER BY position ASC");
95
	// Check if current pages is a parent page and if we need its submenu
96
	if(PARENT == 0) {
97
		// Get the pages submenu
98
		$menu2 = $database->query("SELECT page_id,menu_title,page_title,link,target,visibility$extra_sql FROM ".TABLE_PREFIX."pages WHERE parent = '".PAGE_ID."' AND $extra_where_sql ORDER BY position ASC");
99
	} else {
100
		// Get the pages submenu
101
		$menu2 = $database->query("SELECT page_id,menu_title,page_title,link,target,visibility$extra_sql FROM ".TABLE_PREFIX."pages WHERE parent = '".PARENT."' AND $extra_where_sql ORDER BY position ASC");
102
	}
103
// End WB < 2.4.x template compatibility code
104
// Include template file
105

    
106

    
107
?>
(7-7/11)