Documentation TYPO3 par Ameos

xmlversionLib.inc

00001 <?php
00002 /***************************************************************
00003 *  Copyright notice
00004 *
00005 *  (c) 1999-2005 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 ***************************************************************/
00049 require_once (PATH_t3lib.'class.t3lib_xml.php');
00050 
00051 
00052 
00053 
00054 
00055 
00056 
00057 
00058 
00059 
00060 
00061 
00062 
00063 
00064 
00065 
00066 
00067 
00068 
00096 class user_xmlversion {
00097         var $cObj;              // The backReference to the mother cObj object set at call time
00098 
00099 
00107         function main_xmlversion($content,$conf)        {
00108                 $className=t3lib_div::makeInstanceClassName('t3lib_xml');
00109                 $xmlObj = new $className('typo3_page');
00110                 $xmlObj->XMLdebug=0;
00111                 $xmlObj->setRecFields('pages','doktype,title,alias,hidden,starttime,endtime,fe_group,url,target,no_cache,shortcut,keywords,description,abstract,author,author_email,newUntil,lastUpdated,cache_timeout');
00112                 $xmlObj->setRecFields('tt_content','CType,header,header_link,bodytext,image,imagewidth,imageorient,media,records,colPos,starttime,endtime,fe_group');
00113 
00114                         // Creating top level object
00115                 $xmlObj->renderHeader();
00116 
00117                         // Add page information
00118                 $xmlObj->addRecord('pages',$GLOBALS['TSFE']->page);
00119 
00120                         // Add page content information
00121                 $xmlObj->newLevel('content_records',1);
00122                 $xmlObj->renderRecords('pages',$this->getContentResult('pages'));
00123                 $xmlObj->renderRecords('tt_content',$this->getContentResult('tt_content'));
00124                 $xmlObj->newLevel('content_records');
00125 
00126                 $xmlObj->renderFooter();
00127 
00128                 return $xmlObj->getResult();
00129         }
00130 
00137         function getContentResult($table) {
00138                 global $TCA;
00139                 if ($TCA[$table])       {
00140                         $orderBy = $TCA[$table]['ctrl']['sortby'] ? 'ORDER BY '.$TCA[$table]['ctrl']['sortby'] : $TCA[$table]['ctrl']['default_sortby'];
00141                         $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', $table, 'pid='.intval($GLOBALS['TSFE']->id).$this->cObj->enableFields($table), '', $GLOBALS['TYPO3_DB']->stripOrderBy($orderBy));
00142                         return $res;
00143                 }
00144         }
00145 }
00146 
00147 
00148 
00149 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['media/scripts/xmlversionLib.inc']) {
00150         include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['media/scripts/xmlversionLib.inc']);
00151 }
00152 ?>


Généré par L'expert TYPO3 avec  doxygen 1.4.6