Source for file BasicOutputHandler.class.php

Documentation is available at BasicOutputHandler.class.php

  1. <?php
  2. /**
  3. * @package harmoni.architecture.output
  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: BasicOutputHandler.class.php,v 1.6 2007/09/04 20:25:30 adamfranco Exp $
  9. */
  10.  
  11. require_once(HARMONI."/architecture/output/OutputHandler.abstract.php");
  12.  
  13. /**
  14. * The OutputHander abstract class defines methods for the interaction between
  15. * the Harmoni framework object and output handling classes.
  16. *
  17. *
  18. * @package harmoni.architecture.output
  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: BasicOutputHandler.class.php,v 1.6 2007/09/04 20:25:30 adamfranco Exp $
  24. */
  25. class BasicOutputHandler
  26. extends OutputHandler
  27. {
  28. /**
  29. * Output the content that was returned from an action. This content should
  30. * have been created such that it is a type that this OutputHandler can deal
  31. * with.
  32. *
  33. * @param mixed $returnedContent Content returned by the action
  34. * @param string $printedContent Additional content printed, but not returned.
  35. * @return void
  36. * @access public
  37. * @since 4/4/05
  38. */
  39. function output ( $returnedContent, $printedContent ) {
  40. $osidContext =$this->getOsidContext();
  41. $harmoni =$osidContext->getContext('harmoni');
  42. $doctypeDef = $this->_configuration->getProperty('document_type_definition');
  43. $doctype = $this->_configuration->getProperty('document_type');
  44. $characterSet = $this->_configuration->getProperty('character_set');
  45. $head = $this->getHead();
  46. header("Content-type: $doctype; charset=$characterSet");
  47. print<<<END
  48. $doctypeDef
  49. <html>
  50. <head>
  51. <meta http-equiv="Content-Type" content="$doctype; charset=$characterSet" />
  52. $head
  53. </head>
  54. <body>
  55. $printedContent
  56. END;
  57. if (is_string($returnedContent))
  58. print $returnedContent;
  59. print<<<END
  60.  
  61. </body>
  62. </html>
  63. END;
  64. }
  65. }
  66.  
  67. ?>

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