Skip to content

Commit

Permalink
Updated: Added code to support multi-vhost link suuport when locale m…
Browse files Browse the repository at this point in the history
…atch and object parent node match root node
  • Loading branch information
brookinsconsulting committed Oct 2, 2017
1 parent 563188b commit 20313b7
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions operators/sitelinkoperator.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,16 @@ static function sitelink(&$operatorValue, &$namedParameters){
}
}
}
if(!($UseMatch=isset($Match[$SiteLink->currentHost])?$Match[$SiteLink->currentHost]:false)){

//if(!($UseMatch=isset($Match[$SiteLink->currentHost])?$Match[$SiteLink->currentHost]:false)){
$Matchup=0;
foreach($Match as $UseMatchItem){
if($UseMatchItem['locale']==$SiteLink->currentLocale){
if( (int)$SiteLink->objectNode->NodeID == (int)$UseMatchItem['root_node_id'] ||
(int)$SiteLink->objectNode->ParentNodeID == (int)$UseMatchItem['root_node_id'] ) {
$UseMatch = $UseMatchItem;
break;
}
if ($SiteLink->siteAccess['name'] == $UseMatchItem['siteaccess']) {
$UseMatchItem['host'] = '';
$UseMatch = $UseMatchItem;
Expand All @@ -169,8 +175,8 @@ static function sitelink(&$operatorValue, &$namedParameters){
if(!$UseMatch){
eZDebug::writeWarning('No host matches found have been found.','SiteLink Operator: PHP Class Warning');
}
}
//}

$res = $SiteLink->hyperlink($operatorValue,$UseMatch?$UseMatch['host']:false);
$namedParameters['UseMatch'] = $Match;
return $res;
Expand Down

0 comments on commit 20313b7

Please sign in to comment.