[~CONFIGURATION] Re-enabled lib.parsefunc_RTE for long description in list view....
authorjocrau <jocrau@735d13b6-9817-0410-8766-e36946ffe9aa>
Fri, 5 Feb 2010 23:51:47 +0000 (23:51 +0000)
committerBastian Bringenberg <spam@bastian-bringenberg.de>
Thu, 4 Dec 2014 23:56:07 +0000 (00:56 +0100)
[+TASK] Added upgrade README.

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

ChangeLog
README.txt
class.tx_contagged.php
doc/cooluri_example.xml
doc/realurl_example.php
model/class.tx_contagged_model_mapper.php
model/class.tx_contagged_model_terms.php
pi1/class.tx_contagged_pi1.php
pi1/contagged.tmpl
static/setup.txt

index cac3a73..7ce4c75 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,10 +1,11 @@
-v1.5.1 2010-01-25 Jochen Rau <jochen.rau@typoplanet.de>
+v1.5.1 2010-01-26 Jochen Rau <jochen.rau@typoplanet.de>
 
        [+TASK] Performance optimization and refactorings after an extensive profiling session.
        [-CONFIGURATION] Removed option 'secureFields'.
-       [+CONFIGURATION] Added option 'fieldsToParse' (comma separated list of fields to be parsed by contagged again in list view).
-       [-CONFIGURATION] The long description is not pardes via lib.parseFunc_RTE by default anymore (due to performance reasons). You have to uncomment the appropriate line in the TS setup. It's recommended to do so only on pages where the long description is displayed.
-
+       [!!!][+CONFIGURATION] Added option 'fieldsToParse' (comma separated list of fields to be parsed by contagged again in list view).
+       [!!!][~CONFIGURATION] The long description is parsed via lib.parseFunc_RTE by default only in list view. You have to uncomment the appropriate line in the TS setup if you need this also for "normal" pages.
+       [!!!][~CONFIGURATION] The TS name of the datasource is taken as GET parameter value for 'source' (was the table name). Instead of 'tx_contagged[source]=tx-contagged_terms' there is now 'tx_contagged[source]=default'. The registered key and internal referrer (register:contagged_key) is now 'default_123' instead of 'tx_contagged_term_123'.
 v1.5.0 2010-01-09 Jochen Rau <jochen.rau@typoplanet.de>
 
        [~TASK] Deployed version 1.5.0 to TER. Tagged version 1.5.0.
