Source for file dobomode.php

Documentation is available at dobomode.php

  1. <?php
  2. /**
  3. * @package harmoni.gui.examples
  4. *
  5. * @copyright Copyright &copy; 2005, Middlebury College
  6. * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL)
  7. *
  8. * @version $Id: dobomode.php,v 1.8 2007/09/19 14:00:42 adamfranco Exp $
  9. */
  10.  
  11. // =============================================================================
  12. // Load Harmoni stuff.
  13. // =============================================================================
  14.  
  15.  
  16. define("LOAD_HIERARCHY", false);
  17. define("LOAD_AUTHN",false);
  18. define("LOAD_AGENTINFORMATION", false);
  19. define("LOAD_DATAMANAGER", false);
  20. define("LOAD_AUTHN", false);
  21. define("LOAD_DR", false);
  22. define("LOAD_SETS", false);
  23. if (!defined('HARMONI')) {
  24. require_once("../../../harmoni.inc.php");
  25. }
  26. $errorHandler = Services::getService("ErrorHandler");
  27.  
  28. // =============================================================================
  29. // Include all needed files.
  30. // =============================================================================
  31.  
  32.  
  33. require_once(HARMONI."GUIManager/Themes/DobomodeTheme.class.php");
  34.  
  35. require_once(HARMONI."GUIManager/Component.class.php");
  36.  
  37. require_once(HARMONI."GUIManager/Components/Block.class.php");
  38. require_once(HARMONI."GUIManager/Components/Menu.class.php");
  39. require_once(HARMONI."GUIManager/Components/MenuItemLink.class.php");
  40. require_once(HARMONI."GUIManager/Components/MenuItemHeading.class.php");
  41. // require_once(HARMONI."GUIManager/Components/Heading.class.php");
  42. // require_once(HARMONI."GUIManager/Components/Footer.class.php");
  43. // require_once(HARMONI."GUIManager/Container.class.php");
  44.  
  45. // require_once(HARMONI."GUIManager/Layouts/XLayout.class.php");
  46. // require_once(HARMONI."GUIManager/Layouts/YLayout.class.php");
  47. // require_once(HARMONI."GUIManager/Layouts/FlowLayout.class.php");
  48. // =============================================================================
  49. // Create some containers & components. This stuff would normally go in an action.
  50. // =============================================================================
  51.  
  52. // initialize layouts and theme
  53. $theme = new DobomodeTheme();
  54. // create and add menus
  55. // create and add components
  56. $main = new Block($theme->getDisplayName().": ".$theme->getDescription()."\n", 0);
  57. // create menus
  58. $menu1 = new Menu(new FlowLayout(), 1);
  59. $menu1->add(new MenuItemHeading("Main Menu", 1));
  60. $menu1->add(new MenuItemLink("Home", "http://www.google.com", true, 1, null, null, "Home"));
  61. $menu1->add(new MenuItemLink("Alone", "http://www.depeche-mode.org", false, 1, null, null, "Alone"));
  62. $menu2 = new Menu(new FlowLayout(), 2);
  63. $menu2->add(new MenuItemHeading("Sub-menu", 2));
  64. $menu2->add(new MenuItemLink("Up", "http://www.google.com", true, 2, null, null, "Up"));
  65. $menu2->add(new MenuItemLink("Down", "http://www.depeche-mode.org", false, 2, null, null, "Down"));
  66. // print the page
  67. $theme->setComponent($main);
  68. $theme->addMenu($menu1, 1);
  69. $theme->addMenu($menu2, 2);
  70. $theme->printPage();
  71. // instead of td with XLayout, tables one after another?
  72.  
  73. ?>

Documentation generated on Wed, 19 Sep 2007 10:22:46 -0400 by phpDocumentor 1.3.0RC3