*/ /** * [CLASS/FUNCTION INDEX of SCRIPT] * * * * 96: class user_xmlversion * 107: function main_xmlversion($content,$conf) * 137: function getContentResult($table) * * TOTAL FUNCTIONS: 2 * (This index is automatically created/updated by the extension "extdeveval") * */ require_once (PATH_t3lib.'class.t3lib_xml.php'); /** * Class that creates the current page and content element records as an XML structure using the library "t3lib_xml" * It is demonstrated in use in the testsite package on page "59" * The static template "plugin.alt.xml" is used to trigger this XML creation as well. That template contains this set of TypoScript lines which triggers the XML creation and disables all regular HTML headers * * ## Set up page/type number: * alt_xml > * alt_xml = PAGE * alt_xml { * typeNum=96 * config.disableAllHeaderCode = 1 * config.additionalHeaders = Content-type: text/xml * * ## Includes the newsLib: * includeLibs.alt_xml = media/scripts/xmlversionLib.inc * * ## Inserting the USER cObject for XML rendering * 10 = USER * 10 { * userFunc = user_xmlversion->main_xmlversion * } * } * * @package TYPO3 * @subpackage tslib * @author Kasper Skaarhoj */ class user_xmlversion { var $cObj; // The backReference to the mother cObj object set at call time /** * Main function, called from TypoScript * * @param string Empty, ignore. * @param array TypoScript properties for this content object/function call * @return string XML content */ function main_xmlversion($content,$conf) { $className=t3lib_div::makeInstanceClassName('t3lib_xml'); $xmlObj = new $className('typo3_page'); $xmlObj->XMLdebug=0; $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'); $xmlObj->setRecFields('tt_content','CType,header,header_link,bodytext,image,imagewidth,imageorient,media,records,colPos,starttime,endtime,fe_group'); // Creating top level object $xmlObj->renderHeader(); // Add page information $xmlObj->addRecord('pages',$GLOBALS['TSFE']->page); // Add page content information $xmlObj->newLevel('content_records',1); $xmlObj->renderRecords('pages',$this->getContentResult('pages')); $xmlObj->renderRecords('tt_content',$this->getContentResult('tt_content')); $xmlObj->newLevel('content_records'); $xmlObj->renderFooter(); return $xmlObj->getResult(); } /** * Selects all records from $table having the current page id as PID (records belonging to that page) * * @param string A tablename found in $TCA * @return pointer A database resource pointer */ function getContentResult($table) { global $TCA; if ($TCA[$table]) { $orderBy = $TCA[$table]['ctrl']['sortby'] ? 'ORDER BY '.$TCA[$table]['ctrl']['sortby'] : $TCA[$table]['ctrl']['default_sortby']; $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', $table, 'pid='.intval($GLOBALS['TSFE']->id).$this->cObj->enableFields($table), '', $GLOBALS['TYPO3_DB']->stripOrderBy($orderBy)); return $res; } } } if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['media/scripts/xmlversionLib.inc']) { include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['media/scripts/xmlversionLib.inc']); } ?>