IMP The parser is now invoked also for bullet lists and headers (if <h[1-6]> is not...
authorjocrau <jocrau@735d13b6-9817-0410-8766-e36946ffe9aa>
Wed, 24 Sep 2008 09:18:53 +0000 (09:18 +0000)
committerBastian Bringenberg <spam@bastian-bringenberg.de>
Thu, 4 Dec 2014 23:56:05 +0000 (00:56 +0100)
IMP If maxRecurrences is set, the matches are now spread over the cObj constantly
FIX It's not necessary anymore to set maxRecurrences to invoke the parser

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

ChangeLog
class.tx_contagged.php
ext_emconf.php
static/constants.txt
static/setup.txt

index 4114a1e..dc44e84 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+v0.1.5 2008-09-24 Jochen Rau <j.rau@web.de>
+
+       * IMP The parser is now invoked also for bullet lists and headers (if <h[1-6]> is not an excluded tag)
+       * IMP If maxRecurrences is set, the matches are now spread over the cObj constantly
+       * FIX It's not necessary anymore to set maxRecurrences to invoke the parser
+       
 v0.1.4 2008-09-23 Jochen Rau <j.rau@web.de>
 
        * FIX Fixed typo in TS Setup
index 5838fe8..a75169c 100644 (file)
@@ -145,10 +145,11 @@ class tx_contagged extends tslib_pibase {
                $regEx = $this->getRegEx($term,$termKey,$typeConfigArray);
                preg_match_all($regEx,$content,$matchesArray,PREG_OFFSET_CAPTURE);
                $matchesArray = $matchesArray[0]; // only take the full pattern matches of the regEx
-               
+
                // determine the maximum of recurrences of the same term to be tagged
-               $maxRecurrences = $this->conf['maxRecurrences'] ? min($this->conf['maxRecurrences'], count($matchesArray)) : count($matchesArray);
-               for ($i=0; $i < $maxRecurrences; $i++) {
+               $maxRecurrences = (!empty($this->conf['maxRecurrences'])) ? min($this->conf['maxRecurrences'], count($matchesArray)) : count($matchesArray);
+               $step = $maxRecurrences != 0 ? ceil(count($matchesArray) / $maxRecurrences) : 1;
+               for ($i=0; $i < count($matchesArray); $i = $i + $step) {
                        $preContent = substr($content,0,$matchesArray[$i][1]);
                        $postContent = substr($content,strlen($matchesArray[$i][0])+$matchesArray[$i][1]);
 
index 010c65e..22ad22a 100644 (file)
@@ -3,7 +3,7 @@
 ########################################################################
 # Extension Manager/Repository config file for ext: "contagged"
 #
-# Auto generated 23-09-2008 19:37
+# Auto generated 24-09-2008 11:18
 #
 # Manual updates:
 # Only the data in the array - anything else is removed by next write.
@@ -15,7 +15,7 @@ $EM_CONF[$_EXTKEY] = array(
        'description' => '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\').',
        'category' => 'fe',
        'shy' => 0,
-       'version' => '0.1.4',
+       'version' => '0.1.5',
        'dependencies' => '',
        'conflicts' => '',
        'priority' => '',
@@ -40,7 +40,7 @@ $EM_CONF[$_EXTKEY] = array(
                'suggests' => array(
                ),
        ),
-       '_md5_values_when_last_written' => 'a:23:{s:9:"ChangeLog";s:4:"e047";s:10:"README.txt";s:4:"72b7";s:22:"class.tx_contagged.php";s:4:"f4cd";s:21:"ext_conf_template.txt";s:4:"0086";s:12:"ext_icon.gif";s:4:"50a3";s:17:"ext_localconf.php";s:4:"d45d";s:14:"ext_tables.php";s:4:"022c";s:14:"ext_tables.sql";s:4:"3600";s:27:"icon_tx_contagged_terms.gif";s:4:"50a3";s:16:"locallang_db.xml";s:4:"750b";s:7:"tca.php";s:4:"b9b2";s:14:"doc/manual.sxw";s:4:"0774";s:23:"doc/realurl_example.php";s:4:"7ef3";s:16:"js/selecttext.js";s:4:"1179";s:41:"model/class.tx_contagged_model_mapper.php";s:4:"8ead";s:40:"model/class.tx_contagged_model_terms.php";s:4:"a8ed";s:30:"pi1/class.tx_contagged_pi1.php";s:4:"6370";s:18:"pi1/contagged.tmpl";s:4:"4d1f";s:17:"pi1/locallang.xml";s:4:"1a34";s:20:"static/constants.txt";s:4:"973c";s:16:"static/setup.txt";s:4:"97ff";s:20:"static/css/setup.txt";s:4:"fd93";s:25:"static/examples/setup.txt";s:4:"b39c";}',
+       '_md5_values_when_last_written' => 'a:23:{s:9:"ChangeLog";s:4:"a60d";s:10:"README.txt";s:4:"72b7";s:22:"class.tx_contagged.php";s:4:"883c";s:21:"ext_conf_template.txt";s:4:"0086";s:12:"ext_icon.gif";s:4:"50a3";s:17:"ext_localconf.php";s:4:"d45d";s:14:"ext_tables.php";s:4:"022c";s:14:"ext_tables.sql";s:4:"3600";s:27:"icon_tx_contagged_terms.gif";s:4:"50a3";s:16:"locallang_db.xml";s:4:"750b";s:7:"tca.php";s:4:"b9b2";s:14:"doc/manual.sxw";s:4:"0774";s:23:"doc/realurl_example.php";s:4:"7ef3";s:16:"js/selecttext.js";s:4:"1179";s:41:"model/class.tx_contagged_model_mapper.php";s:4:"8ead";s:40:"model/class.tx_contagged_model_terms.php";s:4:"a8ed";s:30:"pi1/class.tx_contagged_pi1.php";s:4:"6370";s:18:"pi1/contagged.tmpl";s:4:"4d1f";s:17:"pi1/locallang.xml";s:4:"1a34";s:20:"static/constants.txt";s:4:"f729";s:16:"static/setup.txt";s:4:"9077";s:20:"static/css/setup.txt";s:4:"fd93";s:25:"static/examples/setup.txt";s:4:"b39c";}',
        'suggests' => array(
        ),
 );
index a97a1d5..ddd6eb8 100644 (file)
@@ -29,8 +29,8 @@ contagged {
        # cat=plugin.contagged//46; type=int; label=[Storage PIDs)]:A comma separated list of pages or sysFolders (PIDs) the data is stored. This could be overwritten by the type configuration or the data source configuration.
        storagePids = 
 
-       # cat=plugin.contagged//48; type=boolean; label=[Max. Recurrencies]: The maximum number of terms to be tagged in a cObject.
-       maxRecurrencies = 
+       # cat=plugin.contagged//48; type=boolean; label=[Max. Recurrences]: The maximum number of terms to be tagged in a cObject.
+       maxRecurrences = 
 
        # cat=plugin.contagged//50; type=boolean; label=[Check for joined words]: Take pre- and/or post-matches of joined words (with dash) into account (see documentation for examples).
        checkPreAndPostMatches = 1
index 3bb0c0f..2b7e115 100644 (file)
@@ -3,7 +3,10 @@
 # include class tx_contagged as library 
 includeLibs.tx_contagged = EXT:contagged/class.tx_contagged.php
 
+# invoke the parser
+lib.stdheader.stdWrap.postUserFunc = tx_contagged->main
 tt_content.text.20.postUserFunc = tx_contagged->main
+tt_content.bullets.20.postUserFunc = tx_contagged->main
 
 plugin.tx_contagged {
        templateFile = {$contagged.templateFile}
@@ -50,7 +53,7 @@ plugin.tx_contagged {
 
                abbrevation {
                        label = Abbrevation
-                       label.de = Abk├╝rzung (Beispiel: u.s.w.)
+                       label.de = Abk├╝rzung (Beispiel: u.s.w.)                 
                        tag = abbr
                }