mirror of
https://github.com/silverstripe/silverstripe-translatable
synced 2024-10-22 11:05:59 +02:00
Fall back to global locale state for link updates (#139)
This commit is contained in:
parent
15e9037c1b
commit
6336632713
@ -139,19 +139,23 @@ class TranslatableCMSMainExtension extends Extension {
|
||||
}
|
||||
|
||||
function updateLink(&$link) {
|
||||
if($this->owner->Locale) $link = Controller::join_links($link, '?locale=' . $this->owner->Locale);
|
||||
$locale = $this->owner->Locale ? $this->owner->Locale : Translatable::get_current_locale();
|
||||
if($locale) $link = Controller::join_links($link, '?locale=' . $locale);
|
||||
}
|
||||
|
||||
function updateLinkWithSearch(&$link) {
|
||||
if($this->owner->Locale) $link = Controller::join_links($link, '?locale=' . $this->owner->Locale);
|
||||
$locale = $this->owner->Locale ? $this->owner->Locale : Translatable::get_current_locale();
|
||||
if($locale) $link = Controller::join_links($link, '?locale=' . $locale);
|
||||
}
|
||||
|
||||
function updateExtraTreeTools(&$html) {
|
||||
$locale = $this->owner->Locale ? $this->owner->Locale : Translatable::get_current_locale();
|
||||
$html = $this->LangForm()->forTemplate() . $html;
|
||||
}
|
||||
|
||||
function updateLinkPageAdd(&$link) {
|
||||
if($this->owner->Locale) $link = Controller::join_links($link, '?Locale=' . $this->owner->Locale);
|
||||
$locale = $this->owner->Locale ? $this->owner->Locale : Translatable::get_current_locale();
|
||||
if($locale) $link = Controller::join_links($link, '?Locale=' . $locale);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user