<?php
  include_once '../doc-typo3-funcs.php';
  $doxygen_vars = array(	"title" => "TYPO3 4.0.1: typo3_src-4.0.1/typo3/sysext/cms/tslib/media/scripts/plaintextLib.inc Source File",
				"datetime" => "Sat Dec 2 19:22:30 2006",
				"date" => "2 Dec 2006",
				"doxygenversion" => "1.4.6",
				"projectname" => "TYPO3 4.0.1",
				"projectnumber" => "4.0.1"
			);
  get_header($doxygen_vars);
?>
<!-- Generated by Doxygen 1.4.6 -->
<div class="tabs">
  <ul>
    <li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
    <li><a href="namespaces.html"><span>Namespaces</span></a></li>
    <li><a href="classes.html"><span>Classes</span></a></li>
    <li id="current"><a href="files.html"><span>Files</span></a></li>
    <li><a href="dirs.html"><span>Directories</span></a></li>
    <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
    <li><a href="examples.html"><span>Examples</span></a></li>
    <li>
      <form action="search.php" method="get">
        <table cellspacing="0" cellpadding="0" border="0">
          <tr>
            <td><label>&nbsp;<u>S</u>earch&nbsp;for&nbsp;</label></td>
            <td><input type="text" name="query" value="" size="20" accesskey="s"/></td>
          </tr>
        </table>
      </form>
    </li>
  </ul></div>
