Fixed bug #5826: indexed_search: specify media types in advanced search
authorOliver Hader <oliver.hader@typo3.org>
Tue, 28 Oct 2008 19:06:30 +0000 (19:06 +0000)
committerOliver Hader <oliver.hader@typo3.org>
Tue, 28 Oct 2008 19:06:30 +0000 (19:06 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@4366 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/sysext/indexed_search/class.external_parser.php
typo3/sysext/indexed_search/pi/locallang.xml

index f156991..21c14fd 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -9,6 +9,7 @@
        * Fixed bug #9664: EM fails on retrieving files of uppercase extension keys (thanks to Marcus Krause)
        * Added feature #7571: FeUsers in table sys_lockedrecords (thanks to Stefan Geith)
        * Added feature #8523: IRRE - Integrate possibility to define enabledControls in TCA
+       * Fixed bug #5826: indexed_search: specify media types in advanced search
 
 2008-10-24  Oliver Hader  <oliver@typo3.org>
 
index f966192..59a9641 100755 (executable)
@@ -104,7 +104,7 @@ class tx_indexed_search_extparse {
                        // Ignore extensions
                $ignoreExtensions = t3lib_div::trimExplode(',', strtolower($indexerConfig['ignoreExtensions']),1);
                if (in_array($extension, $ignoreExtensions))    {
-                       $this->pObj->log_setTSlogMessage('Extension "'.$extension.'" was set to be ignored.',1);
+                       $this->pObj->log_setTSlogMessage(sprintf($GLOBALS['LANG']->sL('LLL:EXT:indexed_search/pi/locallang.xml:ignoreExtensions'), $extension), 1);
                        return FALSE;
                }
 
@@ -120,8 +120,8 @@ class tx_indexed_search_extparse {
                                                        // PDF mode:
                                                $this->pdf_mode = t3lib_div::intInRange($indexerConfig['pdf_mode'],-100,100);
                                                $extOK = TRUE;
-                                       } else $this->pObj->log_setTSlogMessage("PDF tools was not found in paths '".$pdfPath."pdftotext' and/or '".$pdfPath."pdfinfo'",3);
-                               } else $this->pObj->log_setTSlogMessage('PDF tools disabled',1);
+                                       } else $this->pObj->log_setTSlogMessage(sprintf($GLOBALS['LANG']->sL('LLL:EXT:indexed_search/pi/locallang.xml:pdfToolsNotFound'), $pdfPath), 3);
+                               } else $this->pObj->log_setTSlogMessage($GLOBALS['LANG']->sL('LLL:EXT:indexed_search/pi/locallang.xml:pdfToolsDisabled'), 1);
                        break;
                        case 'doc':
                                        // Catdoc
@@ -130,8 +130,8 @@ class tx_indexed_search_extparse {
                                        if (ini_get('safe_mode') || @is_file($catdocPath.'catdoc'.$exe))        {
                                                $this->app['catdoc'] = $catdocPath.'catdoc'.$exe;
                                                $extOK = TRUE;
-                                       } else $this->pObj->log_setTSlogMessage("'catdoc' tool for reading Word-files was not found in path '".$catdocPath."catdoc'",3);
-                               } else $this->pObj->log_setTSlogMessage('catdoc tools (Word-files) disabled',1);
+                                       } else $this->pObj->log_setTSlogMessage(sprintf($GLOBALS['LANG']->sL('LLL:EXT:indexed_search/pi/locallang.xml:catdocNotFound'), $catdocPath), 3);
+                               } else $this->pObj->log_setTSlogMessage($GLOBALS['LANG']->sL('LLL:EXT:indexed_search/pi/locallang.xml:catdocDisabled'), 1);
                        break;
                        case 'pps':             // MS PowerPoint(?)
                        case 'ppt':             // MS PowerPoint
