[TASK] Remove old and deprecated code 86/5886/2
authorLorenz Ulrich <lorenz.ulrich@visol.ch>
Sun, 16 Oct 2011 22:39:39 +0000 (00:39 +0200)
committerLorenz Ulrich <lorenz.ulrich@visol.ch>
Sun, 16 Oct 2011 22:42:28 +0000 (00:42 +0200)
dam_ttcontent 1.2 requires TYPO3 4.5+. Therefore some old version
switches can be removed.

A call to t3lib_div::intInRange needs to be changed to the wrapper
method in class.tx_dam.php because these method is deprecated in
TYPO3 4.6.

Version dependency was raised to DAM 1.3 because it depends on
static methods introduced with this version.

Change-Id: I236154dbefbc8d8a4d5501861f860da91ea71d88
Resolves: #18298
Releases: 1.2

ext_emconf.php
ext_tables.php
pi_cssstyledcontent/class.tx_damttcontent_pi1.php

index c5b000e..1f0f540 100644 (file)
@@ -35,7 +35,7 @@ $EM_CONF[$_EXTKEY] = array(
        'constraints' => array(
                'depends' => array(
                        'cms' => '',
-                       'dam' => '1.2.0',
+                       'dam' => '1.3.0-',
                        'php' => '4.0.0-',
                        'typo3' => '4.5.0-',
                ),
index 5191852..5a39ba7 100644 (file)
@@ -14,21 +14,7 @@ $tempSetup = $GLOBALS['T3_VAR']['ext']['dam_ttcontent']['setup'];
 
 // CTypes "text w/image" and "image"
 
-// for TYPO3 < 4.5
-if (($tempSetup['ctypes_textpic_image_add_ref']) && (t3lib_div::int_from_ver(TYPO3_version) < 4005000)) {
-
-       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']);
-       }
-
-}
-
-// for TYPO3 >= 4.5
-if (($tempSetup['ctypes_textpic_image_add_ref']) && (t3lib_div::int_from_ver(TYPO3_version) >= 4005000)) {
+if ($tempSetup['ctypes_textpic_image_add_ref']) {
 
        if ($tempSetup['ctypes_textpic_image_add_orig_field']) {
                t3lib_extMgm::addToAllTCAtypes('tt_content','tx_damttcontent_files','image','after:image');
index 30d4a29..5f6fe92 100755 (executable)
@@ -122,7 +122,7 @@ class tx_damttcontent_pi1 extends tx_cssstyledcontent_pi1 {
                $imgCount = count($imgs) - $imgStart;
                $imgMax = intval($this->pObj->cObj->stdWrap($conf['imgMax'], $conf['imgMax.']));
                if ($imgMax)    {
-                       $imgCount = t3lib_div::intInRange($imgCount, 0, $conf['imgMax']);       // reduce the number of images.
+                       $imgCount = tx_dam::forceIntegerInRange($imgCount, 0, $conf['imgMax']); // reduce the number of images.
                }
 
                $imgPath = $this->pObj->cObj->stdWrap($conf['imgPath'], $conf['imgPath.']);