Fix Bug #1049042: Search fails when installed in a subdirectory of Apache's DocumentRoot

This commit is contained in:
Sebastian Meyer 2012-09-11 18:06:12 +02:00
parent 5ef759f268
commit 8abef19453
6 changed files with 42 additions and 8 deletions

View File

@ -395,7 +395,7 @@ class tx_dlf_collection extends tx_dlf_plugin {
t3lib_div::cleanOutputBuffers();
// Send headers.
header('Location: '.t3lib_div::locationHeaderUrl($this->pi_getPageLink($this->conf['targetPid'])));
header('Location: '.t3lib_div::locationHeaderUrl($this->cObj->typoLink_URL(array ('parameter' => $this->conf['targetPid']))));
// Flush output buffer and end script processing.
ob_end_flush();

View File

@ -168,7 +168,13 @@ class tx_dlf_feeds extends tx_dlf_plugin {
$item->appendChild($rss->createElement('title', htmlspecialchars($title, ENT_NOQUOTES, 'UTF-8')));
// Add link.
$item->appendChild($rss->createElement('link', htmlspecialchars(t3lib_div::locationHeaderUrl($this->pi_getPageLink($this->conf['targetPid'], '', array ($this->prefixId => array ('id' => $resArray['uid'])))), ENT_NOQUOTES, 'UTF-8')));
$linkConf = array (
'parameter' => $this->conf['targetPid'],
'forceAbsoluteUrl' => 1,
'additionalParams' => array ($this->prefixId => array ('id' => $resArray['uid']))
);
$item->appendChild($rss->createElement('link', htmlspecialchars($this->cObj->typoLink_URL($linkConf), ENT_NOQUOTES, 'UTF-8')));
// Add author if applicable.
if (!empty($resArray['author'])) {

View File

@ -263,8 +263,14 @@ class tx_dlf_listview extends tx_dlf_plugin {
// Set class prefix.
$prefix = str_replace('_', '-', get_class($this));
// Configure @action URL for form.
$linkConf = array (
'parameter' => $GLOBALS['TSFE']->id,
'forceAbsoluteUrl' => 1
);
// Build HTML form.
$sorting = '<form action="'.$this->pi_getPageLink($GLOBALS['TSFE']->id).'" class="'.$prefix.'-sorting" method="get"><div><input type="hidden" name="id" value="'.$GLOBALS['TSFE']->id.'" />';
$sorting = '<form action="'.$this->cObj->typoLink_URL($linkConf).'" class="'.$prefix.'-sorting" method="get"><div><input type="hidden" name="id" value="'.$GLOBALS['TSFE']->id.'" />';
foreach ($this->piVars as $piVar => $value) {

View File

@ -121,7 +121,13 @@ class tx_dlf_navigation extends tx_dlf_plugin {
// Build page selector.
$uniqId = uniqid($prefix.'-');
$markerArray['###PAGESELECT###'] = '<form action="'.$this->pi_getPageLink($GLOBALS['TSFE']->id).'" class="'.$prefix.'-pageselect" method="get"><div><input type="hidden" name="id" value="'.$GLOBALS['TSFE']->id.'" />';
// Configure @action URL for form.
$linkConf = array (
'parameter' => $GLOBALS['TSFE']->id,
'forceAbsoluteUrl' => 1
);
$markerArray['###PAGESELECT###'] = '<form action="'.$this->cObj->typoLink_URL($linkConf).'" class="'.$prefix.'-pageselect" method="get"><div><input type="hidden" name="id" value="'.$GLOBALS['TSFE']->id.'" />';
foreach ($this->piVars as $piVar => $value) {

View File

@ -501,7 +501,12 @@ class tx_dlf_oai extends tx_dlf_plugin {
}
// Add request.
$request = $this->oai->createElementNS('http://www.openarchives.org/OAI/2.0/', 'request', htmlspecialchars(t3lib_div::locationHeaderUrl($this->pi_getPageLink($GLOBALS['TSFE']->id)), ENT_NOQUOTES, 'UTF-8'));
$linkConf = array (
'parameter' => $GLOBALS['TSFE']->id,
'forceAbsoluteUrl' => 1
);
$request = $this->oai->createElementNS('http://www.openarchives.org/OAI/2.0/', 'request', htmlspecialchars($this->cObj->typoLink_URL($linkConf), ENT_NOQUOTES, 'UTF-8'));
if (!$this->error) {
@ -942,7 +947,12 @@ class tx_dlf_oai extends tx_dlf_plugin {
$Identify->appendChild($this->oai->createElementNS('http://www.openarchives.org/OAI/2.0/', 'repositoryName', htmlspecialchars($resArray['oai_label'], ENT_NOQUOTES, 'UTF-8')));
$Identify->appendChild($this->oai->createElementNS('http://www.openarchives.org/OAI/2.0/', 'baseURL', htmlspecialchars(t3lib_div::locationHeaderUrl($this->pi_getPageLink($GLOBALS['TSFE']->id)), ENT_NOQUOTES, 'UTF-8')));
$linkConf = array (
'parameter' => $GLOBALS['TSFE']->id,
'forceAbsoluteUrl' => 1
);
$Identify->appendChild($this->oai->createElementNS('http://www.openarchives.org/OAI/2.0/', 'baseURL', htmlspecialchars($this->cObj->typoLink_URL($linkConf), ENT_NOQUOTES, 'UTF-8')));
$Identify->appendChild($this->oai->createElementNS('http://www.openarchives.org/OAI/2.0/', 'protocolVersion', '2.0'));

View File

@ -346,9 +346,15 @@ class tx_dlf_search extends tx_dlf_plugin {
}
// Configure @action URL for form.
$linkConf = array (
'parameter' => $GLOBALS['TSFE']->id,
'forceAbsoluteUrl' => 1
);
// Fill markers.
$markerArray = array (
'###ACTION_URL###' => $this->pi_getPageLink($GLOBALS['TSFE']->id),
'###ACTION_URL###' => $this->cObj->typoLink_URL($linkConf),
'###LABEL_QUERY###' => $this->pi_getLL('label.query'),
'###LABEL_SUBMIT###' => $this->pi_getLL('label.submit'),
'###FIELD_QUERY###' => $this->prefixId.'[query]',
@ -450,7 +456,7 @@ class tx_dlf_search extends tx_dlf_plugin {
t3lib_div::cleanOutputBuffers();
// Send headers.
header('Location: '.t3lib_div::locationHeaderUrl($this->pi_getPageLink($this->conf['targetPid'])));
header('Location: '.t3lib_div::locationHeaderUrl($this->cObj->typoLink_URL(array ('parameter' => $this->conf['targetPid']))));
// Flush output buffer and end script processing.
ob_end_flush();