Add a new method to get the site URL based on the language
This commit is contained in:
@@ -302,6 +302,23 @@ class BaseAdminController extends BaseController
|
|||||||
return $this->getCurrentEditionLang()->getLocale();
|
return $this->getCurrentEditionLang()->getLocale();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A simple helper to get the URL based on the language.
|
||||||
|
*/
|
||||||
|
protected function getUrlLanguage($locale = null)
|
||||||
|
{
|
||||||
|
// Check if the functionality is activated
|
||||||
|
if(!ConfigQuery::read("one_domain_foreach_lang", false))
|
||||||
|
return;
|
||||||
|
|
||||||
|
// If we don't have a locale value, use the locale value in the session
|
||||||
|
if(!$locale)
|
||||||
|
$locale = $this->getCurrentEditionLocale();
|
||||||
|
|
||||||
|
return LangQuery::create()->findOneByLocale($locale)->getUrl();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the current list order identifier for a given object name,
|
* Return the current list order identifier for a given object name,
|
||||||
* updating in using the current request.
|
* updating in using the current request.
|
||||||
|
|||||||
Reference in New Issue
Block a user