[+BUGFIX] Fixed registration of termKey.
authorjocrau <jocrau@735d13b6-9817-0410-8766-e36946ffe9aa>
Fri, 5 Feb 2010 23:51:55 +0000 (23:51 +0000)
committerBastian Bringenberg <spam@bastian-bringenberg.de>
Thu, 4 Dec 2014 23:56:07 +0000 (00:56 +0100)
[+TASK] Some refactoring.

git-svn-id: https://svn.typo3.org/TYPO3v4/Extensions/contagged/trunk@29747 735d13b6-9817-0410-8766-e36946ffe9aa

model/class.tx_contagged_model_mapper.php
model/class.tx_contagged_model_terms.php
pi1/class.tx_contagged_pi1.php

index 80d7d8d..1e2ee12 100644 (file)
@@ -51,15 +51,14 @@ class tx_contagged_model_mapper implements t3lib_Singleton {
         */
        function getDataArray($result,$dataSource) {
                $dataArray = array();
-
                $dataSourceConfigArray = $this->conf['dataSources.'][$dataSource . '.'];
-               $sourceName = $dataSourceConfigArray['sourceName'];
 
                // add additional fields configured in the mapping configuration of the data source
-               $fieldsToMapfromTS = t3lib_div::trimExplode(',', $this->conf['fieldsToMap'], 1);
+               $fieldsToMapArray = array();
                foreach ($dataSourceConfigArray['mapping.'] as $fieldToMap => $value) {
                                $fieldsToMapArray[] = substr($fieldToMap,0,-1);
                }
+               $fieldsToMapfromTS = t3lib_div::trimExplode(',', $this->conf['fieldsToMap'], 1);
                foreach ($fieldsToMapfromTS as $key => $fieldToMap) {
                        if ( !t3lib_div::inArray($fieldsToMapArray,$fieldToMap) ) {
                                $fieldsToMapArray[] = $fieldToMap;
@@ -89,7 +88,6 @@ class tx_contagged_model_mapper implements t3lib_Singleton {
                                $GLOBALS['TSFE']->register['contagged_'.$field] = $mappedDataArray[$field];
                        }
                        // TODO $desc_long = preg_replace('/(\015\012)|(\015)|(\012)/ui','<br />',$row['desc_long']);
-                       $typeConfigArray = $this->conf['types.'][$mappedDataArray['term_type'].'.'];
 
                        // post processing
                        $mappedDataArray['term_alt'] = t3lib_div::trimExplode(chr(10),$row['term_alt'],1);
index 1d31378..e12d527 100644 (file)
@@ -146,7 +146,7 @@ class tx_contagged_model_terms implements t3lib_Singleton {
                }
                if (is_array($mappedResult)) {
                        foreach ($mappedResult as $result) {
-                               $dataArray[$result['sourceName'] . '_' . $result['uid']] = $result;
+                               $dataArray[$result['source'] . '_' . $result['uid']] = $result;
                        }
                }
                // TODO piVars as a data source
index eee27fe..276b87a 100644 (file)
@@ -260,7 +260,8 @@ class tx_contagged_pi1 extends tslib_pibase {
                $markerArray['###TERM###'] = $termArray['term'];
                $editIconsConf = array(
                        'styleAttribute' => '',
-                       );              $markerArray['###TERM_KEY###'] = $termArray['source'] . '_' . $termArray['uid'];
+                       );
+               $markerArray['###TERM_KEY###'] = $termArray['source'] . '_' . $termArray['uid'];
                $markerArray['###TERM###'] = $this->cObj->editIcons($termArray['term'],'tx_contagged_terms:term_main,term_alt,term_type,term_lang,term_replace,desc_short,desc_long,image,dam_images,imagecaption,imagealt,imagetitle,related,link,exclude',$editIconsConf,'tx_contagged_terms:'.$termArray['uid']);
                $markerArray['###TERM_MAIN###'] = $termArray['term_main'];
                $markerArray['###TERM_ALT###'] = $termArray['term_alt']?implode(', ',$termArray['term_alt']):$this->pi_getLL('na');