diff --git a/core/lib/Thelia/Controller/Admin/BaseAdminController.php b/core/lib/Thelia/Controller/Admin/BaseAdminController.php index 849438539..65d2e07fb 100755 --- a/core/lib/Thelia/Controller/Admin/BaseAdminController.php +++ b/core/lib/Thelia/Controller/Admin/BaseAdminController.php @@ -302,6 +302,23 @@ class BaseAdminController extends BaseController 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, * updating in using the current request.