[TASK] Replace deprecated methods, remove require_once, use namespaced core classes... develop master rte
authorLorenz Ulrich <lorenz.ulrich@visol.ch>
Wed, 17 Sep 2014 16:28:26 +0000 (18:28 +0200)
committerBastian Bringenberg <spam@bastian-bringenberg.de>
Thu, 4 Dec 2014 23:56:09 +0000 (00:56 +0100)
class.tx_contagged.php
ext_autoload.php [new file with mode: 0644]
ext_localconf.php
ext_tables.php
model/class.tx_contagged_model_mapper.php
model/class.tx_contagged_model_terms.php
pi1/class.tx_contagged_pi1.php
tca.php
tx_contagged_userfunction.php

index cff3ead..b69daaa 100644 (file)
@@ -17,9 +17,7 @@
  *  This copyright notice MUST APPEAR in all copies of the script!
  ***************************************************************/
 
-require_once (PATH_tslib . 'class.tslib_pibase.php');
-require_once (PATH_t3lib . 'class.t3lib_parsehtml.php');
-require_once (t3lib_extMgm::extPath('contagged') . 'model/class.tx_contagged_model_terms.php');
+use TYPO3\CMS\Core\Utility\GeneralUtility;
 
 /**
  * The main class to parse,tag and replace specific terms of the content.
@@ -28,7 +26,7 @@ require_once (t3lib_extMgm::extPath('contagged') . 'model/class.tx_contagged_mod
  * @package TYPO3
  * @subpackage    tx_contagged
  */
