Source for file dftk_output_base.php
Documentation is available at dftk_output_base.php
1 <?php 2 /* 3 4 Copyright (c)2003 DuckCorp(tm) and RtpNet(tm) 5 6 7 8 This file is part of DFTK. 9 10 DFTK is free software; you can redistribute it and/or modify 11 it under the terms of the GNU General Public License as published by 12 the Free Software Foundation; either version 2 of the License, or 13 (at your option) any later version. 14 15 DFTK is distributed in the hope that it will be useful, 16 but WITHOUT ANY WARRANTY; without even the implied warranty of 17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 GNU General Public License for more details. 19 20 You should have received a copy of the GNU General Public License 21 along with DFTK; if not, write to the Free Software 22 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 23 */ 24 25 26 /** 27 * @package dftk 28 * @author Duck <duck@DuckCorp.org> 29 * @author Rtp <rtp@rtp-net.org> 30 * @copyright Copyright (c)2003 DuckCorp(tm) and RtpNet(tm) 31 * @license http://www.gnu.org/licenses/gpl.html GNU General Public License 32 * @version 0.4.0 33 */ 34 35 36 /** 37 * DFTK Output Base Class 38 * 39 * @package dftk 40 * @subpackage dftk-output 41 * @author Duck <duck@DuckCorp.org> 42 * 43 * @access public 44 * @abstract 45 */ 46 class DftkOutput 47 { 48 /** 49 * Trace Manager 50 * 51 * @access private 52 * @var string 53 */ 54 var $_tracemgr; 55 56 /** 57 * Header 58 * 59 * @access private 60 * @var string 61 */ 62 var $_header; 63 64 /** 65 * Content 66 * 67 * @access private 68 * @var string 69 */ 70 var $_content; 71 72 /** 73 * Footer 74 * 75 * @access private 76 * @var string 77 */ 78 var $_footer; 79 80 /** 81 * Constructor 82 * 83 * @access public 84 * @param object DftkDaTraceManager &$tracemgr Language Manager 85 */ 86 function DftkOutput(&$tracemgr) 87 { 88 $this->_tracemgr =& $tracemgr; 89 90 if (!$this->_tracemgr->is_module("DFTK-OUTPUT")) 91 $this->_tracemgr->register_events("DFTK-OUTPUT",DFTK_ROOT_PATH."/output/traces/"); 92 93 $this->_header = ""; 94 $this->_content = ""; 95 $this->_footer = ""; 96 97 register_shutdown_function(array(&$this, "_DftkOutput")); 98 } 99 100 /** 101 * Destructor 102 * 103 * @access private 104 */ 105 function _DftkOutput() 106 { 107 } 108 109 /** 110 * Set Header 111 * 112 * @access public 113 * @param string $header Header 114 * @return object DftkDaTrace $r Trace 115 */ 116 function &set_header($header) 117 { 118 $r =& $this->_tracemgr->create_trace(); 119 120 $this->_header = $header; 121 122 return $r; 123 } 124 125 /** 126 * Set Footer 127 * 128 * @access public 129 * @param string $footer Footer 130 * @return object DftkDaTrace $r Trace 131 */ 132 function &set_footer($footer) 133 { 134 $r =& $this->_tracemgr->create_trace(); 135 136 $this->_footer = $footer; 137 138 return $r; 139 } 140 141 /** 142 * Add Content 143 * 144 * @access public 145 * @param string $str Content to add 146 * @return object DftkDaTrace $r Trace 147 */ 148 function &add_content($str) 149 { 150 $r =& $this->_tracemgr->create_trace(); 151 152 $this->_content.= $str; 153 154 return $r; 155 } 156 157 /** 158 * Clear Content 159 * 160 * @access public 161 * @return object DftkDaTrace $r Trace 162 */ 163 function &clear_content() 164 { 165 $r =& $this->_tracemgr->create_trace(); 166 167 $this->_content = ""; 168 169 return $r; 170 } 171 172 /** 173 * Flush output (MUST BE OVERLOADED) 174 * 175 * @access public 176 * @return object DftkDaTrace $r Trace 177 */ 178 function &flush_output() 179 { 180 return $this->clear_content(); 181 } 182 } 183 184 ?>
|