public function alternateAbsoluteLink($action = null) { $link = Director::absoluteURL($this->owner->Link($action)); if ($this->owner->hasExtension('Translatable')) { $targetLoc = $this->owner->Locale; $currLoc = Translatable::get_current_locale(); if ($targetLoc != $currLoc) { $link = Controller::join_links(Director::protocol() . LocaleDomains::getHostFromLocale($targetLoc), $this->owner->RelativeLink($action)); } } return $link; }
public function updateGoogleSitemapItems(ArrayList $items, $class, $page) { if ($class == "SiteTree") { $items = $items->filter("Locale", LocaleDomains::getLocaleFromHost()); } }