[TASK] Deprecate direct method calls to cObjects 48/36148/4
authorBenjamin Mack <benni@typo3.org>
Tue, 20 Jan 2015 20:46:51 +0000 (21:46 +0100)
committerMarkus Klein <klein.t3@reelworx.at>
Sun, 25 Jan 2015 12:21:51 +0000 (13:21 +0100)
Some (but not all) cObjects used the shorthand calls
inside ContentObjectRenderer which come from the time
before TYPO3 4.5 where all the code was inside
ContentObjectRenderer.

They are now finally marked for deprecation.

All places within the TYPO3 Core are replaced
with the appropriate public API call.

Resolves: #64388
Releases: master
Change-Id: I95d4a44adacfc36496ff1ede7aedb2624871ede2
Reviewed-on: http://review.typo3.org/36148
Reviewed-by: Mathias Schreiber <mathias.schreiber@wmdb.de>
Tested-by: Mathias Schreiber <mathias.schreiber@wmdb.de>
Reviewed-by: Markus Klein <klein.t3@reelworx.at>
Tested-by: Markus Klein <klein.t3@reelworx.at>
13 files changed:
typo3/sysext/core/Documentation/Changelog/master/Deprecation-64388-ContentObjectMethods.rst [new file with mode: 0644]
typo3/sysext/css_styled_content/Classes/Controller/CssStyledContentController.php
typo3/sysext/form/Classes/Controller/FormController.php
typo3/sysext/form/Classes/Domain/Model/Attribute/SrcAttribute.php
typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php
typo3/sysext/frontend/Classes/ContentObject/FormContentObject.php
typo3/sysext/frontend/Classes/ContentObject/ImageTextContentObject.php
typo3/sysext/frontend/Classes/ContentObject/MediaContentObject.php
typo3/sysext/frontend/Classes/ContentObject/UserContentObject.php
typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php
typo3/sysext/frontend/Tests/Unit/ContentObject/ContentObjectRendererTest.php
typo3/sysext/indexed_search/Classes/Controller/SearchController.php
typo3/sysext/indexed_search/Classes/Controller/SearchFormController.php

