Documentation TYPO3 par Ameos

example_callfunction.php

00001 <?php
00002 /***************************************************************
00003 *  Copyright notice
00004 *
00005 *  (c) 1999-2004 Kasper Skaarhoj (kasperYYYY@typo3.com)
00006 *  All rights reserved
00007 *
00008 *  This script is part of the TYPO3 project. The TYPO3 project is
00009 *  free software; you can redistribute it and/or modify
00010 *  it under the terms of the GNU General Public License as published by
00011 *  the Free Software Foundation; either version 2 of the License, or
00012 *  (at your option) any later version.
00013 *
00014 *  The GNU General Public License can be found at
00015 *  http://www.gnu.org/copyleft/gpl.html.
00016 *  A copy is found in the textfile GPL.txt and important notices to the license
00017 *  from the author is found in LICENSE.txt distributed with these scripts.
00018 *
00019 *
00020 *  This script is distributed in the hope that it will be useful,
00021 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00022 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00023 *  GNU General Public License for more details.
00024 *
00025 *  This copyright notice MUST APPEAR in all copies of the script!
00026 ***************************************************************/
00066 function user_reverseString($content,$conf)     {
00067         $content = strrev($content);
00068         if ($conf['uppercase']) {
00069                 $content=strtoupper($content);
00070         }
00071         return $content;
00072 }
00073 
00092 function user_printTime($content,$conf) {
00093         return '<font color="red">Dynamic time: '.date('H:i:s').'</font><br />';
00094 }
00095 
00096 
00097 
00102 class user_various      {
00103         var $cObj;              // Reference to the parent (calling) cObj set from TypoScript
00104 
00113         function reverseString($content,$conf)  {
00114                 $content = strrev($content);
00115                 if ($conf['uppercase']) {
00116                         $content=$this->cObj->caseshift($content,'upper');
00117                 }
00118                 if ($conf['typolink'])  {
00119                         $content=$this->cObj->getTypoLink($content,$conf['typolink']);
00120                 }
00121                 return $content;
00122         }
00123 
00143         function listContentRecordsOnPage($content,$conf)       {
00144                 $query = $GLOBALS['TYPO3_DB']->SELECTquery(
00145                                                 'header',
00146                                                 'tt_content',
00147                                                 'pid='.intval($GLOBALS['TSFE']->id).$this->cObj->enableFields('tt_content'),
00148                                                 '',
00149                                                 'sorting'.($conf['reverseOrder'] ? ' DESC' : '')
00150                                         );
00151                 $output = 'This is the query: <strong>'.$query.'</strong><br /><br />';
00152                 return $output.$this->selectThem($query);
00153         }
00154 
00162         function selectThem($query)     {
00163                 $res = $GLOBALS['TYPO3_DB']->sql(TYPO3_db,$query);
00164                 $output=array();
00165                 while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))       {
00166                         $output[]=$row['header'];
00167                 }
00168                 return implode($output,'<br />');
00169         }
00170 }
00171 
00172 ?>


Généré par TYPO3 Ameos avec  doxygen 1.4.6