Project

General

Profile

Feature #24905 » 17420.diff

Administrator Admin, 2011-01-31 14:08

View differences:

typo3/sysext/cms/tslib/class.tslib_content.php (working copy)
'IMGTEXT' => 'ImageText',
'CONTENT' => 'Content',
'RECORDS' => 'Records',
'LOOP' => 'Loop',
'HMENU' => 'HierarchicalMenu',
'CTABLE' => 'ContentTable',
'OTABLE' => 'OffsetTable',
......
}
/**
* Rendering the cObject, LOOP
*
* @param array array of TypoScript properties
* @return string Output
*/
function LOOP($conf) {
return $this->getContentObject('LOOP')->render($conf);
}
/**
* Rendering the cObject, HMENU
*
* @param array array of TypoScript properties
typo3/sysext/cms/tslib/content/class.tslib_content_fluidtemplate.php (working copy)
}
}
$view->assign('data', $this->cObj->data);
$view->assign('current', $this->cObj->data[$this->cObj->currentValKey]);
if (is_array($this->cObj->data)) {
$view->assign('current', $this->cObj->data[$this->cObj->currentValKey]);
}
/**
* 3. render the content
typo3/sysext/cms/tslib/content/class.tslib_content_loop.php (revision 0)
<?php
/***************************************************************
* Copyright notice
*
* (c) 2011 Xavier Perseguers <typo3@perseguers.ch>
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
* A copy is found in the textfile GPL.txt and important notices to the license
* from the author is found in LICENSE.txt distributed with these scripts.
*
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
/**
* Contains LOOP class object.
*
* $Id$
* @author Xavier Perseguers <typo3@perseguers.ch>
*/
class tslib_content_Loop extends tslib_content_Abstract {
/**
* Rendering the cObject, LOOP
*
* @param array Array of TypoScript properties
* @return string Output
*/
public function render($conf = array()) {
$theValue = '';
$originalRec = $GLOBALS['TSFE']->currentRecord;
if ($originalRec) { // If the currentRecord is set, we register, that this record has invoked this function. It's should not be allowed to do this again then!!
$GLOBALS['TSFE']->recordRegister[$originalRec]++;
}
$data = isset($conf['data.'])
? $this->cObj->stdWrap($conf['data'], $conf['data.'])
: $this->cObj->data;
$hasRenderObj = isset($conf['renderObj']) && isset($conf['renderObj.']);
if (is_array($data) && $hasRenderObj) {
$cObj = t3lib_div::makeInstance('tslib_cObj');
$cObj->setParent($data, $this->cObj->currentRecord);
$this->cObj->currentRecordNumber = 0;
$this->cObj->currentRecordTotal = count($data);
foreach ($data as $id => $row) {
if (!is_array($row)) {
$row = array($row);
}
$this->cObj->currentRecordNumber++;
$cObj->parentRecordNumber = $this->cObj->currentRecordNumber;
$GLOBALS['TSFE']->currentRecord = 'loop:' . $id;
$cObj->start($row);
$tmpValue = $cObj->cObjGetSingle($conf['renderObj'], $conf['renderObj.']);
$theValue .= $tmpValue;
}
}
if (isset($conf['stdWrap.'])) {
$theValue = $this->cObj->stdWrap($theValue, $conf['stdWrap.']);
}
$GLOBALS['TSFE']->currentRecord = $originalRec; // Restore
return $theValue;
}
}
if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['tslib/content/class.tslib_content_loop.php'])) {
include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['tslib/content/class.tslib_content_loop.php']);
}
?>
typo3/sysext/cms/ext_autoload.php (working copy)
'tslib_content_imageresource' => PATH_tslib . 'content/class.tslib_content_imageresource.php',
'tslib_content_imagetext' => PATH_tslib . 'content/class.tslib_content_imagetext.php',
'tslib_content_loadregister' => PATH_tslib . 'content/class.tslib_content_loadregister.php',
'tslib_content_loop' => PATH_tslib . 'content/class.tslib_content_loop.php',
'tslib_content_media' => PATH_tslib . 'content/class.tslib_content_media.php',
'tslib_content_multimedia' => PATH_tslib . 'content/class.tslib_content_multimedia.php',
'tslib_content_offsettable' => PATH_tslib . 'content/class.tslib_content_offsettable.php',
(1-1/2)