webpageTemplate.inc
2.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<?php
/**
* webTemplate.inc
*
* Used in conjunction with the navbar to create the north, west and north west payloads
* and in doing so creating the webtemplate
*
*
* @author Mukhtar Dharsey
* @date 20 January 2003
* @package presentation.lookandfeel
*/
require_once("$default->owl_fs_root/lib/visualpatterns/PatternMainPage.inc");
require_once("$default->owl_fs_root/lib/visualpatterns/PatternImage.inc");
require_once("$default->owl_fs_root/lib/visualpatterns/PatternTableLinks.inc");
require_once("$default->owl_fs_root/lib/visualpatterns/PatternTableSqlQuery.inc");
require_once("$default->owl_fs_root/lib/visualpatterns/NavBar.inc");
// create the navbar and north payload
$navbar = new NavBar();
//get the section name
$sectionName = $default->siteMap->getSectionName(substr($_SERVER["PHP_SELF"], strlen($default->owl_root_url), strlen($_SERVER["PHP_SELF"])));
//highlight the respective section
$navbar->setHighlightedSection($sectionName);
// setup nw payload
$colourBar = $navbar->getNWColourbar();
$image = new PatternImage("$default->owl_graphics_url/tree.gif");
$image->setImgSize(114, 96);
$img = $image->render();
$nwestLoad = "<html>
<table width = \"100%\" height = \"100%\">
<td>". $img ."</td></tr>
<tr><td><img src = " . $colourBar . "></img></td></tr>
</table>
</html>";
$nwPayLoad = new PatternCustom;
$nwPayLoad ->setHtml($nwestLoad);
// set up the west payload
//get section links
if ($sectionName != "General") {
$sectionArray = $default->siteMap->getSectionLinks($sectionName);
//format the array..by taking first element off
$output1["links"] = array_shift ($sectionArray["links"]);
$output2["descriptions"] = array_shift($sectionArray["descriptions"]);
//create links
$westLinks = new PatternTableLinks($sectionArray["links"], $sectionArray["descriptions"], 50 , 1 ,1,null);
$westRender = $westLinks->render();
} else {
$westLinks = new PatternTableLinks(array(), array(), 50 , 1 ,1,null);
$westRender = $westLinks->render();
}
//set up links
$cAdmin = "$default->owl_graphics_url/leftnav/cadmin.gif" ;
$link = "$default->owl_graphics_url/leftnav/links.gif" ;
//setup the westpayload
// TODO -> change to links the images as well
$westLoad = "<table cellspacing = \"5\" cellpadding = \"5\" border = \"0\" width = \"100%\" height = \"75%\">
<tr><td>". $westRender ."</td></tr>
</table>
<hr>
<img src = " . $cAdmin . "></img>
</hr>
<hr>
<img src = ". $link ."></img>
</hr>
<hr>
</hr>";
$westPayLoad = new PatternCustom;
$westPayLoad->setHtml($westLoad);
$main = new PatternMainPage();
$main->setNorthPayload($navbar);
$main->setNorthWestPayload($nwPayLoad);
$main->setWestPayload($westPayLoad);
?>