Add a new method to get the site URL based on the language

This commit is contained in:
touffies
2013-11-29 14:29:12 +01:00
parent 3d48eab76c
commit 71302493c1

View File

@@ -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.