index 6dac0b0..c698bb8 100644 (file)
@@ -1 +1,9 @@
-This extension parses your content to tag, replace and link specific terms. It is useful to auto-generate a glossary - but not only. See \'ChangeLog\' and WiKi (\'http://wiki.typo3.org/index.php/Contagged\'). Needs PHP >5.1.0.
\ No newline at end of file
+This extension parses your content to tag, replace and link specific terms. It is useful to auto-generate a glossary - but not only. See \'ChangeLog\' and WiKi (\'http://wiki.typo3.org/index.php/Contagged\'). Needs PHP >5.1.0.
+
+== UPGRADE INSTRUCTIONS ==
+
+1.5.0 -> 1.6.0
+- The keys of the GET parameters have changed from 'termUid' to 'uid' and from 'termSource' to 'source'. Adapt your RealURL and CoolURI configuration.
+- The TS name of the datasource is taken as GET parameter value for 'source' (was the table name). Instead of 'tx_contagged[source]=tx-contagged_terms' there is now 'tx_contagged[source]=default'.
+- The registered key and internal referrer (register:contagged_key) is now 'default_123' instead of 'tx_contagged_term_123'.
+- You have to explicitly invoke the parser if contagged should parse also its list content. There is a new TS option 'fieldsToParse' for that.
index e47b5ea..49cf1bf 100644 (file)
@@ -280,9 +280,9 @@ class tx_contagged extends tslib_pibase {
                $currentRecord = t3lib_div::trimExplode(':', $this->cObj->currentRecord);
                $GLOBALS['T3_VAR']['ext']['contagged']['index'][$GLOBALS['TSFE']->id][$termKey] = array(
                        'matchedTerm' => $matchedTerm,
-                       'termSourceName' => $this->termsArray[$termKey]['sourceName'],
-                       'termUid' => $this->termsArray[$termKey]['uid'],
-                       'currentRecordSourceName' => $currentRecord[0],
+                       'source' => $this->termsArray[$termKey]['source'],
+                       'uid' => $this->termsArray[$termKey]['uid'],
+                       'currentRecordSource' => $currentRecord[0],
                        'currentRecordUid' => $currentRecord[1],
                        'currentPid' => $GLOBALS['TSFE']->id
                        );
@@ -392,7 +392,7 @@ class tx_contagged extends tslib_pibase {
                                }
                        }
                        $additionalParams = array(
-                               'source' => $termArray['sourceName'],
+                               'source' => $termArray['source'],
                                'uid' => $termArray['uid'],
                                );
                        if ($this->checkLocalGlobal($typeConfigArray,'addBackLink')) {
index 0259b90..9d848d3 100755 (executable)
@@ -31,7 +31,7 @@
  
   <uriparts>
     <part>
-      <parameter>tx_contagged[key]</parameter>
+      <parameter>tx_contagged[uid]</parameter>
       <lookindb>
         <to>SELECT term_main FROM tx_contagged_terms WHERE uid=$1</to>
         <translatetoif>
index e122a4f..cdac545 100644 (file)
@@ -59,12 +59,12 @@ $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl'] = array (
                 ),                               
                'source' => array (
                     array (
-                          'GETvar' => 'tx_contagged[termSource]',              
+                          'GETvar' => 'tx_contagged[source]',              
                     ),                           
                 ),
                                'term' => array (
                     array (                      
-                       'GETvar' => 'tx_contagged[termUid]',
+                       'GETvar' => 'tx_contagged[uid]',
                           'lookUpTable' => array (
                               'table' => 'tx_contagged_terms',
                               'id_field' => 'uid',
index 050af97..80d7d8d 100644 (file)
@@ -73,7 +73,7 @@ class tx_contagged_model_mapper implements t3lib_Singleton {
                        $term = $row[$termReplace] ? $row[$termReplace] : $row[$termMain];
                        $mappedDataArray = array();
                        $mappedDataArray['term'] = $term;
-                       $mappedDataArray['sourceName'] = $dataSource;
+                       $mappedDataArray['source'] = $dataSource;
                        foreach ( $fieldsToMapArray as $field) {
                                $value = $dataSourceConfigArray['mapping.'][$field.'.'];
                                if ( $value['value'] ) {
index 4614a32..1d31378 100644 (file)
@@ -35,7 +35,6 @@ class tx_contagged_model_terms implements t3lib_Singleton {
        var $controller;
        var $tablesArray = array(); // array of all tables in the database
        var $dataSourceArray = array();
-       var $cachedSources = array();
        var $terms = array();
        var $configuredSources = array();
        var $listPagesCache = array();
@@ -77,28 +76,28 @@ class tx_contagged_model_terms implements t3lib_Singleton {
                
        }
 
-       function findAllTerms() {
-               foreach ($this->dataSourceArray as $dataSource => $storagePidsArray ) {
-                       $this->terms = array_merge($this->terms, $this->fetchTermsFromSource($dataSource,$storagePidsArray));
+       function findAllTerms($additionalWhereClause = '') {
+               if (empty($this->terms)) {
+                       foreach ($this->dataSourceArray as $dataSource => $storagePidsArray ) {
+                               $this->terms = array_merge($this->terms, $this->fetchTermsFromSource($dataSource,$storagePidsArray));
+                       }
                }
                return $this->terms;
        }
        
        function findAllTermsToListOnPage($pid = NULL) {
+               $terms = $this->findAllTerms(' AND exclude=0');
                if ($pid === NULL) $pid = $GLOBALS['TSFE']->id;
-               foreach ($this->dataSourceArray as $dataSource => $storagePidsArray ) {
-                       $this->terms = array_merge($this->terms, $this->fetchTermsFromSource($dataSource, $storagePidsArray, ' AND exclude=0'));
-               }
-               $terms = array();
-               foreach ($this->terms as $key => $term) {
+               $filteredTerms = array();
+               foreach ($terms as $key => $term) {
                        $typeConfigurationArray = $this->conf['types.'][$term['term_type'] . '.'];
                        $listPidsArray = $this->getListPidsArray($term['term_type']);
                        if (($typeConfigurationArray['dontListTerms'] == 0) && (in_array($pid, $listPidsArray) || is_array($GLOBALS['T3_VAR']['ext']['contagged']['index'][$pid][$key])) ) {
-                               $terms[$key] = $term;
+                               $filteredTerms[$key] = $term;
                        }
                }
-               uasort($terms, array($this, 'sortByTermAscending'));
-               return $terms;
+               uasort($filteredTerms, array($this, 'sortByTermAscending'));
+               return $filteredTerms;
        }
 
        function sortByTermAscending($termArrayA, $termArrayB) {
@@ -126,25 +125,24 @@ class tx_contagged_model_terms implements t3lib_Singleton {
        function fetchTermsFromSource($dataSource, $storagePidsArray= array(), $additionalWhereClause = '') {
                $dataArray = array();
                $dataSourceConfigArray = $this->conf['dataSources.'][$dataSource . '.'];
-               $sourceName = $dataSourceConfigArray['sourceName'];
+               $tableName = $dataSourceConfigArray['sourceName'];
                // check if the table exists in the database
-               if (array_key_exists($sourceName, $this->tablesArray) ) {                               
+               if (array_key_exists($tableName, $this->tablesArray) ) {                                
                        // Build WHERE-clause
                        $whereClause = '1=1';
                        $whereClause .= count($storagePidsArray) > 0 ? ' AND pid IN (' . implode(',',$storagePidsArray) . ')' : '';
                        $whereClause .= $dataSourceConfigArray['hasSysLanguageUid'] ? ' AND (sys_language_uid=' . intval($GLOBALS['TSFE']->sys_language_uid) . ' OR sys_language_uid=-1)' : '';
-                       $whereClause .= $this->cObj->enableFields($sourceName);
+                       $whereClause .= $this->cObj->enableFields($tableName);
                        $whereClause .= $additionalWhereClause;
 
                        // execute SQL-query
                        $result = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
                                '*', // SELECT ...
-                               $sourceName, // FROM ...
+                               $tableName, // FROM ...
                                $whereClause // WHERE ..
                                );
                        // map the fields
                        $mappedResult = $this->mapper->getDataArray($result,$dataSource);
-                       $this->cachedSources[] = $sourceName;
                }
                if (is_array($mappedResult)) {
                        foreach ($mappedResult as $result) {
index e8eed56..1b5b374 100644 (file)
@@ -261,12 +261,13 @@ class tx_contagged_pi1 extends tslib_pibase {
                $editIconsConf = array(
                        'styleAttribute' => '',
                        );
+               $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');
                $markerArray['###TERM_REPLACE###'] = $termArray['term_replace']?$termArray['term_replace']:$this->pi_getLL('na');
                $markerArray['###DESC_SHORT###'] = $termArray['desc_short']?$termArray['desc_short']:$this->pi_getLL('na');
-               $markerArray['###DESC_LONG###'] = $termArray['desc_long']?$termArray['desc_long']:$this->pi_getLL('na');
+               $markerArray['###DESC_LONG###'] = $termArray['desc_long']?$this->cObj->parseFunc($termArray['desc_long'], array(), '< lib.parseFunc_RTE'):$this->pi_getLL('na');
                $markerArray['###IMAGES###'] = $this->renderImages($termArray);
                $markerArray['###RELATED###'] = $this->renderRelated($termArray);
                $markerArray['###TERM_LANG###'] = $this->pi_getLL('lang.'.$termArray['term_lang'])?$this->pi_getLL('lang.'.$termArray['term_lang']):$this->pi_getLL('na');
index 2884b04..5bbadd8 100644 (file)
@@ -17,6 +17,7 @@
 
        <h2>Markers</h2>
        <pre>
+               ###TERM_KEY###
                ###TERM_LABEL### ###TERM###
                ###TERM_TYPE_LABEL######TERM_TYPE###
                ###TERM_MAIN_LABEL######TERM_MAIN###
index 6734843..b53383d 100644 (file)
@@ -2,14 +2,14 @@
 includeLibs.tx_contagged = EXT:contagged/class.tx_contagged.php
 
 # invoke the parser
-lib.stdheader.stdWrap.postUserFunc = tx_contagged->main
+lib.stdheader.stdWrap.postUserFunc = tx_contagged->main
 tt_content {
        text.20.postUserFunc = tx_contagged->main
-       bullets.20.postUserFunc = tx_contagged->main
-       table.20.stdWrap.postUserFunc = tx_contagged->main
-       uploads.20.itemRendering.20.2.postUserFunc = tx_contagged->main
-       image.20.caption.1.postUserFunc = tx_contagged->main
-       html.postUserFunc = tx_contagged->main
+       bullets.20.postUserFunc = tx_contagged->main
+       table.20.stdWrap.postUserFunc = tx_contagged->main
+       uploads.20.itemRendering.20.2.postUserFunc = tx_contagged->main
+       image.20.caption.1.postUserFunc = tx_contagged->main
+       html.postUserFunc = tx_contagged->main
 }
 
 plugin.tx_contagged {