Fixed bug #16039: Move TCEforms HTML templates to template file (Thanks to Steffen...
authorBenni Mack <benni.mack@typo3.org>
Wed, 17 Nov 2010 09:54:05 +0000 (09:54 +0000)
committerBenni Mack <benni.mack@typo3.org>
Wed, 17 Nov 2010 09:54:05 +0000 (09:54 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@9435 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/class.t3lib_tceforms.php

index b529bdb..d5aeb16 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -8,6 +8,7 @@
 
 2010-11-17  Benjamin Mack  <benni@typo3.org>
 
+       * Fixed bug #16039: Move TCEforms HTML templates to template file (Thanks to Steffen Kamper)
        * Added feature #4203: Workspace DB / filemounts should narrow down the users' mounts (Thanks to Sonja Scholz)
 
 2010-11-17  Susanne Moog  <typo3@susanne-moog.de>
index 33e52f0..d18981a 100644 (file)
@@ -310,7 +310,7 @@ class t3lib_TCEforms        {
        var $hookObjectsSingleField = array();                  // Array containing hook class instances called for each field
        var $extraFormHeaders = array();                        // Rows gettings inserted into the alt_doc headers (when called from alt_doc.php)
 
-
+       public $templateFile = '';                                              // Form templates, relative to typo3 directory
 
 
 
@@ -380,6 +380,8 @@ class t3lib_TCEforms        {
                        }
                }
 
+               $this->templateFile = 'templates/tceforms.html';
+
        }
 
        /**
@@ -4849,46 +4851,18 @@ class t3lib_TCEforms    {
         * @return      void
         */
        function setNewBEDesign()       {
+               $template = t3lib_div::getURL(PATH_typo3 . $this->templateFile);
 
                        // Wrapping all table rows for a particular record being edited:
-               $this->totalWrap='
-               <h2>###PAGE_TITLE###</h2>
-
-               <table class="typo3-TCEforms">'.
-                       '|'.
-                       '
-                       <tr class="typo3-TCEforms-recHeaderRow">
-                               <td colspan="2">###RECORD_ICON### <span class="typo3-TCEforms-recHeader">###TABLE_TITLE###</span> ###ID_NEW_INDICATOR###</td>
-                       </tr>
-               </table>';
+               $this->totalWrap = t3lib_parsehtml::getSubpart($template, '###TOTALWRAP###');
 
                        // Wrapping a single field:
-               $this->fieldTemplate='
-                       <tr ###BGCOLOR_HEAD######CLASSATTR_2###>
-                               <td class="t3-form-col1"><div>&nbsp;</div></td>
-                               <td width="99%"><span style="color:###FONTCOLOR_HEAD###;"###CLASSATTR_4###><strong>###FIELD_NAME###</strong></span></td>
-                       </tr>
-                       <tr ###BGCOLOR######CLASSATTR_1###>
-                               <td nowrap="nowrap"><img name="req_###FIELD_TABLE###_###FIELD_ID###_###FIELD_FIELD###" src="clear.gif" class="t3-TCEforms-reqImg" alt="" /><img name="cm_###FIELD_TABLE###_###FIELD_ID###_###FIELD_FIELD###" src="clear.gif" class="t3-TCEforms-contentchangedImg" alt="" /></td>
-                               <td valign="top">###FIELD_ITEM######FIELD_PAL_LINK_ICON###</td>
-                       </tr>';
-
-               $this->palFieldTemplate='
-                       <tr ###BGCOLOR######CLASSATTR_1###>
-                               <td></td>
-                               <td nowrap="nowrap" valign="top">###FIELD_PALETTE###</td>
-                       </tr>';
-               $this->palFieldTemplateHeader='
-                       <tr ###BGCOLOR_HEAD######CLASSATTR_2###>
-                               <td class="t3-form-col1"><div>&nbsp;</div></td>
-                               <td nowrap="nowrap" valign="top"><strong>###FIELD_HEADER###</strong></td>
-                       </tr>';
-
-               $this->sectionWrap='
-                       <tr>
-                               <td colspan="2"><table ###TABLE_ATTRIBS###>###CONTENT###</table></td>
-                       </tr>
-                       ';
+               $this->fieldTemplate = t3lib_parsehtml::getSubpart($template, '###FIELDTEMPLATE###');
+
+               $this->palFieldTemplate = t3lib_parsehtml::getSubpart($template, '###PALETTE_FIELDTEMPLATE###');
+               $this->palFieldTemplateHeader = t3lib_parsehtml::getSubpart($template, '###PALETTE_FIELDTEMPLATE_HEADER###');
+
+               $this->sectionWrap = t3lib_parsehtml::getSubpart($template, '###SECTION_WRAP###');
        }
 
        /**