Source for file class.TEMPLATE.php

Documentation is available at class.TEMPLATE.php

  1. <?php
  2.  
  3.  
  4. /**
  5.  * Verwaltet Templates
  6.  *
  7.  * @author Kay Koch, <kay.koch@gmx.de>
  8.  * @package src
  9.  * @subpackage tools
  10.  */
  11.  
  12. if (version_compare(PHP_VERSION'5')) {
  13.     die('This file was generated for PHP 5');
  14. }
  15.  
  16. /* user defined includes */
  17. // section -64--88-122--2-339007d5:1043cd4e8c9:-7fc1-includes begin
  18. // section -64--88-122--2-339007d5:1043cd4e8c9:-7fc1-includes end
  19.  
  20. /* user defined constants */
  21. // section -64--88-122--2-339007d5:1043cd4e8c9:-7fc1-constants begin
  22. // section -64--88-122--2-339007d5:1043cd4e8c9:-7fc1-constants end
  23.  
  24. /**
  25.  * Verwaltet Templates
  26.  *
  27.  * @access public
  28.  * @author Kay Koch, <kay.koch@gmx.de>
  29.  * @package src
  30.  * @subpackage tools
  31.  */
  32. {
  33.     // --- ATTRIBUTES ---
  34.  
  35.     // --- OPERATIONS ---
  36.  
  37.     
  38.     /**
  39.      * liefert  das Template
  40.      *
  41.      * @access public
  42.      * @author Kay Koch, <kay.koch@gmx.de>
  43.      * @param string 
  44.      * @param void 
  45.      * @return string 
  46.      */
  47.     public static function getTemplate($tpl$o null)
  48.     {
  49.         $returnValue = (string) '';
  50.  
  51.         // section -64--88-122--2-339007d5:1043cd4e8c9:-7fbf begin
  52.         // einlesen des Template und umwandeln von Anführungsstrichen
  53.         #try {
  54.             $returnValue str_replace("\"""\\\""file_get_contents("templates/" $tpl ".htm"));
  55.             // ersetzen der Variablen im Template durch die Werte aus dem Objekt $o
  56.             if (isset($o->data))
  57.                 $data $o->data;
  58.             #if(!eval ("\$returnValue = \"" . $returnValue . "\";"))
  59.                 #throw new Exception();;
  60.                 eval ("\$returnValue = \"" $returnValue "\";");
  61.         // section -64--88-122--2-339007d5:1043cd4e8c9:-7fbf end
  62.         #} catch (Exception $e) {
  63.         #    src_tools_ERROR :: setError($e, __METHOD__);
  64.         #}
  65.         return (string) $returnValue;
  66.     }
  67.  
  68. /* end of class src_tools_TEMPLATE */
  69.  
  70. ?>

Documentation generated on Sat, 24 Mar 2007 10:00:09 +0100 by phpDocumentor 1.3.1