[CLEANUP] Core has a XML syntax dependency on templavoila
authorBenjamin Mack <benni@typo3.org>
Tue, 3 Jan 2012 15:03:30 +0000 (16:03 +0100)
committerSteffen Ritter <info@rs-websystems.de>
Wed, 4 Jan 2012 08:23:35 +0000 (09:23 +0100)
The TYPO3 core still uses "tx_templavoila" in a XML structure
for referencing the title for a structure like FlexForms with
sections etc. This means that code always looks / looked
like this:
<tx_templavoila>
<title>ABCDEF</title>
</tx_templavoila>

you can see this syntax in EXT:cms/flexform_media.xml.

The change in the Core is to support the new format
(without nesting in tx_templavoila) and deprecate but still
support the old format (see above).

Change-Id: I1af739858fb79299edcdbab9d4b44c063666aa9b
Resolves: #32946
Branches: 4.7
Reviewed-on: http://review.typo3.org/7663
Reviewed-by: Xavier Perseguers
Reviewed-by: Georg Ringer
Reviewed-by: Philipp Gampe
Tested-by: Philipp Gampe
Reviewed-by: Steffen Ritter
Tested-by: Steffen Ritter
t3lib/class.t3lib_tceforms.php
typo3/sysext/cms/flexform_media.xml

index 104aae8..b16e966 100644 (file)
@@ -2608,7 +2608,24 @@ class t3lib_TCEforms {
                                                // Making the row:
                                                // ********************
                                                // Title of field:
-                                       $theTitle = htmlspecialchars(t3lib_div::fixed_lgd_cs($this->sL($value['tx_templavoila']['title']), 30));
+
+                                               // in previous versions (< 4.7), the flexform looked like this:
+                                               // <tx_templavoila>
+                                               //     <title>LLL:EXT:cms/locallang_ttc.xml:media.sources</title>
+                                               // </tx_templavoila>
+                                               // for whatever reason,
+                                               // now, only using <title> in an unnested way is fine.
+                                       $theTitle = $value['title'];
+                                               // old syntax is deprecated and will be removed in TYPO3 4.9
+                                       if (!$theTitle && isset($value['tx_templavoila']['title'])) {
+                                               t3lib_div::deprecationLog('The flexform XML, used in ' . htmlspecialchars($table) . ':' . htmlspecialchars($field) . ' is using legacy syntax, the <title> is wrapped in <tx_templavoila>, however should be moved outside of that XML tag container. This functionality will be removed in TYPO3 4.9.');
+                                               $theTitle = $value['tx_templavoila']['title'];
+                                       }
+
+                                               // if there is a title, check for LLL label
+                                       if (strlen($theTitle) > 0) {
+                                               $theTitle = htmlspecialchars(t3lib_div::fixed_lgd_cs($this->sL($theTitle), 30));
+                                       }
 
                                                // If it's a "section" or "container":
                                        if ($value['type'] == 'array') {
index 61df576..fb3c825 100644 (file)
                                                </TCEforms>
                                        </mmType>
                                        <mmSources>
-                                       <tx_templavoila>
                                                <title>LLL:EXT:cms/locallang_ttc.xml:media.sources</title>
-                                       </tx_templavoila>
                                                <type>array</type>
                                                <section>1</section>
                                                <el>
                                                        <mmSourcesContainer>
                                                                <type>array</type>
-                                                               <tx_templavoila>
-                                                                       <title>LLL:EXT:cms/locallang_ttc.xml:media.media.url</title>
-                                                               </tx_templavoila>
+                                                               <title>LLL:EXT:cms/locallang_ttc.xml:media.media.url</title>
                                                                <el>
                                                                        <mmSource>
                                                                                <TCEforms>
                                                </TCEforms>
                                        </mmCaption>
                                        <mmAudioSources>
-                                       <tx_templavoila>
                                                <title>LLL:EXT:cms/locallang_ttc.xml:media.audioSources</title>
-                                       </tx_templavoila>
                                                <type>array</type>
                                                <section>1</section>
                                                <el>
                                                        <mmAudioSourcesContainer>
                                                                <type>array</type>
-                                                               <tx_templavoila>
-                                                                       <title>LLL:EXT:cms/locallang_ttc.xml:media.media.url</title>
-                                                               </tx_templavoila>
+                                                               <title>LLL:EXT:cms/locallang_ttc.xml:media.media.url</title>
                                                                <el>
                                                                        <mmAudioSource>
                                                                                <TCEforms>
                                                </TCEforms>
                                        </mmRenderType>
                                        <mmMediaOptions>
-                                       <tx_templavoila>
                                                <title>LLL:EXT:cms/locallang_ttc.xml:media.additionalOptions</title>
-                                       </tx_templavoila>
                                                <type>array</type>
                                                <section>1</section>
                                                <el>
                                                        <mmMediaOptionsContainer>
                                                        <type>array</type>
-                                                       <tx_templavoila>
-                                                               <title>LLL:EXT:cms/locallang_ttc.xml:media.params</title>
-                                                       </tx_templavoila>
+                                                       <title>LLL:EXT:cms/locallang_ttc.xml:media.params</title>
                                                        <el>
                                                                <mmParamName>
                                                                        <TCEforms>
                                                        </mmMediaOptionsContainer>
                                                        <mmMediaCustomParameterContainer>
                                                                <type>array</type>
-                                                               <tx_templavoila>
-                                                                       <title>LLL:EXT:cms/locallang_ttc.xml:media.params.customEntry</title>
-                                                               </tx_templavoila>
+                                                               <title>LLL:EXT:cms/locallang_ttc.xml:media.params.customEntry</title>
                                                                <el>
                                                                        <mmParamCustomEntry>
                                                                                <TCEforms>