1
|
<?php
|
2
|
|
3
|
// $Id: compatibility.php 11 2005-09-04 09:20:29Z ryan $
|
4
|
|
5
|
/*
|
6
|
|
7
|
Website Baker Project <http://www.websitebaker.org/>
|
8
|
Copyright (C) 2004-2005, Ryan Djurovich
|
9
|
|
10
|
Website Baker is free software; you can redistribute it and/or modify
|
11
|
it under the terms of the GNU General Public License as published by
|
12
|
the Free Software Foundation; either version 2 of the License, or
|
13
|
(at your option) any later version.
|
14
|
|
15
|
Website Baker is distributed in the hope that it will be useful,
|
16
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
17
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
18
|
GNU General Public License for more details.
|
19
|
|
20
|
You should have received a copy of the GNU General Public License
|
21
|
along with Website Baker; if not, write to the Free Software
|
22
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
23
|
|
24
|
*/
|
25
|
|
26
|
/*
|
27
|
This file is purely for ensuring compatibility with 3rd party
|
28
|
contributions made for WB version 2.5.2 or below
|
29
|
*/
|
30
|
|
31
|
function page_link($link) {
|
32
|
global $wb;
|
33
|
$wb->page_link($link);
|
34
|
}
|
35
|
|
36
|
|
37
|
function page_content($block=1) {
|
38
|
global $wb;
|
39
|
$wb->page_content($block);
|
40
|
}
|
41
|
|
42
|
// Old menu call invokes new menu function
|
43
|
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) {
|
44
|
global $wb;
|
45
|
$wb->menu($menu_number, 0, -1, true, $item_template, '</li>', $menu_header, $menu_footer, $default_class, $current_class, $parent);
|
46
|
// $wb->page_menu($parent, $menu_number, $item_template.'</li>', $menu_header, $menu_footer, $default_class, $current_class, $recurse);
|
47
|
}
|
48
|
|
49
|
// Function for page title
|
50
|
function page_title($spacer = ' - ', $template = '[WEBSITE_TITLE][SPACER][PAGE_TITLE]') {
|
51
|
global $wb;
|
52
|
$wb->page_title($spacer,$template);
|
53
|
}
|
54
|
|
55
|
// Function for page description
|
56
|
function page_description() {
|
57
|
global $wb;
|
58
|
$wb->page_description();
|
59
|
}
|
60
|
// Function for page keywords
|
61
|
function page_keywords() {
|
62
|
global $wb;
|
63
|
$wb->page_keywords();
|
64
|
}
|
65
|
// Function for page header
|
66
|
function page_header($date_format = 'Y') {
|
67
|
global $wb;
|
68
|
$wb->page_header($date_format);
|
69
|
}
|
70
|
// Function for page footer
|
71
|
function page_footer($date_format = 'Y') {
|
72
|
global $wb;
|
73
|
$wb->page_footer($date_format);
|
74
|
}
|
75
|
|
76
|
// references to objects and variables that changed their names
|
77
|
|
78
|
$admin = &$wb;
|
79
|
|
80
|
$default_link=&$wb->default_link;
|
81
|
|
82
|
$page_trail=&$wb->page_trail;
|
83
|
$page_description=&$wb->page_description;
|
84
|
$page_keywords=&$wb->page_keywords;
|
85
|
$page_link=&$wb->link;
|
86
|
|
87
|
$extra_sql=&$wb->extra_sql;
|
88
|
$extra_where_sql=&$wb->extra_where_sql;
|
89
|
|
90
|
|
91
|
// Begin WB < 2.4.x template compatibility code
|
92
|
// Make extra_sql accessable through private_sql
|
93
|
$private_sql = $extra_sql;
|
94
|
$private_where_sql = $extra_where_sql;
|
95
|
// Query pages for menu
|
96
|
$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");
|
97
|
// Check if current pages is a parent page and if we need its submenu
|
98
|
if(PARENT == 0) {
|
99
|
// Get the pages submenu
|
100
|
$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");
|
101
|
} else {
|
102
|
// Get the pages submenu
|
103
|
$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");
|
104
|
}
|
105
|
// End WB < 2.4.x template compatibility code
|
106
|
// Include template file
|
107
|
|
108
|
|
109
|
?>
|