<div class="nav">
<a class="el" href="dir_c8daf1ad746050abf985cc546c89e248.html">typo3_src-4.0.1</a>&nbsp;&raquo&nbsp;<a class="el" href="dir_18071ae4545d8b3e0364d30c0659c74a.html">typo3</a>&nbsp;&raquo&nbsp;<a class="el" href="dir_57bf1ed8249c1fd5b014486d01bcb27a.html">sysext</a>&nbsp;&raquo&nbsp;<a class="el" href="dir_21aa24ee31dafa72450e939d0692a893.html">cms</a>&nbsp;&raquo&nbsp;<a class="el" href="dir_da3d3c31fb60c430897a32b4a10f682b.html">tslib</a>&nbsp;&raquo&nbsp;<a class="el" href="dir_5d5928c48a24a7022098bcc9e1331896.html">media</a>&nbsp;&raquo&nbsp;<a class="el" href="dir_cdcc1b4ce87312c897e9f35885142bfd.html">scripts</a></div>
<h1>plaintextLib.inc</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 &lt;?php
<a name="l00002"></a>00002 <span class="comment">/***************************************************************</span>
<a name="l00003"></a>00003 <span class="comment">*  Copyright notice</span>
<a name="l00004"></a>00004 <span class="comment">*</span>
<a name="l00005"></a>00005 <span class="comment">*  (c) 1999-2005 Kasper Skaarhoj (kasperYYYY@typo3.com)</span>
<a name="l00006"></a>00006 <span class="comment">*  All rights reserved</span>
<a name="l00007"></a>00007 <span class="comment">*</span>
<a name="l00008"></a>00008 <span class="comment">*  This script is part of the TYPO3 project. The TYPO3 project is</span>
<a name="l00009"></a>00009 <span class="comment">*  free software; you can redistribute it and/or modify</span>
<a name="l00010"></a>00010 <span class="comment">*  it under the terms of the GNU General Public License as published by</span>
<a name="l00011"></a>00011 <span class="comment">*  the Free Software Foundation; either version 2 of the License, or</span>
<a name="l00012"></a>00012 <span class="comment">*  (at your option) any later version.</span>
<a name="l00013"></a>00013 <span class="comment">*</span>
<a name="l00014"></a>00014 <span class="comment">*  The GNU General Public License can be found at</span>
<a name="l00015"></a>00015 <span class="comment">*  http://www.gnu.org/copyleft/gpl.html.</span>
<a name="l00016"></a>00016 <span class="comment">*  A copy is found in the textfile GPL.txt and important notices to the license</span>
<a name="l00017"></a>00017 <span class="comment">*  from the author is found in LICENSE.txt distributed with these scripts.</span>
<a name="l00018"></a>00018 <span class="comment">*</span>
<a name="l00019"></a>00019 <span class="comment">*</span>
<a name="l00020"></a>00020 <span class="comment">*  This script is distributed in the hope that it will be useful,</span>
<a name="l00021"></a>00021 <span class="comment">*  but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<a name="l00022"></a>00022 <span class="comment">*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
<a name="l00023"></a>00023 <span class="comment">*  GNU General Public License for more details.</span>
<a name="l00024"></a>00024 <span class="comment">*</span>
<a name="l00025"></a>00025 <span class="comment">*  This copyright notice MUST APPEAR in all copies of the script!</span>
<a name="l00026"></a>00026 <span class="comment">***************************************************************/</span>
<a name="l00123"></a><a class="code" href="classuser__plaintext.html">00123</a> <span class="keyword">class </span><a class="code" href="classuser__plaintext.html">user_plaintext</a> {
<a name="l00124"></a><a class="code" href="classuser__plaintext.html#385669ad1a1b4723e98555fcb3a28f16">00124</a>         var <a class="code" href="classuser__plaintext.html#385669ad1a1b4723e98555fcb3a28f16">$cObj</a>;
<a name="l00125"></a><a class="code" href="classuser__plaintext.html#f62b04cfa7b0969e47c743caf3bcbea2">00125</a>         var <a class="code" href="classuser__plaintext.html#f62b04cfa7b0969e47c743caf3bcbea2">$conf</a>=array();
<a name="l00126"></a><a class="code" href="classuser__plaintext.html#1955c33319b2380afabcc7861dba4cae">00126</a>         var <a class="code" href="classuser__plaintext.html#1955c33319b2380afabcc7861dba4cae">$charWidth</a>=76;
<a name="l00127"></a>00127 
<a name="l00137"></a><a class="code" href="classuser__plaintext.html#a5449e33d76ac587903520e23a96b8be">00137</a>         function <a class="code" href="classuser__plaintext.html#a5449e33d76ac587903520e23a96b8be">main_plaintext</a>($content,<a class="code" href="classuser__plaintext.html#f62b04cfa7b0969e47c743caf3bcbea2">$conf</a>) {
<a name="l00138"></a>00138                 $this-&gt;conf = <a class="code" href="classuser__plaintext.html#f62b04cfa7b0969e47c743caf3bcbea2">$conf</a>;
<a name="l00139"></a>00139                 $this-&gt;siteUrl=<a class="code" href="classuser__plaintext.html#f62b04cfa7b0969e47c743caf3bcbea2">$conf</a>['siteUrl'];
<a name="l00140"></a>00140                 $lines = array();
<a name="l00141"></a>00141                 $CType= (string)$this-&gt;cObj-&gt;data['CType'];
<a name="l00142"></a>00142                 <span class="keywordflow">switch</span>($CType)  {
<a name="l00143"></a>00143                         <span class="keywordflow">case</span> 'header':
<a name="l00144"></a>00144                                 $lines[]=$this-&gt;<a class="code" href="classuser__plaintext.html#cbd787f7824dd7bb41fbacf3611930e9">getHeader</a>();
<a name="l00145"></a>00145                                 <span class="keywordflow">if</span> ($this-&gt;cObj-&gt;data['subheader'])     {
<a name="l00146"></a>00146                                         $lines[]=$this-&gt;<a class="code" href="classuser__plaintext.html#7458c60fc51f494229ea4cc37f2c3060">breakContent</a>(strip_tags($this-&gt;cObj-&gt;data['subheader']));
<a name="l00147"></a>00147                                 }
<a name="l00148"></a>00148                         <span class="keywordflow">break</span>;
<a name="l00149"></a>00149                         <span class="keywordflow">case</span> 'text':
<a name="l00150"></a>00150                         <span class="keywordflow">case</span> 'textpic':
<a name="l00151"></a>00151                                 $lines[]=$this-&gt;<a class="code" href="classuser__plaintext.html#cbd787f7824dd7bb41fbacf3611930e9">getHeader</a>();
<a name="l00152"></a>00152                                 <span class="keywordflow">if</span> ($CType=='textpic' &amp;&amp; !($this-&gt;cObj-&gt;data['imageorient']&amp;24))        {
<a name="l00153"></a>00153                                         $lines[]=$this-&gt;<a class="code" href="classuser__plaintext.html#2df69a1be4db643a038dd9fe456ca097">getImages</a>();
<a name="l00154"></a>00154                                         $lines[]='';
<a name="l00155"></a>00155                                 }
<a name="l00156"></a>00156                                 $lines[]=$this-&gt;<a class="code" href="classuser__plaintext.html#7458c60fc51f494229ea4cc37f2c3060">breakContent</a>(strip_tags($this-&gt;<a class="code" href="classuser__plaintext.html#859ff67aecca4d1bb83ac4fa089acebe">parseBody</a>($this-&gt;cObj-&gt;data['bodytext'])));
<a name="l00157"></a>00157                                 <span class="keywordflow">if</span> ($CType=='textpic' &amp;&amp; ($this-&gt;cObj-&gt;data['imageorient']&amp;24)) {
<a name="l00158"></a>00158                                         $lines[]='';
<a name="l00159"></a>00159                                         $lines[]=$this-&gt;<a class="code" href="classuser__plaintext.html#2df69a1be4db643a038dd9fe456ca097">getImages</a>();
<a name="l00160"></a>00160                                 }
<a name="l00161"></a>00161                         <span class="keywordflow">break</span>;
<a name="l00162"></a>00162                         <span class="keywordflow">case</span> 'image':
<a name="l00163"></a>00163                                 $lines[]=$this-&gt;<a class="code" href="classuser__plaintext.html#cbd787f7824dd7bb41fbacf3611930e9">getHeader</a>();
<a name="l00164"></a>00164                                 $lines[]=$this-&gt;<a class="code" href="classuser__plaintext.html#2df69a1be4db643a038dd9fe456ca097">getImages</a>();
<a name="l00165"></a>00165                         <span class="keywordflow">break</span>;
<a name="l00166"></a>00166                         <span class="keywordflow">case</span> 'uploads':
<a name="l00167"></a>00167                                 $lines[]=$this-&gt;<a class="code" href="classuser__plaintext.html#cbd787f7824dd7bb41fbacf3611930e9">getHeader</a>();
<a name="l00168"></a>00168                                 $lines[]=$this-&gt;<a class="code" href="classuser__plaintext.html#7366d84e7666ab9dc0246fbc85f61397">renderUploads</a>($this-&gt;cObj-&gt;data['media']);
<a name="l00169"></a>00169                         <span class="keywordflow">break</span>;
<a name="l00170"></a>00170                         <span class="keywordflow">case</span> 'menu':
<a name="l00171"></a>00171                                 $lines[]=$this-&gt;<a class="code" href="classuser__plaintext.html#cbd787f7824dd7bb41fbacf3611930e9">getHeader</a>();
<a name="l00172"></a>00172                                 $lines[]=$this-&gt;<a class="code" href="classuser__plaintext.html#3ed2121c9e2afc37ef99ef342d439ada">getMenuSitemap</a>();
<a name="l00173"></a>00173                         <span class="keywordflow">break</span>;
<a name="l00174"></a>00174                         <span class="keywordflow">case</span> 'shortcut':
<a name="l00175"></a>00175                                 $lines[]=$this-&gt;<a class="code" href="classuser__plaintext.html#32e0d675a033a359070145acf92de318">getShortcut</a>();
<a name="l00176"></a>00176                         <span class="keywordflow">break</span>;
<a name="l00177"></a>00177                         <span class="keywordflow">case</span> 'bullets':
<a name="l00178"></a>00178                                 $lines[]=$this-&gt;<a class="code" href="classuser__plaintext.html#cbd787f7824dd7bb41fbacf3611930e9">getHeader</a>();
<a name="l00179"></a>00179                                 $lines[]=$this-&gt;<a class="code" href="classuser__plaintext.html#04fb079f0478d0ea6fc1f12e036d6a89">breakBulletlist</a>(strip_tags($this-&gt;<a class="code" href="classuser__plaintext.html#859ff67aecca4d1bb83ac4fa089acebe">parseBody</a>($this-&gt;cObj-&gt;data['bodytext'])));
<a name="l00180"></a>00180                         <span class="keywordflow">break</span>;
<a name="l00181"></a>00181                         <span class="keywordflow">case</span> 'table':
<a name="l00182"></a>00182                                 $lines[]=$this-&gt;<a class="code" href="classuser__plaintext.html#cbd787f7824dd7bb41fbacf3611930e9">getHeader</a>();
<a name="l00183"></a>00183                                 $lines[]=$this-&gt;<a class="code" href="classuser__plaintext.html#5886d6e9f245c6799c01d8783965e90c">breakTable</a>(strip_tags($this-&gt;<a class="code" href="classuser__plaintext.html#859ff67aecca4d1bb83ac4fa089acebe">parseBody</a>($this-&gt;cObj-&gt;data['bodytext'])));
<a name="l00184"></a>00184                         <span class="keywordflow">break</span>;
<a name="l00185"></a>00185                         <span class="keywordflow">case</span> 'html':
<a name="l00186"></a>00186                                 $lines[]=$this-&gt;<a class="code" href="classuser__plaintext.html#7b9d8c34008188b58a70fef91e8f3e09">getHTML</a>();
<a name="l00187"></a>00187                         <span class="keywordflow">break</span>;
<a name="l00188"></a>00188                         <span class="keywordflow">default</span>:
<a name="l00189"></a>00189                                 $defaultOutput = $this-&gt;<a class="code" href="classuser__plaintext.html#77b1cad3e79f4e1f8e3b3b2e06be4bbd">getString</a>($this-&gt;conf['defaultOutput']);
<a name="l00190"></a>00190                                 <span class="keywordflow">if</span> ($defaultOutput)     {
<a name="l00191"></a>00191                                         $lines[]=str_replace('###CType###',$CType,$defaultOutput);
<a name="l00192"></a>00192                                 }
<a name="l00193"></a>00193                         <span class="keywordflow">break</span>;
<a name="l00194"></a>00194                 }
<a name="l00195"></a>00195 
<a name="l00196"></a>00196                 $lines[]='';    <span class="comment">// First break.</span>
<a name="l00197"></a>00197                 $content = implode(chr(10),$lines);
<a name="l00198"></a>00198 
<a name="l00199"></a>00199                         <span class="comment">// User processing:</span>
<a name="l00200"></a>00200                 $content=$this-&gt;<a class="code" href="classuser__plaintext.html#4ac5bfe091c2aa35b044a010016b49c5">userProcess</a>('userProc',$content);
<a name="l00201"></a>00201                 <span class="keywordflow">return</span> $content;
<a name="l00202"></a>00202         }
<a name="l00203"></a>00203 
<a name="l00209"></a><a class="code" href="classuser__plaintext.html#3ed2121c9e2afc37ef99ef342d439ada">00209</a>         function <a class="code" href="classuser__plaintext.html#3ed2121c9e2afc37ef99ef342d439ada">getMenuSitemap</a>()       {
<a name="l00210"></a>00210                 $str = $this-&gt;cObj-&gt;cObjGetSingle($this-&gt;conf['menu'],$this-&gt;conf['menu.']);
<a name="l00211"></a>00211                 $str = $this-&gt;<a class="code" href="classuser__plaintext.html#04fb079f0478d0ea6fc1f12e036d6a89">breakBulletlist</a>(trim(strip_tags(eregi_replace('&lt;br[ /]*&gt;',chr(10),$this-&gt;<a class="code" href="classuser__plaintext.html#859ff67aecca4d1bb83ac4fa089acebe">parseBody</a>($str)))));
<a name="l00212"></a>00212                 <span class="keywordflow">return</span> $str;
<a name="l00213"></a>00213         }
<a name="l00214"></a>00214 
<a name="l00220"></a><a class="code" href="classuser__plaintext.html#32e0d675a033a359070145acf92de318">00220</a>         function <a class="code" href="classuser__plaintext.html#32e0d675a033a359070145acf92de318">getShortcut</a>()  {
<a name="l00221"></a>00221                 $str = $this-&gt;cObj-&gt;cObjGetSingle($this-&gt;conf['shortcut'],$this-&gt;conf['shortcut.']);
<a name="l00222"></a>00222                 <span class="keywordflow">return</span> $str;
<a name="l00223"></a>00223         }
<a name="l00224"></a>00224 
<a name="l00231"></a><a class="code" href="classuser__plaintext.html#7b9d8c34008188b58a70fef91e8f3e09">00231</a>         function <a class="code" href="classuser__plaintext.html#7b9d8c34008188b58a70fef91e8f3e09">getHTML</a>($str=array())  {
<a name="l00232"></a>00232                 <span class="keywordflow">return</span> $this-&gt;<a class="code" href="classuser__plaintext.html#7458c60fc51f494229ea4cc37f2c3060">breakContent</a>(strip_tags(eregi_replace('&lt;br[ /]*&gt;',chr(10),$this-&gt;<a class="code" href="classuser__plaintext.html#859ff67aecca4d1bb83ac4fa089acebe">parseBody</a>(is_string($str)?$str:$this-&gt;cObj-&gt;data['bodytext']))));
<a name="l00233"></a>00233         }
<a name="l00234"></a>00234 
<a name="l00241"></a><a class="code" href="classuser__plaintext.html#cbd787f7824dd7bb41fbacf3611930e9">00241</a>         function <a class="code" href="classuser__plaintext.html#cbd787f7824dd7bb41fbacf3611930e9">getHeader</a>()    {
<a name="l00242"></a>00242                 <span class="comment">// links...</span>
<a name="l00243"></a>00243                 <span class="keywordflow">return</span> $this-&gt;<a class="code" href="classuser__plaintext.html#c14724affa2aecb7b392838749108193">renderHeader</a>($this-&gt;cObj-&gt;data['header'],$this-&gt;cObj-&gt;data['header_layout']);
<a name="l00244"></a>00244         }
<a name="l00245"></a>00245 
<a name="l00251"></a><a class="code" href="classuser__plaintext.html#2df69a1be4db643a038dd9fe456ca097">00251</a>         function <a class="code" href="classuser__plaintext.html#2df69a1be4db643a038dd9fe456ca097">getImages</a>()    {
<a name="l00252"></a>00252                 $images = $this-&gt;<a class="code" href="classuser__plaintext.html#eaad12f93353fe13b47c7838ff93ae4d">renderImages</a>($this-&gt;cObj-&gt;data['image'],!$this-&gt;cObj-&gt;data['image_zoom']?$this-&gt;cObj-&gt;data['image_link']:'',$this-&gt;cObj-&gt;data['imagecaption']);
<a name="l00253"></a>00253                 <span class="keywordflow">return</span> $images;
<a name="l00254"></a>00254         }
<a name="l00255"></a>00255 
<a name="l00262"></a><a class="code" href="classuser__plaintext.html#859ff67aecca4d1bb83ac4fa089acebe">00262</a>         function <a class="code" href="classuser__plaintext.html#859ff67aecca4d1bb83ac4fa089acebe">parseBody</a>($str)        {
<a name="l00263"></a>00263                         <span class="comment">// First, regular parsing:</span>
<a name="l00264"></a>00264                 $str = eregi_replace('&lt;br[ /]*&gt;<span class="charliteral">','</span> ',$str);
<a name="l00265"></a>00265                 $str = $this-&gt;cObj-&gt;stdWrap($str,$this-&gt;conf['bodytext.']['stdWrap.']);
<a name="l00266"></a>00266                         <span class="comment">// Then all a-tags:</span>
<a name="l00267"></a>00267                 $aConf = array();
<a name="l00268"></a>00268                 $aConf['parseFunc.']['tags.'][<span class="charliteral">'a'</span>]='USER';
<a name="l00269"></a>00269                 $aConf['parseFunc.']['tags.']['a.']['userFunc']='<a class="code" href="classuser__plaintext.html">user_plaintext</a>-&gt;atag_to_http';
<a name="l00270"></a>00270                 $aConf['parseFunc.']['tags.']['a.']['siteUrl'] = $this-&gt;siteUrl;
<a name="l00271"></a>00271 
<a name="l00272"></a>00272                 $str = $this-&gt;cObj-&gt;stdWrap($str,$aConf);
<a name="l00273"></a>00273                 $str = str_replace('&amp;nbsp;<span class="charliteral">','</span> ',<a class="code" href="classt3lib__div.html#f240b4a85b87436f4eba15dd26487991">t3lib_div::htmlspecialchars_decode</a>($str));
<a name="l00274"></a>00274                 <span class="keywordflow">return</span> $str;
<a name="l00275"></a>00275         }
<a name="l00276"></a>00276 
<a name="l00284"></a><a class="code" href="classuser__plaintext.html#7366d84e7666ab9dc0246fbc85f61397">00284</a>         function <a class="code" href="classuser__plaintext.html#7366d84e7666ab9dc0246fbc85f61397">renderUploads</a>($str,$upload_path='uploads/media/')      {
<a name="l00285"></a>00285                 $files = explode(<span class="charliteral">','</span>,$str);
<a name="l00286"></a>00286                 reset($files);
<a name="l00287"></a>00287                 $lines=array();
<a name="l00288"></a>00288                 <span class="keywordflow">if</span> ($this-&gt;conf['uploads.']['header'])  {$lines[]=$this-&gt;<a class="code" href="classuser__plaintext.html#77b1cad3e79f4e1f8e3b3b2e06be4bbd">getString</a>($this-&gt;conf['uploads.']['header']);}
<a name="l00289"></a>00289                 <span class="keywordflow">while</span>(list($k,$file)=each($files))      {
<a name="l00290"></a>00290                         $lines[]=$this-&gt;siteUrl.$upload_path.$file;
<a name="l00291"></a>00291                 }
<a name="l00292"></a>00292                 <span class="keywordflow">return</span> implode(chr(10),$lines);
<a name="l00293"></a>00293         }
<a name="l00294"></a>00294 
<a name="l00302"></a><a class="code" href="classuser__plaintext.html#c14724affa2aecb7b392838749108193">00302</a>         function <a class="code" href="classuser__plaintext.html#c14724affa2aecb7b392838749108193">renderHeader</a>($str,$type=0)     {
<a name="l00303"></a>00303                 <span class="keywordflow">if</span> ($str)       {
<a name="l00304"></a>00304                         $hConf = $this-&gt;conf['header.'];
<a name="l00305"></a>00305                         $defaultType = <a class="code" href="classt3lib__div.html#79f6a47a7658e28e3f65666f8ebc19f8">t3lib_div::intInRange</a>($hConf['defaultType'],1,5);
<a name="l00306"></a>00306                         $type=<a class="code" href="classt3lib__div.html#79f6a47a7658e28e3f65666f8ebc19f8">t3lib_div::intInRange</a>($type,0,6);
<a name="l00307"></a>00307                         <span class="keywordflow">if</span> (!$type)     $type=$defaultType;
<a name="l00308"></a>00308                         <span class="keywordflow">if</span> ($type!=6)   {       <span class="comment">// not hidden</span>
<a name="l00309"></a>00309                                 $tConf = $hConf[$type.<span class="charliteral">'.'</span>];
<a name="l00310"></a>00310 
<a name="l00311"></a>00311                                 $lines=array();
<a name="l00312"></a>00312 
<a name="l00313"></a>00313                                 $blanks = <a class="code" href="classt3lib__div.html#79f6a47a7658e28e3f65666f8ebc19f8">t3lib_div::intInRange</a>($tConf['preBlanks'],0,1000);
<a name="l00314"></a>00314                                 <span class="keywordflow">if</span> ($blanks)    {
<a name="l00315"></a>00315                                         $lines[]=str_pad('', $blanks-1, chr(10));
<a name="l00316"></a>00316                                 }
<a name="l00317"></a>00317 
<a name="l00318"></a>00318                                 $lines=$this-&gt;<a class="code" href="classuser__plaintext.html#029bb6a15b0a5892e73fef260b9a3d52">pad</a>($lines,$tConf['preLineChar'],$tConf['preLineLen']);
<a name="l00319"></a>00319 
<a name="l00320"></a>00320                                 $blanks = <a class="code" href="classt3lib__div.html#79f6a47a7658e28e3f65666f8ebc19f8">t3lib_div::intInRange</a>($tConf['preLineBlanks'],0,1000);
<a name="l00321"></a>00321                                 <span class="keywordflow">if</span> ($blanks)    {$lines[]=str_pad('', $blanks-1, chr(10));}
<a name="l00322"></a>00322 
<a name="l00323"></a>00323                                 <span class="keywordflow">if</span> ($this-&gt;cObj-&gt;data['date'])          {$lines[] = $this-&gt;<a class="code" href="classuser__plaintext.html#77b1cad3e79f4e1f8e3b3b2e06be4bbd">getString</a>($hConf['datePrefix']).date($hConf['date']?$hConf['date']:'d-m-Y',$this-&gt;cObj-&gt;data['date']);}
<a name="l00324"></a>00324                                 $prefix='';
<a name="l00325"></a>00325                                 $str=$this-&gt;<a class="code" href="classuser__plaintext.html#77b1cad3e79f4e1f8e3b3b2e06be4bbd">getString</a>($tConf['prefix']).$str;
<a name="l00326"></a>00326                                 <span class="keywordflow">if</span> ($tConf['autonumber'])       $str=$this-&gt;cObj-&gt;parentRecordNumber.$str;
<a name="l00327"></a>00327                                 <span class="keywordflow">if</span> ($this-&gt;cObj-&gt;data['header_position']=='right')      {$prefix=str_pad(<span class="charliteral">' '</span>,($this-&gt;charWidth-strlen($str)));}
<a name="l00328"></a>00328                                 <span class="keywordflow">if</span> ($this-&gt;cObj-&gt;data['header_position']=='center')     {$prefix=str_pad(<span class="charliteral">' '</span>,floor(($this-&gt;charWidth-strlen($str))/2));}
<a name="l00329"></a>00329                                 $lines[]=$this-&gt;cObj-&gt;stdWrap($prefix.$str,$tConf['stdWrap.']);
<a name="l00330"></a>00330                                 <span class="keywordflow">if</span> ($this-&gt;cObj-&gt;data['header_link'])           {$lines[] = $this-&gt;<a class="code" href="classuser__plaintext.html#77b1cad3e79f4e1f8e3b3b2e06be4bbd">getString</a>($hConf['linkPrefix']).$this-&gt;getLink($this-&gt;cObj-&gt;data['header_link']);}
<a name="l00331"></a>00331 
<a name="l00332"></a>00332                                 $blanks = <a class="code" href="classt3lib__div.html#79f6a47a7658e28e3f65666f8ebc19f8">t3lib_div::intInRange</a>($tConf['postLineBlanks'],0,1000);
<a name="l00333"></a>00333                                 <span class="keywordflow">if</span> ($blanks)    {$lines[]=str_pad('', $blanks-1, chr(10));}
<a name="l00334"></a>00334 
<a name="l00335"></a>00335                                 $lines=$this-&gt;<a class="code" href="classuser__plaintext.html#029bb6a15b0a5892e73fef260b9a3d52">pad</a>($lines,$tConf['postLineChar'],$tConf['postLineLen']);
<a name="l00336"></a>00336 
<a name="l00337"></a>00337                                 $blanks = <a class="code" href="classt3lib__div.html#79f6a47a7658e28e3f65666f8ebc19f8">t3lib_div::intInRange</a>($tConf['postBlanks'],0,1000);
<a name="l00338"></a>00338                                 <span class="keywordflow">if</span> ($blanks)    {$lines[]=str_pad('', $blanks-1, chr(10));}
<a name="l00339"></a>00339                                 <span class="keywordflow">return</span> implode(chr(10),$lines);
<a name="l00340"></a>00340                         }
<a name="l00341"></a>00341                 }
<a name="l00342"></a>00342         }
<a name="l00343"></a>00343 
<a name="l00353"></a><a class="code" href="classuser__plaintext.html#029bb6a15b0a5892e73fef260b9a3d52">00353</a>         function <a class="code" href="classuser__plaintext.html#029bb6a15b0a5892e73fef260b9a3d52">pad</a>($lines,$preLineChar,$len)  {
<a name="l00354"></a>00354                 $strPad = <a class="code" href="classt3lib__div.html#79f6a47a7658e28e3f65666f8ebc19f8">t3lib_div::intInRange</a>($len,0,1000);
<a name="l00355"></a>00355                 $strPadChar = $preLineChar?$preLineChar:<span class="charliteral">'-'</span>;
<a name="l00356"></a>00356                 <span class="keywordflow">if</span> ($strPad)    {
<a name="l00357"></a>00357                         $lines[]=str_pad('', $strPad, $strPadChar);
<a name="l00358"></a>00358                 }
<a name="l00359"></a>00359                 <span class="keywordflow">return</span> $lines;
<a name="l00360"></a>00360         }
<a name="l00361"></a>00361 
<a name="l00369"></a><a class="code" href="classuser__plaintext.html#7458c60fc51f494229ea4cc37f2c3060">00369</a>         function <a class="code" href="classuser__plaintext.html#7458c60fc51f494229ea4cc37f2c3060">breakContent</a>($str)     {
<a name="l00370"></a>00370                 $cParts = explode(chr(10),$str);
<a name="l00371"></a>00371                 reset($cParts);
<a name="l00372"></a>00372                 $lines=array();
<a name="l00373"></a>00373                 <span class="keywordflow">while</span>(list(,$substrs)=each($cParts))    {
<a name="l00374"></a>00374                         $lines[]=$this-&gt;<a class="code" href="classuser__plaintext.html#c6e3b8b43a07538f6ea804fe95a4e245">breakLines</a>($substrs);
<a name="l00375"></a>00375                 }
<a name="l00376"></a>00376                 <span class="keywordflow">return</span> implode(chr(10),$lines);
<a name="l00377"></a>00377         }
<a name="l00378"></a>00378 
<a name="l00385"></a><a class="code" href="classuser__plaintext.html#04fb079f0478d0ea6fc1f12e036d6a89">00385</a>         function <a class="code" href="classuser__plaintext.html#04fb079f0478d0ea6fc1f12e036d6a89">breakBulletlist</a>($str)  {
<a name="l00386"></a>00386                 $type = $this-&gt;cObj-&gt;data['layout'];
<a name="l00387"></a>00387                 $type=<a class="code" href="classt3lib__div.html#79f6a47a7658e28e3f65666f8ebc19f8">t3lib_div::intInRange</a>($type,0,3);
<a name="l00388"></a>00388 
<a name="l00389"></a>00389                 $tConf = $this-&gt;conf['bulletlist.'][$type.<span class="charliteral">'.'</span>];
<a name="l00390"></a>00390 
<a name="l00391"></a>00391                 $cParts = explode(chr(10),$str);
<a name="l00392"></a>00392                 reset($cParts);
<a name="l00393"></a>00393                 $lines=array();
<a name="l00394"></a>00394                 $c=0;
<a name="l00395"></a>00395                 <span class="keywordflow">while</span>(list(,$substrs)=each($cParts))    {
<a name="l00396"></a>00396                         $c++;
<a name="l00397"></a>00397                         $bullet = $tConf['bullet'] ? $this-&gt;<a class="code" href="classuser__plaintext.html#77b1cad3e79f4e1f8e3b3b2e06be4bbd">getString</a>($tConf['bullet']) : ' - ';
<a name="l00398"></a>00398                         $bLen=strlen($bullet);
<a name="l00399"></a>00399                         $bullet = substr(str_replace(<span class="charliteral">'#'</span>,$c,$bullet),0,$bLen);
<a name="l00400"></a>00400                         $secondRow = substr($tConf['secondRow']?$this-&gt;<a class="code" href="classuser__plaintext.html#77b1cad3e79f4e1f8e3b3b2e06be4bbd">getString</a>($tConf['secondRow']):str_pad('',strlen($bullet),<span class="charliteral">' '</span>),0,$bLen);
<a name="l00401"></a>00401 
<a name="l00402"></a>00402                         $lines[]=$bullet.$this-&gt;breakLines($substrs,chr(10).$secondRow,$this-&gt;charWidth-$bLen);
<a name="l00403"></a>00403 
<a name="l00404"></a>00404                         $blanks = <a class="code" href="classt3lib__div.html#79f6a47a7658e28e3f65666f8ebc19f8">t3lib_div::intInRange</a>($tConf['blanks'],0,1000);
<a name="l00405"></a>00405                         <span class="keywordflow">if</span> ($blanks)    {$lines[]=str_pad('', $blanks-1, chr(10));}
<a name="l00406"></a>00406                 }
<a name="l00407"></a>00407                 <span class="keywordflow">return</span> implode(chr(10),$lines);
<a name="l00408"></a>00408         }
<a name="l00409"></a>00409 
<a name="l00416"></a><a class="code" href="classuser__plaintext.html#5886d6e9f245c6799c01d8783965e90c">00416</a>         function <a class="code" href="classuser__plaintext.html#5886d6e9f245c6799c01d8783965e90c">breakTable</a>($str)       {
<a name="l00417"></a>00417                 $cParts = explode(chr(10),$str);
<a name="l00418"></a>00418                 reset($cParts);
<a name="l00419"></a>00419                 $lines=array();
<a name="l00420"></a>00420                 $cols = intval($this-&gt;conf['cols']) ? intval($this-&gt;conf['cols']) : 0 ;
<a name="l00421"></a>00421                 $c=0;
<a name="l00422"></a>00422                 <span class="keywordflow">while</span>(list(,$substrs)=each($cParts))    {
<a name="l00423"></a>00423                         $c++;
<a name="l00424"></a>00424                         <span class="keywordflow">if</span> (trim($substrs))     {
<a name="l00425"></a>00425                                 $lineParts=explode(<span class="charliteral">'|'</span>,$substrs);
<a name="l00426"></a>00426                                 <span class="keywordflow">if</span> (!$cols)     $cols=count($lineParts);
<a name="l00427"></a>00427 
<a name="l00428"></a>00428                                 <span class="keywordflow">for</span> ($a=0;$a&lt;$cols;$a++)        {
<a name="l00429"></a>00429                                         $jdu = explode(chr(10),$this-&gt;<a class="code" href="classuser__plaintext.html#c6e3b8b43a07538f6ea804fe95a4e245">breakLines</a>($lineParts[$a],chr(10),ceil($this-&gt;charWidth/$cols)));
<a name="l00430"></a>00430                                         $lines[$c][$a]=$jdu;
<a name="l00431"></a>00431                                 }
<a name="l00432"></a>00432                         }
<a name="l00433"></a>00433                 }
<a name="l00434"></a>00434                 $messure = $this-&gt;<a class="code" href="classuser__plaintext.html#221c114660e32f496d8a7a883d57c9df">traverseTable</a>($lines);
<a name="l00435"></a>00435 
<a name="l00436"></a>00436 
<a name="l00437"></a>00437                 $divChar=<span class="charliteral">'-'</span>;
<a name="l00438"></a>00438                 $joinChar=<span class="charliteral">'+'</span>;
<a name="l00439"></a>00439                 $colChar=<span class="charliteral">'|'</span>;
<a name="l00440"></a>00440 
<a name="l00441"></a>00441                 <span class="comment">// Make table:</span>
<a name="l00442"></a>00442                 $outLines = array();
<a name="l00443"></a>00443                 $outLines[]=$this-&gt;<a class="code" href="classuser__plaintext.html#66931b42fd6965eb49aac0d3232a2dba">addDiv</a>($messure,'',$divChar,$joinChar,$cols);
<a name="l00444"></a>00444 
<a name="l00445"></a>00445                 reset($lines);
<a name="l00446"></a>00446                 <span class="keywordflow">while</span>(list($k,$v)=each($lines)) {
<a name="l00447"></a>00447                         $top = intval($messure[1][$k]);
<a name="l00448"></a>00448                         <span class="keywordflow">for</span> ($aa=0;$aa&lt;$top;$aa++)      {
<a name="l00449"></a>00449                                 $tempArr=array();
<a name="l00450"></a>00450                                 <span class="keywordflow">for</span> ($bb=0;$bb&lt;$cols;$bb++)     {
<a name="l00451"></a>00451                                         $tempArr[$bb]=str_pad($v[$bb][$aa],$messure[0][$bb],<span class="charliteral">' '</span>);
<a name="l00452"></a>00452                                 }
<a name="l00453"></a>00453                                 $outLines[]=$colChar.implode($colChar,$tempArr).$colChar;
<a name="l00454"></a>00454                         }
<a name="l00455"></a>00455                         $outLines[]=$this-&gt;addDiv($messure,'',$divChar,$joinChar,$cols);
<a name="l00456"></a>00456                 }
<a name="l00457"></a>00457                 <span class="keywordflow">return</span> implode(chr(10),$outLines);
<a name="l00458"></a>00458         }
<a name="l00459"></a>00459 
<a name="l00472"></a><a class="code" href="classuser__plaintext.html#66931b42fd6965eb49aac0d3232a2dba">00472</a>         function addDiv($messure,$content,$divChar,$joinChar,$cols)     {
<a name="l00473"></a>00473                 $tempArr=array();
<a name="l00474"></a>00474                 <span class="keywordflow">for</span> ($a=0;$a&lt;$cols;$a++)        {
<a name="l00475"></a>00475                         $tempArr[$a]=str_pad($content,$messure[0][$a],$divChar);
<a name="l00476"></a>00476                 }
<a name="l00477"></a>00477                 <span class="keywordflow">return</span> $joinChar.implode($joinChar,$tempArr).$joinChar;
<a name="l00478"></a>00478         }
<a name="l00479"></a>00479 
<a name="l00488"></a><a class="code" href="classuser__plaintext.html#221c114660e32f496d8a7a883d57c9df">00488</a>         function traverseTable($tableLines)     {
<a name="l00489"></a>00489                 $maxLen=array();
<a name="l00490"></a>00490                 $maxLines=array();
<a name="l00491"></a>00491                 reset($tableLines);
<a name="l00492"></a>00492                 <span class="keywordflow">while</span>(list($k,$v)=each($tableLines))    {
<a name="l00493"></a>00493                         reset($v);
<a name="l00494"></a>00494                         <span class="keywordflow">while</span>(list($kk,$vv)=each($v))   {
<a name="l00495"></a>00495                                 reset($vv);
<a name="l00496"></a>00496                                 <span class="keywordflow">while</span>(list($lk,$lv)=each($vv))  {
<a name="l00497"></a>00497                                         <span class="keywordflow">if</span> (strlen($lv)&gt;intval($maxLen[$kk]))   $maxLen[$kk]=strlen($lv);
<a name="l00498"></a>00498                                 }
<a name="l00499"></a>00499                                 <span class="keywordflow">if</span> (count($vv)&gt;intval($maxLines[$k]))   $maxLines[$k]=count($vv);
<a name="l00500"></a>00500                         }
<a name="l00501"></a>00501                 }
<a name="l00502"></a>00502                 <span class="keywordflow">return</span> array($maxLen,$maxLines);
<a name="l00503"></a>00503         }
<a name="l00504"></a>00504 
<a name="l00515"></a><a class="code" href="classuser__plaintext.html#eaad12f93353fe13b47c7838ff93ae4d">00515</a>         function renderImages($str,$links,$caption,$upload_path='uploads/pics/')        {
<a name="l00516"></a>00516                 $images = explode(<span class="charliteral">','</span>,$str);
<a name="l00517"></a>00517                 $linksArr = explode(<span class="charliteral">','</span>,$links);
<a name="l00518"></a>00518                 reset($images);
<a name="l00519"></a>00519                 $lines=array();
<a name="l00520"></a>00520                 <span class="keywordflow">if</span> ($this-&gt;conf['images.']['header'])   {$lines[]=$this-&gt;getString($this-&gt;conf['images.']['header']);}
<a name="l00521"></a>00521                 <span class="keywordflow">while</span>(list($k,$file)=each($images))     {
<a name="l00522"></a>00522                         $lines[]=$this-&gt;siteUrl.$upload_path.$file;
<a name="l00523"></a>00523                         <span class="keywordflow">if</span> ($links &amp;&amp; count($linksArr)&gt;1)       {
<a name="l00524"></a>00524                                 <span class="keywordflow">if</span> (isset($linksArr[$k]))       {
<a name="l00525"></a>00525                                         $ll=$linksArr[$k];
<a name="l00526"></a>00526                                 } <span class="keywordflow">else</span> {
<a name="l00527"></a>00527                                         $ll=$linksArr[0];
<a name="l00528"></a>00528                                 }
<a name="l00529"></a>00529 
<a name="l00530"></a>00530                                 $theLink = $this-&gt;getLink($ll);
<a name="l00531"></a>00531                                 <span class="keywordflow">if</span> ($theLink)   {$lines[]=$this-&gt;getString($this-&gt;conf['images.']['linkPrefix']).$theLink;}
<a name="l00532"></a>00532                         }
<a name="l00533"></a>00533                 }
<a name="l00534"></a>00534                 <span class="keywordflow">if</span> ($links &amp;&amp; count($linksArr)==1)      {
<a name="l00535"></a>00535                         $theLink = $this-&gt;getLink($links);
<a name="l00536"></a>00536                         <span class="keywordflow">if</span> ($theLink)   {$lines[]=$this-&gt;getString($this-&gt;conf['images.']['linkPrefix']).$theLink;}
<a name="l00537"></a>00537                 }
<a name="l00538"></a>00538                 <span class="keywordflow">if</span> ($caption)   {
<a name="l00539"></a>00539                         $lines[]='';
<a name="l00540"></a>00540                         $cHeader = trim($this-&gt;getString($this-&gt;conf['images.']['captionHeader']));
<a name="l00541"></a>00541                         <span class="keywordflow">if</span> ($cHeader)           $lines[]=$cHeader;
<a name="l00542"></a>00542                         $lines[]=$this-&gt;breakContent($caption);
<a name="l00543"></a>00543                 }
<a name="l00544"></a>00544 
<a name="l00545"></a>00545                 <span class="keywordflow">return</span> implode(chr(10),$lines);
<a name="l00546"></a>00546         }
<a name="l00547"></a>00547 
<a name="l00554"></a><a class="code" href="classuser__plaintext.html#d009cd77690a2b6c4117d95365ef5eef">00554</a>         function getLink($ll)   {
<a name="l00555"></a>00555                 $theLink=$this-&gt;cObj-&gt;getTypoLink_URL($ll);
<a name="l00556"></a>00556                 <span class="keywordflow">if</span> (substr($theLink,0,4)!='http')       {
<a name="l00557"></a>00557                         $theLink=$this-&gt;siteUrl.$theLink;
<a name="l00558"></a>00558                 }
<a name="l00559"></a>00559                 <span class="keywordflow">return</span> $theLink;
<a name="l00560"></a>00560         }
<a name="l00561"></a>00561 
<a name="l00571"></a><a class="code" href="classuser__plaintext.html#c6e3b8b43a07538f6ea804fe95a4e245">00571</a>         function breakLines($str,$implChar=<span class="stringliteral">"\n"</span>,$charWidth=0)   {
<a name="l00572"></a>00572                 <span class="keywordflow">return</span> <a class="code" href="classt3lib__div.html#be8260952041beed3008299e84ca9b25">t3lib_div::breakLinesForEmail</a>($str,$implChar,$charWidth?$charWidth:$this-&gt;charWidth);
<a name="l00573"></a>00573         }
<a name="l00574"></a>00574 
<a name="l00583"></a><a class="code" href="classuser__plaintext.html#77b1cad3e79f4e1f8e3b3b2e06be4bbd">00583</a>         function getString($str)        {
<a name="l00584"></a>00584                 $parts = explode(<span class="charliteral">'|'</span>,$str);
<a name="l00585"></a>00585                 <span class="keywordflow">return</span> strcmp($parts[1],'')?$parts[1]:$parts[0];
<a name="l00586"></a>00586         }
<a name="l00587"></a>00587 
<a name="l00595"></a><a class="code" href="classuser__plaintext.html#4ac5bfe091c2aa35b044a010016b49c5">00595</a>         function userProcess($mConfKey,$passVar)        {
<a name="l00596"></a>00596                 <span class="keywordflow">if</span> ($this-&gt;conf[$mConfKey])     {
<a name="l00597"></a>00597                         $funcConf = $this-&gt;conf[$mConfKey.<span class="charliteral">'.'</span>];
<a name="l00598"></a>00598                         $funcConf['parentObj']=&amp;$this;
<a name="l00599"></a>00599                         $passVar = $GLOBALS['TSFE']-&gt;cObj-&gt;callUserFunction($this-&gt;conf[$mConfKey], $funcConf, $passVar);
<a name="l00600"></a>00600                 }
<a name="l00601"></a>00601                 <span class="keywordflow">return</span> $passVar;
<a name="l00602"></a>00602         }
<a name="l00603"></a>00603 
<a name="l00613"></a><a class="code" href="classuser__plaintext.html#b3dc917435800d1893db4624219692eb">00613</a>         function atag_to_http($content,$conf)   {
<a name="l00614"></a>00614                 $this-&gt;conf = $conf;
<a name="l00615"></a>00615                 $this-&gt;siteUrl=$conf['siteUrl'];
<a name="l00616"></a>00616                 $theLink  = trim($this-&gt;cObj-&gt;parameters['href']);
<a name="l00617"></a>00617                 <span class="keywordflow">if</span> (strtolower(substr($theLink,0,7))=='mailto:')        {
<a name="l00618"></a>00618                         $theLink=substr($theLink,7);
<a name="l00619"></a>00619                 } elseif (substr($theLink,0,4)!='http') {
<a name="l00620"></a>00620                         $theLink=$this-&gt;siteUrl.$theLink;
<a name="l00621"></a>00621                 }
<a name="l00622"></a>00622                 <span class="keywordflow">return</span> $this-&gt;cObj-&gt;getCurrentVal().' (Link: '.$theLink.' )';
<a name="l00623"></a>00623         }
<a name="l00624"></a>00624 
<a name="l00632"></a><a class="code" href="classuser__plaintext.html#a1f3fe5b577497995d0dcc30a462e332">00632</a>         function typolist($content,$conf)       {
<a name="l00633"></a>00633                 $this-&gt;conf = $this-&gt;cObj-&gt;mergeTSRef($conf,'bulletlist');
<a name="l00634"></a>00634                 $this-&gt;siteUrl=$conf['siteUrl'];
<a name="l00635"></a>00635                 $str = trim($this-&gt;cObj-&gt;getCurrentVal());
<a name="l00636"></a>00636                 $this-&gt;cObj-&gt;data['layout'] = $this-&gt;cObj-&gt;parameters['type'];
<a name="l00637"></a>00637                 <span class="keywordflow">return</span> $this-&gt;breakBulletlist($str);
<a name="l00638"></a>00638         }
<a name="l00639"></a>00639 
<a name="l00647"></a><a class="code" href="classuser__plaintext.html#8244fcc1aa8691c0c09a0ec01b84ecfe">00647</a>         function typohead($content,$conf)       {
<a name="l00648"></a>00648                 $this-&gt;conf = $this-&gt;cObj-&gt;mergeTSRef($conf,'header');
<a name="l00649"></a>00649 
<a name="l00650"></a>00650                 $this-&gt;siteUrl=$conf['siteUrl'];
<a name="l00651"></a>00651                 $str = trim($this-&gt;cObj-&gt;getCurrentVal());
<a name="l00652"></a>00652                 $this-&gt;cObj-&gt;data['header_layout'] = $this-&gt;cObj-&gt;parameters['type'];
<a name="l00653"></a>00653                 $this-&gt;cObj-&gt;data['header_position'] = $this-&gt;cObj-&gt;parameters['align'];
<a name="l00654"></a>00654                 $this-&gt;cObj-&gt;data['header']=$str;
<a name="l00655"></a>00655 
<a name="l00656"></a>00656                 <span class="keywordflow">return</span> $this-&gt;getHeader();
<a name="l00657"></a>00657         }
<a name="l00658"></a>00658 
<a name="l00666"></a><a class="code" href="classuser__plaintext.html#7c1c4a0644aa9aa384d41354f5636c32">00666</a>         function typocode($content,$conf)       {
<a name="l00667"></a>00667                         <span class="comment">// Nothing is really done here...</span>
<a name="l00668"></a>00668                 $this-&gt;conf = $conf;
<a name="l00669"></a>00669                 $this-&gt;siteUrl=$conf['siteUrl'];
<a name="l00670"></a>00670                 <span class="keywordflow">return</span> $this-&gt;cObj-&gt;getCurrentVal();
<a name="l00671"></a>00671         }
<a name="l00672"></a>00672 }
<a name="l00673"></a>00673 
<a name="l00674"></a>00674 
<a name="l00675"></a>00675 
<a name="l00676"></a>00676 
<a name="l00677"></a>00677 <span class="keywordflow">if</span> (defined('TYPO3_MODE') &amp;&amp; $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['media/scripts/plaintextLib.inc'])  {
<a name="l00678"></a>00678         include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['media/scripts/plaintextLib.inc']);
<a name="l00679"></a>00679 }
<a name="l00680"></a>00680 ?&gt;
</pre></div><?php
  include_once '../doc-typo3-funcs.php';
  get_footer();
?>