diff --git a/typo3/sysext/core/Documentation/Changelog/master/Deprecation-64388-ContentObjectMethods.rst b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-64388-ContentObjectMethods.rst
new file mode 100644 (file)
index 0000000..4d76410
--- /dev/null
@@ -0,0 +1,64 @@
+===============================================================================
+Deprecation: #64388 - Direct ContentObject methods within ContentObjectRenderer
+===============================================================================
+
+Description
+===========
+
+The following wrapper methods for ContentObject rendering within ContentObjectRenderer
+have been marked for removal for TYPO3 CMS 8.
+
+.. code-block:: php
+
+       FLOWPLAYER()
+       TEXT()
+       CLEARGIF()
+       COBJ_ARRAY()
+       USER()
+       FILE()
+       FILES()
+       IMAGE()
+       IMG_RESOURCE()
+       IMGTEXT()
+       CONTENT()
+       RECORDS()
+       HMENU()
+       CTABLE()
+       OTABLE()
+       COLUMNS()
+       HRULER()
+       CASEFUNC()
+       LOAD_REGISTER()
+       FORM()
+       SEARCHRESULT()
+       TEMPLATE()
+       FLUIDTEMPLATE()
+       MULTIMEDIA()
+       MEDIA()
+       SWFOBJECT()
+       QTOBJECT()
+       SVG()
+
+
+Impact
+======
+
+Using the methods above directly in any third party extension will trigger a deprecation log message.
+
+
+Affected installations
+======================
+
+Instances which use custom calls to ContentObjects via the methods above.
+
+
+Migration
+=========
+
+Replace the direct method calls to ``$contentObject->COBJECT()`` with the common method.
+
+Example for the SVG() ContentObject call:
+
+.. code-block:: php
+
+       $cObj->cObjGetSingle('SVG', $conf);
index a0ead75..88d76a0 100644 (file)
@@ -440,7 +440,7 @@ class CssStyledContentController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlug
        }
 
        /**
-        * Rendering the IMGTEXT content element, called from TypoScript (tt_content.textpic.20)
+        * Rendering the text w/ image content element, called from TypoScript (tt_content.textpic.20)
         *
         * @param string $content Content input. Not used, ignore.
         * @param array $conf TypoScript configuration. See TSRef "IMGTEXT". This function aims to be compatible.
@@ -456,12 +456,12 @@ class CssStyledContentController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlug
                $renderMethod = $this->cObj->stdWrap($conf['renderMethod'], $conf['renderMethod.']);
                // Render using the default IMGTEXT code (table-based)
                if (!$renderMethod || $renderMethod == 'table') {
-                       return $this->cObj->IMGTEXT($conf);
+                       return $this->cObj->cObjGetSingle('IMGTEXT', $conf);
                }
                $restoreRegisters = FALSE;
                if (isset($conf['preRenderRegisters.'])) {
                        $restoreRegisters = TRUE;
-                       $this->cObj->LOAD_REGISTER($conf['preRenderRegisters.'], 'LOAD_REGISTER');
+                       $this->cObj->cObjGetSingle('LOAD_REGISTER', $conf['preRenderRegisters.']);
                }
                // Specific configuration for the chosen rendering method
                if (is_array($conf['rendering.'][$renderMethod . '.'])) {
@@ -475,7 +475,7 @@ class CssStyledContentController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlug
                if (!$imgList) {
                        // No images, that's easy
                        if ($restoreRegisters) {
-                               $this->cObj->LOAD_REGISTER(array(), 'RESTORE_REGISTER');
+                               $this->cObj->cObjGetSingle('RESTORE_REGISTER', array());
                        }
                        return $content;
                }
@@ -483,7 +483,7 @@ class CssStyledContentController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlug
                if (count($imgs) === 0) {
                        // The imgList was not empty but did only contain empty values
                        if ($restoreRegisters) {
-                               $this->cObj->LOAD_REGISTER(array(), 'RESTORE_REGISTER');
+                               $this->cObj->cObjGetSingle('RESTORE_REGISTER', array());
                        }
                        return $content;
                }
@@ -742,10 +742,10 @@ class CssStyledContentController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlug
                                                $imgConf['emptyTitleHandling'] = 'removeAttr';
                                        }
                                }
-                               $imgsTag[$imgKey] = $this->cObj->IMAGE($imgConf);
+                               $imgsTag[$imgKey] = $this->cObj->cObjGetSingle('IMAGE', $imgConf);
                        } else {
                                // currentValKey !!!
-                               $imgsTag[$imgKey] = $this->cObj->IMAGE(array('file' => $totalImagePath));
+                               $imgsTag[$imgKey] = $this->cObj->cObjGetSingle('IMAGE', array('file' => $totalImagePath));
                        }
                        // Restore our ATagParams
                        $GLOBALS['TSFE']->ATagParams = $oldATagParms;
@@ -1076,7 +1076,7 @@ class CssStyledContentController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlug
                );
 
                if ($restoreRegisters) {
-                       $this->cObj->LOAD_REGISTER(array(), 'RESTORE_REGISTER');
+                       $this->cObj->cObjGetSingle('RESTORE_REGISTER', array());
                }
 
                return $output;
@@ -1279,4 +1279,4 @@ class CssStyledContentController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlug
                return \TYPO3\CMS\Core\Resource\ResourceFactory::getInstance();
        }
 
-}
\ No newline at end of file
+}
index b449e67..b2a167d 100644 (file)
@@ -107,7 +107,7 @@ class FormController {
                                '10' => 'FORM_INT',
                                '10.' => is_array($mergedTypoScript) ? $mergedTypoScript : $typoScript,
                        );
-                       $content = $contentObject->COBJ_ARRAY($newTypoScript, 'INT');
+                       $content = $contentObject->cObjGetSingle('COA_INT', $newTypoScript);
                        // Only apply stdWrap to TypoScript that was NOT created by the wizard:
                        if (isset($typoScript['stdWrap.'])) {
                                $content = $contentObject->stdWrap($content, $typoScript['stdWrap.']);
index 3fe63cd..bda0347 100644 (file)
@@ -34,7 +34,7 @@ class SrcAttribute extends \TYPO3\CMS\Form\Domain\Model\Attribute\AbstractAttrib
         * @see \TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer::getImgResource()
         */
        public function getValue() {
-               $attribute = $this->localCobj->IMG_RESOURCE($this->value);
+               $attribute = $this->localCobj->cObjGetSingle('IMG_RESOURCE', $this->value);
                return $attribute;
        }
 