-class tx_contagged extends tslib_pibase {
+class tx_contagged extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin {
 
        var $prefixId = 'tx_contagged';
 
@@ -59,10 +57,11 @@ class tx_contagged extends tslib_pibase {
                if (!is_array($conf)) {
                        $conf = array();
                }
-               $this->conf = t3lib_div::array_merge_recursive_overrule($GLOBALS['TSFE']->tmpl->setup['plugin.'][$this->prefixId . '.'], $conf);
+               $this->conf = $GLOBALS['TSFE']->tmpl->setup['plugin.'][$this->prefixId . '.'];
+               \TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule($this->conf, $conf);
                $this->pi_setPiVarDefaults();
                if (!is_object($this->cObj)) {
-                       $this->cObj = t3lib_div::makeInstance('tslib_cObj');
+                       $this->cObj = GeneralUtility::makeInstance('TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer');
                        $this->cObj->setCurrentVal($GLOBALS['TSFE']->id);
                }
 
@@ -72,7 +71,6 @@ class tx_contagged extends tslib_pibase {
                        unset($this->typolinkConf['additionalParams.']);
                }
                $this->typolinkConf['useCacheHash'] = 1;
-
                // exit if the content should be skipped
                if ($this->isContentToSkip()) {
                        return $content;
@@ -82,7 +80,7 @@ class tx_contagged extends tslib_pibase {
                $this->typesArray = $this->conf['types.'];
 
                // get the model (an associated array of terms)
-               $model = t3lib_div::makeInstance('tx_contagged_model_terms', $this);
+               $model = GeneralUtility::makeInstance('tx_contagged_model_terms', $this);
                $this->termsArray = $model->findAllTerms();
 
                $excludeTerms = explode(',', $this->conf['excludeTerms']);
@@ -109,7 +107,7 @@ class tx_contagged extends tslib_pibase {
                $tagsToOmitt = $this->getTagsToOmitt();
 
                // TODO split recursively
-               $parseObj = t3lib_div::makeInstance('t3lib_parsehtml');
+               $parseObj = GeneralUtility::makeInstance('TYPO3\CMS\Core\Html\HtmlParser');
                $splittedContent = $parseObj->splitIntoBlock($tagsToOmitt, $content);
                foreach ((array)$splittedContent as $intKey => $HTMLvalue) {
                        if (!($intKey % 2)) {
@@ -145,7 +143,7 @@ class tx_contagged extends tslib_pibase {
         * @return integer +1 if term from a is shorter than b, -1 for the contrary, 0 in case of equality
         */
        public function sortTermsByDescendingLength($a, $b) {
-               // Calculate length correctly by relying on t3lib_cs
+               // Calculate length correctly by relying on \TYPO3\CMS\Core\Charset\CharsetConverter
                $aTermLength = $GLOBALS['TSFE']->csConvObj->strlen($GLOBALS['TSFE']->renderCharset, $a['term']);
                $bTermLength = $GLOBALS['TSFE']->csConvObj->strlen($GLOBALS['TSFE']->renderCharset, $b['term']);
                if ($aTermLength == $bTermLength) {
@@ -318,7 +316,7 @@ class tx_contagged extends tslib_pibase {
        }
 
        function updateIndex($termKey, $matchedTerm) {
-               $currentRecord = t3lib_div::trimExplode(':', $this->cObj->currentRecord);
+               $currentRecord = GeneralUtility::trimExplode(':', $this->cObj->currentRecord);
                $GLOBALS['T3_VAR']['ext']['contagged']['index'][$GLOBALS['TSFE']->id][$termKey] = array(
                        'matchedTerm' => $matchedTerm,
                        'source' => $this->termsArray[$termKey]['source'],
@@ -340,7 +338,7 @@ class tx_contagged extends tslib_pibase {
 
                // if there are tags to exclude: add them to the list
                if ($this->conf['excludeTags']) {
-                       $tagArray = t3lib_div::trimExplode(',', $this->conf['excludeTags'], 1);
+                       $tagArray = GeneralUtility::trimExplode(',', $this->conf['excludeTags'], 1);
                }
 
                // if configured: add tags used by the term definitions
@@ -422,16 +420,16 @@ class tx_contagged extends tslib_pibase {
                        unset($typolinkConf);
                        $typolinkConf = $this->typolinkConf;
                        if (!empty($typeConfigArray['typolink.'])) {
-                               $typolinkConf = t3lib_div::array_merge_recursive_overrule($typolinkConf, $typeConfigArray['typolink.']);
+                               \TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule($typolinkConf, $typeConfigArray['typolink.']);
                        }
                        if ($termArray['link']) {
                                $typolinkConf['parameter'] = $termArray['link'];
                                $typolinkConf['additionalParams'] = $termArray['link.']['additionalParams'];
                        } else {
                                if ($typeConfigArray['listPages']) {
-                                       $typolinkConf['parameter'] = array_shift(t3lib_div::trimExplode(',', $typeConfigArray['listPages'], 1));
+                                       $typolinkConf['parameter'] = array_shift(GeneralUtility::trimExplode(',', $typeConfigArray['listPages'], 1));
                                } else {
-                                       $typolinkConf['parameter'] = array_shift(t3lib_div::trimExplode(',', $this->conf['listPages'], 1));
+                                       $typolinkConf['parameter'] = array_shift(GeneralUtility::trimExplode(',', $this->conf['listPages'], 1));
                                }
                                $GLOBALS['TSFE']->register['contagged_list_page'] = $typolinkConf['parameter'];
                                $additionalParams['source'] = $termArray['source'];
@@ -439,7 +437,7 @@ class tx_contagged extends tslib_pibase {
                                if ($this->checkLocalGlobal($typeConfigArray, 'addBackLink')) {
                                        $additionalParams['backPid'] = $GLOBALS['TSFE']->id;
                                }
-                               $typolinkConf['additionalParams'] = t3lib_div::implodeArrayForUrl('tx_contagged', $additionalParams, '', 1);
+                               $typolinkConf['additionalParams'] = GeneralUtility::implodeArrayForUrl('tx_contagged', $additionalParams, '', 1);
                        }
                        $GLOBALS['TSFE']->register['contagged_link_url'] = $this->cObj->typoLink_URL($typolinkConf);
                        $matchedTerm = $this->cObj->typolink($matchedTerm, $typolinkConf);
@@ -543,22 +541,22 @@ class tx_contagged extends tslib_pibase {
                        $pageUidsInRootline[] = $rootline["$i"]['uid'];
                }
                // check if the root page is in the rootline of the current page
-               $includeRootPagesUids = t3lib_div::trimExplode(',', $this->conf['includeRootPages'], 1);
+               $includeRootPagesUids = GeneralUtility::trimExplode(',', $this->conf['includeRootPages'], 1);
                foreach ($includeRootPagesUids as $includeRootPageUid) {
-                       if (t3lib_div::inArray((array)$pageUidsInRootline, $includeRootPageUid)) {
+                       if (GeneralUtility::inArray((array)$pageUidsInRootline, $includeRootPageUid)) {
                                $result = false;
                        }
                }
-               $excludeRootPagesUids = t3lib_div::trimExplode(',', $this->conf['excludeRootPages'], 1);
+               $excludeRootPagesUids = GeneralUtility::trimExplode(',', $this->conf['excludeRootPages'], 1);
                foreach ($excludeRootPagesUids as $excludeRootPageUid) {
-                       if (t3lib_div::inArray((array)$pageUidsInRootline, $excludeRootPageUid)) {
+                       if (GeneralUtility::inArray((array)$pageUidsInRootline, $excludeRootPageUid)) {
                                $result = true;
                        }
                }
-               if (t3lib_div::inList($this->conf['includePages'], $currentPageUid)) {
+               if (GeneralUtility::inList($this->conf['includePages'], $currentPageUid)) {
                        $result = false;
                }
-               if (t3lib_div::inList($this->conf['excludePages'], $currentPageUid)) {
+               if (GeneralUtility::inList($this->conf['excludePages'], $currentPageUid)) {
                        $result = true;
                }
                if ($GLOBALS['TSFE']->page['tx_contagged_dont_parse'] == 1) {
diff --git a/ext_autoload.php b/ext_autoload.php
new file mode 100644 (file)
index 0000000..ee2a76c
--- /dev/null
@@ -0,0 +1,8 @@
+<?php
+$extensionPath = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('contagged');
+return array(
+       'tx_contagged' => $extensionPath . 'class.tx_contagged.php',
+       'tx_contagged_model_mapper' => $extensionPath . 'model/class.tx_contagged_model_mapper.php',
+       'tx_contagged_model_terms' => $extensionPath . 'model/class.tx_contagged_model_terms.php',
+);
+?>
\ No newline at end of file
index 19b5016..07444f0 100644 (file)
@@ -3,9 +3,5 @@ if (!defined('TYPO3_MODE')) {
        die ('Access denied.');
 }
 
-t3lib_extMgm::addUserTSConfig('
-       options.saveDocNew.tx_contagged_terms=1
-');
-
-t3lib_extMgm::addPItoST43($_EXTKEY, 'pi1/class.tx_contagged_pi1.php', '_pi1', 'list_type', 1);
+\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPItoST43($_EXTKEY, 'pi1/class.tx_contagged_pi1.php', '_pi1', 'list_type', 1);
 ?>
index a4db09c..a81561a 100644 (file)
@@ -3,15 +3,15 @@ if (!defined('TYPO3_MODE')) {
        die ('Access denied.');
 }
 
-t3lib_extMgm::allowTableOnStandardPages('tx_contagged_terms');
-t3lib_extMgm::addToInsertRecords('tx_contagged_terms');
+\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::allowTableOnStandardPages('tx_contagged_terms');
+\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToInsertRecords('tx_contagged_terms');
 
 // add contagged to the "insert plugin" content element
-t3lib_extMgm::addPlugin(array('LLL:EXT:contagged/locallang_db.php:tx_contagged_terms.plugin', $_EXTKEY . '_pi1'), 'list_type');
+\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPlugin(array('LLL:EXT:contagged/locallang_db.php:tx_contagged_terms.plugin', $_EXTKEY . '_pi1'), 'list_type');
 
 // initialize static extension templates
-t3lib_extMgm::addStaticFile($_EXTKEY, 'static/', 'Content parser');
-t3lib_extMgm::addStaticFile($_EXTKEY, 'static/examples/', 'Experimental Setup');
+\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile($_EXTKEY, 'static/', 'Content parser');
+\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile($_EXTKEY, 'static/examples/', 'Experimental Setup');
 
 $TCA["tx_contagged_terms"] = array(
        "ctrl" => array(
@@ -36,8 +36,8 @@ $TCA["tx_contagged_terms"] = array(
                        'fe_group' => 'fe_group',
                ),
                'useColumnsForDefaultValues' => 'term_type',
-               'dynamicConfigFile' => t3lib_extMgm::extPath($_EXTKEY) . 'tca.php',
-               'iconfile' => t3lib_extMgm::extRelPath($_EXTKEY) . 'icon_tx_contagged_terms.gif',
+               'dynamicConfigFile' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY) . 'tca.php',
+               'iconfile' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath($_EXTKEY) . 'icon_tx_contagged_terms.gif',
        ),
        "feInterface" => array(
                "fe_admin_fieldList" => "sys_language_uid, l18n_parent, l18n_diffsource, hidden, starttime, endtime, fe_group, term_main, term_alt, term_type, term_lang, term_replace, desc_short, desc_long, image, dam_images, imagecaption, imagealt, imagetitle, related, link, exclude",
@@ -55,12 +55,10 @@ $tempColumns = Array(
        ),
 );
 
-t3lib_div::loadTCA("pages");
-t3lib_extMgm::addTCAcolumns("pages", $tempColumns, 1);
-t3lib_extMgm::addToAllTCAtypes("pages", "tx_contagged_dont_parse;;;;1-1-1");
+\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns("pages", $tempColumns, 1);
+\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes("pages", "tx_contagged_dont_parse;;;;1-1-1");
 
-t3lib_div::loadTCA("tt_content");
-t3lib_extMgm::addTCAcolumns("tt_content", $tempColumns, 1);
-t3lib_extMgm::addToAllTCAtypes("tt_content", "tx_contagged_dont_parse;;;;1-1-1");
+\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns("tt_content", $tempColumns, 1);
+\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes("tt_content", "tx_contagged_dont_parse;;;;1-1-1");
 
 ?>
\ No newline at end of file
index 8eadea0..3a2a4e7 100644 (file)
@@ -16,6 +16,7 @@
  *  GNU General Public License for more details.
  *  This copyright notice MUST APPEAR in all copies of the script!
  ***************************************************************/
+use TYPO3\CMS\Core\Utility\GeneralUtility;
 
 /**
  * The model of contagged.
@@ -24,7 +25,7 @@
  * @package    TYPO3
  * @subpackage    tx_contagged_model_mapper
  */
-class tx_contagged_model_mapper implements t3lib_Singleton {
+class tx_contagged_model_mapper implements \TYPO3\CMS\Core\SingletonInterface {
 
        var $conf; // the TypoScript configuration array
        var $controller;
@@ -33,7 +34,7 @@ class tx_contagged_model_mapper implements t3lib_Singleton {
                $this->controller = $controller;
                $this->conf = $controller->conf;
                if (!is_object($this->cObj)) {
-                       $this->cObj = t3lib_div::makeInstance('tslib_cObj');
+                       $this->cObj = GeneralUtility::makeInstance('TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer');
                }
        }
 
@@ -53,9 +54,9 @@ class tx_contagged_model_mapper implements t3lib_Singleton {
                foreach ($dataSourceConfigArray['mapping.'] as $fieldToMap => $value) {
                        $fieldsToMapArray[] = substr($fieldToMap, 0, -1);
                }
-               $fieldsToMapfromTS = t3lib_div::trimExplode(',', $this->conf['fieldsToMap'], 1);
+               $fieldsToMapfromTS = GeneralUtility::trimExplode(',', $this->conf['fieldsToMap'], 1);
                foreach ($fieldsToMapfromTS as $key => $fieldToMap) {
-                       if (!t3lib_div::inArray($fieldsToMapArray, $fieldToMap)) {
+                       if (!GeneralUtility::inArray($fieldsToMapArray, $fieldToMap)) {
                                $fieldsToMapArray[] = $fieldToMap;
                        }
                }
@@ -90,7 +91,7 @@ class tx_contagged_model_mapper implements t3lib_Singleton {
                        }
 
                        // post processing
-                       $mappedDataArray['term_alt'] = t3lib_div::trimExplode(chr(10), $row['term_alt'], 1);
+                       $mappedDataArray['term_alt'] = GeneralUtility::trimExplode(chr(10), $row['term_alt'], 1);
                        // TODO: hook "mappingPostProcessing"
 
                        if (!empty($dataSourceConfigArray['mapping.']['uid.']['field'])) {
index 1a3c73c..7893224 100644 (file)
@@ -16,7 +16,7 @@
  *  GNU General Public License for more details.
  *  This copyright notice MUST APPEAR in all copies of the script!
  ***************************************************************/
-require_once (t3lib_extMgm::extPath('contagged') . 'model/class.tx_contagged_model_mapper.php');
+use TYPO3\CMS\Core\Utility\GeneralUtility;
 
 /**
  * The model of contagged.
@@ -25,7 +25,7 @@ require_once (t3lib_extMgm::extPath('contagged') . 'model/class.tx_contagged_mod
  * @package    TYPO3
  * @subpackage    tx_contagged_model_terms
  */
-class tx_contagged_model_terms implements t3lib_Singleton {
+class tx_contagged_model_terms implements \TYPO3\CMS\Core\SingletonInterface {
 
        var $conf; // the TypoScript configuration array
        var $controller;
@@ -43,10 +43,10 @@ class tx_contagged_model_terms implements t3lib_Singleton {
                $this->controller = $controller;
                $this->conf = $controller->conf;
                if (!is_object($this->cObj)) {
-                       $this->cObj = t3lib_div::makeInstance('tslib_cObj');
+                       $this->cObj = GeneralUtility::makeInstance('TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer');
                }
 
-               $this->mapper = t3lib_div::makeInstance('tx_contagged_model_mapper', $this->controller);
+               $this->mapper = GeneralUtility::makeInstance('tx_contagged_model_mapper', $this->controller);
 
                // build an array of tables in the database
                $this->tablesArray = $GLOBALS['TYPO3_DB']->admin_get_tables(TYPO3_db);
@@ -195,11 +195,11 @@ class tx_contagged_model_terms implements t3lib_Singleton {
                $storagePidsArray = array();
                $dataSource = $typeConfigArray['dataSource'] ? $typeConfigArray['dataSource'] : 'default';
                if (!empty($typeConfigArray['storagePids'])) {
-                       $storagePidsArray = t3lib_div::intExplode(',', $typeConfigArray['storagePids']);
+                       $storagePidsArray = GeneralUtility::intExplode(',', $typeConfigArray['storagePids']);
                } elseif (!empty($this->conf['dataSources.'][$dataSource . '.']['storagePids'])) {
-                       $storagePidsArray = t3lib_div::intExplode(',', $this->conf['dataSources.'][$dataSource . '.']['storagePids']);
+                       $storagePidsArray = GeneralUtility::intExplode(',', $this->conf['dataSources.'][$dataSource . '.']['storagePids']);
                } elseif (!empty($this->conf['storagePids'])) {
-                       $storagePidsArray = t3lib_div::intExplode(',', $this->conf['storagePids']);
+                       $storagePidsArray = GeneralUtility::intExplode(',', $this->conf['storagePids']);
                }
                return $storagePidsArray;
        }
@@ -215,9 +215,9 @@ class tx_contagged_model_terms implements t3lib_Singleton {
                if (!isset($this->listPagesCache[$termType])) {
                        $listPidsArray = array();
                        if (!empty($this->conf['types.'][$termArray['term_type'] . '.']['listPages'])) {
-                               $this->listPagesCache[$termType] = t3lib_div::intExplode(',', $this->conf['types.'][$termArray['term_type'] . '.']['listPages']);
+                               $this->listPagesCache[$termType] = GeneralUtility::intExplode(',', $this->conf['types.'][$termArray['term_type'] . '.']['listPages']);
                        } elseif (!empty($this->conf['listPages'])) {
-                               $this->listPagesCache[$termType] = t3lib_div::intExplode(',', $this->conf['listPages']);
+                               $this->listPagesCache[$termType] = GeneralUtility::intExplode(',', $this->conf['listPages']);
                        }
                }
                return $this->listPagesCache[$termType];
index 2f79f29..91b198d 100644 (file)
  *  This copyright notice MUST APPEAR in all copies of the script!
  ***************************************************************/
 
-require_once (PATH_tslib . 'class.tslib_pibase.php');
-require_once (t3lib_extMgm::extPath('contagged') . 'class.tx_contagged.php');
-require_once (t3lib_extMgm::extPath('contagged') . 'model/class.tx_contagged_model_terms.php');
-require_once (t3lib_extMgm::extPath('contagged') . 'model/class.tx_contagged_model_mapper.php');
+use TYPO3\CMS\Core\Utility\GeneralUtility;
 
 /**
  * contagged list plugin
@@ -29,8 +26,7 @@ require_once (t3lib_extMgm::extPath('contagged') . 'model/class.tx_contagged_mod
  * @package    TYPO3
  * @subpackage    tx_contagged_pi1
  */
-class tx_contagged_pi1 extends tslib_pibase {
-
+class tx_contagged_pi1 extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin {
        var $prefixId = 'tx_contagged'; // same as class name
        var $scriptRelPath = 'pi1/class.tx_contagged_pi1.php'; // path to this script relative to the extension dir
        var $extKey = 'contagged'; // the extension key
@@ -54,11 +50,12 @@ class tx_contagged_pi1 extends tslib_pibase {
         */
        function main($content, $conf) {
                $this->conf = $GLOBALS['TSFE']->tmpl->setup['plugin.'][$this->prefixId . '.'];
-               $this->parser = t3lib_div::makeInstance('tx_contagged');
-               $this->local_cObj = t3lib_div::makeInstance('tslib_cObj');
+               $this->parser = GeneralUtility::makeInstance('tx_contagged');
+               $this->local_cObj = GeneralUtility::makeInstance('TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer');
                $this->local_cObj->setCurrentVal($GLOBALS['TSFE']->id);
                if (is_array($GLOBALS['TSFE']->tmpl->setup['plugin.']['tx_contagged.'])) {
-                       $this->conf = t3lib_div::array_merge_recursive_overrule($GLOBALS['TSFE']->tmpl->setup['plugin.']['tx_contagged.'], $conf);
+                       $this->conf = $GLOBALS['TSFE']->tmpl->setup['plugin.']['tx_contagged.'];
+                       \TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule($this->conf, $conf);
                }
                $this->pi_loadLL();
                $this->templateCode = $this->cObj->fileResource($this->conf['templateFile'] ? $this->conf['templateFile'] : $this->templateFile);
@@ -83,8 +80,8 @@ class tx_contagged_pi1 extends tslib_pibase {
                $this->typesArray = $this->conf['types.'];
 
                // get the model (an associated array of terms)
-               $this->mapper = t3lib_div::makeInstance('tx_contagged_model_mapper', $this);
-               $this->model = t3lib_div::makeInstance('tx_contagged_model_terms', $this);
+               $this->mapper = GeneralUtility::makeInstance('tx_contagged_model_mapper', $this);
+               $this->model = GeneralUtility::makeInstance('tx_contagged_model_terms', $this);
 
                if (!is_null($termKey)) {
                        $content .= $this->renderSingleItemByKey($dataSource, $uid);
@@ -164,7 +161,7 @@ class tx_contagged_pi1 extends tslib_pibase {
                $this->renderIndex($markerArray, $termsArray);
                $this->renderSearchBox($markerArray);
                foreach ($termsArray as $termKey => $termArray) {
-                       $fieldsToSearch = t3lib_div::trimExplode(',', $this->conf['searchbox.']['fieldsToSearch']);
+                       $fieldsToSearch = GeneralUtility::trimExplode(',', $this->conf['searchbox.']['fieldsToSearch']);
                        foreach ($fieldsToSearch as $field) {
                                if (is_array($termArray[$field])) {
                                        foreach ($termArray[$field] as $subFieldValue) {
@@ -223,7 +220,7 @@ class tx_contagged_pi1 extends tslib_pibase {
                // make "back to..." link
                if ($this->backPid && $this->conf['addBackLink'] !== '0') {
                        if ($this->conf['addBackLinkDescription'] > 0) {
-                               $pageSelectObject = new t3lib_pageSelect;
+                               $pageSelectObject = new \TYPO3\CMS\Frontend\Page\PageRepository;
                                $pageSelectObject->init(FALSE);
                                $pageSelectObject->sys_language_uid = $GLOBALS['TSFE']->sys_language_uid;
                                $backPage = $pageSelectObject->getPage($this->backPid);
@@ -254,7 +251,7 @@ class tx_contagged_pi1 extends tslib_pibase {
 
                $termArray['desc_long'] = $this->cObj->parseFunc($termArray['desc_long'], array(), '< lib.parseFunc_RTE');
                if (!empty($this->conf['fieldsToParse'])) {
-                       $fieldsToParse = t3lib_div::trimExplode(',', $this->conf['fieldsToParse']);
+                       $fieldsToParse = GeneralUtility::trimExplode(',', $this->conf['fieldsToParse']);
                        $excludeTerms = $termArray['term_alt'];
                        $excludeTerms[] = $termArray['term_main'];
                        foreach ($fieldsToParse as $fieldName) {
@@ -303,7 +300,7 @@ class tx_contagged_pi1 extends tslib_pibase {
                $markerArray['###DETAILS###'] = $this->pi_getLL('details');
                $typolinkConf = $this->typolinkConf;
                if (!empty($typeConfigArray['typolink.'])) {
-                       $typolinkConf = t3lib_div::array_merge_recursive_overrule($typolinkConf, $typeConfigArray['typolink.']);
+                       \TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule($typolinkConf, $typeConfigArray['typolink.']);
                }
                $typolinkConf['additionalParams'] .= '&' . $this->prefixId . '[source]=' . $termArray['source'] . '&' . $this->prefixId . '[uid]=' . $termArray['uid'];
                $typolinkConf['parameter'] = array_shift($this->model->getListPidsArray($termArray['term_type']));
@@ -319,7 +316,7 @@ class tx_contagged_pi1 extends tslib_pibase {
                                $relatedTerm = $this->model->findTermByUid($termReference['source'], $termReference['uid']);
                                $typolinkConf = $this->typolinkConf;
                                if (!empty($typeConfigArray['typolink.'])) {
-                                       $typolinkConf = t3lib_div::array_merge_recursive_overrule($typolinkConf, $typeConfigArray['typolink.']);
+                                       \TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule($typolinkConf, $typeConfigArray['typolink.']);
                                }
                                $typolinkConf['useCacheHash'] = 1;
                                $typolinkConf['additionalParams'] .= '&' . $this->prefixId . '[source]=' . $termReference['source'] . '&' . $this->prefixId . '[uid]=' . $termReference['uid'];
@@ -354,15 +351,15 @@ class tx_contagged_pi1 extends tslib_pibase {
                                $imagesTitleText[] = str_replace(array(chr(10), chr(13)), ' ', $row['title'] . ' ');
                        }
                } else {
-                       $images = t3lib_div::trimExplode(',', $termArray['image'], 1);
+                       $images = GeneralUtility::trimExplode(',', $termArray['image'], 1);
                        $imagesWithPath = array();
                        foreach ($images as $image) {
                                $imagesWithPath[] = 'uploads/pics/' . $image;
                        }
                        $images = $imagesWithPath;
-                       $imagesCaption = t3lib_div::trimExplode(chr(10), $termArray['imagecaption']);
-                       $imagesAltText = t3lib_div::trimExplode(chr(10), $termArray['imagealt']);
-                       $imagesTitleText = t3lib_div::trimExplode(chr(10), $termArray['imagetitle']);
+                       $imagesCaption = GeneralUtility::trimExplode(chr(10), $termArray['imagecaption']);
+                       $imagesAltText = GeneralUtility::trimExplode(chr(10), $termArray['imagealt']);
+                       $imagesTitleText = GeneralUtility::trimExplode(chr(10), $termArray['imagetitle']);
                }
 
                if (!empty($images)) {
@@ -413,8 +410,8 @@ class tx_contagged_pi1 extends tslib_pibase {
                $indexArray = array();
                $reverseIndexArray = array();
                // Get localized index chars.
-               foreach (t3lib_div::trimExplode(',', $this->pi_getLL('indexChars')) as $key => $value) {
-                       $subCharArray = t3lib_div::trimExplode('|', $value);
+               foreach (GeneralUtility::trimExplode(',', $this->pi_getLL('indexChars')) as $key => $value) {
+                       $subCharArray = GeneralUtility::trimExplode('|', $value);
                        $indexArray[$subCharArray[0]] = NULL;
                        foreach ($subCharArray as $subChar) {
                                $reverseIndexArray[$subChar] = $subCharArray[0];
diff --git a/tca.php b/tca.php
index 15d2855..13f0a81 100644 (file)
--- a/tca.php
+++ b/tca.php
@@ -315,9 +315,6 @@ if ($extConfArray['getImagesFromDAM'] > 0 && t3lib_extMgm::isLoaded('dam')) {
        );
 }
 
-require_once (PATH_t3lib . 'class.t3lib_page.php');
-require_once (PATH_t3lib . 'class.t3lib_tstemplate.php');
-require_once (PATH_t3lib . 'class.t3lib_tsparser_ext.php');
-require_once(t3lib_extMgM::extPath('contagged') . 'tx_contagged_userfunction.php');
+require_once(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('contagged') . 'tx_contagged_userfunction.php');
 
 ?>
\ No newline at end of file
index 22656f1..1ca8944 100644 (file)
@@ -1,12 +1,10 @@
 <?php
 
 function user_addTermTypes(&$params, &$pObj) {
-       global $BE_USER;
-
-       $template = t3lib_div::makeInstance('t3lib_TStemplate');
+       $template = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\CMS\Core\TypoScript\TemplateService');
        $template->tt_track = 0;
        $template->init();
-       $sysPage = t3lib_div::makeInstance('t3lib_pageSelect');
+       $sysPage = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\CMS\Frontend\Page\PageRepository');
        $rootline = $sysPage->getRootLine(getCurrentPageId());
        $rootlineIndex = 0;
        foreach ($rootline as $index => $rootlinePart) {
@@ -38,12 +36,12 @@ function user_addTermTypes(&$params, &$pObj) {
 }
 
 function getCurrentPageId() {
-       $pageId = (integer)t3lib_div::_GP('id');
+       $pageId = (integer)\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('id');
        if ($pageId > 0) {
                return $pageId;
        }
 
-       preg_match('/(?<=id=)[0-9]a/', urldecode(t3lib_div::_GET('returnUrl')), $matches);
+       preg_match('/(?<=id=)[0-9]a/', urldecode(\TYPO3\CMS\Core\Utility\GeneralUtility::_GET('returnUrl')), $matches);
        if (count($matches) > 0) {
                return $matches[0];
        }