@@ -141,8 +141,8 @@ class tx_indexed_search_extparse {
                                        if (ini_get('safe_mode') || @is_file($ppthtmlPath.'ppthtml'.$exe)){
                                                $this->app['ppthtml'] = $ppthtmlPath.'ppthtml'.$exe;
                                                $extOK = TRUE;
-                                       } else $this->pObj->log_setTSlogMessage("'ppthtml' tool for reading Powerpoint-files was not found in path '".$ppthtmlPath."ppthtml'",3);
-                               } else $this->pObj->log_setTSlogMessage('ppthtml tools (Powerpoint-files) disabled',1);
+                                       } else $this->pObj->log_setTSlogMessage(sprintf($GLOBALS['LANG']->sL('LLL:EXT:indexed_search/pi/locallang.xml:ppthtmlNotFound'), $ppthtmlPath), 3);
+                               } else $this->pObj->log_setTSlogMessage($GLOBALS['LANG']->sL('LLL:EXT:indexed_search/pi/locallang.xml:ppthtmlDisabled'), 1);
                        break;
                        case 'xls':             // MS Excel
                                        // Xlhtml
@@ -151,8 +151,8 @@ class tx_indexed_search_extparse {
                                        if (ini_get('safe_mode') || @is_file($xlhtmlPath.'xlhtml'.$exe)){
                                                $this->app['xlhtml'] = $xlhtmlPath.'xlhtml'.$exe;
                                                $extOK = TRUE;
-                                       } else $this->pObj->log_setTSlogMessage("'xlhtml' tool for reading Excel-files was not found in path '".$xlhtmlPath."xlhtml'",3);
-                               } else $this->pObj->log_setTSlogMessage('xlhtml tools (Excel-files) disabled',1);
+                                       } else $this->pObj->log_setTSlogMessage(sprintf($GLOBALS['LANG']->sL('LLL:EXT:indexed_search/pi/locallang.xml:xlhtmlNotFound'), $xlhtmlPath), 3);
+                               } else $this->pObj->log_setTSlogMessage($GLOBALS['LANG']->sL('LLL:EXT:indexed_search/pi/locallang.xml:xlhtmlDisabled'), 1);
                        break;
                        case 'sxc':             // Open Office Calc.
                        case 'sxi':             // Open Office Impress
@@ -165,8 +165,8 @@ class tx_indexed_search_extparse {
                                        if (ini_get('safe_mode') || @is_file($unzipPath.'unzip'.$exe))  {
                                                $this->app['unzip'] = $unzipPath.'unzip'.$exe;
                                                $extOK = TRUE;
-                                       } else $this->pObj->log_setTSlogMessage("'unzip' tool for reading OpenOffice.org-files was not found in path '".$unzipPath."unzip'",3);
-                               } else $this->pObj->log_setTSlogMessage('unzip tool (OpenOffice.org-files) disabled',1);
+                                       } else $this->pObj->log_setTSlogMessage(sprintf($GLOBALS['LANG']->sL('LLL:EXT:indexed_search/pi/locallang.xml:unzipNotFound'), $unzipPath), 3);
+                               } else $this->pObj->log_setTSlogMessage($GLOBALS['LANG']->sL('LLL:EXT:indexed_search/pi/locallang.xml:unzipDisabled'), 1);
                        break;
                        case 'rtf':
                                        // Catdoc
@@ -175,8 +175,8 @@ class tx_indexed_search_extparse {
                                        if (ini_get('safe_mode') || @is_file($unrtfPath.'unrtf'.$exe))  {
                                                $this->app['unrtf'] = $unrtfPath.'unrtf'.$exe;
                                                $extOK = TRUE;
-                                       } else $this->pObj->log_setTSlogMessage("'unrtf' tool for reading RTF-files was not found in path '".$unrtfPath."unrtf'",3);
-                               } else $this->pObj->log_setTSlogMessage('unrtf tool (RTF-files) disabled',1);
+                                       } else $this->pObj->log_setTSlogMessage(sprintf($GLOBALS['LANG']->sL('LLL:EXT:indexed_search/pi/locallang.xml:unrtfNotFound'), $unrtfPath), 3);
+                               } else $this->pObj->log_setTSlogMessage($GLOBALS['LANG']->sL('LLL:EXT:indexed_search/pi/locallang.xml:unrtfDisabled'), 1);
                        break;
                        case 'txt':             // Raw text
                        case 'csv':             // Raw text