index 0859168..fccc9d7 100644 (file)
@@ -428,28 +428,28 @@ class ContentObjectRenderer {
        public $currentRecord = '';
 
        /**
-        * Set in cObj->RECORDS and cObj->CONTENT to the current number of records selected in a query.
+        * Set in RecordsContentObject and ContentContentObject to the current number of records selected in a query.
         *
         * @var int
         */
        public $currentRecordTotal = 0;
 
        /**
-        * Incremented in cObj->RECORDS and cObj->CONTENT before each record rendering.
+        * Incremented in RecordsContentObject and ContentContentObject before each record rendering.
         *
         * @var int
         */
        public $currentRecordNumber = 0;
 
        /**
-        * Incremented in parent cObj->RECORDS and cObj->CONTENT before each record rendering.
+        * Incremented in RecordsContentObject and ContentContentObject before each record rendering.
         *
         * @var int
         */
        public $parentRecordNumber = 0;
 
        /**
-        * If the ContentObjectRender was started from CONTENT, RECORD or SEARCHRESULT cObject's this array has two keys, 'data' and 'currentRecord' which indicates the record and data for the parent cObj.
+        * If the ContentObjectRender was started from ContentContentObject, RecordsContentObject or SearchResultContentObject this array has two keys, 'data' and 'currentRecord' which indicates the record and data for the parent cObj.
         *
         * @var array
         */
@@ -922,8 +922,10 @@ class ContentObjectRenderer {
         *
         * @param array $conf Array of TypoScript properties
         * @return string Output
+        * @deprecated since TYPO3 CMS 7, will be removed with TYPO3 CMS 8, use $cObj->cObjGetSingle('FLOWPLAYER', $conf) instead
         */
        public function FLOWPLAYER($conf) {
+               GeneralUtility::logDeprecatedFunction();
                return $this->render($this->getContentObject('FLOWPLAYER'), $conf);
        }
 
@@ -932,8 +934,10 @@ class ContentObjectRenderer {
         *
         * @param array $conf Array of TypoScript properties
         * @return string Output
+        * @deprecated since TYPO3 CMS 7, will be removed with TYPO3 CMS 8, use $cObj->cObjGetSingle('TEXT', $conf) instead
         */
        public function TEXT($conf) {
+               GeneralUtility::logDeprecatedFunction();
                return $this->render($this->getContentObject('TEXT'), $conf);
        }
 
@@ -942,8 +946,10 @@ class ContentObjectRenderer {
         *
         * @param array $conf Array of TypoScript properties
         * @return string Output
+        * @deprecated since TYPO3 CMS 7, will be removed with TYPO3 CMS 8, use $cObj->cObjGetSingle('CLEARGIF', $conf) instead
         */
        public function CLEARGIF($conf) {
+               GeneralUtility::logDeprecatedFunction();
                return $this->render($this->getContentObject('CLEARGIF'), $conf);
        }
 
@@ -953,8 +959,10 @@ class ContentObjectRenderer {
         * @param array $conf Array of TypoScript properties
         * @param string $ext If "INT" then the cObject is a "COBJ_ARRAY_INT" (non-cached), otherwise just "COBJ_ARRAY" (cached)
         * @return string Output
+        * @deprecated since TYPO3 CMS 7, will be removed with TYPO3 CMS 8, use $cObj->cObjGetSingle('COA', $conf) or $cObj->cObjGetSingle('COA_INT', $conf) instead
         */
        public function COBJ_ARRAY($conf, $ext = '') {
+               GeneralUtility::logDeprecatedFunction();
                if ($ext === 'INT') {
                        return $this->render($this->getContentObject('COA_INT'), $conf);
                } else {
@@ -968,8 +976,10 @@ class ContentObjectRenderer {
         * @param array $conf Array of TypoScript properties
         * @param string $ext If "INT" then the cObject is a "USER_INT" (non-cached), otherwise just "USER" (cached)
         * @return string Output
+        * @deprecated since TYPO3 CMS 7, will be removed with TYPO3 CMS 8, use $cObj->cObjGetSingle('USER', $conf) or $cObj->cObjGetSingle('USER_INT', $conf) instead
         */
        public function USER($conf, $ext = '') {
+               GeneralUtility::logDeprecatedFunction();
                if ($ext === 'INT') {
                        return $this->render($this->getContentObject('USER_INT'), $conf);
                } else {
@@ -1017,8 +1027,10 @@ class ContentObjectRenderer {
         *
         * @param array $conf Array of TypoScript properties
         * @return string Output
+        * @deprecated since TYPO3 CMS 7, will be removed with TYPO3 CMS 8, use $cObj->cObjGetSingle('FILE', $conf) instead
         */
        public function FILE($conf) {
+               GeneralUtility::logDeprecatedFunction();
                return $this->render($this->getContentObject('FILE'), $conf);
        }
 
@@ -1027,8 +1039,10 @@ class ContentObjectRenderer {
         *
         * @param array $conf Array of TypoScript properties
         * @return string Output
+        * @deprecated since TYPO3 CMS 7, will be removed with TYPO3 CMS 8, use $cObj->cObjGetSingle('FILES', $conf) instead
         */
        public function FILES($conf) {
+               GeneralUtility::logDeprecatedFunction();
                return $this->render($this->getContentObject('FILES'), $conf);
        }
 
@@ -1038,8 +1052,10 @@ class ContentObjectRenderer {
         * @param array $conf Array of TypoScript properties
         * @return string Output
         * @see cImage()
+        * @deprecated since TYPO3 CMS 7, will be removed with TYPO3 CMS 8, use $cObj->cObjGetSingle('IMAGE', $conf) instead
         */
        public function IMAGE($conf) {
+               GeneralUtility::logDeprecatedFunction();
                return $this->render($this->getContentObject('IMAGE'), $conf);
        }
 
@@ -1049,8 +1065,10 @@ class ContentObjectRenderer {
         * @param array $conf Array of TypoScript properties
         * @return string Output
         * @see getImgResource()
+        * @deprecated since TYPO3 CMS 7, will be removed with TYPO3 CMS 8, use $cObj->cObjGetSingle('IMG_RESOURCE', $conf) instead
         */
        public function IMG_RESOURCE($conf) {
+               GeneralUtility::logDeprecatedFunction();
                return $this->render($this->getContentObject('IMG_RESOURCE'), $conf);
        }
 
@@ -1059,8 +1077,10 @@ class ContentObjectRenderer {
         *
         * @param array $conf Array of TypoScript properties
         * @return string Output
+        * @deprecated since TYPO3 CMS 7, will be removed with TYPO3 CMS 8, use $cObj->cObjGetSingle('IMGTEXT', $conf) instead
         */
        public function IMGTEXT($conf) {
+               GeneralUtility::logDeprecatedFunction();
                return $this->render($this->getContentObject('IMGTEXT'), $conf);
        }
 
@@ -1069,8 +1089,10 @@ class ContentObjectRenderer {
         *
         * @param array $conf Array of TypoScript properties
         * @return string Output
+        * @deprecated since TYPO3 CMS 7, will be removed with TYPO3 CMS 8, use $cObj->cObjGetSingle('CONTENT', $conf) instead
         */
        public function CONTENT($conf) {
+               GeneralUtility::logDeprecatedFunction();
                return $this->render($this->getContentObject('CONTENT'), $conf);
        }
 
@@ -1079,8 +1101,10 @@ class ContentObjectRenderer {
         *
         * @param array $conf Array of TypoScript properties
         * @return string Output
+        * @deprecated since TYPO3 CMS 7, will be removed with TYPO3 CMS 8, use $cObj->cObjGetSingle('RECORDS', $conf) instead
         */
        public function RECORDS($conf) {
+               GeneralUtility::logDeprecatedFunction();
                return $this->render($this->getContentObject('RECORDS'), $conf);
        }
 
@@ -1089,8 +1113,10 @@ class ContentObjectRenderer {
         *
         * @param array $conf Array of TypoScript properties
         * @return string Output
+        * @deprecated since TYPO3 CMS 7, will be removed with TYPO3 CMS 8, use $cObj->cObjGetSingle('HMENU', $conf) instead
         */
        public function HMENU($conf) {
+               GeneralUtility::logDeprecatedFunction();
                return $this->render($this->getContentObject('HMENU'), $conf);
        }
 
@@ -1099,8 +1125,10 @@ class ContentObjectRenderer {
         *
         * @param array $conf Array of TypoScript properties
         * @return string Output
+        * @deprecated since TYPO3 CMS 7, will be removed with TYPO3 CMS 8, use $cObj->cObjGetSingle('CTABLE', $conf) instead
         */
        public function CTABLE($conf) {
+               GeneralUtility::logDeprecatedFunction();
                return $this->render($this->getContentObject('CTABLE'), $conf);
        }
 
@@ -1109,8 +1137,10 @@ class ContentObjectRenderer {
         *
         * @param array $conf Array of TypoScript properties
         * @return string Output
+        * @deprecated since TYPO3 CMS 7, will be removed with TYPO3 CMS 8, use $cObj->cObjGetSingle('OTABLE', $conf) instead
         */
        public function OTABLE($conf) {
+               GeneralUtility::logDeprecatedFunction();
                return $this->render($this->getContentObject('OTABLE'), $conf);
        }
 
@@ -1119,8 +1149,10 @@ class ContentObjectRenderer {
         *
         * @param array $conf Array of TypoScript properties
         * @return string Output
+        * @deprecated since TYPO3 CMS 7, will be removed with TYPO3 CMS 8, use $cObj->cObjGetSingle('COLUMNS', $conf) instead
         */
        public function COLUMNS($conf) {
+               GeneralUtility::logDeprecatedFunction();
                return $this->render($this->getContentObject('COLUMNS'), $conf);
        }
 
@@ -1129,8 +1161,10 @@ class ContentObjectRenderer {
         *
         * @param array $conf Array of TypoScript properties
         * @return string Output
+        * @deprecated since TYPO3 CMS 7, will be removed with TYPO3 CMS 8, use $cObj->cObjGetSingle('HRULER', $conf) instead
         */
        public function HRULER($conf) {
+               GeneralUtility::logDeprecatedFunction();
                return $this->render($this->getContentObject('HRULER'), $conf);
        }
 
@@ -1139,8 +1173,10 @@ class ContentObjectRenderer {
         *
         * @param array $conf Array of TypoScript properties
         * @return string Output
+        * @deprecated since TYPO3 CMS 7, will be removed with TYPO3 CMS 8, use $cObj->cObjGetSingle('CASE', $conf) instead
         */
        public function CASEFUNC($conf) {
+               GeneralUtility::logDeprecatedFunction();
                return $this->render($this->getContentObject('CASE'), $conf);
        }
 
@@ -1149,10 +1185,12 @@ class ContentObjectRenderer {
         * NOTICE: This cObject does NOT return any content since it just sets internal data based on the TypoScript properties.
         *
         * @param array $conf Array of TypoScript properties
-        * @param string $name If "RESTORE_REGISTER" then the cObject rendered is "RESTORE_REGISTER", otherwise "LOAD_REGISTER
+        * @param string $name If "RESTORE_REGISTER" then the cObject rendered is "RESTORE_REGISTER", otherwise "LOAD_REGISTER"
         * @return string Empty string (the cObject only sets internal data!)
+        * @deprecated since TYPO3 CMS 7, will be removed with TYPO3 CMS 8, use $cObj->cObjGetSingle('LOAD_REGISTER', $conf) and $cObj->cObjGetSingle('RESTORE_REGISTER', $conf) instead
         */
        public function LOAD_REGISTER($conf, $name) {
+               GeneralUtility::logDeprecatedFunction();
                if ($name === 'RESTORE_REGISTER') {
                        return $this->render($this->getContentObject('RESTORE_REGISTER'), $conf);
                } else {
@@ -1166,8 +1204,10 @@ class ContentObjectRenderer {
         * @param array $conf Array of TypoScript properties
         * @param array $formData Alternative formdata overriding whatever comes from TypoScript
         * @return string Output
+        * @deprecated since TYPO3 CMS 7, will be removed with TYPO3 CMS 8, use $cObj->cObjGetSingle('FORM', $conf) instead
         */
        public function FORM($conf, $formData = '') {
+               GeneralUtility::logDeprecatedFunction();
                return $this->render($this->getContentObject('FORM'), $conf);
        }
 
@@ -1176,8 +1216,10 @@ class ContentObjectRenderer {
         *
         * @param array $conf Array of TypoScript properties
         * @return string Output
+        * @deprecated since TYPO3 CMS 7, will be removed with TYPO3 CMS 8, use $cObj->cObjGetSingle('SEARCHRESULT', $conf) instead
         */
        public function SEARCHRESULT($conf) {
+               GeneralUtility::logDeprecatedFunction();
                return $this->render($this->getContentObject('SEARCHRESULT'), $conf);
        }
 
@@ -1187,8 +1229,10 @@ class ContentObjectRenderer {
         * @param array $conf Array of TypoScript properties
         * @return string Output
         * @see substituteMarkerArrayCached()
+        * @deprecated since TYPO3 CMS 7, will be removed with TYPO3 CMS 8, use $cObj->cObjGetSingle('TEMPLATE', $conf) instead
         */
        public function TEMPLATE($conf) {
+               GeneralUtility::logDeprecatedFunction();
                return $this->render($this->getContentObject('TEMPLATE'), $conf);
        }
 
@@ -1199,8 +1243,10 @@ class ContentObjectRenderer {
         * @return string the HTML output
         * @author Steffen Ritter <info@steffen-ritter.net>
         * @author Benjamin Mack <benni@typo3.org>
+        * @deprecated since TYPO3 CMS 7, will be removed with TYPO3 CMS 8, use $cObj->cObjGetSingle('FLUIDTEMPLATE', $conf) instead
         */
        protected function FLUIDTEMPLATE(array $conf) {
+               GeneralUtility::logDeprecatedFunction();
                return $this->render($this->getContentObject('FLUIDTEMPLATE'), $conf);
        }
 
@@ -1209,8 +1255,10 @@ class ContentObjectRenderer {
         *
         * @param array $conf Array of TypoScript properties
         * @return string Output
+        * @deprecated since TYPO3 CMS 7, will be removed with TYPO3 CMS 8, use $cObj->cObjGetSingle('MULTIMEDIA', $conf) instead
         */
        public function MULTIMEDIA($conf) {
+               GeneralUtility::logDeprecatedFunction();
                return $this->render($this->getContentObject('MULTIMEDIA'), $conf);
        }
 
@@ -1219,8 +1267,10 @@ class ContentObjectRenderer {
         *
         * @param array $conf Array of TypoScript properties
         * @return string Output
+        * @deprecated since TYPO3 CMS 7, will be removed with TYPO3 CMS 8, use $cObj->cObjGetSingle('MEDIA', $conf) instead
         */
        public function MEDIA($conf) {
+               GeneralUtility::logDeprecatedFunction();
                return $this->render($this->getContentObject('MEDIA'), $conf);
        }
 
@@ -1229,8 +1279,10 @@ class ContentObjectRenderer {
         *
         * @param array $conf Array of TypoScript properties
         * @return string Output
+        * @deprecated since TYPO3 CMS 7, will be removed with TYPO3 CMS 8, use $cObj->cObjGetSingle('SWFOBJECT', $conf) instead
         */
        public function SWFOBJECT($conf) {
+               GeneralUtility::logDeprecatedFunction();
                return $this->render($this->getContentObject('SWFOBJECT'), $conf);
        }
 
@@ -1239,8 +1291,10 @@ class ContentObjectRenderer {
         *
         * @param array $conf Array of TypoScript properties
         * @return string Output
+        * @deprecated since TYPO3 CMS 7, will be removed with TYPO3 CMS 8, use $cObj->cObjGetSingle('QTOBJECT', $conf) instead
         */
        public function QTOBJECT($conf) {
+               GeneralUtility::logDeprecatedFunction();
                return $this->render($this->getContentObject('QTOBJECT'), $conf);
        }
 
@@ -1249,8 +1303,10 @@ class ContentObjectRenderer {
         *
         * @param array $conf Array of TypoScript properties
         * @return string Output
+        * @deprecated since TYPO3 CMS 7, will be removed with TYPO3 CMS 8, use $cObj->cObjGetSingle('SVG', $conf) instead
         */
        public function SVG($conf) {
+               GeneralUtility::logDeprecatedFunction();
                return $this->render($this->getContentObject('SVG'), $conf);
        }
 
@@ -1576,7 +1632,7 @@ class ContentObjectRenderer {
                                                'file' => $imageFile,
                                                'file.' => $conf
                                        );
-                                       $url = $this->IMG_RESOURCE($imgResourceConf);
+                                       $url = $this->cObjGetSingle('IMG_RESOURCE', $imgResourceConf);
                                        if (!$url) {
                                                // If no imagemagick / gm is available
                                                $url = $imageFile;
@@ -3622,7 +3678,7 @@ class ContentObjectRenderer {
         *
         * @param array $conf TypoScript properties defining what to compare
         * @return bool
-        * @see HMENU(), CASEFUNC(), IMAGE(), COLUMN(), stdWrap(), _parseFunc()
+        * @see stdWrap(), _parseFunc()
         */
        public function checkIf($conf) {
                if (!is_array($conf)) {
index a2e29b0..fc013b8 100644 (file)
@@ -395,7 +395,7 @@ class FormContentObject extends AbstractContentObject {
                                                $value = trim($parts[2]);
                                                if ($conf['image.']) {
                                                        $this->cObj->data[$this->cObj->currentValKey] = $value;
-                                                       $image = $this->cObj->IMG_RESOURCE($conf['image.']);
+                                                       $image = $this->cObj->cObjGetSingle('IMG_RESOURCE', $conf['image.']);
                                                        $params = $conf['image.']['params'] ? ' ' . $conf['image.']['params'] : '';
                                                        $params .= $this->cObj->getAltParam($conf['image.'], FALSE);
                                                        $params .= $addParams;
index 81485d3..29291ce 100644 (file)
@@ -254,7 +254,7 @@ class ImageTextContentObject extends AbstractContentObject {
                                                'file' => $totalImagePath
                                        );
                                }
-                               $imgsTag[$imgKey] = $this->cObj->IMAGE($imgConf);
+                               $imgsTag[$imgKey] = $this->cObj->cObjGetSingle('IMAGE', $imgConf);
                                // Store the original filepath
                                $origImages[$imgKey] = $GLOBALS['TSFE']->lastImageInfo;
                                $imageRowsFinalWidths[floor($a / $colCount)] += $GLOBALS['TSFE']->lastImageInfo[0];
index 554d587..8317006 100644 (file)
@@ -189,21 +189,21 @@ class MediaContentObject extends AbstractContentObject {
                                $conf['attributes.'] = array_merge((array)$conf['attributes.'], $conf['predefined']);
                                $conf['params.'] = array_merge((array)$conf['params.'], $conf['predefined']);
                                $conf['flashvars.'] = array_merge((array)$conf['flashvars.'], $conf['predefined']);
-                               $content = $this->cObj->FLOWPLAYER($conf);
+                               $content = $this->cObj->cObjGetSingle('FLOWPLAYER', $conf);
                                break;
                        case 'swf':
                                $conf[$conf['type'] . '.'] = array_merge((array)$conf['mimeConf.']['swfobject.'][($conf['type'] . '.')], $typeConf);
                                $conf = array_merge((array)$conf['mimeConf.']['swfobject.'], $conf);
                                unset($conf['mimeConf.']);
                                $conf['flashvars.'] = array_merge((array)$conf['flashvars.'], $conf['predefined']);
-                               $content = $this->cObj->SWFOBJECT($conf);
+                               $content = $this->cObj->cObjGetSingle('SWFOBJECT', $conf);
                                break;
                        case 'qt':
                                $conf[$conf['type'] . '.'] = array_merge($conf['mimeConf.']['swfobject.'][$conf['type'] . '.'], $typeConf);
                                $conf = array_merge($conf['mimeConf.']['qtobject.'], $conf);
                                unset($conf['mimeConf.']);
                                $conf['params.'] = array_merge((array)$conf['params.'], $conf['predefined']);
-                               $content = $this->cObj->QTOBJECT($conf);
+                               $content = $this->cObj->cObjGetSingle('QTOBJECT', $conf);
                                break;
                        case 'embed':
                                $paramsArray = array_merge((array)$typeConf['default.']['params.'], (array)$conf['params.'], $conf['predefined']);
@@ -211,7 +211,7 @@ class MediaContentObject extends AbstractContentObject {
                                foreach ($paramsArray as $key => $value) {
                                        $conf['params'] .= $key . '=' . $value . LF;
                                }
-                               $content = $this->cObj->MULTIMEDIA($conf);
+                               $content = $this->cObj->cObjGetSingle('MULTIMEDIA', $conf);
                                break;
                        default:
                                if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/hooks/class.tx_cms_mediaitems.php']['customMediaRender'])) {
index 37edce9..7fafee4 100644 (file)
@@ -42,7 +42,7 @@ class UserContentObject extends AbstractContentObject {
                $tempContent = $this->cObj->callUserFunction($conf['userFunc'], $conf, '');
                if ($this->cObj->doConvertToUserIntObject) {
                        $this->cObj->doConvertToUserIntObject = FALSE;
-                       $content = $this->cObj->USER($conf, 'INT');
+                       $content = $this->cObj->cObjGetSingle('USER_INT', $conf);
                } else {
                        $content .= $tempContent;
                }
index 23d3d19..80ebe43 100644 (file)
@@ -600,7 +600,7 @@ class TypoScriptFrontendController {
        public $cObjectDepthCounter = 50;
 
        /**
-        * Used by cObj->RECORDS and cObj->CONTENT to ensure the a records is NOT
+        * Used by RecordContentObject and ContentContentObject to ensure the a records is NOT
         * rendered twice through it!
         * @var array
         */
@@ -631,8 +631,7 @@ class TypoScriptFrontendController {
 
        /**
         * Is set in ContentObjectRenderer->cImage() function to the info-array of the
-        * most recent rendered image. The information is used in
-        * ContentObjectRenderer->IMGTEXT
+        * most recent rendered image. The information is used in ImageTextContentObject
         * @var array
         */
        public $lastImageInfo = array();
@@ -3506,10 +3505,10 @@ class TypoScriptFrontendController {
                                        $INTiS_cObj->INT_include = 1;
                                        switch ($INTiS_config[$INTiS_key]['type']) {
                                                case 'COA':
-                                                       $incContent = $INTiS_cObj->COBJ_ARRAY($INTiS_config[$INTiS_key]['conf']);
+                                                       $incContent = $INTiS_cObj->cObjGetSingle('COA', $INTiS_config[$INTiS_key]['conf']);
                                                        break;
                                                case 'FUNC':
-                                                       $incContent = $INTiS_cObj->USER($INTiS_config[$INTiS_key]['conf']);
+                                                       $incContent = $INTiS_cObj->cObjGetSingle('USER', $INTiS_config[$INTiS_key]['conf']);
                                                        break;
                                                case 'POSTUSERFUNC':
                                                        $incContent = $INTiS_cObj->callUserFunction($INTiS_config[$INTiS_key]['postUserFunc'], $INTiS_config[$INTiS_key]['conf'], $INTiS_config[$INTiS_key]['content']);
index 7eb135f..4fe6026 100644 (file)
@@ -219,7 +219,7 @@ class ContentObjectRendererTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         */
        public function formWithSecureFormMailEnabledDoesNotContainRecipientField() {
                $GLOBALS['TYPO3_CONF_VARS']['FE']['secureFormmail'] = TRUE;
-               $this->assertNotContains('name="recipient', $this->subject->FORM(array('recipient' => 'foo@bar.com', 'recipient.' => array()), array()));
+               $this->assertNotContains('name="recipient', $this->subject->cObjGetSingle('FORM', array('recipient' => 'foo@bar.com', 'recipient.' => array()), array()));
        }
 
        /**
@@ -227,7 +227,7 @@ class ContentObjectRendererTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         */
        public function formWithSecureFormMailDisabledDoesNotContainRecipientField() {
                $GLOBALS['TYPO3_CONF_VARS']['FE']['secureFormmail'] = FALSE;
-               $this->assertContains('name="recipient', $this->subject->FORM(array('recipient' => 'foo@bar.com', 'recipient.' => array()), array()));
+               $this->assertContains('name="recipient', $this->subject->cObjGetSingle('FORM', array('recipient' => 'foo@bar.com', 'recipient.' => array()), array()));
        }
 
        /////////////////////////////////////////
index 9528300..c77586e 100644 (file)
@@ -522,7 +522,7 @@ class SearchController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionControlle
                                $icon = '';
                                if ($imageType === '0' || substr($imageType, 0, 2) == '0:') {
                                        if (is_array($specRowConf['pageIcon.'])) {
-                                               $this->iconFileNameCache[$imageType] = $this->cObj->IMAGE($specRowConf['pageIcon.']);
+                                               $this->iconFileNameCache[$imageType] = $this->cObj->cObjGetSingle('IMAGE', $specRowConf['pageIcon.']);
                                        } else {
                                                $icon = 'EXT:indexed_search/pi/res/pages.gif';
                                        }
index f73f1b4..45d9f2e 100644 (file)
@@ -1735,7 +1735,7 @@ class SearchFormController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin {
                                $icon = '';
                                if ($it === '0' || substr($it, 0, 2) == '0:') {
                                        if (is_array($specRowConf['pageIcon.'])) {
-                                               $this->iconFileNameCache[$it] = $this->cObj->IMAGE($specRowConf['pageIcon.']);
+                                               $this->iconFileNameCache[$it] = $this->cObj->cObjGetSingle('IMAGE', $specRowConf['pageIcon.']);
                                        } else {
                                                $icon = 'EXT:indexed_search/pi/res/pages.gif';
                                        }