test.php
1.25 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
<?php
require_once ("./lib/visualpatterns/PatternMainPage.inc");
require_once ("./lib/visualpatterns/PatternImage.inc");
require_once ("./lib/visualpatterns/PatternTableLinks.inc");
require_once ("./lib/visualpatterns/PatternTableSqlQuery.inc");
/**
* @package tests.visualpatterns
*/
//North west image
$img = new PatternImage("file://C:/temp/test/al.jpg");
//build the top menu of links
$aTopMenuLinks = array(0=>"www.google.com",1=>"www.yahoo.com",2=>"www.msn.com");
$aTopMenuText = array(0=>"google",1=>"yahoo",2=>"msn");
$oPatternTableLinks = new PatternTableLinks($aTopMenuLinks, $aTopMenuText, 3, 1);
//build the central grid for paging through results
$aCentralPageColumns = array(0=>"name",1=>"parent",2=>"security");
$aColumnTypes = array(0=>1,1=>2,2=>1);
$oTableSqlQuery = & new PatternTableSqlQuery("Folders", $aCentralPageColumns, $aColumnTypes);
($HTTP_GET_VARS["fStartIndex"]) ? $oTableSqlQuery->setStartIndex($HTTP_GET_VARS["fStartIndex"]) : $oTableSqlQuery->setStartIndex(0);
$oTableSqlQuery->setLinkType(1);
//get a page
$tmp = new PatternMainPage();
//put the page together
$tmp->setNorthWestPayload($img);
$tmp->setNorthPayload($oPatternTableLinks);
$tmp->setCentralPayload($oTableSqlQuery);
$tmp->setFormAction("Navigate.inc");
$tmp->render();
?>