Source for file FlowLayout.class.php

Documentation is available at FlowLayout.class.php

  1. <?php
  2.  
  3. require_once(HARMONI."GUIManager/Layout.interface.php");
  4.  
  5. /**
  6. * <code>FlowLayout</code> is the most simple <code>Layout</code>; it renders a
  7. * container by simply rendering all of the container's components. The width, height,
  8. * and alignment options of the container and its components are ignored. No special
  9. * arranging is done, and it is up to the browser or user to display the components properly.
  10. * <br /><br />
  11. * Contrary to what one might think, this could be a very useful <code>Layout</code>.
  12. * For eaxmple, it could be used to display components that are just
  13. * <code>div</code> elements with aboslute positioning.
  14. * <br /><br />
  15. * Layouts are assigned to Containers and they specify how (in terms of location,
  16. * not appearance) the sub-<code>Components</code> are going to be rendered on the screen.
  17. *
  18. * @package harmoni.gui.layouts
  19. *
  20. * @copyright Copyright &copy; 2005, Middlebury College
  21. * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL)
  22. *
  23. * @version $Id: FlowLayout.class.php,v 1.7 2007/09/04 20:25:22 adamfranco Exp $
  24. */
  25. class FlowLayout extends LayoutInterface {
  26.  
  27. /**
  28. * The constructor.
  29. * @access public
  30. ***/
  31. function FlowLayout() {
  32. }
  33.  
  34. /**
  35. * Lays out and renders the given container and its components. The Layout
  36. * object should arrange the <code>Components</code> in a well-defined manner
  37. * and then call the <code>render()</code> methods of each individual component.
  38. * @access public
  39. * @param ref object The container to render.
  40. * @param ref object theme The Theme object to use in producing the result
  41. * of this method.
  42. * @param string tabs This is a string (normally a bunch of tabs) that will be
  43. * prepended to each text line. This argument is optional but its usage is highly
  44. * recommended in order to produce a nicely formatted HTML output.
  45. ***/
  46. function render($container, $theme, $tabs = "") {
  47. // now output each component of the given container
  48. $components =$container->getComponents();
  49. foreach (array_keys($components) as $key) {
  50. $component =$components[$key];
  51. $component->render($theme, $tabs."\t");
  52. }
  53. }
  54. /**
  55. * Returns any CSS code that might be needed in order for this <code>Layout</code>
  56. * to render properly.
  57. * @access public
  58. * @param string tabs This is a string (normally a bunch of tabs) that will be
  59. * prepended to each text line. This argument is optional but its usage is highly
  60. * recommended in order to produce a nicely formatted HTML output.
  61. * @return string The CSS code that might be needed in order for this <code>Layout</code>
  62. * to render properly.
  63. ***/
  64. function getCSS($tabs = "") {
  65. return "";
  66. }
  67. }
  68.  
  69. ?>

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