<?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/example_callfunction.php 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 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 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> <u>S</u>earch for </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> » <a class="el" href="dir_18071ae4545d8b3e0364d30c0659c74a.html">typo3</a> » <a class="el" href="dir_57bf1ed8249c1fd5b014486d01bcb27a.html">sysext</a> » <a class="el" href="dir_21aa24ee31dafa72450e939d0692a893.html">cms</a> » <a class="el" href="dir_da3d3c31fb60c430897a32b4a10f682b.html">tslib</a> » <a class="el" href="dir_5d5928c48a24a7022098bcc9e1331896.html">media</a> » <a class="el" href="dir_cdcc1b4ce87312c897e9f35885142bfd.html">scripts</a></div> <h1>example_callfunction.php</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <?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="l00065"></a>00065 function user_reverseString($content,$conf) { <a name="l00066"></a>00066 $content = strrev($content); <a name="l00067"></a>00067 <span class="keywordflow">if</span> ($conf['uppercase']) { <a name="l00068"></a>00068 $content=strtoupper($content); <a name="l00069"></a>00069 } <a name="l00070"></a>00070 <span class="keywordflow">return</span> $content; <a name="l00071"></a>00071 } <a name="l00072"></a>00072 <a name="l00090"></a>00090 function user_printTime($content,$conf) { <a name="l00091"></a>00091 <span class="keywordflow">return</span> '<font color=<span class="stringliteral">"red"</span>>Dynamic time: '.date('H:i:s').'</font><br />'; <a name="l00092"></a>00092 } <a name="l00093"></a>00093 <a name="l00094"></a>00094 <a name="l00095"></a>00095 <a name="l00100"></a><a class="code" href="classuser__various.html">00100</a> <span class="keyword">class </span><a class="code" href="classuser__various.html">user_various</a> { <a name="l00101"></a><a class="code" href="classuser__various.html#d4534131dcf8c89c9efe43911ec3da27">00101</a> var <a class="code" href="classuser__various.html#d4534131dcf8c89c9efe43911ec3da27">$cObj</a>; <span class="comment">// Reference to the parent (calling) cObj set from TypoScript</span> <a name="l00102"></a>00102 <a name="l00111"></a><a class="code" href="classuser__various.html#5bb551d1abf3446f60a869bbf0ddc8ce">00111</a> function <a class="code" href="classuser__various.html#5bb551d1abf3446f60a869bbf0ddc8ce">reverseString</a>($content,$conf) { <a name="l00112"></a>00112 $content = strrev($content); <a name="l00113"></a>00113 <span class="keywordflow">if</span> ($conf['uppercase']) { <a name="l00114"></a>00114 $content=$this->cObj->caseshift($content,'upper'); <a name="l00115"></a>00115 } <a name="l00116"></a>00116 <span class="keywordflow">if</span> ($conf['typolink']) { <a name="l00117"></a>00117 $content=$this->cObj->getTypoLink($content,$conf['typolink']); <a name="l00118"></a>00118 } <a name="l00119"></a>00119 <span class="keywordflow">return</span> $content; <a name="l00120"></a>00120 } <a name="l00121"></a>00121 <a name="l00140"></a><a class="code" href="classuser__various.html#b78755980c0c6e7902d00c5d3f7f7851">00140</a> function <a class="code" href="classuser__various.html#b78755980c0c6e7902d00c5d3f7f7851">listContentRecordsOnPage</a>($content,$conf) { <a name="l00141"></a>00141 $query = $GLOBALS['TYPO3_DB']->SELECTquery( <a name="l00142"></a>00142 'header', <a name="l00143"></a>00143 'tt_content', <a name="l00144"></a>00144 'pid='.intval($GLOBALS['TSFE']-><span class="keywordtype">id</span>).$this->cObj->enableFields('tt_content'), <a name="l00145"></a>00145 '', <a name="l00146"></a>00146 'sorting'.($conf['reverseOrder'] ? ' DESC' : '') <a name="l00147"></a>00147 ); <a name="l00148"></a>00148 $output = 'This is the query: <strong>'.$query.'</strong><br /><br />'; <a name="l00149"></a>00149 <span class="keywordflow">return</span> $output.$this->selectThem($query); <a name="l00150"></a>00150 } <a name="l00151"></a>00151 <a name="l00159"></a><a class="code" href="classuser__various.html#1d743c49d078ca66e5d9bfcd8c345d5a">00159</a> function <a class="code" href="classuser__various.html#1d743c49d078ca66e5d9bfcd8c345d5a">selectThem</a>($query) { <a name="l00160"></a>00160 $res = $GLOBALS['TYPO3_DB']->sql(TYPO3_db,$query); <a name="l00161"></a>00161 $output=array(); <a name="l00162"></a>00162 <span class="keywordflow">while</span>($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) { <a name="l00163"></a>00163 $output[]=$row['header']; <a name="l00164"></a>00164 } <a name="l00165"></a>00165 <span class="keywordflow">return</span> implode($output,'<br />'); <a name="l00166"></a>00166 } <a name="l00167"></a>00167 } <a name="l00168"></a>00168 <a name="l00169"></a>00169 ?> </pre></div><?php include_once '../doc-typo3-funcs.php'; get_footer(); ?>