1 |
jonen |
1.1 |
<?php |
2 |
|
|
|
3 |
|
|
/** |
4 |
|
|
* This example illustrates the use of the |
5 |
|
|
* NavTable widget. |
6 |
|
|
* |
7 |
|
|
* |
8 |
jonen |
1.3 |
* $Id: widget1.php,v 1.7 2003/07/28 17:02:03 hemna Exp $ |
9 |
jonen |
1.1 |
* |
10 |
|
|
* @author Walter A. Boring IV <waboring@buildabetterweb.com> |
11 |
|
|
* @package phpHtmlLib |
12 |
|
|
* @subpackage widget-examples |
13 |
|
|
* @version 2.0 |
14 |
|
|
* |
15 |
|
|
*/ |
16 |
|
|
|
17 |
|
|
/** |
18 |
|
|
* Include the phphtmllib libraries |
19 |
|
|
* |
20 |
|
|
*/ |
21 |
|
|
include_once("includes.inc"); |
22 |
|
|
|
23 |
|
|
|
24 |
|
|
//create the page object |
25 |
|
|
$page = new HTMLPageClass("phpHtmlLib Widgets - NavTable", |
26 |
|
|
XHTML_TRANSITIONAL); |
27 |
|
|
|
28 |
|
|
//enable output debugging. |
29 |
jonen |
1.3 |
if (isset($_GET['debug'])) { |
30 |
|
|
$page->set_text_debug( TRUE ); |
31 |
|
|
} |
32 |
|
|
|
33 |
jonen |
1.1 |
|
34 |
|
|
//add the css link to the default theme which will |
35 |
|
|
//automatically generate the css classes used |
36 |
|
|
//by the Navtable widget, as well as the other widgets. |
37 |
|
|
$page->add_css_link( "/css/defaulttheme.php" ); |
38 |
|
|
|
39 |
|
|
|
40 |
|
|
//create the NavTable Object |
41 |
|
|
//create the widget with a |
42 |
|
|
//title of "Some lame title" |
43 |
|
|
//subtitle of "some subtitle" |
44 |
|
|
//overall width of 300 pixels ( u can use % as well ) |
45 |
|
|
$nav = new NavTable("Some lame title", "some subtitle", "300"); |
46 |
|
|
|
47 |
|
|
$nav->add("#", "Some Link", "This is title text"); |
48 |
|
|
$nav->add("#", "Another"); |
49 |
|
|
$nav->add_blank(); |
50 |
|
|
$nav->add("#", "Some Link", "This is title text"); |
51 |
|
|
$nav->add("#", "Another"); |
52 |
|
|
|
53 |
|
|
$page->add( $nav ); |
54 |
|
|
|
55 |
|
|
|
56 |
|
|
//this will render the entire page |
57 |
|
|
//with the content you have added |
58 |
|
|
//wrapped inside all the required |
59 |
|
|
//elements for a complete HTML/XHTML page. |
60 |
|
|
//NOTE: all the objects in phphtmllib have |
61 |
|
|
// the render() method. So you can call |
62 |
|
|
// render on any phphtmlib object. |
63 |
|
|
print $page->render(); |
64 |
|
|
?> |