Skip to content

Commit

Permalink
allow sub pages to have site access within file name
Browse files Browse the repository at this point in the history
  • Loading branch information
pat11 committed Aug 12, 2011
1 parent 5ddcc0c commit 8913d2e
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions classes/sitelink.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,7 @@ function hyperlink(&$operatorValue=false, $host=false){
if($this->useSiteaccessOverride && isset($this->useSiteaccess)){
$urlComponents['path']='/'.$this->useSiteaccess.$urlComponents['path'];
} else if($this->siteAccess && isset($this->siteAccess['uri_part']) && count($this->siteAccess['uri_part']) && !$urlComponents['host']){
$SiteAccessPosition=stripos($urlComponents['path'],implode('/',$this->siteAccess['uri_part']));
if($SiteAccessPosition===false || $SiteAccessPosition>0){
if(stripos($urlComponents['path'],implode('/',$this->siteAccess['uri_part']))===false){
$urlComponents['path']='/'.implode('/',$this->siteAccess['uri_part']).$urlComponents['path'];
}
}
Expand Down Expand Up @@ -170,18 +169,17 @@ function normalize(){

foreach ($excluded as $ex) {
if (strpos($this->urlComponents['path'], $ex) !== false) return true;
}

}
if($this->urlComponents){
if($this->isMultisite && $this->urlComponents['path'] && !$this->urlComponents['host']){
if($this->urlComponents['path']){
foreach(self::pathPrefixList() as $PathPrefix){
if(stripos($this->urlComponents['path'],$PathPrefix)!==false){
if(stripos($this->urlComponents['path'],"$PathPrefix/")!==false){
$this->pathPrefix=$PathPrefix;
break;
}
}
if(stripos($this->urlComponents['path'],$this->pathPrefix)===false){
if(stripos($this->urlComponents['path'],"$this->pathPrefix/")===false){
$this->urlComponents['path']=$this->pathPrefix.'/'.$this->urlComponents['path'];
}
}
Expand Down Expand Up @@ -316,7 +314,10 @@ static function isMultisite(&$object=false){
static function pathPrefixList(){
$PathPrefixList=array();
foreach(eZSiteAccess::siteAccessList() as $key=>$value){
$PathPrefixList[]=self::configSetting('SiteAccessSettings','PathPrefix','site.ini','settings/siteaccess/'.$value['name'],true);
$PathPrefixItem=self::configSetting('SiteAccessSettings','PathPrefix','site.ini','settings/siteaccess/'.$value['name'],true);
if($PathPrefixItem && !in_array($PathPrefixItem,$PathPrefixList)){
$PathPrefixList[]=$PathPrefixItem;
}
}
return $PathPrefixList;
}
Expand Down

0 comments on commit 8913d2e

Please sign in to comment.