Updated to v0.1.0 (beta)
authorjocrau <jocrau@735d13b6-9817-0410-8766-e36946ffe9aa>
Sun, 31 Aug 2008 21:01:38 +0000 (21:01 +0000)
committerBastian Bringenberg <spam@bastian-bringenberg.de>
Thu, 4 Dec 2014 23:56:05 +0000 (00:56 +0100)
git-svn-id: https://svn.typo3.org/TYPO3v4/Extensions/contagged/trunk@11570 735d13b6-9817-0410-8766-e36946ffe9aa

22 files changed:
ChangeLog
README.txt
class.tx_contagged.php
doc/manual.sxw
doc/wizard_form.dat [deleted file]
doc/wizard_form.html [deleted file]
ext_conf_template.txt
ext_emconf.php
ext_localconf.php
ext_tables.php
js/selecttext.js [new file with mode: 0644]
locallang_db.xml
model/class.tx_contagged_model_mapper.php
model/class.tx_contagged_model_terms.php
pi1/class.tx_contagged_pi1.php
pi1/contagged.tmpl
pi1/locallang.xml
static/constants.txt
static/css/setup.txt
static/examples/setup.txt [new file with mode: 0755]
static/setup.txt
tca.php

index a773d9f..5fdb65d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,8 +1,55 @@
-v0.0.14 2007-10-07 Jochen Rau <j.rau@web.de>
-
-       * IMP Better support for multibyte character sets (used t3lib_cs instead of native strlen() and substr())
+v0.1.0 2008-08-31 Jochen Rau <j.rau@web.de>
+
+       * CHG Changed status to "beta"
+
+v0.0.18 2008-08-31 Jochen Rau <j.rau@web.de>
+
+       * ADD fieldsToEdit
+       * ADD New data source "references" added to experimental types
+       * CHG Cleaned up template file
+       * ADD Phrases can now be added by selecting them (experimental)
+       * ADD Terms can now be edited in the FE-list and in the content elements (you have to enable Admin Panel Editing)
+       * CHG Activated keywords option
+       * CHG Changed the way to generate links
+
+v0.0.17 2008-02-14 Jochen Rau <j.rau@web.de>
+
+       * CHG Major revision of the parser; refactured code
+       * ADD Support for tt_news (be sure to add the static template of contagged after the static template of tt_news)
+       * FIX Link "More Details" showed list instead of extended single view if $termKey was "0"
+       * CHG Set autoExcludeTags = 1 to avoid nested parsing
+       * ADD Documentation (http://wiki.typo3.org/Contagged)
+       * ADD Added index for numbers "0-9"
+       * FIX Keywords stored in "contagged_keywords" (table "pages") are now taken from the whole page and not only from the last cObj that has been parsed
+       * FIX Uppercase handling of replaced term
+       * FIX Fixed inifinite loop caused by incorrect mapping (only PHP >5.2.2)
+       * CHG Secured fields are now term_main,term_alt,desc_short in the standard configuration
+       * RMV special exclude tag "exparse" was removed
+       * CHG listPage changed to listPages; more than one list page per type can be defined (comma separated); the first list page will be linked (if you want)
+       * FIX List pages show only those types of terms that are pointing to them (listPages)
+       * CHG If there are alternative terms: the longest takes precedence while parsing
+       * CHG Fields are not htmlspecialchared by default anymore
+       * CHG Experimental type definitions are now stored in a separate static template (to be included as usual)
+
+v0.0.16 2007-12-05 Jochen Rau <j.rau@web.de>
+
+       * FIX Small bugfix to avoid inaccurate parsing inside a tag
+
+v0.0.15 2007-10-19 Jochen Rau <j.rau@web.de>
+
+       * FIX Localization of the labels (BE) now depends on the BE-user settings
+       * RMV Removed obsolete parameter "backendLanguage" from TS Setup
+       * CHG Encoding of the file EXT:static/setup.txt is now iso-8859-1
+       * CHG The term is linked even if there is no long description (desc_long)
+       * FIX Part of a joined word is no longer disappearing, if the term is replaced
+       * ADD Support for tx_categories; you have to define the proper storage pid of the hidden sysFolder (tx_categories is an experimental extension maintained by Mads Brunn; not in TER; see TYP3_ect on news.netfielder.de)
+       * FIX Keys of $termsArray are no longer overwritten, if more than one data source is configured
+
+v0.0.14 2007-10-09 Jochen Rau <j.rau@web.de>
+
+       * IMP Better support for multibyte character sets (using t3lib_cs instead of native strlen() and substr())
        * FIX Link "back to page ..." in FE-Plugin
-       * CHG Sorting of terms
+       * CHG Sorting of terms (not improved yet)
 
 v0.0.13 2007-10-06 Jochen Rau <j.rau@web.de>
 
index e19ba6a..6dac0b0 100644 (file)
@@ -1 +1 @@
-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 >4.4.0 or >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.
\ No newline at end of file
index 7c8b408..4d26320 100644 (file)
        *
        *  This script is distributed in the hope that it will be useful,
        *  but WITHOUT ANY WARRANTY; without even the implied warranty of
-       *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+       *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
        *  GNU General Public License for more details.
        *
        *  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');
+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');
 
 /**
      * The main class to parse,tag and replace specific terms of the content.
-       * 
      * @author       Jochen Rau <j.rau@web.de>
      * @package      TYPO3
      * @subpackage   tx_contagged
      */
+ * The main class to parse,tag and replace specific terms of the content.
+ *
* @author     Jochen Rau <j.rau@web.de>
* @package TYPO3
* @subpackage tx_contagged
+ */
 class tx_contagged extends tslib_pibase {
        var $prefixId = 'tx_contagged';
        var $scriptRelPath = 'class.tx_contagged.php'; // path to this script relative to the extension dir
        var $extKey = 'contagged'; // the extension key
-       var $pi_checkCHash = true;
        var $conf; // the TypoScript configuration array
-       var $termsFoundArray = array(); // an array of main terms for each term found in the cObj
-       var $specialExcludeTag = 'exparse'; // content tagged by <exparse>|</exparse> will not be parsed
 
        /**
-               * The method for parsing, tagging and linking the terms in a cObj
-               *
-               * @param        string          $content: The content of the cObj
-               * @return       The parsed and tagged content that is displayed on the website
-               */
+        * The main method to parse, tag and link terms
+        *
+        * @param       string          $content: The content
+        * @param       array           $conf: The configuration array
+        * @return      string          The parsed and tagged content that is displayed on the website
+        */
        function main($content,$conf) {
                $this->conf = $GLOBALS['TSFE']->tmpl->setup['plugin.'][$this->prefixId.'.'];
-
+               
                // exit if the content should be skipped
-               if ($this->isContentToSkip()) {
-                       return $content;
-                       exit;
-               }
+               if ($this->isContentToSkip()) return $content;
+               
+               $GLOBALS['TSFE']->additionalHeaderData['tx_contagged'] = '<script type="text/javascript" src="'.t3lib_extMgm::siteRelPath('contagged').'js/selecttext.js"></script>';
+               $GLOBALS['TSFE']->JSeventFuncCalls['onload']['tx_contagged'] = 'init_getSelectedText();';
+               // $GLOBALS['TSFE']->JSeventFuncCalls['onmouseup']['tx_contagged'] = 'getSelectedText();';
+               // $GLOBALS['TSFE']->divSection = '<span id="tx_contagged_new" style="visibility:hidden;position:relative;top:280px;left:10px;z-index:1000;"></span>';
+
+               // TODO "New" icon
+               $storagePids = t3lib_div::trimExplode(',',$this->conf['storagePids'],1);
+               $mainStoragePid = $storagePids[0];
+               $panelConf = array(
+                               'newRecordFromTable' => 'tx_contagged_terms',
+                               'newRecordInPid' => $mainStoragePid,
+                               );
+               $innerHTML = $this->cObj->editPanel('',$panelConf,'');
+               $GLOBALS['TSFE']->divSection = '<div id="tx_contagged_panel" class="" style="visibility:hidden;position:absolute;width:0px;top:0;left:0;z-index:1000;">'.$innerHTML.'</div>';
+               
 
                // get an array of all type configurations
-               $typesArray = $this->conf['types.'];
-               
+               $this->typesArray = $this->conf['types.'];
+
                // get the model (an associated array of terms)
-               $model = new tx_contagged_model_terms($this);
-               $termsArray = $model->getAllTerms();
-               
+               $modelClassName = t3lib_div::makeInstanceClassName('tx_contagged_model_terms');
+               $model = new $modelClassName($this);
+               $this->termsArray = $model->getTermsArray();
+
                // get a comma separated list of all tags which should be omitted
                $tagsToOmitt = $this->getTagsToOmitt();
-               // debug($termsArray); return $content; exit;
 
-               // iterate through all terms
-               foreach ($termsArray as $termArray) {
+               // TODO split recursively
+               $parseObj = t3lib_div::makeInstance('t3lib_parsehtml');
+               $content = $parseObj->splitIntoBlock($tagsToOmitt,$content);
+               // debug($content);
+               foreach($content as $intKey => $HTMLvalue) {
+                       if (!($intKey%2)) {
+                               $positionsArray = array();
+                               // iterate through all terms
+                               // debug($this->termsArray);
+                               foreach ($this->termsArray as $termKey=>$termArray) {
+                                       // get the maximum amount of replaced terms
+                                       $maxOccur = $this->typesArray[$termArray['term_type'] . '.']['maxOccur'] ? (int)$typeConfigArray['maxOccur'] : 9999;
+                                       
+                                       $typeConfigArray = $this->typesArray[$termArray['term_type'] . '.'];
+                                       
+                                       $terms = array();
+                                       $terms[] = $termArray['term_main'];
+                                       if ( $termArray['term_alt'] ) {
+                                               $terms = array_merge($terms,$termArray['term_alt']);
+                                       }
+                                       // sort the array descending by length of the value, so the longest term will match
+                                       usort($terms,array($this,'sortArrayByLengthDescending'));
+                                       foreach ( $terms as $term ) {
+                                               $this->getPositions($content[$intKey],&$positionsArray,$typeConfigArray,$term,$termArray,$termKey,$regEx,$tagsToOmitt,$maxOccur);
+                                       }
+                               }
+                               // debug($content[$intKey]);
+                               ksort($positionsArray);
+                               // debug($positionsArray);
+                               $content[$intKey] = $this->doReplace($content[$intKey],$positionsArray);                        
+                       }
+               }
+               $content = implode('',$content);
+               
 
-                       unset($typeConfigArray);
-                       $typeConfigArray = $typesArray[$termArray['term_type'] . '.'];
+               // update the keywords (field "tx_contagged_keywords" in table "page")
+               if ($this->conf['updateKeywords']>0) {
+                       $this->insertKeywords();
+               }
 
-                       $this->registerFields($typeConfigArray,$termArray);
+               return $content;
 
-                       // build the tag enclosing the term
-                       if ( !empty($typeConfigArray['tag']) ) {
-                               // get the attributes
-                               $langAttribute = $this->getLangAttribute($typeConfigArray,$termArray);
-                               $titleAttribute = $this->getTitleAttribute($typeConfigArray,$termArray);
-                               $cssClassAttribute = $this->getCssClassAttribute($typeConfigArray,$termArray);
-                               // concatenate the tag
-                               $before = '<' . $typeConfigArray['tag'] . $titleAttribute . $cssClassAttribute . $langAttribute . '>';
-                               $after = '</' . $typeConfigArray['tag'] . '>';
-                       }
+       }
+       
+       function sortArrayByLengthDescending($a,$b) {
+               if (strlen($a)==strlen($b)) {
+                       return 0;
+               }
+               
+               return strlen($a)<strlen($b) ? 1 : -1;
+       }
 
-                       // get the maximum amount of replaced terms
-                       $maxOccur = $typeConfigArray['maxOccur'] ? (int)$typeConfigArray['maxOccur'] : 9999;
+       function getRegEx($term,$termKey,$typeConfigArray) {
+               $termArray = $this->termsArray[$termKey];
+               // stdWrap for the term to search for; usefull to realize custom tags like <person>|</person>
+               $regExTerm = $this->cObj->stdWrap($term,$typeConfigArray['termStdWrap.']);
+               $regEx = '';
+               if ( $this->checkLocalGlobal($typeConfigArray,'termIsRegEx')>0 ) {
+                       $regEx = $termArray['term_main'].$this->conf['modifier'];
+               } else {
+                       $regEx = '/(?<=\P{L}|^)' . preg_quote($regExTerm,'/') . '(?=\P{L}|$)/'.$this->conf['modifier'];
+               }
+               
+               return $regEx;
+       }
+
+       function getPositions($content,&$positionsArray,$typeConfigArray,$term,$termArray,$termKey,$regEx,$tagsToOmitt,$maxOccur) {
+               $regEx = $this->getRegEx($term,$termKey,$typeConfigArray);
+               // debug($regEx,2);
+               preg_match_all($regEx,$content,$matchesArray,PREG_OFFSET_CAPTURE);
+               $matchesArray = $matchesArray[0]; // only take the full pattern matches of the regEx
+               for ($i=0; $i < count($matchesArray); $i++) {
                        
-                       $terms = array();
-                       $terms = $termArray['term_alt'];
-                       $terms[] = $termArray['term_main'];
-                       foreach ( $terms as $term ) {
-                               $termsFound = 0; // reset the amount of terms found in a cObj
-                               
-                               // build main RegEx
-                               // stdWrap for the term to search for; usefull to realize custom tags like <person>|</person>
-                               $term = $this->cObj->stdWrap($term,$typeConfigArray['termStdWrap.']);
-                               if ( $this->checkLocalGlobal($typeConfigArray,'termIsRegEx')>0 ) {
-                                       $regEx = $termArray['term_main'];
-                               } else {
-                                       $regEx = '/(?<=\P{L}|^)' . preg_quote($term,'/') . '(?=\P{L}|$)/';
-                               }
+                       $preContent = substr($content,0,$matchesArray[$i][1]);
+                       $postContent = substr($content,strlen($matchesArray[$i][0])+$matchesArray[$i][1]);
 
-                               // TODO split recursively
-                               $parseObj = t3lib_div::makeInstance('t3lib_parsehtml');
-                               $content = $parseObj->splitIntoBlock($tagsToOmitt,$content);
-                               // debug($content);
-                               foreach($content as $intKey => $HTMLvalue) {
-                                       if (!($intKey%2)) {
-                                               // split the content in two pieces separated by the matched term
-                                               // this was inspired by class.tslib_content.php, line 4265ff
-                                               $newstring = '';
-                                               do {
-                                                       // split the content in two pieces separated by the term
-                                                       $pieces = preg_split( $regEx . $this->conf['modifier'], $content[$intKey], 2 );
-
-                                                       // Flag: $inTag=true if we are inside a tag < here we are > or if we are inside an entity (eg. &nbsp;)
-                                                       // first RegEx see "Friedl, Jeffrey: Reguläre Audrücke. p.204"
-                                                       if ( preg_match('/<("[^"]*"|\'[^\']*\'|[^\'">])*$/u',$pieces[0])>0 && preg_match('/^("[^"]*"|\'[^\']*\'|[^\'"<])*>/u',$pieces[1])>0 ) {
-                                                               $inTag = true;
-                                                       } elseif (preg_match('/&.{0,5}$/u',$pieces[0])>0 && preg_match('/^.{0,5};/u',$pieces[1])>0) {
-                                                               $inTag = true;
-                                                       } else {
-                                                               $inTag = false;
-                                                       }
-
-                                                       // support for joined words (with a dash)
-                                                       $preMatch = '';
-                                                       $postMatch = '';
-                                                       if ($this->checkLocalGlobal($typeConfigArray,'checkPreAndPostMatches')>0) {
-                                                               preg_match('/(?<=\P{L})[\p{L}\p{Pd}]*\p{Pd}$/Uuis', $pieces[0], $preMatch);
-                                                               preg_match('/^\p{Pd}[\p{L}\p{Pd}]*(?=\P{L})/Uuis', $pieces[1], $postMatch);                                                             
-                                                       }
-
-                                                       // add the first string ($pieces[0]) to the new string without the pre matched part
-                                                       $newstring .= $GLOBALS['TSFE']->csConvObj->substr('utf-8',$pieces[0],0,$GLOBALS['TSFE']->csConvObj->strlen('utf-8',$pieces[0])-$GLOBALS['TSFE']->csConvObj->strlen('utf-8',$preMatch[0]));
-
-                                                       // the term is handled as $matchedTerm, so it doesn't conflict with case (in)sensitivity of the RegEx
-                                                       $matchLength = $GLOBALS['TSFE']->csConvObj->strlen('utf-8',$content[$intKey]) - ($GLOBALS['TSFE']->csConvObj->strlen('utf-8',$pieces[0]) + $GLOBALS['TSFE']->csConvObj->strlen('utf-8',$pieces[1])) + $GLOBALS['TSFE']->csConvObj->strlen('utf-8',$preMatch[0]) + $GLOBALS['TSFE']->csConvObj->strlen('utf-8',$postMatch[0]);
-                                                       $matchedTerm = $GLOBALS['TSFE']->csConvObj->substr('utf-8',$content[$intKey], $GLOBALS['TSFE']->csConvObj->strlen('utf-8',$pieces[0])-$GLOBALS['TSFE']->csConvObj->strlen('utf-8',$preMatch[0]), $matchLength);
-                                                       // do something with the matched term (replace, stdWrap, link, tag)
-                                                       if ( trim($matchedTerm) && $inTag==false && ($termsFound<$maxOccur) ) {
-                                                               $this->replaceMatchedTerm(&$matchedTerm,$typeConfigArray,$termArray);
-                                                               $GLOBALS['TSFE']->register['contagged_matchedTerm'] = $matchedTerm;
-
-                                                               // call stdWrap to handle the matched term via TS BEFORE it is wraped with a-tags
-                                                               if ($typeConfigArray['preStdWrap.']) {
-                                                                       $matchedTerm = $this->cObj->stdWrap($matchedTerm,$typeConfigArray['preStdWrap.']);
-                                                               }
-
-                                                               $this->linkMatchedTerm(&$matchedTerm,$typeConfigArray,$termArray);
-
-                                                               // call stdWrap to handle the matched term via TS AFTER it was wrapped with a-tags
-                                                               if ($typeConfigArray['postStdWrap.'] or $typeConfigArray['stdWrap.']) {
-                                                                       $matchedTerm = $this->cObj->stdWrap($matchedTerm,$typeConfigArray['postStdWrap.']);
-                                                                       $matchedTerm = $this->cObj->stdWrap($matchedTerm,$typeConfigArray['stdWrap.']); // for compatibility with < v0.0.5
-                                                               }
-
-                                                               if ( !empty($typeConfigArray['tag']) ) {
-                                                                       $matchedTerm = $before . $matchedTerm . $after;
-                                                               }
-
-                                                               // TODO updated keywords are only taken from the last cObj that has been parsed
-                                                               // Build an array of terms found in the contentObject.
-                                                               // This will be used to store them as keywords of the page.
-                                                               $this->termsFoundArray[] = $termArray['term'];
-                                                               $termsFound++;
-                                                       }
-                                                       // concatenate the term again
-                                                       $newstring .= $matchedTerm;
-                                                       $content[$intKey] = $GLOBALS['TSFE']->csConvObj->substr('utf-8',$pieces[1],$GLOBALS['TSFE']->csConvObj->strlen('utf-8',$postMatch[0]));
-                                               } while ($pieces[1]);
-                                               $content[$intKey] = $newstring;
+                       // Flag: $inTag=true if we are inside a tag < here we are >
+                       $inTag = FALSE;
+                       if ( preg_match('/<[^<>]*$/u',$preContent)>0 && preg_match('/^[^<>]*>/u',$postContent)>0 ) {
+                               $inTag = TRUE;
+                       }
+                       if (!$inTag) {
+                               // support for joined words (with a dashes)
+                               $preMatch = '';
+                               $postMatch = '';
+                               if ($this->checkLocalGlobal($typeConfigArray,'checkPreAndPostMatches')>0) {
+                                       preg_match('/(?<=\P{L})[\p{L}\p{Pd}]*\p{Pd}$/Uuis', $preContent, $preMatch);
+                                       preg_match('/^\p{Pd}[\p{L}\p{Pd}]*(?=\P{L})/Uuis', $postContent, $postMatch);
+                               }
+                               $matchedTerm = $preMatch[0].$matchesArray[$i][0].$postMatch[0];
+                               $matchStart = $matchesArray[$i][1] - strlen($preMatch[0]);
+                               $matchEnd = $matchStart + strlen($matchedTerm);
+                               
+                               $isNested = FALSE;
+                               $checkArray = $positionsArray;
+                               foreach ($checkArray as $start => $value) {
+                                       $length = strlen($value['matchedTerm']);
+                                       $end = $start+$length;
+                                       if ( ($matchStart>=$start&&$matchStart<$end) || ($matchEnd>$start&&$matchEnd<=$end) ) {
+                                               $isNested = TRUE;
                                        }
                                }
-                               $content = implode('',$content);
+                               
+                               // change the sign of the matchStart if the matchedTerm is nested
+                               $matchStart = $isNested ? -$matchStart : $matchStart;
+                               $positionsArray[$matchStart] = array(
+                                       'termKey' => $termKey,
+                                       'matchedTerm' => $matchedTerm,
+                                       'preMatch' => $preMatch[0],
+                                       'postMatch' => $postMatch[0]
+                                       );
+                       }
+               }
+       }
+       
+       function doReplace($content,$positionsArray) {
+               $posStart = 0;
+               $newContent = '';
+               if($positionsArray){
+                       foreach ($positionsArray as $matchStart => $matchArray) {
+                               if ($matchStart>=0) { // ignore nested matches
+                                       // debug($matchArray,'match');
+                                       $matchLength = strlen($matchArray['matchedTerm']);
+                                       $termKey = $matchArray['termKey'];
+                                       $replacement = $this->getReplacement($termKey,$matchArray['matchedTerm'],$matchArray['preMatch'],$matchArray['postMatch']);
+                                       $replacementLength = strlen($replacement);
+                                       $newContent = $newContent.substr($content,$posStart,$matchStart-$posStart).$replacement;
+                                       $posStart = $matchStart+$matchLength;
+                               }
                        }
+                       $newContent = $newContent.substr($content,$posStart);
+               } else {
+                       $newContent = $content;
                }
+                                       
+               return $newContent;
+       }
 
-               // update the keywords (field "tx_contagged_keywords" in table "page")
-               if ($this->conf['updateKeywords'] > 0) {
-                       $this->insertKeywords();
+       /**
+        *      Do something with the matched term (replace, stdWrap, link, tag)
+        *
+        * @param int                   $termKey: the internal "uid" of the term (not related to the database uid)
+        * @param string                $matchedTerm: The matched term including pre and post matches
+        * @return string               The replaced, linked and tagged term
+        * @author Jochen Rau
+        */
+       function getReplacement($termKey,$matchedTerm,$preMatch,$postMatch) {
+               $termArray = $this->termsArray[$termKey];
+               $typeConfigArray = $this->typesArray[$termArray['term_type'] . '.'];
+               // debug($termArray);
+               // register the term array
+               $this->registerFields($typeConfigArray,$termKey);
+               
+               // build the tag enclosing the term
+               if ( !empty($typeConfigArray['tag']) ) {
+                       // get the attributes
+                       $langAttribute = $this->getLangAttribute($typeConfigArray,$termArray);
+                       $titleAttribute = $this->getTitleAttribute($typeConfigArray,$termArray);
+                       $cssClassAttribute = $this->getCssClassAttribute($typeConfigArray,$termArray);
+                       // concatenate the tag
+                       $before = '<' . $typeConfigArray['tag'] . $titleAttribute . $cssClassAttribute . $langAttribute . '>';
+                       $after = '</' . $typeConfigArray['tag'] . '>';
                }
 
-               return $content;
+               // replace matched term
+               if ( $this->checkLocalGlobal($typeConfigArray,'replaceTerm') && $termArray['term_replace'] ) {
+                       // if the first letter of the matched term is upper case
+                       // make the first letter of the replacing term also upper case
+                       // (\p{Lu} stands for "unicode letter uppercase")
+                       if ( preg_match('/^\p{Lu}/u',$matchedTerm)>0 ) {
+                               $matchedTerm = $preMatch . ucfirst($termArray['term_replace']) . $postMatch;
+                               // TODO ucfirst is not UTF8 safe; it depends on the locale settings (they could be ASCII)
+                       } else {
+                               $matchedTerm = $preMatch . $termArray['term_replace'] . $postMatch;
+                       }
+               }
+
+               $GLOBALS['TSFE']->register['contagged_matchedTerm'] = $matchedTerm;
+               if ( !$termArray['exclude'] && !$typeConfigArray['dontListTerms'] ) {
+                       $GLOBALS['TSFE']->register['contagged_termsFound'][] = strip_tags($matchedTerm);
+               }
+
+               // call stdWrap to handle the matched term via TS BEFORE it is wraped with a-tags
+               if ($typeConfigArray['preStdWrap.']) {
+                       $matchedTerm = $this->cObj->stdWrap($matchedTerm,$typeConfigArray['preStdWrap.']);
+               }
+
+               $matchedTerm = $this->linkMatchedTerm($matchedTerm,$typeConfigArray,$termKey);
+
+               // call stdWrap to handle the matched term via TS AFTER it was wrapped with a-tags
+               if ($typeConfigArray['postStdWrap.'] or $typeConfigArray['stdWrap.']) {
+                       $matchedTerm = $this->cObj->stdWrap($matchedTerm,$typeConfigArray['postStdWrap.']);
+                       $matchedTerm = $this->cObj->stdWrap($matchedTerm,$typeConfigArray['stdWrap.']); // for compatibility with < v0.0.5
+               }
+
+               if ( !empty($typeConfigArray['tag']) ) {
+                       $matchedTerm = $before . $matchedTerm . $after;
+               }
+               
+               // TODO Edit Icons
+               // $editIconsConf = array(
+               //      'styleAttribute' => '',
+               //      );
+               $matchedTerm = $this->cObj->editIcons($matchedTerm,'tx_contagged_terms:sys_language_uid,hidden,starttime,endtime,fe_group,term_main,term_alt,term_type,term_lang,term_replace,desc_short,desc_long,link,exclude',$editIconsConf,'tx_contagged_terms:'.$termArray['uid'],NULL,'&defVals[tx_contagged_terms][desc_short]=TEST');
+               
+               return $matchedTerm;
 
        }
 
+       /**
+        * Some content tagged by configured tags could be prevented from beeing parsed.
+        * This function collects all the tags which should be considered.
+        *
+        * @return      string          Comma separated list of tags
+        */
        function getTagsToOmitt() {
-               // build a list of tags used in the type definitions
-               // these tags will be omitted while parsing the text
                $tagArray = array();
-               // if configured: build a list of tags used by the term definitions
+
+               // if there are tags to exclude: add them to the list
+               if ($this->conf['excludeTags']) {
+                       $tagArray = t3lib_div::trimExplode(',',$this->conf['excludeTags'],1);
+               }
+
+               // if configured: add tags used by the term definitions
                if ($this->conf['autoExcludeTags']>0) {;
                        foreach ($this->conf['types.'] as $key => $type) {
                                if (!empty($type['tag']) && !in_array($type['tag'],$tagArray)) {
@@ -202,24 +310,21 @@ class tx_contagged extends tslib_pibase {
                                }
                        }
                }
-               // if there are tags to exclude: add them to the list
-               if ($this->conf['excludeTags']) {
-                       $tagArray[] = $this->conf['excludeTags'];
-               }
-               // add the special exclude tag <exparse> to the list
-               $tagArray[] = $this->specialExcludeTag;
-               $tagList = implode(',',$tagArray);
                
+               $tagList = implode(',',$tagArray);
+
                return $tagList;
        }
 
        function insertKeywords() {
+               $GLOBALS['TSFE']->register['contagged_termsFound'] = array_unique((array)$GLOBALS['TSFE']->register['contagged_termsFound']);
+               // debug($GLOBALS['TSFE']->register['contagged_termsFound']);
                // make a list of unique terms found in the content
-               $this->termsFoundArray = array_unique($this->termsFoundArray);
-               $termsFoundList = implode(',',$this->termsFoundArray);
-               $GLOBALS['TSFE']->register['contagged_keywords'];
+               $termsFoundList = implode(',',$GLOBALS['TSFE']->register['contagged_termsFound']);
+               // debug($termsFoundList);
                // build an array to be passed to the UPDATE query
                $updateArray = array($this->prefixId . '_keywords' => $termsFoundList);
+               // $updateArray = array('keywords' => $termsFoundList);
                // execute sql-query
                $res = $GLOBALS['TYPO3_DB']->exec_UPDATEquery(
                        'pages', // TABLE ...
@@ -227,24 +332,60 @@ class tx_contagged extends tslib_pibase {
                        $updateArray
                        );
        }
-
-       function registerFields($typeConfigArray,$termArray) {
+       
+       /**
+        * Cleans up a string of keywords. Keywords at splitted by "," (comma)  ";" (semi colon) and linebreak
+        *
+        * @param       string          String of keywords
+        * @return      string          Cleaned up string, keywords will be separated by a comma only.
+        */
+       function keywords($content)     {
+               $listArr = split(',|;|'.chr(10),$content);
+               reset($listArr);
+               while(list($k,$v)=each($listArr))       {
+                       $listArr[$k]=trim($v);
+               }
+               return implode(',',$listArr);
+       }
+       
+       /**
+        * Register the fields in $GLOBALS['TSFE] to be used in the TS Setup 
+        *
+        * @param       array           $typeConfigArray: Configuration array of the term
+        * @param       array           $this->termsArray: Array of terms
+        * @param       int                     $termKey: Internal key of the term
+        */
+       function registerFields($typeConfigArray,$termKey) {
                // Replace <p></p> with <br/>; Idea from Markus Timtner. Thank you!
                // TODO: strip or replace all block-tags
                if ($typeConfigArray['stripBlockTags']>0) {
-                       $termArray['desc_long'] = preg_replace('/<p[^<>]*>(.*?)<\/p\s*>/ui','$1<br />',$termArray['desc_long']);                        
+                       $this->termsArray[$termKey]['desc_long'] = preg_replace('/<p[^<>]*>(.*?)<\/p\s*>/ui','$1<br />',$this->termsArray[$termKey]['desc_long']);
                }
 
+               $GLOBALS['TSFE']->register['contagged_key'] = $termKey;
+
                // register all fields to be handled by the TS Setup
-               foreach ($termArray as $key => $value) {
-                       $GLOBALS['TSFE']->register['contagged_'.$key] = $termArray[$key];                       
+               foreach ($this->termsArray[$termKey] as $label => $value) {
+                       $GLOBALS['TSFE']->register['contagged_'.$label] = $value;
                }
        }
 
-       function linkMatchedTerm(&$matchedTerm,$typeConfigArray,$termArray) {
+       /**
+        * Wrap the matched term in a link tag - as configured
+        *
+        * @param string $matchedTerm 
+        * @param string $typeConfigArray 
+        * @param string $this->termsArray 
+        * @param string $termKey 
+        * @return void
+        * @author Jochen Rau
+        */
+       function linkMatchedTerm($matchedTerm,$typeConfigArray,$termKey) {
+               $termArray = $this->termsArray[$termKey];
+
                // check conditions if the term should be linked to a list page
                $makeLink = $this->checkLocalGlobal($typeConfigArray,'linkToListPage');
-               if ( ($termArray['desc_long'] == '') || ($termArray['exclude']>0) ) {
+               if ( $termArray['exclude']>0 ) {
                        $makeLink = false;
                }
                if ($termArray['link']) {
@@ -253,39 +394,36 @@ class tx_contagged extends tslib_pibase {
 
                // link the matched term to the front-end list page
                if ($makeLink) {
-                       unset($typolinkConf);
+                   $cache = 0;
+                   $this->pi_USER_INT_obj = 1;
+                   $this->prefixId = 'tx_contagged_pi1';
+                   $label = $matchedTerm;  // the link text
+                   $overrulePIvars = array(
+                               'backPid' => $GLOBALS['TSFE']->id,
+                               'key' => $termKey,
+                       );
+                   $clearAnyway=1;    // the current values of piVars will NOT be preserved
                        if ($termArray['link']) {
-                               $parameter = $termArray['link'];
-                       } else {
-                               $parameter = $typeConfigArray['listPage']?$typeConfigArray['listPage']:$this->conf['listPage'];
-                       }
-                       
-                       $GLOBALS['TSFE']->register['contagged_list_page'] = $parameter;
-                       $typolinkConf['parameter'] = $parameter;
-                       // $typolinkConf['useCacheHash'] = 1; // TODO cHash
-                       // $typolinkConf['ATagParams'] = "rel='moodalbox'";
-                       $typolinkConf['additionalParams'] =
-                               '&' . $this->prefixId . '_pi1' . '[backPid]=' . $GLOBALS['TSFE']->id .
-                               '&' . $this->prefixId . '_pi1' . '[uid]=' . $termArray['uid'];
-                               //. '&' . $this->prefixId . '_pi1' . '[term_type]=' . $termArray['term_type'];
-                       $matchedTerm = $this->cObj->typolink($matchedTerm, $typolinkConf);
-               }
-       }
-
-       function replaceMatchedTerm(&$matchedTerm,$typeConfigArray,$termArray) {
-               $replaceTerm = $this->checkLocalGlobal($typeConfigArray,'replaceTerm');
-               if ( $replaceTerm && $termArray['term_replace'] ) {
-                       // if the first letter of the matched term is upper case
-                       // make the first letter of the replacing term also upper case
-                       // (\p{Lu} stands for "unicode letter uppercase")
-                       if ( preg_match('/^\p{Lu}?/u',$matchedTerm)>0 ) {
-                               $matchedTerm = ucfirst($termArray['term_replace']); // TODO ucfirst is not UTF8 safe; it depends on the locale settings (they could be ASCII) 
+                               $altPageId = $termArray['link']; // ID of the target page
                        } else {
-                               $matchedTerm = $termArray['term_replace'];
+                               $altPageId = $termArray['listPages'][0];
                        }
+                       $GLOBALS['TSFE']->register['contagged_list_page'] = $altPageId;
+                   $matchedTerm = $this->pi_linkTP_keepPIvars($matchedTerm, $overrulePIvars, $cache, $clearAnyway, $altPageId);
+                       $this->prefixId = 'tx_contagged';
                }
+               
+               return $matchedTerm;
        }
 
+       /**
+        * undocumented function
+        *
+        * @param string $typeConfigArray 
+        * @param string $attributeName 
+        * @return void
+        * @author Jochen Rau
+        */
        function checkLocalGlobal($typeConfigArray,$attributeName) {
                if ( isset($typeConfigArray[$attributeName]) ) {
                        $addAttribute = ($typeConfigArray[$attributeName]>0) ? true : false;
@@ -297,13 +435,16 @@ class tx_contagged extends tslib_pibase {
        }
 
        /**
-               * If the language of the term is undefined, 
-               * or the page language is the same as language of the term,
-               * then the lang attribute will not be shown. 
-               * 
-               * If the terms language is defined and different from the page language, 
-               * then the language attribute is added.
-               */
+        * If the language of the term is undefined, or the page language is the same as language of the term,
+        * then the lang attribute will not be shown.
+        *
+        * If the terms language is defined and different from the page language, then the language attribute is added.
+        *
+        * @param string $typeConfigArray 
+        * @param string $termArray 
+        * @return void
+        * @author Jochen Rau
+        */
        function getLangAttribute($typeConfigArray,$termArray) {
                // get page language
                if ($GLOBALS['TSFE']->config['config']['language']) {
@@ -320,6 +461,14 @@ class tx_contagged extends tslib_pibase {
                return $langAttribute;
        }
 
+       /**
+        * undocumented function
+        *
+        * @param string $typeConfigArray 
+        * @param string $termArray 
+        * @return void
+        * @author Jochen Rau
+        */
        function getTitleAttribute($typeConfigArray,$termArray) {
                if ($this->checkLocalGlobal($typeConfigArray,'addTitleAttribute') && !empty($termArray['desc_short'])) {
                        $titleAttribute = ' title="' . $termArray['desc_short'] . '"';
@@ -328,6 +477,13 @@ class tx_contagged extends tslib_pibase {
                return $titleAttribute;
        }
 
+       /**
+        * [Describe function...]
+        *
+        * @param       [type]          $typeConfigArray: ...
+        * @param       [type]          $termArray: ...
+        * @return      [type]          ...
+        */
        function getCssClassAttribute($typeConfigArray,$termArray) {
                if ($this->checkLocalGlobal($typeConfigArray,'addCssClassAttribute')) {
                        if ( $typeConfigArray['cssClass'] ) {
@@ -341,10 +497,10 @@ class tx_contagged extends tslib_pibase {
        }
 
        /**
-               * Test, if the current page should be skipped
-               *
-               * @return       True, if the page should be skipped
-               */
+        * Test, if the current page should be skipped
+        *
+        * @return      boolean True if the page should be skipped
+        */
        function isContentToSkip() {
                $result = true; // true, if the page should be skipped
                $currentPageUid = $GLOBALS['TSFE']->id;
@@ -358,19 +514,19 @@ class tx_contagged extends tslib_pibase {
                // check if the root page is in the rootline of the current page
                $includeRootPagesUids = t3lib_div::trimExplode(',', $this->conf['includeRootPages'], 1);
                foreach ($includeRootPagesUids as $includeRootPageUid) {
-                       if (t3lib_div :: inArray($pageUidsInRootline, $includeRootPageUid))
+                       if (t3lib_div::inArray((array)$pageUidsInRootline, $includeRootPageUid))
                                $result = false;
                }
                $excludeRootPagesUids = t3lib_div::trimExplode(',', $this->conf['excludeRootPages'], 1);
                foreach ($excludeRootPagesUids as $excludeRootPageUid) {
-                       if (t3lib_div :: inArray($pageUidsInRootline, $excludeRootPageUid))
+                       if (t3lib_div::inArray((array)$pageUidsInRootline, $excludeRootPageUid))
                                $result = true;
                }
                if (t3lib_div::inList($this->conf['includePages'], $currentPageUid)) {
                        $result = false;
                }
                if (t3lib_div::inList($this->conf['excludePages'], $currentPageUid)) {
-                       $result = true;                 
+                       $result = true;
                }
                if ( $GLOBALS['TSFE']->page['tx_contagged_dont_parse'] == 1) {
                        $result = true;
index 783af72..2bbde59 100644 (file)
Binary files a/doc/manual.sxw and b/doc/manual.sxw differ
diff --git a/doc/wizard_form.dat b/doc/wizard_form.dat
deleted file mode 100644 (file)
index de0d234..0000000
+++ /dev/null
@@ -1 +0,0 @@
-a:4:{s:4:"save";a:3:{s:13:"extension_key";s:9:"contagged";s:18:"print_wop_comments";s:1:"0";s:15:"overwrite_files";a:11:{s:9:"ChangeLog";s:1:"1";s:10:"README.txt";s:1:"1";s:12:"ext_icon.gif";s:1:"1";s:17:"ext_localconf.php";s:1:"1";s:14:"ext_tables.php";s:1:"1";s:14:"ext_tables.sql";s:1:"1";s:27:"icon_tx_contagged_terms.gif";s:1:"1";s:16:"locallang_db.xml";s:1:"1";s:7:"tca.php";s:1:"1";s:19:"doc/wizard_form.dat";s:1:"1";s:20:"doc/wizard_form.html";s:1:"1";}}s:6:"emconf";a:1:{i:1;a:7:{s:5:"title";s:14:"Content parser";s:11:"description";s:188:"This extension parses the text of a content element to tag, replace and link specific terms. It is useful to auto-generate a glossary - but not only. Because it is configurable through TS.";s:8:"category";s:2:"fe";s:5:"state";s:5:"alpha";s:12:"dependencies";s:0:"";s:6:"author";s:10:"Jochen Rau";s:12:"author_email";s:12:"j.rau@web.de";}}s:9:"languages";a:1:{i:1;a:45:{s:2:"ar";s:1:"0";s:2:"my";s:1:"0";s:2:"eu";s:1:"0";s:2:"ba";s:1:"0";s:2:"br";s:1:"0";s:2:"bg";s:1:"0";s:2:"ca";s:1:"0";s:2:"ch";s:1:"0";s:2:"hk";s:1:"0";s:2:"hr";s:1:"0";s:2:"cz";s:1:"0";s:2:"dk";s:1:"0";s:2:"nl";s:1:"0";s:2:"eo";s:1:"0";s:2:"et";s:1:"0";s:2:"fo";s:1:"0";s:2:"fi";s:1:"0";s:2:"fr";s:1:"0";s:2:"de";s:1:"1";s:2:"gr";s:1:"0";s:2:"gl";s:1:"0";s:2:"he";s:1:"0";s:2:"hi";s:1:"0";s:2:"hu";s:1:"0";s:2:"is";s:1:"0";s:2:"it";s:1:"0";s:2:"jp";s:1:"0";s:2:"kr";s:1:"0";s:2:"lv";s:1:"0";s:2:"lt";s:1:"0";s:2:"no";s:1:"0";s:2:"fa";s:1:"0";s:2:"pl";s:1:"0";s:2:"pt";s:1:"0";s:2:"ro";s:1:"0";s:2:"ru";s:1:"0";s:2:"sr";s:1:"0";s:2:"sk";s:1:"0";s:2:"si";s:1:"0";s:2:"es";s:1:"0";s:2:"se";s:1:"0";s:2:"th";s:1:"0";s:2:"tr";s:1:"0";s:2:"ua";s:1:"0";s:2:"vn";s:1:"0";}}s:6:"tables";a:1:{i:1;a:20:{s:9:"tablename";s:5:"terms";s:5:"title";s:5:"Terms";s:8:"title_de";s:10:"Ausdrücke";s:11:"add_deleted";s:1:"1";s:10:"add_hidden";s:1:"1";s:13:"add_starttime";s:1:"1";s:11:"add_endtime";s:1:"1";s:10:"add_access";s:1:"1";s:12:"localization";s:1:"1";s:10:"versioning";s:1:"1";s:7:"sorting";s:1:"1";s:13:"sorting_field";s:6:"crdate";s:12:"sorting_desc";s:1:"0";s:10:"type_field";s:1:"0";s:12:"header_field";s:1:"0";s:7:"defIcon";s:11:"default.gif";s:14:"allow_on_pages";s:1:"1";s:23:"allow_ce_insert_records";s:1:"1";s:12:"save_and_new";s:1:"1";s:6:"fields";a:0:{}}}}
\ No newline at end of file
diff --git a/doc/wizard_form.html b/doc/wizard_form.html
deleted file mode 100644 (file)
index 85ad87c..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
-
-       <html>
-       <head>
-               <title>Untitled</title>
-       </head>
-
-       <body>
-
-               <table border="0" cellpadding="2" cellspacing="2"><tr bgcolor=""><td><strong><span style="font-family:verdana,arial,sans-serif; font-size:10px;">General info</span></strong></td></tr><tr bgcolor=""><td><span style="font-family:verdana,arial,sans-serif; font-size:10px;">Enter general information about the extension here: Title, description, category, author...</span></td></tr><tr><td></td></tr><tr bgcolor=""><td><span style="font-family:verdana,arial,sans-serif; font-size:10px;"><strong>Title:</strong><br /><a name="260dbfdff6"></a><input type="text" name="kickstarter[wizArray_upd][emconf][1][title]" value="Content parser" style="width:200px;" onchange="setFormAnchorPoint('260dbfdff6');" title="WOP: [emconf][1][title]"></span></td></tr><tr bgcolor=""><td><span style="font-family:verdana,arial,sans-serif; font-size:10px;"><strong>Description:</strong><br /><a name="e9cba6944a"></a><input type="text" name="kickstarter[wizArray_upd][emconf][1][description]" value="This extension parses the text of a content element to tag, replace and link specific terms. It is useful to auto-generate a glossary - but not only. Because it is configurable through TS." style="width:200px;" onchange="setFormAnchorPoint('e9cba6944a');" title="WOP: [emconf][1][description]"></span></td></tr><tr bgcolor=""><td><span style="font-family:verdana,arial,sans-serif; font-size:10px;"><strong>Category:</strong><br /><a name="b46008f89f"></a><select name="kickstarter[wizArray_upd][emconf][1][category]" onchange="setFormAnchorPoint('b46008f89f');" title="WOP: [emconf][1][category]"><option value=""></option><option value="fe" selected="selected">Frontend</option><option value="plugin">Frontend Plugins</option><option value="be">Backend</option><option value="module">Backend Modules</option><option value="services">Services</option><option value="example">Examples</option><option value="misc">Miscellaneous</option><option value="templates">Templates</option><option value="doc">Documentation</option></select></span></td></tr><tr bgcolor=""><td><span style="font-family:verdana,arial,sans-serif; font-size:10px;"><strong>State</strong><br /><a name="dbd328a5a5"></a><select name="kickstarter[wizArray_upd][emconf][1][state]" onchange="setFormAnchorPoint('dbd328a5a5');" title="WOP: [emconf][1][state]"><option value="alpha" selected="selected">Alpha (Very initial development)</option><option value="beta">Beta (Under current development, should work partly)</option><option value="stable">Stable (Stable and used in production)</option><option value="experimental">Experimental (Nobody knows if this is going anywhere yet...)</option><option value="test">Test (Test extension, demonstrates concepts etc.)</option></select></span></td></tr><tr bgcolor=""><td><span style="font-family:verdana,arial,sans-serif; font-size:10px;"><strong>Dependencies (comma list of extkeys):</strong><br /><a name="ce30f2d5ba"></a><input type="text" name="kickstarter[wizArray_upd][emconf][1][dependencies]" value="" style="width:200px;" onchange="setFormAnchorPoint('ce30f2d5ba');" title="WOP: [emconf][1][dependencies]"></span></td></tr><tr bgcolor=""><td><span style="font-family:verdana,arial,sans-serif; font-size:10px;"><strong>Author Name:</strong><br /><a name="5317cdfcff"></a><input type="text" name="kickstarter[wizArray_upd][emconf][1][author]" value="Jochen Rau" style="width:200px;" onchange="setFormAnchorPoint('5317cdfcff');" title="WOP: [emconf][1][author]"></span></td></tr><tr bgcolor=""><td><span style="font-family:verdana,arial,sans-serif; font-size:10px;"><strong>Author email:</strong><br /><a name="58289f4384"></a><input type="text" name="kickstarter[wizArray_upd][emconf][1][author_email]" value="j.rau@web.de" style="width:200px;" onchange="setFormAnchorPoint('58289f4384');" title="WOP: [emconf][1][author_email]"></span></td></tr></table><hr /><table border="0" cellpadding="2" cellspacing="2"><tr bgcolor=""><td><strong><span style="font-family:verdana,arial,sans-serif; font-size:10px;">Setup languages</span></strong></td></tr><tr bgcolor=""><td><span style="font-family:verdana,arial,sans-serif; font-size:10px;">Start here by entering the number of system languages you want to use in your extension.</span></td></tr><tr><td></td></tr><tr bgcolor=""><td><span style="font-family:verdana,arial,sans-serif; font-size:10px;"><strong>Enter which languages to setup:</strong><br /><blockquote><a name="7d533a7756"></a><input type="hidden" name="kickstarter[wizArray_upd][languages][1][ar]" value="0"><input type="checkbox" name="kickstarter[wizArray_upd][languages][1][ar]" value="1" onclick="setFormAnchorPoint('7d533a7756');" title="WOP: [languages][1][ar]">Arabic<br /><a name="78fbe4fcab"></a><input type="hidden" name="kickstarter[wizArray_upd][languages][1][my]" value="0"><input type="checkbox" name="kickstarter[wizArray_upd][languages][1][my]" value="1" onclick="setFormAnchorPoint('78fbe4fcab');" title="WOP: [languages][1][my]">Bahasa Malaysia<br /><a name="59bb5b03a9"></a><input type="hidden" name="kickstarter[wizArray_upd][languages][1][eu]" value="0"><input type="checkbox" name="kickstarter[wizArray_upd][languages][1][eu]" value="1" onclick="setFormAnchorPoint('59bb5b03a9');" title="WOP: [languages][1][eu]">Basque<br /><a name="82f6df3fe6"></a><input type="hidden" name="kickstarter[wizArray_upd][languages][1][ba]" value="0"><input type="checkbox" name="kickstarter[wizArray_upd][languages][1][ba]" value="1" onclick="setFormAnchorPoint('82f6df3fe6');" title="WOP: [languages][1][ba]">Bosnian<br /><a name="d5fc9e9f4d"></a><input type="hidden" name="kickstarter[wizArray_upd][languages][1][br]" value="0"><input type="checkbox" name="kickstarter[wizArray_upd][languages][1][br]" value="1" onclick="setFormAnchorPoint('d5fc9e9f4d');" title="WOP: [languages][1][br]">Brazilian Portuguese<br /><a name="9850ab5b73"></a><input type="hidden" name="kickstarter[wizArray_upd][languages][1][bg]" value="0"><input type="checkbox" name="kickstarter[wizArray_upd][languages][1][bg]" value="1" onclick="setFormAnchorPoint('9850ab5b73');" title="WOP: [languages][1][bg]">Bulgarian<br /><a name="022f262c2e"></a><input type="hidden" name="kickstarter[wizArray_upd][languages][1][ca]" value="0"><input type="checkbox" name="kickstarter[wizArray_upd][languages][1][ca]" value="1" onclick="setFormAnchorPoint('022f262c2e');" title="WOP: [languages][1][ca]">Catalan<br /><a name="0a86ea2302"></a><input type="hidden" name="kickstarter[wizArray_upd][languages][1][ch]" value="0"><input type="checkbox" name="kickstarter[wizArray_upd][languages][1][ch]" value="1" onclick="setFormAnchorPoint('0a86ea2302');" title="WOP: [languages][1][ch]">Chinese (Simpl)<br /><a name="4c39f3d408"></a><input type="hidden" name="kickstarter[wizArray_upd][languages][1][hk]" value="0"><input type="checkbox" name="kickstarter[wizArray_upd][languages][1][hk]" value="1" onclick="setFormAnchorPoint('4c39f3d408');" title="WOP: [languages][1][hk]">Chinese (Trad)<br /><a name="ba0c21b368"></a><input type="hidden" name="kickstarter[wizArray_upd][languages][1][hr]" value="0"><input type="checkbox" name="kickstarter[wizArray_upd][languages][1][hr]" value="1" onclick="setFormAnchorPoint('ba0c21b368');" title="WOP: [languages][1][hr]">Croatian<br /><a name="7fcce12c93"></a><input type="hidden" name="kickstarter[wizArray_upd][languages][1][cz]" value="0"><input type="checkbox" name="kickstarter[wizArray_upd][languages][1][cz]" value="1" onclick="setFormAnchorPoint('7fcce12c93');" title="WOP: [languages][1][cz]">Czech<br /><a name="b86f1028b2"></a><input type="hidden" name="kickstarter[wizArray_upd][languages][1][dk]" value="0"><input type="checkbox" name="kickstarter[wizArray_upd][languages][1][dk]" value="1" onclick="setFormAnchorPoint('b86f1028b2');" title="WOP: [languages][1][dk]">Danish<br /><a name="54b2a05e4d"></a><input type="hidden" name="kickstarter[wizArray_upd][languages][1][nl]" value="0"><input type="checkbox" name="kickstarter[wizArray_upd][languages][1][nl]" value="1" onclick="setFormAnchorPoint('54b2a05e4d');" title="WOP: [languages][1][nl]">Dutch<br /><a name="60d4c8e0f1"></a><input type="hidden" name="kickstarter[wizArray_upd][languages][1][eo]" value="0"><input type="checkbox" name="kickstarter[wizArray_upd][languages][1][eo]" value="1" onclick="setFormAnchorPoint('60d4c8e0f1');" title="WOP: [languages][1][eo]">Esperanto<br /><a name="d2aeaa8deb"></a><input type="hidden" name="kickstarter[wizArray_upd][languages][1][et]" value="0"><input type="checkbox" name="kickstarter[wizArray_upd][languages][1][et]" value="1" onclick="setFormAnchorPoint('d2aeaa8deb');" title="WOP: [languages][1][et]">Estonian<br /><a name="84b06abc79"></a><input type="hidden" name="kickstarter[wizArray_upd][languages][1][fo]" value="0"><input type="checkbox" name="kickstarter[wizArray_upd][languages][1][fo]" value="1" onclick="setFormAnchorPoint('84b06abc79');" title="WOP: [languages][1][fo]">Faroese<br /><a name="0bc4ee7821"></a><input type="hidden" name="kickstarter[wizArray_upd][languages][1][fi]" value="0"><input type="checkbox" name="kickstarter[wizArray_upd][languages][1][fi]" value="1" onclick="setFormAnchorPoint('0bc4ee7821');" title="WOP: [languages][1][fi]">Finnish<br /><a name="3dac7ddfab"></a><input type="hidden" name="kickstarter[wizArray_upd][languages][1][fr]" value="0"><input type="checkbox" name="kickstarter[wizArray_upd][languages][1][fr]" value="1" onclick="setFormAnchorPoint('3dac7ddfab');" title="WOP: [languages][1][fr]">French<br /><a name="827e867baf"></a><input type="hidden" name="kickstarter[wizArray_upd][languages][1][de]" value="0"><input type="checkbox" name="kickstarter[wizArray_upd][languages][1][de]" value="1" checked="checked" onclick="setFormAnchorPoint('827e867baf');" title="WOP: [languages][1][de]">German<br /><a name="47346a0a45"></a><input type="hidden" name="kickstarter[wizArray_upd][languages][1][gr]" value="0"><input type="checkbox" name="kickstarter[wizArray_upd][languages][1][gr]" value="1" onclick="setFormAnchorPoint('47346a0a45');" title="WOP: [languages][1][gr]">Greek<br /><a name="b62d68ce6c"></a><input type="hidden" name="kickstarter[wizArray_upd][languages][1][gl]" value="0"><input type="checkbox" name="kickstarter[wizArray_upd][languages][1][gl]" value="1" onclick="setFormAnchorPoint('b62d68ce6c');" title="WOP: [languages][1][gl]">Greenlandic<br /><a name="7083677049"></a><input type="hidden" name="kickstarter[wizArray_upd][languages][1][he]" value="0"><input type="checkbox" name="kickstarter[wizArray_upd][languages][1][he]" value="1" onclick="setFormAnchorPoint('7083677049');" title="WOP: [languages][1][he]">Hebrew<br /><a name="8821dba88e"></a><input type="hidden" name="kickstarter[wizArray_upd][languages][1][hi]" value="0"><input type="checkbox" name="kickstarter[wizArray_upd][languages][1][hi]" value="1" onclick="setFormAnchorPoint('8821dba88e');" title="WOP: [languages][1][hi]">Hindi<br /><a name="8293f23e10"></a><input type="hidden" name="kickstarter[wizArray_upd][languages][1][hu]" value="0"><input type="checkbox" name="kickstarter[wizArray_upd][languages][1][hu]" value="1" onclick="setFormAnchorPoint('8293f23e10');" title="WOP: [languages][1][hu]">Hungarian<br /><a name="1fbf3d59e1"></a><input type="hidden" name="kickstarter[wizArray_upd][languages][1][is]" value="0"><input type="checkbox" name="kickstarter[wizArray_upd][languages][1][is]" value="1" onclick="setFormAnchorPoint('1fbf3d59e1');" title="WOP: [languages][1][is]">Icelandic<br /><a name="73e154abd2"></a><input type="hidden" name="kickstarter[wizArray_upd][languages][1][it]" value="0"><input type="checkbox" name="kickstarter[wizArray_upd][languages][1][it]" value="1" onclick="setFormAnchorPoint('73e154abd2');" title="WOP: [languages][1][it]">Italian<br /><a name="4be98144d7"></a><input type="hidden" name="kickstarter[wizArray_upd][languages][1][jp]" value="0"><input type="checkbox" name="kickstarter[wizArray_upd][languages][1][jp]" value="1" onclick="setFormAnchorPoint('4be98144d7');" title="WOP: [languages][1][jp]">Japanese<br /><a name="72d3409fc7"></a><input type="hidden" name="kickstarter[wizArray_upd][languages][1][kr]" value="0"><input type="checkbox" name="kickstarter[wizArray_upd][languages][1][kr]" value="1" onclick="setFormAnchorPoint('72d3409fc7');" title="WOP: [languages][1][kr]">Korean<br /><a name="3aecc5e21e"></a><input type="hidden" name="kickstarter[wizArray_upd][languages][1][lv]" value="0"><input type="checkbox" name="kickstarter[wizArray_upd][languages][1][lv]" value="1" onclick="setFormAnchorPoint('3aecc5e21e');" title="WOP: [languages][1][lv]">Latvian<br /><a name="4f9b71ee82"></a><input type="hidden" name="kickstarter[wizArray_upd][languages][1][lt]" value="0"><input type="checkbox" name="kickstarter[wizArray_upd][languages][1][lt]" value="1" onclick="setFormAnchorPoint('4f9b71ee82');" title="WOP: [languages][1][lt]">Lithuanian<br /><a name="7f432802c6"></a><input type="hidden" name="kickstarter[wizArray_upd][languages][1][no]" value="0"><input type="checkbox" name="kickstarter[wizArray_upd][languages][1][no]" value="1" onclick="setFormAnchorPoint('7f432802c6');" title="WOP: [languages][1][no]">Norwegian<br /><a name="b6208f5c27"></a><input type="hidden" name="kickstarter[wizArray_upd][languages][1][fa]" value="0"><input type="checkbox" name="kickstarter[wizArray_upd][languages][1][fa]" value="1" onclick="setFormAnchorPoint('b6208f5c27');" title="WOP: [languages][1][fa]">Persian<br /><a name="4cd3612e78"></a><input type="hidden" name="kickstarter[wizArray_upd][languages][1][pl]" value="0"><input type="checkbox" name="kickstarter[wizArray_upd][languages][1][pl]" value="1" onclick="setFormAnchorPoint('4cd3612e78');" title="WOP: [languages][1][pl]">Polish<br /><a name="63d5243829"></a><input type="hidden" name="kickstarter[wizArray_upd][languages][1][pt]" value="0"><input type="checkbox" name="kickstarter[wizArray_upd][languages][1][pt]" value="1" onclick="setFormAnchorPoint('63d5243829');" title="WOP: [languages][1][pt]">Portuguese<br /><a name="ebc2430d26"></a><input type="hidden" name="kickstarter[wizArray_upd][languages][1][ro]" value="0"><input type="checkbox" name="kickstarter[wizArray_upd][languages][1][ro]" value="1" onclick="setFormAnchorPoint('ebc2430d26');" title="WOP: [languages][1][ro]">Romanian<br /><a name="a098cc1f91"></a><input type="hidden" name="kickstarter[wizArray_upd][languages][1][ru]" value="0"><input type="checkbox" name="kickstarter[wizArray_upd][languages][1][ru]" value="1" onclick="setFormAnchorPoint('a098cc1f91');" title="WOP: [languages][1][ru]">Russian<br /><a name="8519524025"></a><input type="hidden" name="kickstarter[wizArray_upd][languages][1][sr]" value="0"><input type="checkbox" name="kickstarter[wizArray_upd][languages][1][sr]" value="1" onclick="setFormAnchorPoint('8519524025');" title="WOP: [languages][1][sr]">Serbian<br /><a name="c8d205aed0"></a><input type="hidden" name="kickstarter[wizArray_upd][languages][1][sk]" value="0"><input type="checkbox" name="kickstarter[wizArray_upd][languages][1][sk]" value="1" onclick="setFormAnchorPoint('c8d205aed0');" title="WOP: [languages][1][sk]">Slovak<br /><a name="6404570bc0"></a><input type="hidden" name="kickstarter[wizArray_upd][languages][1][si]" value="0"><input type="checkbox" name="kickstarter[wizArray_upd][languages][1][si]" value="1" onclick="setFormAnchorPoint('6404570bc0');" title="WOP: [languages][1][si]">Slovenian<br /><a name="8be7af8e47"></a><input type="hidden" name="kickstarter[wizArray_upd][languages][1][es]" value="0"><input type="checkbox" name="kickstarter[wizArray_upd][languages][1][es]" value="1" onclick="setFormAnchorPoint('8be7af8e47');" title="WOP: [languages][1][es]">Spanish<br /><a name="db1a396ac5"></a><input type="hidden" name="kickstarter[wizArray_upd][languages][1][se]" value="0"><input type="checkbox" name="kickstarter[wizArray_upd][languages][1][se]" value="1" onclick="setFormAnchorPoint('db1a396ac5');" title="WOP: [languages][1][se]">Swedish<br /><a name="09b51bc212"></a><input type="hidden" name="kickstarter[wizArray_upd][languages][1][th]" value="0"><input type="checkbox" name="kickstarter[wizArray_upd][languages][1][th]" value="1" onclick="setFormAnchorPoint('09b51bc212');" title="WOP: [languages][1][th]">Thai<br /><a name="04887aadc6"></a><input type="hidden" name="kickstarter[wizArray_upd][languages][1][tr]" value="0"><input type="checkbox" name="kickstarter[wizArray_upd][languages][1][tr]" value="1" onclick="setFormAnchorPoint('04887aadc6');" title="WOP: [languages][1][tr]">Turkish<br /><a name="593a18ebf0"></a><input type="hidden" name="kickstarter[wizArray_upd][languages][1][ua]" value="0"><input type="checkbox" name="kickstarter[wizArray_upd][languages][1][ua]" value="1" onclick="setFormAnchorPoint('593a18ebf0');" title="WOP: [languages][1][ua]">Ukrainian<br /><a name="75226f1caf"></a><input type="hidden" name="kickstarter[wizArray_upd][languages][1][vn]" value="0"><input type="checkbox" name="kickstarter[wizArray_upd][languages][1][vn]" value="1" onclick="setFormAnchorPoint('75226f1caf');" title="WOP: [languages][1][vn]">Vietnamese<br /></blockquote></span></td></tr></table><hr /><table border=0 cellpadding=2 cellspacing=2><tr bgcolor=""><td><strong><span style="font-family:verdana,arial,sans-serif; font-size:10px;">New Database Tables</span></strong></td></tr><tr bgcolor=""><td><span style="font-family:verdana,arial,sans-serif; font-size:10px;">Add database tables which can be edited inside the backend. These tables will be added to the global TCA array in TYPO3.</span></td></tr><tr><td></td></tr><tr bgcolor=""><td><span style="font-family:verdana,arial,sans-serif; font-size:10px;"><strong>Tablename:</strong><BR>tx_contagged_<a name="eaea358363"></a><input type="text" name="kickstarter[wizArray_upd][tables][1][tablename]" value="terms" style="width:200px;" onchange="setFormAnchorPoint('eaea358363');" title="WOP: [tables][1][tablename]"><BR><strong>Notice:</strong> Use characters a-z0-9 only. Only lowercase, no spaces.<BR>
-               This becomes the table name in the database. </span></td></tr><tr bgcolor=""><td><span style="font-family:verdana,arial,sans-serif; font-size:10px;"><strong>Title of the table:</strong><BR><a name="dc5d9257e8"></a><input type="text" name="kickstarter[wizArray_upd][tables][1][title]" value="Terms" style="width:200px;" onchange="setFormAnchorPoint('dc5d9257e8');" title="WOP: [tables][1][title]"> [English]<blockquote><a name="e303e60be8"></a><input type="text" name="kickstarter[wizArray_upd][tables][1][title_de]" value="Ausdrücke" style="width:200px;" onchange="setFormAnchorPoint('e303e60be8');" title="WOP: [tables][1][title_de]"> [German]</blockquote></span></td></tr><tr bgcolor=""><td><strong> Fields Overview </strong></td></tr><tr><td></td></tr><tr bgcolor=""><td><table><span style="font-family:verdana,arial,sans-serif; font-size:10px;"><tr  bgcolor="">
-                       <td><strong>Name</strong></td>
-                       <td><strong>Title</strong></td>
-                       <td><strong>Type</strong></td>
-                       <td><strong>Exclude?</strong></td>
-                       <td><strong>Details</strong></td>
-               </tr></span></table></td></tr><tr bgcolor=""><td><strong> Edit Fields </strong></td></tr><tr><td></td></tr><tr bgcolor=""><td><span style="font-family:verdana,arial,sans-serif; font-size:10px;"><a name="9272a1fd29"></a><input type="hidden" name="kickstarter[wizArray_upd][tables][1][add_deleted]" value="0"><input type="checkbox" name="kickstarter[wizArray_upd][tables][1][add_deleted]" value="1" checked="checked" onclick="setFormAnchorPoint('9272a1fd29');" title="WOP: [tables][1][add_deleted]">Add "Deleted" field  <a href="#" title="Whole system: If a table has a deleted column, records are never really deleted, just &quot;marked deleted&quot; . Thus deleted records can actually be restored by clearing a deleted-flag later.\nNotice that all attached files are also not deleted from the server, so if you expect the table to hold some heavy size uploads, maybe you should not set this..." style="cursor:help" onclick="alert(String.fromCharCode(87,104,111,108,101,32,115,121,115,116,101,109,58,32,73,102,32,97,32,116,97,98,108,101,32,104,97,115,32,97,32,100,101,108,101,116,101,100,32,99,111,108,117,109,110,44,32,114,101,99,111,114,100,115,32,97,114,101,32,110,101,118,101,114,32,114,101,97,108,108,121,32,100,101,108,101,116,101,100,44,32,106,117,115,116,32,34,109,97,114,107,101,100,32,100,101,108,101,116,101,100,34,32,46,32,84,104,117,115,32,100,101,108,101,116,101,100,32,114,101,99,111,114,100,115,32,99,97,110,32,97,99,116,117,97,108,108,121,32,98,101,32,114,101,115,116,111,114,101,100,32,98,121,32,99,108,101,97,114,105,110,103,32,97,32,100,101,108,101,116,101,100,45,102,108,97,103,32,108,97,116,101,114,46,92,110,78,111,116,105,99,101,32,116,104,97,116,32,97,108,108,32,97,116,116,97,99,104,101,100,32,102,105,108,101,115,32,97,114,101,32,97,108,115,111,32,110,111,116,32,100,101,108,101,116,101,100,32,102,114,111,109,32,116,104,101,32,115,101,114,118,101,114,44,32,115,111,32,105,102,32,121,111,117,32,101,120,112,101,99,116,32,116,104,101,32,116,97,98,108,101,32,116,111,32,104,111,108,100,32,115,111,109,101,32,104,101,97,118,121,32,115,105,122,101,32,117,112,108,111,97,100,115,44,32,109,97,121,98,101,32,121,111,117,32,115,104,111,117,108,100,32,110,111,116,32,115,101,116,32,116,104,105,115,46,46,46));return false;">(What is this?)</a><BR><a name="0fe022d591"></a><input type="hidden" name="kickstarter[wizArray_upd][tables][1][add_hidden]" value="0"><input type="checkbox" name="kickstarter[wizArray_upd][tables][1][add_hidden]" value="1" checked="checked" onclick="setFormAnchorPoint('0fe022d591');" title="WOP: [tables][1][add_hidden]">Add "Hidden" flag  <a href="#" title="Frontend: The &quot;Hidden&quot; flag will prevent the record from being displayed on the frontend." style="cursor:help" onclick="alert(String.fromCharCode(70,114,111,110,116,101,110,100,58,32,84,104,101,32,34,72,105,100,100,101,110,34,32,102,108,97,103,32,119,105,108,108,32,112,114,101,118,101,110,116,32,116,104,101,32,114,101,99,111,114,100,32,102,114,111,109,32,98,101,105,110,103,32,100,105,115,112,108,97,121,101,100,32,111,110,32,116,104,101,32,102,114,111,110,116,101,110,100,46));return false;">(What is this?)</a><BR><img src="../../../../typo3/ext/kickstarter/res/t_flag_hidden.png" width="134" height="35" hspace=20 vspace="5" border="1" style="border:solid 1px;" /><BR><BR><a name="8624de0b56"></a><input type="hidden" name="kickstarter[wizArray_upd][tables][1][add_starttime]" value="0"><input type="checkbox" name="kickstarter[wizArray_upd][tables][1][add_starttime]" value="1" checked="checked" onclick="setFormAnchorPoint('8624de0b56');" title="WOP: [tables][1][add_starttime]">Add "Starttime"  <a href="#" title="Frontend: If a &quot;Starttime&quot; is set, the record will not be visible on the website, before that date arrives." style="cursor:help" onclick="alert(String.fromCharCode(70,114,111,110,116,101,110,100,58,32,73,102,32,97,32,34,83,116,97,114,116,116,105,109,101,34,32,105,115,32,115,101,116,44,32,116,104,101,32,114,101,99,111,114,100,32,119,105,108,108,32,110,111,116,32,98,101,32,118,105,115,105,98,108,101,32,111,110,32,116,104,101,32,119,101,98,115,105,116,101,44,32,98,101,102,111,114,101,32,116,104,97,116,32,100,97,116,101,32,97,114,114,105,118,101,115,46));return false;">(What is this?)</a><BR><img src="../../../../typo3/ext/kickstarter/res/t_flag_starttime.png" width="134" height="35" hspace=20 vspace="5" border="1" style="border:solid 1px;" /><BR><BR><a name="653fb46a0c"></a><input type="hidden" name="kickstarter[wizArray_upd][tables][1][add_endtime]" value="0"><input type="checkbox" name="kickstarter[wizArray_upd][tables][1][add_endtime]" value="1" checked="checked" onclick="setFormAnchorPoint('653fb46a0c');" title="WOP: [tables][1][add_endtime]">Add "Endtime"  <a href="#" title="Frontend: If a &quot;Endtime&quot; is set, the record will be hidden from that date and into the future." style="cursor:help" onclick="alert(String.fromCharCode(70,114,111,110,116,101,110,100,58,32,73,102,32,97,32,34,69,110,100,116,105,109,101,34,32,105,115,32,115,101,116,44,32,116,104,101,32,114,101,99,111,114,100,32,119,105,108,108,32,98,101,32,104,105,100,100,101,110,32,102,114,111,109,32,116,104,97,116,32,100,97,116,101,32,97,110,100,32,105,110,116,111,32,116,104,101,32,102,117,116,117,114,101,46));return false;">(What is this?)</a><BR><img src="../../../../typo3/ext/kickstarter/res/t_flag_endtime.png" width="134" height="35" hspace=20 vspace="5" border="1" style="border:solid 1px;" /><BR><BR><a name="f968a89b45"></a><input type="hidden" name="kickstarter[wizArray_upd][tables][1][add_access]" value="0"><input type="checkbox" name="kickstarter[wizArray_upd][tables][1][add_access]" value="1" checked="checked" onclick="setFormAnchorPoint('f968a89b45');" title="WOP: [tables][1][add_access]">Add "Access group"  <a href="#" title="Frontend: If a frontend user group is set for a record, only frontend users that are members of that group will be able to see the record." style="cursor:help" onclick="alert(String.fromCharCode(70,114,111,110,116,101,110,100,58,32,73,102,32,97,32,102,114,111,110,116,101,110,100,32,117,115,101,114,32,103,114,111,117,112,32,105,115,32,115,101,116,32,102,111,114,32,97,32,114,101,99,111,114,100,44,32,111,110,108,121,32,102,114,111,110,116,101,110,100,32,117,115,101,114,115,32,116,104,97,116,32,97,114,101,32,109,101,109,98,101,114,115,32,111,102,32,116,104,97,116,32,103,114,111,117,112,32,119,105,108,108,32,98,101,32,97,98,108,101,32,116,111,32,115,101,101,32,116,104,101,32,114,101,99,111,114,100,46));return false;">(What is this?)</a><BR><img src="../../../../typo3/ext/kickstarter/res/t_flag_access.png" width="134" height="35" hspace=20 vspace="5" border="1" style="border:solid 1px;" /><BR><BR></span></td></tr><tr bgcolor=""><td><span style="font-family:verdana,arial,sans-serif; font-size:10px;"><a name="2ee150e41d"></a><input type="hidden" name="kickstarter[wizArray_upd][tables][1][localization]" value="0"><input type="checkbox" name="kickstarter[wizArray_upd][tables][1][localization]" value="1" checked="checked" onclick="setFormAnchorPoint('2ee150e41d');" title="WOP: [tables][1][localization]">Enabled localization features <a href="#" title="If set, the records will have a selector box for language and a reference field which can point back to the original default translation for the record. These features are part of the internal framework for localization." style="cursor:help" onclick="alert(String.fromCharCode(73,102,32,115,101,116,44,32,116,104,101,32,114,101,99,111,114,100,115,32,119,105,108,108,32,104,97,118,101,32,97,32,115,101,108,101,99,116,111,114,32,98,111,120,32,102,111,114,32,108,97,110,103,117,97,103,101,32,97,110,100,32,97,32,114,101,102,101,114,101,110,99,101,32,102,105,101,108,100,32,119,104,105,99,104,32,99,97,110,32,112,111,105,110,116,32,98,97,99,107,32,116,111,32,116,104,101,32,111,114,105,103,105,110,97,108,32,100,101,102,97,117,108,116,32,116,114,97,110,115,108,97,116,105,111,110,32,102,111,114,32,116,104,101,32,114,101,99,111,114,100,46,32,84,104,101,115,101,32,102,101,97,116,117,114,101,115,32,97,114,101,32,112,97,114,116,32,111,102,32,116,104,101,32,105,110,116,101,114,110,97,108,32,102,114,97,109,101,119,111,114,107,32,102,111,114,32,108,111,99,97,108,105,122,97,116,105,111,110,46));return false;">(What is this?)</a><BR><a name="f8d2d91dbf"></a><input type="hidden" name="kickstarter[wizArray_upd][tables][1][versioning]" value="0"><input type="checkbox" name="kickstarter[wizArray_upd][tables][1][versioning]" value="1" checked="checked" onclick="setFormAnchorPoint('f8d2d91dbf');" title="WOP: [tables][1][versioning]">Enable versioning  <a href="#" title="If set, you will be able to versionize records from this table. Highly recommended if the records are passed around in a workflow." style="cursor:help" onclick="alert(String.fromCharCode(73,102,32,115,101,116,44,32,121,111,117,32,119,105,108,108,32,98,101,32,97,98,108,101,32,116,111,32,118,101,114,115,105,111,110,105,122,101,32,114,101,99,111,114,100,115,32,102,114,111,109,32,116,104,105,115,32,116,97,98,108,101,46,32,72,105,103,104,108,121,32,114,101,99,111,109,109,101,110,100,101,100,32,105,102,32,116,104,101,32,114,101,99,111,114,100,115,32,97,114,101,32,112,97,115,115,101,100,32,97,114,111,117,110,100,32,105,110,32,97,32,119,111,114,107,102,108,111,119,46));return false;">(What is this?)</a><BR><a name="3eb5780bca"></a><input type="hidden" name="kickstarter[wizArray_upd][tables][1][sorting]" value="0"><input type="checkbox" name="kickstarter[wizArray_upd][tables][1][sorting]" value="1" checked="checked" onclick="setFormAnchorPoint('3eb5780bca');" title="WOP: [tables][1][sorting]">Manual ordering of records  <a href="#" title="If set, the records can be moved up and down relative to each other in the backend. Just like Content Elements. Otherwise they are sorted automatically by any field you specify" style="cursor:help" onclick="alert(String.fromCharCode(73,102,32,115,101,116,44,32,116,104,101,32,114,101,99,111,114,100,115,32,99,97,110,32,98,101,32,109,111,118,101,100,32,117,112,32,97,110,100,32,100,111,119,110,32,114,101,108,97,116,105,118,101,32,116,111,32,101,97,99,104,32,111,116,104,101,114,32,105,110,32,116,104,101,32,98,97,99,107,101,110,100,46,32,74,117,115,116,32,108,105,107,101,32,67,111,110,116,101,110,116,32,69,108,101,109,101,110,116,115,46,32,79,116,104,101,114,119,105,115,101,32,116,104,101,121,32,97,114,101,32,115,111,114,116,101,100,32,97,117,116,111,109,97,116,105,99,97,108,108,121,32,98,121,32,97,110,121,32,102,105,101,108,100,32,121,111,117,32,115,112,101,99,105,102,121));return false;">(What is this?)</a><BR><blockquote>If "Manual ordering" is not set, order the table by this field:<BR><a name="79955aed7f"></a><select name="kickstarter[wizArray_upd][tables][1][sorting_field]" onchange="setFormAnchorPoint('79955aed7f');" title="WOP: [tables][1][sorting_field]"><option value="crdate" selected="selected">[crdate]</option><option value="cruser_id">[cruser_id]</option><option value="tstamp">[tstamp]</option></select><BR><a name="76ceb55890"></a><input type="hidden" name="kickstarter[wizArray_upd][tables][1][sorting_desc]" value="0"><input type="checkbox" name="kickstarter[wizArray_upd][tables][1][sorting_desc]" value="1" onclick="setFormAnchorPoint('76ceb55890');" title="WOP: [tables][1][sorting_desc]"> Descending</blockquote></span></td></tr><tr bgcolor=""><td><span style="font-family:verdana,arial,sans-serif; font-size:10px;"><strong>"Type-field", if any:<BR></strong><a name="acd96759da"></a><select name="kickstarter[wizArray_upd][tables][1][type_field]" onchange="setFormAnchorPoint('acd96759da');" title="WOP: [tables][1][type_field]"><option value="0" selected="selected">[none]</option></select> <a href="#" title="A &quot;type-field&quot; is the field in the table which determines how the form is rendered in the backend, eg. which fields are shown under which circumstances.\nFor instance the Content Element table &quot;tt_content&quot; has a type-field, CType. The value of this field determines if the editing form shows the bodytext field as is the case when the type is &quot;Text&quot; or if also the image-field should be shown as when the type is &quot;Text w/Image&quot;" style="cursor:help" onclick="alert(String.fromCharCode(65,32,34,116,121,112,101,45,102,105,101,108,100,34,32,105,115,32,116,104,101,32,102,105,101,108,100,32,105,110,32,116,104,101,32,116,97,98,108,101,32,119,104,105,99,104,32,100,101,116,101,114,109,105,110,101,115,32,104,111,119,32,116,104,101,32,102,111,114,109,32,105,115,32,114,101,110,100,101,114,101,100,32,105,110,32,116,104,101,32,98,97,99,107,101,110,100,44,32,101,103,46,32,119,104,105,99,104,32,102,105,101,108,100,115,32,97,114,101,32,115,104,111,119,110,32,117,110,100,101,114,32,119,104,105,99,104,32,99,105,114,99,117,109,115,116,97,110,99,101,115,46,92,110,70,111,114,32,105,110,115,116,97,110,99,101,32,116,104,101,32,67,111,110,116,101,110,116,32,69,108,101,109,101,110,116,32,116,97,98,108,101,32,34,116,116,95,99,111,110,116,101,110,116,34,32,104,97,115,32,97,32,116,121,112,101,45,102,105,101,108,100,44,32,67,84,121,112,101,46,32,84,104,101,32,118,97,108,117,101,32,111,102,32,116,104,105,115,32,102,105,101,108,100,32,100,101,116,101,114,109,105,110,101,115,32,105,102,32,116,104,101,32,101,100,105,116,105,110,103,32,102,111,114,109,32,115,104,111,119,115,32,116,104,101,32,98,111,100,121,116,101,120,116,32,102,105,101,108,100,32,97,115,32,105,115,32,116,104,101,32,99,97,115,101,32,119,104,101,110,32,116,104,101,32,116,121,112,101,32,105,115,32,34,84,101,120,116,34,32,111,114,32,105,102,32,97,108,115,111,32,116,104,101,32,105,109,97,103,101,45,102,105,101,108,100,32,115,104,111,117,108,100,32,98,101,32,115,104,111,119,110,32,97,115,32,119,104,101,110,32,116,104,101,32,116,121,112,101,32,105,115,32,34,84,101,120,116,32,119,47,73,109,97,103,101,34));return false;">(What is this?)</a></span></td></tr><tr bgcolor=""><td><span style="font-family:verdana,arial,sans-serif; font-size:10px;"><strong>Label-field:<BR></strong><a name="baa714a2a8"></a><select name="kickstarter[wizArray_upd][tables][1][header_field]" onchange="setFormAnchorPoint('baa714a2a8');" title="WOP: [tables][1][header_field]"><option value="0" selected="selected">[none]</option></select> <a href="#" title="A &quot;label-field&quot; is the field used as record title in the backend." style="cursor:help" onclick="alert(String.fromCharCode(65,32,34,108,97,98,101,108,45,102,105,101,108,100,34,32,105,115,32,116,104,101,32,102,105,101,108,100,32,117,115,101,100,32,97,115,32,114,101,99,111,114,100,32,116,105,116,108,101,32,105,110,32,116,104,101,32,98,97,99,107,101,110,100,46));return false;">(What is this?)</a></span></td></tr><tr bgcolor=""><td><span style="font-family:verdana,arial,sans-serif; font-size:10px;"><a name="137de2c3a6"></a><select name="kickstarter[wizArray_upd][tables][1][defIcon]" onchange="setFormAnchorPoint('137de2c3a6');" title="WOP: [tables][1][defIcon]"><option value="default.gif" selected="selected">Default (white)</option><option value="default_black.gif">Black</option><option value="default_gray4.gif">Gray</option><option value="default_blue.gif">Blue</option><option value="default_green.gif">Green</option><option value="default_red.gif">Red</option><option value="default_yellow.gif">Yellow</option><option value="default_purple.gif">Purple</option></select> Default icon  <a href="#" title="All tables have at least one associated icon. Select which default icon you wish. You can always substitute the file with another." style="cursor:help" onclick="alert(String.fromCharCode(65,108,108,32,116,97,98,108,101,115,32,104,97,118,101,32,97,116,32,108,101,97,115,116,32,111,110,101,32,97,115,115,111,99,105,97,116,101,100,32,105,99,111,110,46,32,83,101,108,101,99,116,32,119,104,105,99,104,32,100,101,102,97,117,108,116,32,105,99,111,110,32,121,111,117,32,119,105,115,104,46,32,89,111,117,32,99,97,110,32,97,108,119,97,121,115,32,115,117,98,115,116,105,116,117,116,101,32,116,104,101,32,102,105,108,101,32,119,105,116,104,32,97,110,111,116,104,101,114,46));return false;">(What is this?)</a></span></td></tr><tr bgcolor=""><td><span style="font-family:verdana,arial,sans-serif; font-size:10px;"><strong>Allowed on pages:<BR></strong><a name="3ab0de4e3a"></a><input type="hidden" name="kickstarter[wizArray_upd][tables][1][allow_on_pages]" value="0"><input type="checkbox" name="kickstarter[wizArray_upd][tables][1][allow_on_pages]" value="1" checked="checked" onclick="setFormAnchorPoint('3ab0de4e3a');" title="WOP: [tables][1][allow_on_pages]"> Allow records from this table to be created on regular pages.</span></td></tr><tr bgcolor=""><td><span style="font-family:verdana,arial,sans-serif; font-size:10px;"><strong>Allowed in "Insert Records" field in content elements:<BR></strong><a name="55468e6cbd"></a><input type="hidden" name="kickstarter[wizArray_upd][tables][1][allow_ce_insert_records]" value="0"><input type="checkbox" name="kickstarter[wizArray_upd][tables][1][allow_ce_insert_records]" value="1" checked="checked" onclick="setFormAnchorPoint('55468e6cbd');" title="WOP: [tables][1][allow_ce_insert_records]"> Allow records from this table to be linked to by content elements.</span></td></tr><tr bgcolor=""><td><span style="font-family:verdana,arial,sans-serif; font-size:10px;"><strong>Add "Save and new" button in forms:<BR></strong><a name="ea3495b007"></a><input type="hidden" name="kickstarter[wizArray_upd][tables][1][save_and_new]" value="0"><input type="checkbox" name="kickstarter[wizArray_upd][tables][1][save_and_new]" value="1" checked="checked" onclick="setFormAnchorPoint('ea3495b007');" title="WOP: [tables][1][save_and_new]"> Will add an additional save-button to forms by which you can save the item and instantly create the next.</span></td></tr><tr bgcolor=""><td><span style="font-family:verdana,arial,sans-serif; font-size:10px;"><strong>Notice on fieldnames:<BR></strong>Don't use fieldnames from this list of reserved names/words: <BR>
-               <blockquote><em>uid, pid, endtime, starttime, sorting, fe_group, hidden, deleted, cruser_id, crdate, tstamp, data, table, field, key, desc, all, and, asensitive, bigint, both, cascade, char, collate, connection, convert, current_date, current_user, databases, day_minute, decimal, delayed, describe, distinctrow, drop, else, escaped, explain, float, for, from, group, hour_microsecond, if, index, inout, int, int3, integer, is, leading, like, load, lock, longtext, match, mediumtext, minute_second, natural, null, optimize, or, outer, primary, raid0, real, release, replace, return, rlike, second_microsecond, separator, smallint, specific, sqlstate, sql_cal_found_rows, starting, terminated, tinyint, trailing, undo, unlock, usage, utc_date, values, varcharacter, where, write, year_month, call, condition, continue, cursor, declare, deterministic, each, elseif, exit, fetch, goto, insensitive, iterate, label, leave, loop, modifies, out, reads, repeat, schema, schemas, sensitive, sql, sqlexception, sqlwarning, trigger, upgrade, while</em></blockquote></span></td></tr><tr bgcolor=""><td><span style="font-family:verdana,arial,sans-serif; font-size:10px;"><strong>NEW FIELD:</strong></span></td></tr><tr bgcolor=""><td><span style="font-family:verdana,arial,sans-serif; font-size:10px;"><table border="0" cellpadding="0" cellspacing="0">
-       <tr><td valign="top"><span style="font-family:verdana,arial,sans-serif; font-size:10px;">Field name:</span></td><td valign="top"><span style="font-family:verdana,arial,sans-serif; font-size:10px;"><a name="43bdd40f96"></a><input type="text" name="kickstarter[wizArray_upd][tables][1][fields][1][fieldname]" value="" style="width:200px;" onchange="setFormAnchorPoint('43bdd40f96');" title="WOP: [tables][1][fields][1][fieldname]"></span></td></tr>
-       <tr><td valign="top"><span style="font-family:verdana,arial,sans-serif; font-size:10px;">Field title:</span></td><td valign="top"><span style="font-family:verdana,arial,sans-serif; font-size:10px;"><a name="84135628ec"></a><input type="text" name="kickstarter[wizArray_upd][tables][1][fields][1][title]" value="" style="width:200px;" onchange="setFormAnchorPoint('84135628ec');" title="WOP: [tables][1][fields][1][title]"> [English]<blockquote><a name="0265cff709"></a><input type="text" name="kickstarter[wizArray_upd][tables][1][fields][1][title_de]" value="" style="width:200px;" onchange="setFormAnchorPoint('0265cff709');" title="WOP: [tables][1][fields][1][title_de]"> [German]</blockquote></span></td></tr>
-       <tr><td valign="top"><span style="font-family:verdana,arial,sans-serif; font-size:10px;">Field type:</span></td><td valign="top"><span style="font-family:verdana,arial,sans-serif; font-size:10px;"><a name="49d2551d6d"></a><select name="kickstarter[wizArray_upd][tables][1][fields][1][type]" onchange="setFormAnchorPoint('49d2551d6d');" title="WOP: [tables][1][fields][1][type]"><option value="" selected="selected"></option><option value="input">String input</option><option value="input+">String input, advanced</option><option value="textarea">Text area</option><option value="textarea_rte">Text area with RTE</option><option value="textarea_nowrap">Text area, No wrapping</option><option value="check">Checkbox, single</option><option value="check_4">Checkbox, 4 boxes in a row</option><option value="check_10">Checkbox, 10 boxes in two rows (max)</option><option value="link">Link</option><option value="date">Date</option><option value="datetime">Date and time</option><option value="integer">Integer, 10-1000</option><option value="select">Selectorbox</option><option value="radio">Radio buttons</option><option value="rel">Database relation</option><option value="files">Files</option><option value="none">Not editable, only displayed</option><option value="passthrough">[Passthrough]</option></select><a name="1c283ce973"></a><input type="hidden" name="kickstarter[wizArray_upd][tables][1][fields][1][excludeField]" value="0"><input type="checkbox" name="kickstarter[wizArray_upd][tables][1][fields][1][excludeField]" value="1" checked="checked" onclick="setFormAnchorPoint('1c283ce973');" title="WOP: [tables][1][fields][1][excludeField]"> Is Exclude-field  <a href="#" title="If a field is marked &quot;Exclude-field&quot;, users can edit it ONLY if the field is specifically listed in one of the backend user groups of the user.\nIn other words, if a field is marked &quot;Exclude-field&quot; you can control which users can edit it and which cannot." style="cursor:help" onclick="alert(String.fromCharCode(73,102,32,97,32,102,105,101,108,100,32,105,115,32,109,97,114,107,101,100,32,34,69,120,99,108,117,100,101,45,102,105,101,108,100,34,44,32,117,115,101,114,115,32,99,97,110,32,101,100,105,116,32,105,116,32,79,78,76,89,32,105,102,32,116,104,101,32,102,105,101,108,100,32,105,115,32,115,112,101,99,105,102,105,99,97,108,108,121,32,108,105,115,116,101,100,32,105,110,32,111,110,101,32,111,102,32,116,104,101,32,98,97,99,107,101,110,100,32,117,115,101,114,32,103,114,111,117,112,115,32,111,102,32,116,104,101,32,117,115,101,114,46,92,110,73,110,32,111,116,104,101,114,32,119,111,114,100,115,44,32,105,102,32,97,32,102,105,101,108,100,32,105,115,32,109,97,114,107,101,100,32,34,69,120,99,108,117,100,101,45,102,105,101,108,100,34,32,121,111,117,32,99,97,110,32,99,111,110,116,114,111,108,32,119,104,105,99,104,32,117,115,101,114,115,32,99,97,110,32,101,100,105,116,32,105,116,32,97,110,100,32,119,104,105,99,104,32,99,97,110,110,111,116,46));return false;">(What is this?)</a><br /></span></td></tr>
-</table></span></td></tr><tr bgcolor=""><td><span style="font-family:verdana,arial,sans-serif; font-size:10px;"><BR><BR>Load preset fields: <BR></span></td></tr></table>
-       </body>
-       </html>
\ No newline at end of file
index 2fce6ad..384b1a1 100644 (file)
@@ -1,3 +1,3 @@
 
-       # cat=basic//10; type=int; label= Page-ID where the main template is stored.
-       mainConfigStoragePid = 0
+       # cat=basic//10; type=int; label= Page-ID where the type definitions are stored (typically by adding a static template to the main template => root page pid).
+       mainConfigStoragePid = 
index f990100..5488ba0 100644 (file)
@@ -3,7 +3,7 @@
 ########################################################################
 # Extension Manager/Repository config file for ext: "contagged"
 #
-# Auto generated 06-10-2007 00:53
+# Auto generated 31-08-2008 18:02
 #
 # Manual updates:
 # Only the data in the array - anything else is removed by next write.
@@ -15,16 +15,16 @@ $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\'). Needs at least PHP 4.4.0',
        'category' => 'fe',
        'shy' => 0,
-       'version' => '0.0.13',
+       'version' => '0.1.0',
        'dependencies' => '',
        'conflicts' => '',
        'priority' => '',
        'loadOrder' => '',
        'module' => '',
-       'state' => 'alpha',
+       'state' => 'beta',
        'uploadfolder' => 1,
        'createDirs' => 'uploads/tx_contagged/rte/',
-       'modify_tables' => '',
+       'modify_tables' => 'tt_content,pages',
        'clearcacheonload' => 0,
        'lockType' => '',
        'author' => 'Jochen Rau',
@@ -40,7 +40,7 @@ $EM_CONF[$_EXTKEY] = array(
                'suggests' => array(
                ),
        ),
-       '_md5_values_when_last_written' => 'a:29:{s:9:"ChangeLog";s:4:"c780";s:10:"README.txt";s:4:"821e";s:22:"class.tx_contagged.php";s:4:"c03f";s:21:"ext_conf_template.txt";s:4:"f53f";s:12:"ext_icon.gif";s:4:"50a3";s:17:"ext_localconf.php";s:4:"a6a7";s:14:"ext_tables.php";s:4:"3a59";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:"9602";s:7:"tca.php";s:4:"dffd";s:27:"configuration/css/setup.txt";s:4:"f0f0";s:30:"configuration/ts/constants.txt";s:4:"9507";s:26:"configuration/ts/setup.txt";s:4:"a67c";s:49:"controller/class.tx_contagged_controller_list.php";s:4:"e29c";s:24:"controller/locallang.xml";s:4:"eab9";s:14:"doc/manual.sxw";s:4:"676c";s:19:"doc/wizard_form.dat";s:4:"8bf3";s:20:"doc/wizard_form.html";s:4:"c95f";s:41:"model/class.tx_contagged_model_mapper.php";s:4:"5534";s:40:"model/class.tx_contagged_model_terms.php";s:4:"60ef";s:30:"pi1/class.tx_contagged_pi1.php";s:4:"8f28";s:18:"pi1/contagged.tmpl";s:4:"a534";s:17:"pi1/locallang.xml";s:4:"4a6d";s:20:"static/constants.txt";s:4:"3696";s:16:"static/setup.txt";s:4:"5ff0";s:20:"static/css/setup.txt";s:4:"f0f0";s:37:"view/class.tx_contagged_view_list.php";s:4:"d51a";s:19:"view/contagged.tmpl";s:4:"f38e";}',
+       '_md5_values_when_last_written' => 'a:23:{s:9:"ChangeLog";s:4:"e057";s:10:"README.txt";s:4:"821e";s:22:"class.tx_contagged.php";s:4:"35e5";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: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:"ddcb";s:18:"pi1/contagged.tmpl";s:4:"4d1f";s:17:"pi1/locallang.xml";s:4:"1a34";s:20:"static/constants.txt";s:4:"af87";s:16:"static/setup.txt";s:4:"635b";s:20:"static/css/setup.txt";s:4:"22be";s:25:"static/examples/setup.txt";s:4:"b39c";s:31:"tests/tx_contagged_testcase.php";s:4:"4a3c";}',
        'suggests' => array(
        ),
 );
index c9a1002..ccd1010 100644 (file)
@@ -1,25 +1,11 @@
 <?php
 if (!defined ('TYPO3_MODE'))   die ('Access denied.');
 
-// TODO RTE configuration
-// t3lib_extMgm::addPageTSConfig('
-//     RTE.config.tx_contagged_terms.desc_long {
-//             proc.exitHTMLparser_db=1
-//             proc.exitHTMLparser_db {
-//                     keepNonMatchedTags=1
-//             }
-//     }
-// ');
-
-// TODO Remove lines below; just for testing
-// t3lib_extMgm::addPageTSConfig('
-//     TCEFORM.tx_contagged_terms.term_type.itemsProcFunc.test = 1
-// ');
-
 t3lib_extMgm::addUserTSConfig('
        options.saveDocNew.tx_contagged_terms=1
 ');
 
-// $TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_fe.php']['contentPostProc-all']['tx_contagged'] = 'EXT:contagged/class.tx_contagged.php:&tx_contagged->main';
+t3lib_extMgm::addPItoST43($_EXTKEY,'pi1/class.tx_contagged_pi1.php','_pi1','list_type',1);
 
+// $TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_fe.php']['contentPostProc-all']['tx_contagged'] = 'EXT:contagged/class.tx_contagged.php:&tx_contagged->main';
 ?>
\ No newline at end of file
index b3c84ad..7023148 100644 (file)
@@ -6,11 +6,11 @@ t3lib_extMgm::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');
-t3lib_extMgm::addPItoST43($_EXTKEY,'pi1/class.tx_contagged_pi1.php','_pi1','list_type',1);
 
 // initialize static extension templates
 t3lib_extMgm::addStaticFile($_EXTKEY,'static/', 'Content parser');
-t3lib_extMgm::addStaticFile($_EXTKEY,'static/css/','default CSS-styles');
+t3lib_extMgm::addStaticFile($_EXTKEY,'static/examples/', 'Experimental types');
+t3lib_extMgm::addStaticFile($_EXTKEY,'static/css/','Default CSS-styles');
 
 $TCA["tx_contagged_terms"] = array (
        "ctrl" => array (
diff --git a/js/selecttext.js b/js/selecttext.js
new file mode 100644 (file)
index 0000000..d605d4c
--- /dev/null
@@ -0,0 +1,78 @@
+// Find out if IE runs in quirks mode
+var documentElement = (
+             typeof document.compatMode != "undefined" && 
+             document.compatMode        != "BackCompat"
+            )? "documentElement" : "body";
+
+// Register event
+function init_getSelectedText() {
+    document.onmouseup = getSelectedText;
+    document.onmousedown = resetClassAttribute;
+}
+
+
+function getSelectedText(e) {  
+
+       var txt = '';
+       if (window.getSelection) {
+               txt = window.getSelection();
+       } else if (document.getSelection) {
+               txt = document.getSelection();
+       } else if (document.selection) {
+               txt = document.selection.createRange().text;
+       } else return;
+
+       // Get mouse position
+       xPos = 0;
+       yPos = 0;
+    // Position where the mouse event fired
+    var xPos =  e? e.pageX : window.event.x;
+       var yPos =  e? e.pageY : window.event.y;
+       // For IE: add scroll position
+       if (document.all && !document.captureEvents) {
+           xPos += document[documentElement].scrollLeft;
+           yPos += document[documentElement].scrollTop;
+    }
+       var panel = document.getElementById('tx_contagged_panel');
+       if (txt!='' && panel ) {
+               if (panel.getAttribute('class')=='') {
+                       panel.style.visibility = 'visible';
+                       panel.style.top = (yPos-20)+'px';
+                       panel.style.left = xPos+'px';
+                       panel.setAttribute('class','fixed');
+                       var form = panel.getElementsByTagName('FORM')[0];
+                       // alert(form);
+                       var link = form.getElementsByTagName('A')[0];
+                       onclick = link.getAttribute('onclick');
+                       parts = onclick.split('&noView=0');
+                       // alert(parts[1]);
+                       newOnclick = parts[0]+'&noView=0&defVals[tx_contagged_terms][term_main]='+txt+'&'+parts[1];
+                       link.setAttribute('onclick',newOnclick);
+                       // childs = form[0].getElementById('tx_contagged_defVal');
+                       // childs = form[0];
+                       // if (false) {
+                       //      childs[0].setAttribute('value',txt);                            
+                       // } else {
+                       //      var hiddenField = document.createElement('input');
+                       //      hiddenField.setAttribute('type','hidden');
+                       //      hiddenField.setAttribute('name','TSFE_EDIT[data][tx_contagged_terms][NEW][term_main]');
+                       //      hiddenField.setAttribute('value',txt);
+                       //      hiddenField.setAttribute('id','tx_contagged_defVal');
+                       //      form[0].insertBefore(hiddenField,form[0].firstChild);                           
+                       // }
+               }
+       // '<input type="hidden" name="TSFE_EDIT[data][tx_contagged_terms][NEW][term_main]" value="'+txt+'" />');
+       } else {
+               panel.style.visibility = 'hidden';
+       }
+}
+
+function resetClassAttribute(e) {
+       var panel = document.getElementById('tx_contagged_panel');
+       if (panel.getAttribute('class')=='fixed') {
+               panel.setAttribute('class','second');
+       } else {
+               panel.setAttribute('class','');
+       }
+}
\ No newline at end of file
index 4ff5989..4a534ef 100644 (file)
@@ -16,6 +16,7 @@
                        <label index="tx_contagged_terms.term_lang.I.3">German</label>
                        <label index="tx_contagged_terms.term_lang.I.4">Italian</label>
                        <label index="tx_contagged_terms.term_lang.I.5">Spanish</label>
+                       <label index="tx_contagged_terms.term_lang.I.6">unpolite</label>
                        <label index="tx_contagged_terms.term_lang">Language of term</label>
                        <label index="tx_contagged_terms.term_replace">Replacement</label>
                        <label index="tx_contagged_terms.desc_short">Short Description (e.g. Tool Tip Text)</label>
                        <label index="tx_contagged_terms.term_lang.I.3">Deutsch</label>
                        <label index="tx_contagged_terms.term_lang.I.4">Italienisch</label>
                        <label index="tx_contagged_terms.term_lang.I.5">Spanisch</label>
+                       <label index="tx_contagged_terms.term_lang.I.6">unhöflich</label>
                        <label index="tx_contagged_terms.term_lang">Sprache des Ausdrucks</label>
                        <label index="tx_contagged_terms.term_replace">Ersatz</label>
-                       <label index="tx_contagged_terms.desc_short">Kurzbeschreibung (z. B. Tool-Tip-Text)</label>
+                       <label index="tx_contagged_terms.desc_short">Kurzbeschreibung (z.B. Tool-Tip-Text)</label>
                        <label index="tx_contagged_terms.desc_long">Ausführliche Beschreibung</label>
                        <label index="tx_contagged_terms.link">Verweis</label>
                        <label index="tx_contagged_terms.exclude">Von Frontend-Listen ausschließen</label>
index bc00385..f5cfb23 100644 (file)
        ***************************************************************/
 
 /**
      * The model of contagged.
-       * 
      * @author       Jochen Rau <j.rau@web.de>
      * @package      TYPO3
      * @subpackage   tx_contagged_model_mapper
      */
+ * The model of contagged.
+ *
* @author     Jochen Rau <j.rau@web.de>
* @package    TYPO3
* @subpackage tx_contagged_model_mapper
+ */
 class tx_contagged_model_mapper {
        var $conf; // the TypoScript configuration array
        var $cObj;
        var $controller;
-       
+
        function tx_contagged_model_mapper($controller) {
                $this->controller = $controller;
                $this->conf = $controller->conf;
@@ -41,10 +41,12 @@ class tx_contagged_model_mapper {
        }
 
        /**
-               * Build an array of the entries in the table "tx_contagged_terms"
-               *
-               * @return       An array with the data of the table "tx_contagged_terms"
-               */
+        * Build an array of the entries in the table "tx_contagged_terms"
+        *
+        * @param       [type]          $result: ...
+        * @param       [type]          $dataSource: ...
+        * @return      An              array with the data of the table "tx_contagged_terms"
+        */
        function getDataArray($result,$dataSource) {
                $dataArray = array();
                $terms = array();
@@ -62,47 +64,97 @@ class tx_contagged_model_mapper {
                                $fieldsToMapArray[] = $fieldToMap;
                        }
                }
-               
+
                // iterate through all data from the datasource
                foreach ($result as $row) {
-                       $secureFields = $this->conf['types.'][$row['term_type'].'.']['termIsRegEx']>0 ? $this->conf['types.'][$row['term_type'].'.']['secureFields'] : $this->conf['secureFields'];
                        if ($dataSourceConfigArray['mapping.']['uid.']['field']) {
-                               $termUid = $row[$dataSourceConfigArray['mapping.']['uid.']['field']];                           
+                               $termKey = $row[$dataSourceConfigArray['mapping.']['uid.']['field']];
                        }
                        $termMain = $dataSourceConfigArray['mapping.']['term_main.']['field'] ? $dataSourceConfigArray['mapping.']['term_main.']['field'] : '';
                        $termReplace = $dataSourceConfigArray['mapping.']['term_replace.']['field'] ? $dataSourceConfigArray['mapping.']['term_replace.']['field'] : '';
                        $term = $row[$termReplace] ? $row[$termReplace] : $row[$termMain];
-                       $dataArray[$termUid] = array();
-                       $dataArray[$termUid]['term'] = $term;
+                       $mappedDataArray = array();
+                       $mappedDataArray['term'] = $term;
                        foreach ( $fieldsToMapArray as $field) {
                                $value = $dataSourceConfigArray['mapping.'][$field.'.'];
                                if ( $value['value'] ) {
-                                       $dataArray[$termUid][$field] = $value['value'];
+                                       $mappedDataArray[$field] = $value['value'];
                                } elseif ( $value['field'] ) {
-                                       $dataArray[$termUid][$field] = t3lib_div::inList($secureFields,$field) ? htmlspecialchars($row[$value['field']]) : $row[$value['field']];
+                                       $mappedDataArray[$field] = $row[$value['field']];
                                } else {
-                                       $dataArray[$termUid][$field] = NULL;
+                                       $mappedDataArray[$field] = NULL;
                                }
                                if ( $value['stdWrap.'] ) {
-                                       $dataArray[$termUid][$field] = $this->cObj->stdWrap($dataArray[$termUid][$field],$value['stdWrap.']);
-                               }
-                               $GLOBALS['TSFE']->register['contagged_'.$field] = $dataArray[$termUid][$field];                                 
-                               if ( !t3lib_div::inArray($fieldsToMapArray,$field) ) {
-                                       unset( $dataArray[$termUid][$field]);
+                                       $mappedDataArray[$field] = $this->cObj->stdWrap($mappedDataArray[$field],$value['stdWrap.']);
                                }
+                               $GLOBALS['TSFE']->register['contagged_'.$field] = $mappedDataArray[$field];
                        }
-                       // TODO sort the array by descending length of value string; in combination with the htmlparser this will prevend nesting
                        // TODO $desc_long = preg_replace('/(\015\012)|(\015)|(\012)/ui','<br />',$row['desc_long']);
-                       
+                       $typeConfigArray = $this->conf['types.'][$mappedDataArray['term_type'].'.'];
+
                        // post processing
-                       $dataArray[$termUid]['term_alt'] = t3lib_div::trimExplode(chr(10),$row['term_alt'],$onlyNonEmptyValues=1);
-                       $dataArray[$termUid]['desc_long'] = $this->cObj->parseFunc($dataArray[$termUid]['desc_long'],$conf='',$ref='< lib.parseFunc_RTE');
+                       $mappedDataArray['term_alt'] = t3lib_div::trimExplode(chr(10),$row['term_alt'],1);
+                       $mappedDataArray['desc_long'] = $this->cObj->parseFunc($mappedDataArray['desc_long'],$conf='',$ref='< lib.parseFunc_RTE');
+                       $mappedDataArray['storagePids'] = $this->getStoragePidsArray($typeConfigArray);
+                                               
+                       if ($typeConfigArray['listPages']) {
+                               $mappedDataArray['listPages'] = t3lib_div::trimExplode(',',$typeConfigArray['listPages'],1);
+                       } else {
+                               $mappedDataArray['listPages'] = t3lib_div::trimExplode(',',$this->conf['listPages'],1);
+                       }
+
+                       // TODO Remove; only for backwards compatibility
+                       // if ($typeConfigArray['listPage']) {
+                       //      $mappedDataArray['listPages'] = t3lib_div::trimExplode(',',$typeConfigArray['listPage'],1);
+                       // } else {
+                       //      $mappedDataArray['listPages'] = t3lib_div::trimExplode(',',$this->conf['listPage'],1);
+                       // }
+
+                       $secureFields = $typeConfigArray['termIsRegEx']>0 ? $this->conf['types.'][$row['term_type'].'.']['secureFields'] : $this->conf['secureFields'];
+                       foreach ($mappedDataArray as $field => $fieldContent) {
+                               if ($fieldContent) {
+                                       if ( is_array($fieldContent) ) {
+                                               foreach ($fieldContent as $termAltKey => $innerContent) {
+                                                       if ( t3lib_div::inList($secureFields,$field) ) {
+                                                               $mappedDataArray[$field][$termAltKey] = htmlspecialchars($innerContent);
+                                                       }
+                                               }
+                                       } else {
+                                               if ( t3lib_div::inList($secureFields,$field) ) {
+                                                       $mappedDataArray[$field] = htmlspecialchars($fieldContent);
+                                               }
+                                       }
+                               }
+                       }
+                       
                        // TODO: hook "mappingPostProcessing"
+                       $dataArray[] = $mappedDataArray;
                }
 
                return $dataArray;
        }
 
+       /**
+        * get the storage pids; cascade: type > dataSource > globalConfig
+        *
+        * @param string        $typeConfigArray 
+        * @return array        An array containing the storage PIDs of the type given by
+        * @author Jochen Rau
+        */
+       function getStoragePidsArray($typeConfigArray) {
+               $storagePidsArray = array();            
+               $dataSource = $typeConfigArray['dataSource'] ? $typeConfigArray['dataSource'] : 'default';
+               if ( $typeConfigArray['storagePids'] ) {
+                       $storagePidsArray = t3lib_div::trimExplode(',',$typeConfigArray['storagePids']);
+               } elseif ( $this->conf['dataSources.'][$dataSource.'.']['storagePids'] ) {
+                       $storagePidsArray = t3lib_div::trimExplode(',',$this->conf['dataSources.'][$dataSource.'.']['storagePids']);
+               } elseif ( $this->conf['storagePids']) {
+                       $storagePidsArray = t3lib_div::trimExplode(',',$this->conf['storagePids']);
+               }
+               
+               return $storagePidsArray;
+       }
+
 }
 
 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/contagged/model/class.tx_contagged_model_mapper.php']) {
index e2f30ff..a169992 100644 (file)
 require_once (t3lib_extMgm::extPath('contagged') . 'model/class.tx_contagged_model_mapper.php');
 
 /**
      * The model of contagged.
-       * 
      * @author       Jochen Rau <j.rau@web.de>
      * @package      TYPO3
      * @subpackage   tx_contagged_model_terms
      */
+ * The model of contagged.
+ *
* @author     Jochen Rau <j.rau@web.de>
* @package    TYPO3
* @subpackage tx_contagged_model_terms
+ */
 class tx_contagged_model_terms {
        var $conf; // the TypoScript configuration array
        var $cObj;
        var $controller;
        var $tablesArray; // array of all tables in the database
-       
+
        function tx_contagged_model_terms($controller) {
                $this->controller = $controller;
                $this->conf = $controller->conf;
                $this->cObj = $controller->cObj;
-               
+
+               $mapperClassName = t3lib_div::makeInstanceClassName('tx_contagged_model_mapper');
+               $this->mapper = new $mapperClassName($this->controller);
+
                // build an array of tables in the database
                $tablesArray = array();
                $tablesResult = mysql_list_tables(TYPO3_db);
@@ -51,35 +54,47 @@ class tx_contagged_model_terms {
                }
        }
 
-       function getAllTerms() {
+       /**
+        * [Describe function...]
+        *
+        * @return      [type]          ...
+        */
+       function getTermsArray() {
                $typesArray = $this->conf['types.'];
                $termsArray = array();
-               foreach ($typesArray as $type => $typeConfigArray) {
-
-                       // get the storage pids
-                       if ( $typeConfigArray['storagePids'] ) {
-                               $storagePids = $typeConfigArray['storagePids'];
-                       } elseif ( $this->conf['dataSources.'][$typeConfigArray['dataSource'].'.']['storagePids'] ) {
-                               $storagePids = $this->conf['dataSources.'][$typeConfigArray['dataSource'].'.']['storagePids'];
-                       } elseif ( $this->conf['storagePids'] ) {
-                               $storagePids = $this->conf['storagePids'];
-                       } else {
-                               $storagePids = '';
-                       }
-
+               $dataSourceArray = array();
+               foreach ($typesArray as $type=>$typeConfigArray) {
+                       $storagePidsArray = $this->mapper->getStoragePidsArray($typeConfigArray);
                        $dataSource = $typeConfigArray['dataSource'] ? $typeConfigArray['dataSource'] : 'default';
-
-                       // get an array of all data rows in the configured tables
-                       if ( $storagePids!='' ) {
-                               $termsArray = t3lib_div::array_merge($termsArray,$this->getTermsArray($dataSource,$storagePids));
+                       foreach ($storagePidsArray as $pid) {
+                               // if there is an entry for the data source: check for duplicates before adding the pid
+                               // otherwise: create a new entry and add the pid
+                               if ($dataSourceArray[$dataSource]) {
+                                       if ( !in_array($pid,$dataSourceArray[$dataSource]) ) {
+                                               $dataSourceArray[$dataSource][] = $pid;
+                                       }
+                               } else {
+                                       $dataSourceArray[$dataSource][] = $pid;
+                               }
                        }
                }
-               
-               uasort($termsArray,array($this,"sortByTermAscending"));
-               
+               // get an array of all data rows in the configured tables
+               foreach ($dataSourceArray as $dataSource=>$storagePidsArray ) {
+                       $termsArray = array_merge($termsArray,$this->getTerms($dataSource,$storagePidsArray));
+               }
+
+               uasort($termsArray,array($this,'sortByTermAscending'));
+
                return $termsArray;
        }
-       
+
+       /**
+        * [Describe function...]
+        *
+        * @param       [type]          $termArrayA: ...
+        * @param       [type]          $termArrayB: ...
+        * @return      [type]          ...
+        */
        function sortByTermAscending($termArrayA,$termArrayB) {
                // TODO: improve sorting (UTF8, configurable, localized->hook)
                // strcasecmp() internally converts the two strings it is comparing to lowercase, based on the server locale settings. As such, it
@@ -87,7 +102,9 @@ class tx_contagged_model_terms {
                // locale, may have internally corrupted the UTF-8 strings it is comparing, having falsely matched byte sequences. It won’t actually
                // damage the UTF-8 string but the result of the comparison cannot be trusted. (Ref. http://www.phpwact.org/php/i18n/utf-8)
                // TODO remove; just a hack
-               $termsArray = array($termArrayA['term'],$termArrayB['term']);
+               $sortFieldA = $this->getSortField($termArrayA);
+               $sortFieldB = $this->getSortField($termArrayB);
+               $termsArray = array($termArrayA[$sortFieldA],$termArrayB[$sortFieldB]);
                // $GLOBALS['TSFE']->csConvObj->convArray($termsArray,'utf-8','iso-8859-1');
                $termsArrayBefore = $termsArray;
                sort($termsArray,SORT_LOCALE_STRING);
@@ -103,22 +120,24 @@ class tx_contagged_model_terms {
        }
 
        /**
-               * Build an array of the entries in the tables
-               *
-               * @return       An array with the terms an their configuration
-               */
-       function getTermsArray($dataSource,$storagePids='') {
+        * Build an array of the entries in the tables
+        *
+        * @param       [type]          $dataSource: ...
+        * @param       [type]          $storagePids: ...
+        * @return      An              array with the terms an their configuration
+        */
+       function getTerms($dataSource,$storagePidsArray=NULL) {
                $dataArray = array();
                $terms = array();
-
-               $dataSourceConfigArray = $this->conf['dataSources.'][$dataSource . '.'];
+               $storagePidsList = implode(',',$storagePidsArray);
+               $dataSourceConfigArray = $this->conf['dataSources.'][$dataSource.'.'];
                $sourceName = $dataSourceConfigArray['sourceName'];
-               
+
                // check if the table exists in the database
                if (t3lib_div::inArray($this->tablesArray,$sourceName) ) {
                        // Build WHERE-clause
                        $whereClause = '1=1';
-                       $whereClause .= $storagePids ? ' AND pid IN ('.$storagePids.')' : '';
+                       $whereClause .= $storagePidsList ? ' AND pid IN ('.$storagePidsList.')' : '';
                        $whereClause .= $dataSourceConfigArray['hasSysLanguageUid'] ? ' AND (sys_language_uid='.intval($GLOBALS['TSFE']->sys_language_uid) . ' OR sys_language_uid=-1)' : '';
                        $whereClause .= tslib_cObj::enableFields($sourceName);
 
@@ -130,24 +149,24 @@ class tx_contagged_model_terms {
                                );
 
                        // map the fields
-                       $mapper = new tx_contagged_model_mapper($this->controller);
-                       $dataArray = $mapper->getDataArray($result,$dataSource);
+                       $dataArray = $this->mapper->getDataArray($result,$dataSource);
                }
-
+               
                // TODO piVars as a data source
-               //              $result = array(
-               //                      array(
-               //                              'uid' => 5,
-               //                              'pid' => 94,
-               //                              'term' => 'nullam',
-               //                              'term_type' => 'definition',
-               //                              'desc_short' => 'Test'                  
-               //                              )
-               //                      );
-               // krumo($result);
 
                return $dataArray;
        }
+       
+       function getSortField($termArray) {
+               if ($this->conf['types.'][$termArray['term_type'].'.']['sortField']) {
+                       $sortField = $this->conf['types.'][$termArray['term_type'].'.']['sortField'];
+               } elseif ($this->conf['sortField']) {
+                       $sortField = $this->conf['sortField'];
+               } else {
+                       $sortField = 'term';
+               }
+               return $sortField;
+       }
 
 }
 
index 05eac6f..b05e042 100644 (file)
 
 require_once (PATH_tslib . 'class.tslib_pibase.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');
 
 /**
      * contagged list plugin
-       * 
      * @author       Jochen Rau <j.rau@web.de>
      * @package      TYPO3
      * @subpackage   tx_contagged_pi1
      */
+ * contagged list plugin
+ *
* @author     Jochen Rau <j.rau@web.de>
* @package    TYPO3
* @subpackage tx_contagged_pi1
+ */
 class tx_contagged_pi1 extends tslib_pibase {
        var $prefixId = 'tx_contagged_pi1'; // same as class name
        var $scriptRelPath = 'pi1/class.tx_contagged_pi1.php'; // path to this script relative to the extension dir
@@ -43,15 +44,15 @@ class tx_contagged_pi1 extends tslib_pibase {
        var $typolinkConf;
        var $backPid; // pid of the last visited page (from piVars)
        var $indexChar; // char of the given index the user has clicked on (from piVars)
-       var $termUid;
+       var $termKey; // local key for each term (not related to the uid in the database)
 
        /**
-               * main method of the contagged list plugin
-               *
-               * @param        string          $content: The content of the cObj
-               * @param        array           $conf: The configuration
-               * @return       a single or list view of terms
-               */
+        * main method of the contagged list plugin
+        *
+        * @param       string          $content: The content of the cObj
+        * @param       array           $conf: The configuration
+        * @return      string                  a single or list view of terms
+        */
        function main($content) {
                $this->local_cObj = t3lib_div::makeInstance('tslib_cObj');
                $this->local_cObj->setCurrentVal($GLOBALS['TSFE']->id);
@@ -64,63 +65,123 @@ class tx_contagged_pi1 extends tslib_pibase {
                unset($this->typolinkConf['additionalParams.']);
                $this->backPid = (int)$this->piVars['backPid'] ? (int)$this->piVars['backPid'] : NULL;
                $this->indexChar = $this->piVars['index'] ? urldecode($this->piVars['index']) : NULL;
-               $this->termUid = (int)$this->piVars['uid'] ? (int)$this->piVars['uid'] : NULL;
+               if ( !is_null($this->piVars['key']) ) {
+                       $this->termKey = (int)$this->piVars['key'];
+               }
+               $this->sword = $this->piVars['sword'] ? urldecode($this->piVars['sword']) : NULL;
+
+               // get an array of all type configurations
+               $this->typesArray = $this->conf['types.'];
+
+               $this->mapper = new tx_contagged_model_mapper($this);
 
-               $model = new tx_contagged_model_terms($this);
-               $this->termsArray = $model->getAllTerms();
+               // get the model (an associated array of terms)
+               $this->model = new tx_contagged_model_terms($this);
+               $this->termsArray = $this->model->getTermsArray();
 
-               if ( $this->termUid==NULL ) {
-                       $renderFunction = 'renderList';                 
-               } elseif ( $this->termUid!=NULL ) {
-                       $renderFunction = 'renderSingleItemByUid';                                                                      
+               if ( is_null($this->termKey) && is_null($this->sword) ) {
+                       $renderFunction = 'renderList';
+               } elseif ( is_null($this->termKey) && !is_null($this->sword) ) {
+                       $renderFunction = 'renderListBySword';
+               } elseif ( !is_null($this->termKey) ) {
+                       $renderFunction = 'renderSingleItemByKey';
                }
 
                // TODO hook "newRenderFunctionName"
-               
+
                if(method_exists($this, $renderFunction)) {
                        $content .= $this->$renderFunction();
                }
 
-               return $this->pi_wrapInBaseClass($content);     
+               return $this->pi_wrapInBaseClass($content);
        }
 
+       /**
+        * [Describe function...]
+        *
+        * @return      [type]          ...
+        */
        function renderList() {
                $subparts = $this->getSubparts('LIST');
                $this->renderLinks($markerArray,$wrappedSubpartArray);
                $this->renderIndex($markerArray);
-               foreach ( $this->termsArray as $termUid => $termArray ) {
-                       if ( $termArray['exclude']!=1 && $this->conf['types.'][$termArray['term_type'].'.']['dontListTerms']!=1 ) {
+               foreach ( $this->termsArray as $termKey => $termArray ) {
+                       if ( $termArray['exclude']!=1 && $this->conf['types.'][$termArray['term_type'].'.']['dontListTerms']!=1 && in_array($GLOBALS['TSFE']->id,$termArray['listPages']) ) {
                                if ( $this->indexChar==NULL || $termArray['indexChar']==$this->indexChar ) {
-                                       $this->renderSingleItem($termUid,$markerArray,$wrappedSubpartArray);
+                                       $this->renderSingleItem($termKey,$markerArray,$wrappedSubpartArray);
                                        $subpartArray['###LIST###'] .= $this->cObj->substituteMarkerArrayCached($subparts['item'],$markerArray,$subpartArray,$wrappedSubpartArray);
                                }
                        }
                }
                $content = $this->cObj->substituteMarkerArrayCached($subparts['template_list'],$markerArray,$subpartArray,$wrappedSubpartArray);
-               
+
                return $content;
        }
-       
-       function renderSingleItemByUid() {
+
+       /**
+        * [Describe function...]
+        *
+        * @return      [type]          ...
+        */
+       function renderListBySword() {
+               $subparts = $this->getSubparts('LIST');
+               $this->renderLinks($markerArray,$wrappedSubpartArray);
+               $this->renderIndex($markerArray);
+               foreach ( $this->termsArray as $termKey => $termArray ) {
+                       if ( $termArray['exclude']!=1 && $this->conf['types.'][$termArray['term_type'].'.']['dontListTerms']!=1 ) {
+                               if ( $this->indexChar==NULL || $termArray['indexChar']==$this->indexChar ) {
+                                       $fieldsToSearch = t3lib_div::trimExplode(',',$this->conf['fieldsToSearch'] );
+                                       foreach ($fieldsToSearch as $field) {
+                                               $swordMatched = preg_match('/'.preg_quote($this->sword,'/').'/Uui',$termArray[$field]) ? TRUE : FALSE;
+                                       }
+                                       if ( $swordMatched ) {
+                                               $this->renderSingleItem($termKey,$markerArray,$wrappedSubpartArray);
+                                               $subpartArray['###LIST###'] .= $this->cObj->substituteMarkerArrayCached($subparts['item'],$markerArray,$subpartArray,$wrappedSubpartArray);
+                                       }
+                               }
+                       }
+               }
+               // TODO Display warning if result is empty
+               // if (!$content) {
+               //      $subpartArray['###LIST###'] = "No items.";
+               // }
+               $content = $this->cObj->substituteMarkerArrayCached($subparts['template_list'],$markerArray,$subpartArray,$wrappedSubpartArray);                        
+
+               return $content;
+       }
+
+       /**
+        * [Describe function...]
+        *
+        * @return      [type]          ...
+        */
+       function renderSingleItemByKey() {
                $subparts = $this->getSubparts('SINGLE');
-               $this->renderLinks($markerArray,$wrappedSubpartArray);          
+               $this->renderLinks($markerArray,$wrappedSubpartArray);
                $this->renderIndex($markerArray);
-               $this->renderSingleItem($this->termUid,$markerArray,$wrappedSubpartArray);
-               $subpartArray['###LIST###'] = $this->cObj->substituteMarkerArrayCached($subparts['item'],$markerArray,$subpartArray,$wrappedSubpartArray);              
+               $this->renderSingleItem($this->termKey,$markerArray,$wrappedSubpartArray);
+               $subpartArray['###LIST###'] = $this->cObj->substituteMarkerArrayCached($subparts['item'],$markerArray,$subpartArray,$wrappedSubpartArray);
                $content = $this->cObj->substituteMarkerArrayCached($subparts['template_list'],$markerArray,$subpartArray,$wrappedSubpartArray);
-               
+
                return $content;
        }
-       
+
        // TODO hook "newRenderFunction"
-       
+
        function getSubparts($templateName='LIST') {
                $subparts['template_list'] = $this->cObj->getSubpart($this->templateCode,'###TEMPLATE_' . $templateName . '###');
                $subparts['item'] = $this->cObj->getSubpart($subparts['template_list'],'###ITEM###');
-               
+
                return $subparts;
        }
-       
+
+       /**
+        * [Describe function...]
+        *
+        * @param       [type]          $$markerArray: ...
+        * @param       [type]          $wrappedSubpartArray: ...
+        * @return      [type]          ...
+        */
        function renderLinks(&$markerArray,&$wrappedSubpartArray) {
                // make "back to..." link
                if ($this->backPid) {
@@ -135,34 +196,45 @@ class tx_contagged_pi1 extends tslib_pibase {
                }
                unset($typolinkConf);
                $typolinkConf['parameter'] = $this->backPid;
-               $wrappedSubpartArray['###LINK_BACK_TO###'] = $this->local_cObj->typolinkWrap($typolinkConf);    
+               $wrappedSubpartArray['###LINK_BACK_TO###'] = $this->local_cObj->typolinkWrap($typolinkConf);
 
                // make "link to all entries"
-               unset($typolinkConf);
-               $typolinkConf = $this->typolinkConf;
-               $allLink = $this->local_cObj->typolink($this->pi_getLL('all'), $typolinkConf);
-               $markerArray['###INDEX_ALL###'] = $allLink;
+           $markerArray['###INDEX_ALL###'] = $this->pi_linkTP($this->pi_getLL('all'));
 
                // make "to list ..." link
                unset($typolinkConf);
                $markerArray['###TO_LIST###'] = $this->pi_getLL('toList');
                $typolinkConf = $this->typolinkConf;
                $typolinkConf['parameter.']['wrap'] = "|,".$GLOBALS['TSFE']->type;
-               $wrappedSubpartArray['###LINK_TO_LIST###'] = $this->local_cObj->typolinkWrap($typolinkConf);
+               $wrappedSubpartArray['###LINK_TO_LIST###'] = $this->local_cObj->typolinkWrap($typolinkConf);            
        }
 
-       function renderSingleItem ($termUid,&$markerArray,&$wrappedSubpartArray) {              
-               $termArray = $this->termsArray[$termUid];
+       /**
+        * [Describe function...]
+        *
+        * @param       [type]          $termKey: ...
+        * @param       [type]          $markerArray: ...
+        * @param       [type]          $wrappedSubpartArray: ...
+        * @return      [type]          ...
+        */
+       function renderSingleItem ($termKey,&$markerArray,&$wrappedSubpartArray) {
+               $termArray = $this->termsArray[$termKey];
                $typeConfigArray = $this->conf['types.'][$termArray['term_type'] . '.'];
 
+               // TODO Add a search box
+               // $markerArray['###SEARCHBOX###'] = $this->pi_list_searchBox();
+               $markerArray['###SEARCHBOX###'] = '';
+
                $markerArray['###TERM_TYPE###'] = $typeConfigArray['label'];
-               $markerArray['###TERM###'] = $termArray['term'];
+               $markerArray['###TERM###'] = $this->cObj->editIcons($termArray['term'],'tx_contagged_terms:term_main,term_alt,term_type,term_lang,term_replace,desc_short,desc_long,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['###TERM_LANG###'] = $this->pi_getLL('lang.'.$termArray['term_lang'])?$this->pi_getLL('lang.'.$termArray['term_lang']):$this->pi_getLL('na');
+               // TODO Support for tx_categories
+               $markerArray['###TERM_CATEGORY###'] = $termArray['term_category']?$termArray['term_category']:$this->pi_getLL('na');
 
                $labelWrap['noTrimWrap'] = $typeConfigArray['labelWrap1']?$typeConfigArray['labelWrap1']:$this->conf['labelWrap1'];
                $markerArray['###TERM_TYPE_LABEL###'] = $markerArray['###TERM_TYPE###']?$this->local_cObj->stdWrap($this->pi_getLL('term_type'),$labelWrap):'';
@@ -178,15 +250,21 @@ class tx_contagged_pi1 extends tslib_pibase {
                $markerArray['###DETAILS###'] = $this->pi_getLL('details');
                unset($typolinkConf);
                $typolinkConf = $this->typolinkConf;
-               $typolinkConf['additionalParams'] .= '&' . $this->prefixId . '[uid]=' . $termUid;
+               $typolinkConf['additionalParams'] .= '&' . $this->prefixId . '[key]=' . $termKey;
                $typolinkConf['parameter.']['wrap'] = "|,".$GLOBALS['TSFE']->type;
                $wrappedSubpartArray['###LINK_DETAILS###'] = $this->local_cObj->typolinkWrap($typolinkConf);
        }
 
+       /**
+        * [Describe function...]
+        *
+        * @param       [type]          $$markerArray: ...
+        * @return      [type]          ...
+        */
        function renderIndex (&$markerArray) {
                $subparts = array();
                $subparts['template_index'] = $this->cObj->getSubpart($this->templateCode,'###TEMPLATE_INDEX###');
-               $subparts['item'] = $this->cObj->getSubpart($subparts['template_index'],'###ITEM###');          
+               $subparts['item'] = $this->cObj->getSubpart($subparts['template_index'],'###ITEM###');
 
                $indexArray = $this->getIndexArray();
 
@@ -215,6 +293,11 @@ class tx_contagged_pi1 extends tslib_pibase {
                $markerArray['###INDEX###'] = $this->cObj->substituteMarkerArrayCached($subparts['template_index'], $markerArray, $subpartArray);
        }
 
+       /**
+        * [Describe function...]
+        *
+        * @return      [type]          ...
+        */
        function getIndexArray() {
                // Get localized index chars.
                foreach (t3lib_div::trimExplode(',', $this->pi_getLL('indexChars')) as $key => $value) {
@@ -228,39 +311,42 @@ class tx_contagged_pi1 extends tslib_pibase {
                // The configuered subchars like Ö will be linked as O (see documentation and file "locallang.xml").
                unset($typolinkConf);
                $typolinkConf = $this->typolinkConf;
-               foreach ($this->termsArray as $termUid => $termArray) {
-                       if ( $termArray['exclude']!=1 && $this->conf['types.'][$termArray['term_type'].'.']['dontListTerms']!=1 ) {
+               foreach ($this->termsArray as $termKey => $termArray) {
+                       if ( $termArray['exclude']!=1 && $this->conf['types.'][$termArray['term_type'].'.']['dontListTerms']!=1 && in_array($GLOBALS['TSFE']->id,$termArray['listPages']) ) {
+                               $sortField = $this->model->getSortField($termArray);
+                               // debug($sortField);
                                foreach ($reverseIndexArray as $subChar => $indexChar) {
                                        // debug(preg_quote($subChar),$termArray['term']);
                                        // debug(preg_match('/^'.preg_quote($subChar).'/ui',$termArray['term']));
-                                       if ( preg_match('/^'.preg_quote($subChar).'/ui',$termArray['term'])>0 ) {
+                                       if ( preg_match('/^'.preg_quote($subChar).'/ui',$termArray[$sortField])>0 ) {
                                                $typolinkConf['additionalParams'] = '&' . $this->prefixId . '[index]=' . $indexChar;
                                                $indexArray[$indexChar] = $this->local_cObj->typolink($indexChar, $typolinkConf);
-                                               $this->termsArray[$termUid]['indexChar'] = $indexChar;
+                                               $this->termsArray[$termKey]['indexChar'] = $indexChar;
                                        }
                                }
                                // If the term matches no given index char, crate one if desired and add it to the index
-                               if ( $this->termsArray[$termUid]['indexChar']=='' && $this->conf['autoAddIndexChars']==1 ) {
+                               if ( $this->termsArray[$termKey]['indexChar']=='' && $this->conf['autoAddIndexChars']==1 ) {                                    
                                        // get the first char of the term (UTF8)
                                        // TODO: Make the RegEx configurable to make ZIP-Codes possible
-                                       preg_match('/^./u',$termArray['term'],$match);
+                                       preg_match('/^./u',$termArray[$sortField],$match);
                                        $newIndexChar = $match[0];
                                        $indexArray[$newIndexChar] = NULL;
                                        $typolinkConf['additionalParams'] = '&' . $this->prefixId . '[index]=' . urlencode($newIndexChar);
                                        $indexArray[$newIndexChar] = $this->local_cObj->typolink($newIndexChar, $typolinkConf);
-                                       $this->termsArray[$termUid]['indexChar'] = $newIndexChar;
+                                       $this->termsArray[$termKey]['indexChar'] = $newIndexChar;
                                }
                        }
                }
 
                // TODO Sorting of the index (UTF8)
                ksort($indexArray,SORT_LOCALE_STRING);
-               
+
                return $indexArray;
        }
 }
 
+
 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/contagged/pi1/class.tx_contagged_pi1.php']) {
        include_once ($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/contagged/pi1/class.tx_contagged_pi1.php']);
-}      
+}
 ?>
\ No newline at end of file
index 2814d30..d7d2f4f 100644 (file)
                This is the template to display a list of terms
        -->
        ###INDEX###
+       ###SEARCHBOX###
        <dl class="tx-contagged-list">
                <!-- ###LIST###-->
                        <!-- ###ITEM###-->              
                                <dt>###TERM###</dt>
-                               <dd>###TERM_ALT_LABEL######TERM_ALT###</dd>
                                <dd>###DESC_SHORT###</dd>
                                <dd class="tx-contagged-navlink"><!--###LINK_DETAILS###-->###DETAILS###<!--###LINK_DETAILS###--></dd>
                        <!-- ###ITEM###-->
index 067d79d..04177a1 100644 (file)
@@ -8,7 +8,7 @@
        <data type="array">
                <languageKey index="default" type="array">
                        <label index="header">Glossary</label>
-                       <label index="indexChars">A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z</label>
+                       <label index="indexChars">0-9|1|2|3|4|5|6|7|8|9|0,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z</label>
                        <label index="na">-</label>
                        <label index="details">more details</label>
                        <label index="all">all items</label>
                        <label index="lang.de">ger.</label>
                        <label index="lang.it">it.</label>
                        <label index="lang.es">span.</label>
+                       <label index="pi_list_searchBox_search">Search</label>
                </languageKey>
                <languageKey index="de" type="array">
                        <label index="header">Glossar</label>
-                       <label index="indexChars">A|Ä|AE,B,C,D,E,F,G,H,I,J,K,L,M,N,O|Ö|OE,P,Q,R,S,T,U|Ü|UE,V,W,X,Y,Z</label>
+                       <label index="indexChars">0-9|1|2|3|4|5|6|7|8|9|0,A|Ä|AE,B,C,D,E,F,G,H,I,J,K,L,M,N,O|Ö|OE,P,Q,R,S,T,U|Ü|UE,V,W,X,Y,Z</label>
+                       <!-- <label index="indexChars">0,1,2,3,4,5,6,70,71,72,73,74,75,76,77,78,79,8,9,0</label> -->
                        <label index="na">-</label>
                        <label index="details">mehr Details</label>
                        <label index="all">alle Einträge</label>
@@ -51,6 +53,7 @@
                        <label index="lang.de">dt.</label>
                        <label index="lang.it">ital.</label>
                        <label index="lang.es">span.</label>
+                       <label index="pi_list_searchBox_search">Suche</label>
                </languageKey>
        </data>
 </T3locallang>
\ No newline at end of file
index 6e9b670..627b3ec 100644 (file)
@@ -1,44 +1,80 @@
-contagged {
-       allWrap = <dl>|</dl>
-       termWrap = <dt>|</dt>
-       descriptionWrap = <dd>|</dd>
-       #<div style="clear:both;"></div>
-       back = zurück
-       backWrap = <p>|</p>
-       allTerms = Alle Begriffe
-       allTermsWrap = <p>|</p>
-       orderBy = term_main
-
-       # cat=plugin.contagged//10; type=int; label=[Link to list page]:Set this to 1 if all types of terms shold be linked to the list page specified by "listPage". This could be overwritten by the type configuration. you have to configure a list page globally (see below) or in the configuration of a type of term.
-       linkToListPage = 1
-
-       # cat=plugin.contagged//20; type=int; label=[Default List Page (PID)]:PID of the default list page if no special list page in the configuration of a type of term is selected. This could be overwritten by the type configuration.
-       listPage =
+contagged {    
+       # cat=plugin.contagged//7; type=string; label=[Template File]:Path and name of your custom template file.
+       templateFile = EXT:contagged/pi1/contagged.tmpl
 
-       # cat=plugin.contagged//30; type=string; label=[Root Pages (List of PID) to be included]: A comma separated list of root pages of branches to be parsed. This could be overwritten by the type configuration.
-       includeRootPages = 0
+       # cat=plugin.contagged//10; type=string; label=[Root Pages (List of PID) to be included]: A comma separated list of root pages of branches to be parsed. This could be overwritten by the type configuration.
+       includeRootPages = 
 
-       # cat=plugin.contagged//40; type=string; label=[Root Pages (List of PID) to be excluded]: A comma separated list of root pages of branches to be excluded from parsing. Overwrites the settings of "includeRootPages".
+       # cat=plugin.contagged//15; type=string; label=[Root Pages (List of PID) to be excluded]: A comma separated list of root pages of branches to be excluded from parsing. Overwrites the settings of "includeRootPages".
        excludeRootPages =
 
-       # cat=plugin.contagged//50; type=string; label=[Pages (List of PID) to be included]: A comma separated list of pages to be included. Overwrites the settings of "excludeRootPages".
+       # cat=plugin.contagged//20; type=string; label=[Pages (List of PID) to be included]: A comma separated list of pages to be included. Overwrites the settings of "excludeRootPages".
        includePages =
 
-       # cat=plugin.contagged//55; type=string; label=[Pages (List of PID) to be excluded]: A comma separated list of pages to be excluded from parsing. Overwrites the settings of "includePages" and "includeRootPages".
+       # cat=plugin.contagged//25; type=string; label=[Pages (List of PID) to be excluded]: A comma separated list of pages to be excluded from parsing. Overwrites the settings of "includePages" and "includeRootPages".
        excludePages =
 
-       # cat=plugin.contagged//60; type=string; label=[Tags to be excluded]: A comma separated list of tags to be excluded from parsing.
-       excludeTags = h1,h2,h3,h4,h5,h6
+       # cat=plugin.contagged//30; type=string; label=[Tags to be excluded]: A comma separated list of tags to be excluded from parsing.
+       excludeTags = h1,h2,h3,h4,h5,h6,a,dfn,abbr,acronym,exclude
+
+       # cat=plugin.contagged//35; type=boolean; label=[Exclude used tags]: Auto-exclude tags used by the contagged type definitions (like <dfn> or <abbr>).
+       autoExcludeTags = 0
+
+       # cat=plugin.contagged//40; type=int; label=[Link to list page]:Set this to 1 if all types of terms shold be linked to the list page specified by "listPage". This could be overwritten by the type configuration. you have to configure a list page globally (see below) or in the configuration of a type of term.
+       linkToListPage = 1
 
-       # cat=plugin.contagged//70; type=boolean; label=[Add title attribute]: Should the "title" attribute containing a short description of the term be added to the tag?
+       # cat=plugin.contagged//45; type=int; label=[Default List Page (PID)]:PID of the default list page if no special list page in the configuration of a type of term is selected. This could be overwritten by the type configuration.
+       listPages = 
+
+       # 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//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
+
+       # cat=plugin.contagged//55; type=boolean; label=[Add title attribute]: Should the "title" attribute containing a short description of the term be added to the tag?
        addTitleAttribute = 1
 
-       # cat=plugin.contagged//80; type=boolean; label=[Add language attribute]: Should a "lang" attribute be added to the tag?
+       # cat=plugin.contagged//60; type=boolean; label=[Add language attribute]: Should a "lang" attribute be added to the tag?
        addLangAttribute = 1
 
-       # cat=plugin.contagged//90; type=boolean; label=[Add css class]: Should a css class name be added to the tag? By default the class name is the name of the type of term (e.g. "dfn_inline") headed by the extension prefix.
+       # cat=plugin.contagged//65; type=boolean; label=[Add css class]: Should a css class name be added to the tag? By default the class name is the name of the type of term (e.g. "dfn_inline") headed by the extension prefix.
        addCssClassAttribute = 0
 
-       # cat=plugin.contagged//95; type=boolean; label=[Update page keywords]: Should the matched terms be used as keywords for the page they are on. If there is a replaced term it will be used as keyword. If no the main term will be the keyword. The list of matched terms will be stored in a separate database field (not in the field 'keywords'), so your own keywords are preserved.
-       updateKeywords = 0
+       # cat=plugin.contagged//70; type=boolean; label=[Replace term]: Should the term be replaced by the specified replacement? This could be overwritten by the type configuration.
+       replaceTerm = 1
+
+       # cat=plugin.contagged//75; type=boolean; label=[Update page keywords]: Should the matched terms be used as keywords for the page they are on. If there is a replaced term it will be used as keyword. If no the main term will be the keyword. The list of matched terms will be stored in a separate database field (not in the field 'keywords'), so your own keywords are preserved.
+       updateKeywords = 1
+       
+       # cat=plugin.contagged//80; type=wrap; label=[Label Wrap 1]
+       labelWrap1 = |<strong>|:</strong> |
+       
+       # cat=plugin.contagged//85; type=wrap; label=[Label Wrap 2]
+       labelWrap2 = &nbsp;(|)
+
+       # cat=plugin.contagged//90; type=string; label=[RegEx modifier]: RegEx modifier of the main RegEx. Don't touch it, if you don't know what you do ;-) .
+       modifier = Uuis
+
+       # cat=plugin.contagged//91; type=string; label=[Fields to be searched]: Fields to be searched.
+       fieldsToSearch = term,term_main,term_alt,term_replace,desc_short,desc_long
+
+       # cat=plugin.contagged//92; type=string; label=[Sort Field]: The front-end lists will be sorted by this field.
+       sortField = term
+
+       # cat=plugin.contagged//93; type=string; label=[Fields to Map]: Fields to be mapped.
+       fieldsToMap = uid,pid,term_main,term_alt,term_type,term_lang,term_replace,desc_short,desc_long,link,exclude
+
+       # cat=plugin.contagged//94; type=string; label=[Secured Fields]: .
+       secureFields = 
+
+       # cat=plugin.contagged//95; type=boolean; label=[Only matched Index]: Show only those index chars, for which a term matches.
+       showOnlyMatchedIndexChars = 0
+
+       # cat=plugin.contagged//97; type=boolean; label=[Add index chars]: Supplement missing index chars automatically.
+       autoAddIndexChars = 1
+
+       # cat=plugin.contagged//99; type=boolean; label=[Add Back Link]: Add the page title to the back link.
+       addBackLinkDescription = 1
+
 }
\ No newline at end of file
index 2ac1e97..38d92cb 100644 (file)
@@ -1,5 +1,5 @@
 ###
-# This are the default CSS Styles for the contagged extension
+# These are the default CSS Styles for the contagged extension
 ##
 
 plugin.tx_contagged {
@@ -11,40 +11,9 @@ plugin.tx_contagged {
                        cursor: help;
                        position: relative;
                }
-               /* position:relative is necessary for correct positioning of inline descriptions */
-               dfn.tx-contagged-dfn_block {
-                       position: relative;
-               }
-               /* z-index makes shure the block is the top most element */
-               dfn.tx-contagged-dfn_block>span {
-                       background: #EEEEEE;
-                       display: none;
-                       z-index: 9999;
-               }
-               dfn.tx-contagged-dfn_block:hover>span {
-                       display: block;
-                       position: absolute;
-                       top: -2px;
-                       left: -11px;
-                       width: 300px;
-                       margin-top: -1px;
-                       border: 1px #CCCCCC solid;
-                       padding: 0px 10px 10px 10px;
-               }
-               dfn.tx-contagged-dfn_block p {
-                       margin:0;
-                       padding:0;
-               }
-
-               dfn.tx-contagged-dfn_inline {
-               }
-               dfn.tx-contagged-dfn_inline>span {
-                       color: #009900;
-                       display: none;
-               }
-               dfn.tx-contagged-dfn_inline:active>span {
-                       position:relative;
-                       display:inline;
+               
+               div.tx-contagged-pi1 dt {
+                       font-size: 1.2em;
                }
        )
 }
\ No newline at end of file
diff --git a/static/examples/setup.txt b/static/examples/setup.txt
new file mode 100755 (executable)
index 0000000..24ec9c5
--- /dev/null
@@ -0,0 +1,230 @@
+# encoding: iso-8859-1
+
+# there are several places (eg. tt_content.text) and several ways (postUserFunc, parseFunc.userFunc,contentPostProc-all)
+# to initiate parsing
+
+# 1st possibility:
+# tt_content.text.20.parseFunc.userFunc = tx_contagged->main
+
+# 2nd possibility:
+# tt_content.text.20.postUserFunc = tx_contagged->main
+
+# 3rd possibility:
+# temp_content < styles.content.get
+# temp_content.stdWrap.postUserFunc = tx_contagged->main
+# styles.content.get >
+# styles.content.get < temp_content
+
+plugin.tx_contagged {
+       
+       types {
+
+               dfn_block {
+                       label = Definition (tool-tip)
+                       label.de = Definition (Tool-Tip)
+                       tag = span
+                       addCssClassAttribute = 1
+                       cssClass = dfn_block
+                       stripBlockTags = 1
+                       stdWrap.innerWrap.cObject = COA
+                       stdWrap.innerWrap.cObject {
+                               10 = TEXT
+                               10.value = | <span class="tx-contagged-dfn_block-content">
+                               20 = TEXT
+                               20.data = register:contagged_matchedTerm
+                               20.typolink {
+                                       parameter.data = register:contagged_list_page
+                                       parameter.override.field = link
+                                       useCacheHash = 1
+                                       additionalParams.data = register:contagged_key
+                                       additionalParams.wrap = &tx_contagged_pi1[key]=|
+                                       additionalParams.dataWrap = |&tx_contagged_pi1[backPid]={TSFE:id}
+                               }
+                               30 = TEXT
+                               30.value = <br />
+                               40 = TEXT
+                               40.required = 1
+                               40.data = register:contagged_desc_long
+                               50 = TEXT
+                               50.value = </span>
+                       }
+               }
+
+               dfn_inline {
+                       label = Definition (inline)
+                       label.de = Definition (im Fließtext)
+                       tag = span
+                       linkToListPage = 0
+                       addCssClassAttribute = 1
+                       stdWrap.innerWrap.cObject = COA
+                       stdWrap.innerWrap.cObject {
+                               10 = TEXT
+                               10.value = | <span class="tx-contagged-dfn_block-content">&nbsp;[
+                               20 = TEXT
+                               20.required = 1
+                               20.stripHtml = 1
+                               20.data = register:contagged_desc_long
+                               30 = TEXT
+                               30.value = ] </span>
+                       }
+               }
+               
+               location {
+                       label = Location
+                       label.de = Ortsbezeichnung
+                       tag = strong
+               }
+
+               price {
+                       label = Price
+                       label.de = Preis
+                       termStdWrap.wrap = ***|***
+                       linkToListPage = 0
+                       stdWrap.wrap = |&nbsp;Euro
+                       dontListTerms = 1
+               }
+
+               regex {
+                       label = Regular Expression
+                       label.de = Regulärer Ausdruck
+                       linkToListPage = 1
+                       termIsRegEx = 1
+                       secureFields =
+                       dontListTerms = 0
+               }
+               
+               person < plugin.tx_contagged.types.dfn_block
+               person {
+                       label = Person
+                       label.de = Person
+                       dataSource = addresses
+                       sortField = zip
+               }
+               
+               reference {
+                       label = Reference
+                       label.de = Quelle
+                       dataSource = references
+                       sortField = term_main
+               }
+               
+               category < plugin.tx_contagged.types.dfn_block
+               category {
+                       label = Category
+                       label.de = Kategorie
+                       dataSource = categories
+               }
+               
+       }
+
+       dataSources {
+
+               references {
+                       sourceName = tx_sibibtex_entries
+                       hasSysLanguageUid = 0
+                       storagePids = 237
+                       fieldsToEdit = 
+                       mapping {
+                               uid.field = uid
+                               pid.field = pid
+                               year.field = year
+                               author.field = author
+                               author.stdWrap.crop = -4||1
+                               term_replace.value = 
+                               term_replace.stdWrap.dataWrap = {register:contagged_author}, {register:contagged_year}
+                               term_replace.stdWrap.outerWrap = [|]
+                               term_main.field = author
+                               term_type.value = reference
+                               desc_long.field = title
+                               # desc_long.field = address
+                               # desc_long.stdWrap.dataWrap = |<br />{register:contagged_zip} {register:contagged_city}
+                               exclude.value = 0
+                       }
+               }
+
+               
+               addresses {
+                       sourceName = tt_address
+                       hasSysLanguageUid = 0
+                       storagePids = 
+                       fieldsToEdit = name,person,address
+                       mapping {
+                               uid.field = uid
+                               pid.field = pid
+                               # first_name.field = first_name
+                               # middle_name.field = middle_name
+                               # term_main.field = last_name
+                               # term_main.stdWrap.dataWrap = |, {register:contagged_first_name} {register:contagged_middle_name}
+                               # term_alt.field = name
+                               term_main.field = name
+                               term_type.value = person
+                               zip.field = zip
+                               city.field = city
+                               desc_long.field = address
+                               desc_long.stdWrap.dataWrap = |<br />{register:contagged_zip} {register:contagged_city}
+                               exclude.value = 0
+                       }
+               }
+               
+               categories {
+                       sourceName = tx_categories
+                       hasSysLanguageUid = 1
+                       storagePids = 
+                       fieldsToEdit = title,synonyms,description
+                       mapping {
+                               uid.field = uid
+                               pid.field = pid
+                               term_main.field = title
+                               term_alt.field = synonyms
+                               term_type.value = category
+                               desc_long.field = description
+                               exclude.value = 0
+                       }
+               }
+               
+       }
+}
+
+plugin.tx_contagged {
+       _CSS_DEFAULT_STYLE (
+
+               acronym, abbr, dfn, span.tx-contagged-dfn_block, span.tx-contagged-dfn_inline {
+                       font-style: normal;
+                       border-bottom: 1px dotted #333333;
+                       cursor: help;
+                       position: relative;
+               }
+               
+               
+               /* position:relative is necessary for correct positioning of inline descriptions */
+               span.tx-contagged-dfn_block {
+                       position: relative;
+               }
+               /* z-index makes sure the block is the top most element */
+               span.tx-contagged-dfn_block span.tx-contagged-dfn_block-content {
+                       background: #EEEEEE;
+                       display: none;
+                       position: absolute;
+                       z-index: 9999;
+               }
+               span.tx-contagged-dfn_block:hover span.tx-contagged-dfn_block-content {
+                       display: inline;
+                       position: absolute;
+                       top: -2px;
+                       left: -11px;
+                       width: 300px;
+                       margin-top: -1px;
+                       border: 1px #CCCCCC solid;
+                       padding: 0px 10px 10px 10px;
+               }
+
+
+               span.tx-contagged-dfn_inline span.tx-contagged-dfn_block-content {
+                       color: #009900;
+                       display: none;
+               }
+               span.tx-contagged-dfn_inline:active span.tx-contagged-dfn_block-content {
+                       display:inline;
+               }
+       )
+}
index 877d42e..fe42835 100644 (file)
-# incude class tx_contagged as library 
-includeLibs.tx_contagged = EXT:contagged/class.tx_contagged.php
-
-# setup the content element by calling the user function 'main' of the class tx_contagged
-#tt_content.text.20.parseFunc.userFunc = tx_contagged->main
-#tt_content.text.20.postUserFunc = tx_contagged->main
+# encoding: iso-8859-1
 
+# include class tx_contagged as library 
+includeLibs.tx_contagged = EXT:contagged/class.tx_contagged.php
 
-#temp_content < styles.content.get
-#temp_content.stdWrap.postUserFunc = tx_contagged->main
-#styles.content.get >
-#styles.content.get < temp_content
+tt_content.text.20.postUserFunc = tx_contagged->main
 
 plugin.tx_contagged {
+       templateFile = {$contagged.templateFile}
        linkToListPage = {$contagged.linkToListPage}
-       listPage = {$contagged.listPage}
+       listPages = {$contagged.listPages}
+       storagePids = {$contagged.storagePids}
        includeRootPages = {$contagged.includeRootPages}
        excludeRootPages = {$contagged.excludeRootPages}
        includePages = {$contagged.includePages}
        excludePages = {$contagged.excludePages}
        excludeTags = {$contagged.excludeTags}
+       autoExcludeTags = {$contagged.autoExcludeTags}
+       checkPreAndPostMatches = {$contagged.checkPreAndPostMatches}
        addTitleAttribute = {$contagged.addTitleAttribute}
        addLangAttribute = {$contagged.addLangAttribute}
        addCssClassAttribute = {$contagged.addCssClassAttribute}
+       replaceTerm = {$contagged.replaceTerm}
        updateKeywords = {$contagged.updateKeywords}
+       labelWrap1 = {$contagged.labelWrap1}
+       labelWrap2 = {$contagged.labelWrap2}
+       modifier = {$contagged.modifier}
+       fieldsToSearch = {$contagged.fieldsToSearch}
+       sortField = {$contagged.sortField}
+       fieldsToMap = {$contagged.fieldsToMap}
+       secureFields = {$contagged.secureFields}
+       showOnlyMatchedIndexChars = {$contagged.showOnlyMatchedIndexChars}
+       autoAddIndexChars = {$contagged.autoAddIndexChars}
+       addBackLinkDescription = {$contagged.addBackLinkDescription}
+
        types {
 
                definition {
                        label = Definition
+                       label.de = Definition
                        tag = dfn
                }
 
-               dfn_block {
-                       label = Definition (block)
-                       tag = dfn
-                       addCssClassAttribute = 1
-                       stdWrap.innerWrap.cObject = COA
-                       stdWrap.innerWrap.cObject {
-                               10 = TEXT
-                               10.value = | <span><p>
-                               20 = TEXT
-                               20.data = register:contagged_matchedTerm
-                               30 = TEXT
-                               30.value = </p>
-                               40 = TEXT
-                               40.required = 1
-                               40.data = register:contagged_desc_long
-                               50 = TEXT
-                               50.value = </span>
-                       }
-               }
-
-               dfn_inline {
-                       label = Definition (inline)
-                       tag = dfn
-                       linkToListPage = 0
-                       addCssClassAttribute = 1
-                       stdWrap.innerWrap.cObject = COA
-                       stdWrap.innerWrap.cObject {
-                               10 = TEXT
-                               10.value = | <span>&nbsp;[
-                               20 = TEXT
-                               20.required = 1
-                               20.stripHtml = 1
-                               20.data = register:contagged_desc_long
-                               30 = TEXT
-                               30.value = ]&nbsp;</span>
-                       }
-               }
-
                acronym {
-                       label = Kurzwort aus Anfangsbuchstaben (Beispiel: NATO)
+                       label = Acronym
+                       label.de = Kurzwort aus Anfangsbuchstaben (Beispiel: NATO)
                        tag = acronym
                }
 
                abbrevation {
-                       label = Abk&uuml;rzung (Beispiel: u.s.w.)
+                       label = Abbrevation
+                       label.de = Abkürzung (Beispiel: u.s.w.)
                        tag = abbr
                }
-
-               location {
-                       label = Ortsbezeichnung
-                       tag = strong
-                       listPage = 111
-                       replaceTerm = 1
-               }
+                               
        }
-}
 
-
-# configuration of the list display
-tx_contagged_terms = COA
-tx_contagged_terms {
-       10 = TEXT
-       10.if.isTrue.field = term_main
-       10.field = term_main
-       10.wrap = {$contagged.termWrap}
-       20 = TEXT
-       20.if.isTrue.field = desc_long
-       20.field = desc_long
-       20.parseFunc < lib.parseFunc_RTE
-       20.wrap = {$contagged.descriptionWrap}
-}
-
-# configuration of the list plugin
-tt_content.list.20.contagged = CONTENT
-tt_content.list.20.contagged {
-       table = tx_contagged_terms
-       stdWrap.wrap = {$contagged.allWrap}
-       stdWrap {
-               append = COA
-               append.stdWrap.if.isTrue.data = GPvar:tx_contagged|back
-               append.10 = TEXT
-               append.10.value = {$contagged.back}
-               append.10.wrap = {$contagged.backWrap}
-               append.10.typolink.parameter.data = GPvar:tx_contagged|back
-               append.10.typolink.useCacheHash = 1
-               append.20 = TEXT
-               append.20.value = {$contagged.allTerms}
-               append.20.wrap = {$contagged.allTermsWrap}
-               append.20.typolink.parameter.data = TSFE:id
-#              append.20.typolink.additionalParams.stdWrap.cObject = COA
-#              append.20.typolink.additionalParams.stdWrap.cObject {
-#                      10 = TEXT
-#                      10.data = GPvar:tx_contagged|uid
-#              }
-       }
-       select {
-               pidInList.field = pages
-               orderBy = {$contagged.orderBy}
-               where = exclude=0
-               andWhere.cObject = COA
-               andWhere.cObject {
-                       10 = TEXT
-                       10.required = 1
-                       10.data = GPvar:tx_contagged|uid
-                       10.wrap = uid=|
-#                      20 = TEXT
-#                      20.value = "location"
-#                      20.noTrimWrap = | AND term_type=| |
+       dataSources {
+               
+               default {
+                       sourceName = tx_contagged_terms
+                       hasSysLanguageUid = 1
+                       storagePids = 
+                       fieldsToEdit = term_main,term_alt,term_type,term_lang,term_replace,desc_short,desc_long,link,exclude
+                       mapping {
+                               uid.field = uid
+                               pid.field = pid
+                               term_main.field = term_main
+                               term_alt.field = term_alt
+                               term_type.field = term_type
+                               term_replace.field = term_replace
+                               term_lang.field = term_lang
+                               desc_short.field = desc_short
+                               desc_long.field = desc_long
+                               link.field = link
+                               exclude.field = exclude
+                       }
                }
-               #term_lang = sys_language_uid
        }
 }
\ No newline at end of file
diff --git a/tca.php b/tca.php
index a32eaff..9cf5d55 100644 (file)
--- a/tca.php
+++ b/tca.php
@@ -140,6 +140,7 @@ $TCA["tx_contagged_terms"] = array (
                                                Array("LLL:EXT:contagged/locallang_db.xml:tx_contagged_terms.term_lang.I.3", "de"),
                                                Array("LLL:EXT:contagged/locallang_db.xml:tx_contagged_terms.term_lang.I.4", "it"),
                                                Array("LLL:EXT:contagged/locallang_db.xml:tx_contagged_terms.term_lang.I.5", "es"),
+                                               Array("LLL:EXT:contagged/locallang_db.xml:tx_contagged_terms.term_lang.I.6", "un"),
                                        ),
                                        "size" => 1,    
                                        "maxitems" => 1,
@@ -220,9 +221,11 @@ $TCA["tx_contagged_terms"] = array (
 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 (PATH_typo3.'sysext/lang/lang.php');
        
 function user_addTermTypes(&$params,&$pObj) {
+       global $BE_USER;
+       $BE_USER->uc['lang'] = $BE_USER->uc['lang'] ? $BE_USER->uc['lang'] : 'default';
+
        // get extension configuration
        $extConfArray = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['contagged']);
        if ( (int)$extConfArray['mainConfigStoragePid']>0 ) {
@@ -239,22 +242,17 @@ function user_addTermTypes(&$params,&$pObj) {
        $TSObj->generateConfig();
        $conf = $TSObj->setup['plugin.']['tx_contagged.'];
 
-       // make localized labels        
-       $LANG = t3lib_div::makeInstance('language');
-//     $LANG->init($BE_USER->uc['lang']); // FIXIT This doesn't work because no BE-User is configured at this time of execution. Any suggestions?
-       $LANG->init($conf['backendLanguage']); // a quick solution
+       // make localized labels
        $LOCAL_LANG_ARRAY = array();
        if (!empty($conf['types.'])) {
                foreach ($conf['types.'] as $typeName => $typeConfigArray ) {
-                       unset($label);
-                       if ( !$typeConfigArray['hideSelection']>0 ) {
-                               $label['default'] = $typeConfigArray['label.']['default'];
-                               $label['default'] = $typeConfigArray['label'];
-                               foreach ($label as $langKey => $labelText) {
-                                       $LOCAL_LANG_ARRAY[$langKey] = array('label'=>$labelText);
+                       unset($LOCAL_LANG_ARRAY);
+                       if ( !$typeConfigArray['hideSelection']>0 && !$typeConfigArray['dataSource'] ) {
+                               foreach ($typeConfigArray['label.'] as $langKey => $labelText) {
+                                       $LOCAL_LANG_ARRAY[$langKey]['label'] = $labelText;
                                }
-                               $label = array_merge($label,$typeConfigArray['label.']);
-                               $params['items'][]= Array( $LANG->getLLL('label',$LOCAL_LANG_ARRAY,1), substr($typeName,0,-1) );
+                               $LOCAL_LANG_ARRAY['default']['label'] = $typeConfigArray['label'] ? $typeConfigArray['label'] : $typeConfigArray['label.']['default'];
+                               $params['items'][]= array( $GLOBALS['LANG']->getLLL('label',$LOCAL_LANG_ARRAY), substr($typeName,0,-1) );
                        }
                }
        }