@@ -260,51 +260,79 @@ class tx_indexed_search_extparse {
                        case 'pdf':
                                        // PDF
                                if ($indexerConfig['pdftools']) {
-                                       return 'PDF';
+                                       return sprintf($GLOBALS['LANG']->sL('LLL:EXT:indexed_search/pi/locallang.xml:extensionPDF'), $extension);
                                }
                        break;
                        case 'doc':
                                        // Catdoc
                                if ($indexerConfig['catdoc'])   {
-                                       return 'MS Word';
+                                       return sprintf($GLOBALS['LANG']->sL('LLL:EXT:indexed_search/pi/locallang.xml:extension.DOC'), $extension);
                                }
                        break;
                        case 'pps':             // MS PowerPoint(?)
                        case 'ppt':             // MS PowerPoint
                                        // ppthtml
                                if ($indexerConfig['ppthtml'])  {
-                                       return 'MS Powerpoint';
+                                       return sprintf($GLOBALS['LANG']->sL('LLL:EXT:indexed_search/pi/locallang.xml:extension.PP'), $extension);
                                }
                        break;
                        case 'xls':             // MS Excel
                                        // Xlhtml
                                if ($indexerConfig['xlhtml'])   {
-                                       return 'MS Excel';
+                                       return sprintf($GLOBALS['LANG']->sL('LLL:EXT:indexed_search/pi/locallang.xml:extension.XLS'), $extension);
                                }
                        break;
                        case 'sxc':             // Open Office Calc.
+                       if ($indexerConfig['unzip'])    {
+                                       return sprintf($GLOBALS['LANG']->sL('LLL:EXT:indexed_search/pi/locallang.xml:extension.SXC'), $extension);
+                               }
+                       break;
                        case 'sxi':             // Open Office Impress
+                       if ($indexerConfig['unzip'])    {
+                                       return sprintf($GLOBALS['LANG']->sL('LLL:EXT:indexed_search/pi/locallang.xml:extension.SXI'), $extension);
+                               }
+                       break;
                        case 'sxw':             // Open Office Writer
+                       if ($indexerConfig['unzip'])    {
+                                       return sprintf($GLOBALS['LANG']->sL('LLL:EXT:indexed_search/pi/locallang.xml:extension.SXW'), $extension);
+                               }
+                       break;
                        case 'ods':             // Oasis OpenDocument Spreadsheet
+                       if ($indexerConfig['unzip'])    {
+                                       return sprintf($GLOBALS['LANG']->sL('LLL:EXT:indexed_search/pi/locallang.xml:extension.ODS'), $extension);
+                               }
+                       break;
                        case 'odp':             // Oasis OpenDocument Presentation
+                               if ($indexerConfig['unzip'])    {
+                                       return sprintf($GLOBALS['LANG']->sL('LLL:EXT:indexed_search/pi/locallang.xml:extension.ODP'), $extension);
+                               }
+                       break;
                        case 'odt':             // Oasis OpenDocument Text
                                if ($indexerConfig['unzip'])    {
-                                       return 'Open Office';
+                                       return sprintf($GLOBALS['LANG']->sL('LLL:EXT:indexed_search/pi/locallang.xml:extension.ODT'), $extension);
                                }
                        break;
                        case 'rtf':
                                        // Catdoc
                                if ($indexerConfig['unrtf'])    {
-                                       return 'RTF';
+                                       return sprintf($GLOBALS['LANG']->sL('LLL:EXT:indexed_search/pi/locallang.xml:extension.RTF'), $extension);
                                }
                        break;
-                       case 'html':    // PHP strip-tags()
                        case 'jpeg':    // PHP EXIF
+                       case 'tif':             // PHP EXIF 
+                               return sprintf($GLOBALS['LANG']->sL('LLL:EXT:indexed_search/pi/locallang.xml:extension.Images'), $extension);
+                       break;
+                       case 'html':    // PHP strip-tags()
+                               return sprintf($GLOBALS['LANG']->sL('LLL:EXT:indexed_search/pi/locallang.xml:extension.HTML'), $extension);
+                       break;
                        case 'txt':             // Raw text
+                               return sprintf($GLOBALS['LANG']->sL('LLL:EXT:indexed_search/pi/locallang.xml:extension.TXT'), $extension);
+                       break;
                        case 'csv':             // Raw text
+                               return sprintf($GLOBALS['LANG']->sL('LLL:EXT:indexed_search/pi/locallang.xml:extension.CSV'), $extension);
+                       break;
                        case 'xml':             // PHP strip-tags()
-                       case 'tif':             // PHP EXIF
-                               return strtoupper($extension);
+                               return sprintf($GLOBALS['LANG']->sL('LLL:EXT:indexed_search/pi/locallang.xml:extension.XML'), $extension);
                        break;
                                // NO entry (duplicates or blank):
                        case 'htm':             // PHP strip-tags()
@@ -378,7 +406,7 @@ class tx_indexed_search_extparse {
                                                        $content = t3lib_div::getUrl($tempFileName);
                                                        unlink($tempFileName);
                                                } else {
-                                                       $this->pObj->log_setTSlogMessage('PDFtoText Failed on this document: '.$absFile.". Maybe the PDF file is locked for printing or encrypted.",2);
+                                                       $this->pObj->log_setTSlogMessage(sprintf($GLOBALS['LANG']->sL('LLL:EXT:indexed_search/pi/locallang.xml:pdfToolsFailed'), $absFile), 2);
                                                }
                                                if (strlen($content))   {
                                                        $contentArr = $this->pObj->splitRegularContent($this->removeEndJunk($content));
@@ -624,6 +652,6 @@ class tx_indexed_search_extparse {
 }
 
 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/indexed_search/class.external_parser.php'])    {
-    include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/indexed_search/class.external_parser.php']);
+       include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/indexed_search/class.external_parser.php']);
 }
-?>
\ No newline at end of file
+?>
index ea50cd8..589db8f 100755 (executable)
                        <label index="local_operator_NOT">NOT</label>
                        <label index="makerating_addToCurrentSearch">Add to current search words</label>
                        <label index="maketitle_matches">matches</label>
+                       <label index="ignoreExtensions">Extension %s was set to be ignored.</label>
+                       <label index="pdfToolsNotFound">PDF tools was not found in paths '%1$spdftotext' and/or '%1$spdfinfo'"</label>
+                       <label index="pdfToolsDisabled">PDF tools disabled</label>
+                       <label index="pdfToolsFailed">PDFtoText Failed on this document: '%s'. Maybe the PDF file is locked for printing or encrypted.</label>
+                       <label index="catdocNotFound">'catdoc' tool for reading Word-files was not found in path '%scatdoc'</label>
+                       <label index="catdocDisabled">catdoc tools (Word-files) disabled</label>
+                       <label index="ppthtmlNotFound">'ppthtml' tool for reading Powerpoint-files was not found in path '%sppthtml'</label>
+                       <label index="ppthtmlDisabled">ppthtml tools (Powerpoint-files) disabled</label>
+                       <label index="xlhtmlNotFound">'xlhtml' tool for reading Excel-files was not found in path '%sxlhtml'</label>
+                       <label index="xlhtmlDisabled">xlhtml tools (Excel-files) disabled</label>
+                       <label index="unzipNotFound">'unzip' tool for reading OpenOffice.org-files was not found in path '%sunzip'</label>
+                       <label index="unzipDisabled">unzip tool (OpenOffice.org-files) disabled</label>
+                       <label index="unrtfNotFound">'unrtf' tool for reading RTF-files was not found in path '%sunrtf'</label>
+                       <label index="unrtfDisabled">unrtf tool (RTF-files) disabled</label>
+                       <label index="extension.PDF">PDF (*.%s)</label>
+                       <label index="extension.DOC">MS Word (*.%s)</label>
+                       <label index="extension.PP">MS Powerpoint (*.%s)</label>
+                       <label index="extension.XLS">MS Excel (*.%s)</label>
+                       <label index="extension.SXC">OpenOffice.org Calc (*.%s)</label>
+                       <label index="extension.SXI">OpenOffice.org Impress (*.%s)</label>
+                       <label index="extension.SXW">OpenOffice.org Writer (*.%s)</label>
+                       <label index="extension.ODS">ODF Spreadsheet (*.%s)</label>
+                       <label index="extension.ODP">ODF Presentation (*.%s)</label>
+                       <label index="extension.ODT">ODF Text (*.%s)</label>
+                       <label index="extension.RTF">Rich Text Format (*.%s)</label>
+                       <label index="extension.images">Images (*.%s)</label>
+                       <label index="extension.HTML">Webpages (*.%s)</label>
+                       <label index="extension.TXT">Textfiles (*.%s)</label>
+                       <label index="extension.CSV">Comma-Separated Values (*.%s)</label>
+                       <label index="extension.XML">Extensible Markup Language (*.%s)</label>
                </languageKey>
        </data>
 </T3locallang>
\ No newline at end of file