Project

General

Profile

Feature #18498 » realurl.diff

Administrator Admin, 2008-07-18 14:43

View differences:

realurl.bak/class.tx_realurl_advanced.php 2009-05-07 12:37:38.000000000 +0400
* @param array Array with the current pid/mpvar to return if no processing is done.
* @return array With resolved id and $mpvar
*/
function searchTitle($pid, $mpvar, &$urlParts, $currentIdMp = '') {
function searchTitle ( $pid, $mpvar, &$urlParts, $currentIdMp = '', $foundUID = false ) {
// Creating currentIdMp variable if not set:
if (!is_array($currentIdMp)) {
$currentIdMp = array($pid, $mpvar);
$currentIdMp = array( $pid, $mpvar, $foundUID );
}
// No more urlparts? Return what we have.
......
// If a title was found...
if ($uid) {
return $this->searchTitle_processResult($row, $mpvar, $urlParts);
return $this->searchTitle_processResult( $row, $mpvar, $urlParts, 1 );
}
elseif (count($exclude)) {
// There were excluded pages, we have to process those!
foreach ($exclude as $row) {
$urlParts_copy = $urlParts;
array_unshift($urlParts_copy, $title);
$result = $this->searchTitle_processResult($row, $mpvar, $urlParts_copy);
if ($result[0]) {
$result = $this->searchTitle_processResult( $row, $mpvar, $urlParts_copy, 0 );
if ( $result[2] ) {
$urlParts = $urlParts_copy;
return $result;
}
......
* @param array $urlParts URL segments
* @return array Resolved id and mpvar
*/
function searchTitle_processResult($row, $mpvar, &$urlParts) {
function searchTitle_processResult($row, $mpvar, &$urlParts, $foundUID ) {
$uid = $row['uid'];
// Set base currentIdMp for next level:
$currentIdMp = array($uid, $mpvar);
$currentIdMp = array( $uid, $mpvar, $foundUID );
// Modify values if it was a mount point:
if (is_array($row['_IS_MOUNTPOINT'])) {
......
}
// Yep, go search for the next subpage
return $this->searchTitle($uid, $mpvar, $urlParts, $currentIdMp);
return $this->searchTitle($uid, $mpvar, $urlParts, $currentIdMp, $foundUID);
}
/**
(1-1/2)