TYPO3 API  SVNRelease
testscript_EXT.php
Go to the documentation of this file.
00001 <?php
00002 # TYPO3 SVN ID: $Id: testscript_EXT.php 3437 2008-03-16 16:22:11Z flyguide $
00003 
00004 if (!is_object($TSFE)) die ('Error: No parent object present.');
00005 
00006 
00007 
00008 
00009 /**
00010  * Printing current time dynamically
00011  *
00012  * @param   string      Content (ignore)
00013  * @param   array       TypoScript configuration passed
00014  * @return  string      Current time wrapped in <font> tags with red color
00015  */
00016 function user_printTimeExt($content,$conf)  {
00017     return '<font color="red">Dynamic time: '.date('H:i:s').'</font><br />';
00018 }
00019 
00020 ?>
00021 
00022 This is output from an external script!
00023 <br />
00024 <br />
00025 
00026 You can get the content of the record, that included this script in $REC:<br />
00027 <br />
00028 
00029 
00030 <?php debug($REC); ?>
00031 
00032 <br />
00033 <br />
00034 The configuration for the script is in the array, $CONF:<br />
00035 <br />
00036 
00037 
00038 
00039 
00040 <?php
00041 debug($CONF);
00042 
00043 ?>
00044 
00045 <br />
00046 <br />
00047 These are global variables!
00048 
00049 <br />
00050 <br />
00051 Good luck....
00052 
00053 
00054 BTW: The time:
00055 <?php if ($CONF['showTime'])    {echo user_printTimeExt('','');} ?>
00056 <br />
00057 <br />
00058 
00059 <?php
00060 
00061 $content = '(This is returned in the variable, $content, which is another option...';
00062 
00063 ?>
00064 <hr />