Fixed Bug #16349: Adapt dam_tt_content to the TCA changes in TYPO3 4.5 (Thanks Lorenz...
authordosipov <dosipov@735d13b6-9817-0410-8766-e36946ffe9aa>
Thu, 13 Jan 2011 03:10:04 +0000 (03:10 +0000)
committerdosipov <dosipov@735d13b6-9817-0410-8766-e36946ffe9aa>
Thu, 13 Jan 2011 03:10:04 +0000 (03:10 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Extensions/dam/dam_ttcontent/trunk@42089 735d13b6-9817-0410-8766-e36946ffe9aa

ChangeLog
ext_conf_template.txt
ext_localconf.php
ext_tables.php

index 9ba20e3..5a58682 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2011-01-12  Dan Osipov <dosipov@phillyburbs.com>
+
+       * Fixed Bug #16349: Adapt dam_tt_content to the TCA changes in TYPO3 4.5 (Thanks Lorenz Ulrich)
+
 2008-09-30  Michiel Roos <michiel@netcreators.com>
 
        * Fixed Bug #10284: dam_ttcontent has the string '\ No new line at end of file' at the end of several files
index b7a02d6..0e6094d 100644 (file)
@@ -1,14 +1,8 @@
-  # cat=basic/enable; type=boolean; label=CType Image: Enable DAM reference field for the content type "Image".
-ctype_image_add_ref = 1
-  # cat=basic/enable; type=boolean; label=CType Image: Enable original file field for the content type "Image" as second image field.
-ctype_image_add_orig_field = 1
-  # cat=basic/enable; type=boolean; label=CType Text w/image: Enable DAM reference field for the content type "Text w/image".
-ctype_textpic_add_ref = 1
-  # cat=basic/enable; type=boolean; label=CType Text w/image: Enable original file field for the content type "Text w/image" as second image field.
-ctype_textpic_add_orig_field = 1
+  # cat=basic/enable; type=boolean; label=DAM for Text w/image and Image: Enable DAM reference field for the content types "Text w/image" and "Image".
+ctypes_textpic_image_add_ref = 1
+  # cat=basic/enable; type=boolean; label=Keep original media fields: Enable original file field for the content types "Text w/image" and "Image" as second image field.
+ctypes_textpic_image_add_orig_field = 1
   # cat=basic/enable; type=boolean; label=Alternative CSS Styled Rendering: Enable alternative rendering for css_styled_content to.
 add_css_styled_hook = 1
-  # cat=basic/enable; type=boolean; label=Page module modifications: Enable modifications to the page module (XCLASS) to enable the display of thumbnails for reference fields.
-add_page_mod_xclass = 1
   # cat=basic/enable; type=boolean; label=Workspace module modifications: Enable modifications to the workspace module (XCLASS) to enable the display of thumbnails for reference fields.
 add_ws_mod_xclass = 1
index e901570..4745099 100644 (file)
@@ -3,7 +3,7 @@
 $GLOBALS['T3_VAR']['ext'][$_EXTKEY]['setup'] = unserialize($_EXTCONF);
 
 
-if ($GLOBALS['T3_VAR']['ext'][$_EXTKEY]['setup']['ctype_image_add_ref']) {
+if ($GLOBALS['T3_VAR']['ext'][$_EXTKEY]['setup']['ctypes_textpic_image_add_ref']) {
 
        t3lib_extMgm::addTypoScript(
                $_EXTKEY,
@@ -27,17 +27,6 @@ if ($GLOBALS['T3_VAR']['ext'][$_EXTKEY]['setup']['ctype_image_add_ref']) {
                tt_content.image.20.imgPath >
                tt_content.image.20.imgPath =
 
-               ',
-               43
-       );
-}
-
-if ($GLOBALS['T3_VAR']['ext'][$_EXTKEY]['setup']['ctype_textpic_add_ref']) {
-
-       t3lib_extMgm::addTypoScript(
-               $_EXTKEY,
-               'setup','
-               includeLibs.tx_damttcontent = EXT:dam/lib/class.tx_dam_tsfe.php
 
                temp.tx_dam.fileList < tt_content.textpic.20.imgList
 
index f392cc6..5191852 100644 (file)
@@ -12,26 +12,31 @@ t3lib_extMgm::addTCAcolumns('tt_content',$tempColumns,1);
 
 $tempSetup = $GLOBALS['T3_VAR']['ext']['dam_ttcontent']['setup'];
 
-## CType image
+// CTypes "text w/image" and "image"
 
-if ($tempSetup['ctype_image_add_ref']) {
+// for TYPO3 < 4.5
+if (($tempSetup['ctypes_textpic_image_add_ref']) && (t3lib_div::int_from_ver(TYPO3_version) < 4005000)) {
 
-       if ($tempSetup['ctype_image_add_orig_field']) {
+       if ($tempSetup['ctypes_textpic_image_add_orig_field']) {
                t3lib_extMgm::addToAllTCAtypes('tt_content','tx_damttcontent_files','image','after:image');
+               t3lib_extMgm::addToAllTCAtypes('tt_content','tx_damttcontent_files','textpic','after:image');
        } else {
                $TCA['tt_content']['types']['image']['showitem'] = str_replace(', image;', ', tx_damttcontent_files;', $TCA['tt_content']['types']['image']['showitem']);
+               $TCA['tt_content']['types']['textpic']['showitem'] = str_replace(', image;', ', tx_damttcontent_files;', $TCA['tt_content']['types']['textpic']['showitem']);
        }
-}
 
-## CType textpic
+}
 
-if ($tempSetup['ctype_textpic_add_ref']) {
+// for TYPO3 >= 4.5
+if (($tempSetup['ctypes_textpic_image_add_ref']) && (t3lib_div::int_from_ver(TYPO3_version) >= 4005000)) {
 
-       if ($tempSetup['ctype_textpic_add_orig_field']) {
+       if ($tempSetup['ctypes_textpic_image_add_orig_field']) {
+               t3lib_extMgm::addToAllTCAtypes('tt_content','tx_damttcontent_files','image','after:image');
                t3lib_extMgm::addToAllTCAtypes('tt_content','tx_damttcontent_files','textpic','after:image');
        } else {
-               $TCA['tt_content']['types']['textpic']['showitem'] = str_replace(', image;', ', tx_damttcontent_files;', $TCA['tt_content']['types']['textpic']['showitem']);
+               t3lib_extMgm::addToAllTCAtypes('tt_content','tx_damttcontent_files','textpic','replace:image');
        }
+
 }
 
 if ($GLOBALS['T3_VAR']['ext']['dam_ttcontent']['setup']['add_css_styled_hook']) {