| 1 | <?php | 
| 2 |  | 
| 3 | /** | 
| 4 | * This example illustrates the use of the | 
| 5 | * NavTable widget. | 
| 6 | * | 
| 7 | * | 
| 8 | * $Id: widget1.php,v 1.5 2002/09/26 21:03:42 hemna Exp $ | 
| 9 | * | 
| 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 | $page->set_text_debug( $_GET["debug"] ); | 
| 30 |  | 
| 31 | //add the css link to the default theme which will | 
| 32 | //automatically generate the css classes used | 
| 33 | //by the Navtable widget, as well as the other widgets. | 
| 34 | $page->add_css_link( "/css/defaulttheme.php" ); | 
| 35 |  | 
| 36 |  | 
| 37 | //create the NavTable Object | 
| 38 | //create the widget with a | 
| 39 | //title of "Some lame title" | 
| 40 | //subtitle of "some subtitle" | 
| 41 | //overall width of 300 pixels ( u can use % as well ) | 
| 42 | $nav = new NavTable("Some lame title", "some subtitle", "300"); | 
| 43 |  | 
| 44 | $nav->add("#", "Some Link", "This is title text"); | 
| 45 | $nav->add("#", "Another"); | 
| 46 | $nav->add_blank(); | 
| 47 | $nav->add("#", "Some Link", "This is title text"); | 
| 48 | $nav->add("#", "Another"); | 
| 49 |  | 
| 50 | $page->add( $nav ); | 
| 51 |  | 
| 52 |  | 
| 53 | //this will render the entire page | 
| 54 | //with the content you have added | 
| 55 | //wrapped inside all the required | 
| 56 | //elements for a complete HTML/XHTML page. | 
| 57 | //NOTE: all the objects in phphtmllib have | 
| 58 | //      the render() method.  So you can call | 
| 59 | //      render on any phphtmlib object. | 
| 60 | print $page->render(); | 
| 61 | ?> |