Fall back to global locale state for link updates (#139)

This commit is contained in:
Ingo Schommer 2013-09-05 16:06:58 +02:00
parent 15e9037c1b
commit 6336632713
1 changed files with 7 additions and 3 deletions

View File

@ -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);
}
/**