Source for file Heading.class.php

Documentation is available at Heading.class.php

  1. <?php
  2.  
  3. require_once(HARMONI."GUIManager/Component.class.php");
  4.  
  5. /**
  6. * Heading components are identical to Block components with the only exception
  7. * that their type is set to <code>HEADING</code>.
  8. * <br /><br />
  9. * <code>Components</code> are the basic units that can be displayed on
  10. * the screen. The main method <code>render()</code> which renders the component
  11. * on the screen.
  12. *
  13. * @package harmoni.gui.components
  14. *
  15. * @copyright Copyright &copy; 2005, Middlebury College
  16. * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL)
  17. *
  18. * @version $Id: Heading.class.php,v 1.7 2005/03/29 21:53:13 adamfranco Exp $
  19. */
  20. class Heading extends Component {
  21.  
  22. /**
  23. * The constructor.
  24. * @access public
  25. * @param string content This is an arbitrary string that will be printed,
  26. * whenever the user calls the <code>render()</code> method. The parameter
  27. * is required.
  28. * @param integer index The index of this component. The index has no semantic meaning:
  29. * you can think of the index as 'level' of the component. Alternatively,
  30. * the index could serve as means of distinguishing between components with
  31. * the same type. Most often one would use the index in conjunction with
  32. * the <code>getStylesForComponentType()</code> and
  33. * <code>addStyleForComponentType()</code> methods.
  34. * @param optional object StyleCollections styles,... Zero, one, or more StyleCollection
  35. * objects that will be added to the newly created Component. Warning, this will
  36. * result in copying the objects instead of referencing them as using
  37. * <code>addStyle()</code> would do.
  38. ***/
  39. function Heading($content, $index) {
  40. // ** parameter validation
  41. ArgumentValidator::validate($content, StringValidatorRule::getRule(), true);
  42. // ** end of parameter validation
  43.  
  44. $this->Component($content, HEADING, $index);
  45. // if there are style collections to add
  46. if (func_num_args() > 2)
  47. for ($i = 2; $i < func_num_args(); $i++)
  48. $this->addStyle(func_get_arg($i));
  49. }
  50.  
  51. }
  52.  
  53. ?>

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