Fixed bug #10392: Indexed search does not use config.fileTarget for files
authorDmitry Dulepov <dmitry.dulepov@gmail.com>
Thu, 18 Mar 2010 13:30:52 +0000 (13:30 +0000)
committerDmitry Dulepov <dmitry.dulepov@gmail.com>
Thu, 18 Mar 2010 13:30:52 +0000 (13:30 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@7135 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/sysext/indexed_search/ChangeLog
typo3/sysext/indexed_search/pi/class.tx_indexedsearch.php

index f5b84e3..2b91861 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
 2010-01-18  Dmitry Dulepov  <dmitry.dulepov@gmail.com>
 
        * Fixed bug #12434: Name attribute in search form - invalid XHTML strict
+       * Fixed bug #10392: Indexed search does not use config.fileTarget for files
 
 2010-03-18  Ernesto Baschny  <ernst@cron-it.de>
 
index 3d9092c..5d49988 100755 (executable)
@@ -1,6 +1,7 @@
 2010-01-18  Dmitry Dulepov  <dmitry.dulepov@gmail.com>
 
        * Fixed bug #12434: Name attribute in search form - invalid XHTML strict
+       * Fixed bug #10392: Indexed search does not use config.fileTarget for files
 
 2009-01-20  Ingo Renner  <ingo@typo3.org>
 
index be2cdfb..bba51a6 100755 (executable)
@@ -1731,7 +1731,13 @@ class tx_indexedsearch extends tslib_pibase {
                        // If external media, link to the media-file instead.
                if ($row['item_type'])  {               // External media
                        if ($row['show_resume'])        {       // Can link directly.
-                               $title = '<a href="'.htmlspecialchars($row['data_filename']).'">'.htmlspecialchars($this->makeTitle($row)).'</a>';
+                               $targetAttribute = '';
+                               if ($GLOBALS['TSFE']->config['config']['fileTarget']) {
+                                       $targetAttribute = ' target="' . htmlspecialchars($GLOBALS['TSFE']->config['config']['fileTarget']) . '"';
+                               }
+                               $title = '<a href="' . htmlspecialchars($row['data_filename']) . '"' . $targetAttribute . '>' .
+                                       htmlspecialchars($this->makeTitle($row)) .
+                                       '</a>';
                        } else {        // Suspicious, so linking to page instead...
                                $copy_row = $row;
                                unset($copy_row['cHashParams']);
@@ -2102,7 +2108,13 @@ class tx_indexedsearch extends tslib_pibase {
 
                $pI = parse_url($row['data_filename']);
                if ($pI['scheme'])      {
-                       $tmplArray['path'] = '<a href="'.htmlspecialchars($row['data_filename']).'">'.htmlspecialchars($row['data_filename']).'</a>';
+                       $targetAttribute = '';
+                       if ($GLOBALS['TSFE']->config['config']['fileTarget']) {
+                               $targetAttribute = ' target="' . htmlspecialchars($GLOBALS['TSFE']->config['config']['fileTarget']) . '"';
+                       }
+                       $tmplArray['path'] = '<a href="' . htmlspecialchars($row['data_filename']) . '"' . $targetAttribute . '>' .
+                               htmlspecialchars($row['data_filename']) .
+                               '</a>';
                } else {
                        $pathStr = htmlspecialchars($this->getPathFromPageId($pathId,$pathMP));
                        $tmplArray['path'] = $this->linkPage($pathId,$pathStr,array(