本文整理汇总了PHP中Locale::uninstallLocale方法的典型用法代码示例。如果您正苦于以下问题:PHP Locale::uninstallLocale方法的具体用法?PHP Locale::uninstallLocale怎么用?PHP Locale::uninstallLocale使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Locale
的用法示例。
在下文中一共展示了Locale::uninstallLocale方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: uninstallLocale
/**
* Uninstall a locale
* @param $args array
* @param $request object
*/
function uninstallLocale($args, &$request)
{
$this->validate();
$site =& $request->getSite();
$locale = $request->getUserVar('locale');
if (isset($locale) && !empty($locale) && $locale != $site->getPrimaryLocale()) {
$installedLocales = $site->getInstalledLocales();
if (in_array($locale, $installedLocales)) {
$installedLocales = array_diff($installedLocales, array($locale));
$site->setInstalledLocales($installedLocales);
$supportedLocales = $site->getSupportedLocales();
$supportedLocales = array_diff($supportedLocales, array($locale));
$site->setSupportedLocales($supportedLocales);
$siteDao =& DAORegistry::getDAO('SiteDAO');
$siteDao->updateObject($site);
$this->_removeLocalesFromPresses($request);
Locale::uninstallLocale($locale);
}
}
$request->redirect(null, null, 'languages');
}
示例2: reloadLocale
/**
* Reload locale-specific data.
* @param $locale string
*/
function reloadLocale($locale)
{
Locale::uninstallLocale($locale);
Locale::installLocale($locale);
}
示例3: uninstallLocale
/**
* Uninstall a locale
*/
function uninstallLocale()
{
$this->validate();
$site =& Request::getSite();
$locale = Request::getUserVar('locale');
if (isset($locale) && !empty($locale) && $locale != $site->getPrimaryLocale()) {
$installedLocales = $site->getInstalledLocales();
if (in_array($locale, $installedLocales)) {
$installedLocales = array_diff($installedLocales, array($locale));
$site->setInstalledLocales($installedLocales);
$supportedLocales = $site->getSupportedLocales();
$supportedLocales = array_diff($supportedLocales, array($locale));
$site->setSupportedLocales($supportedLocales);
$siteDao =& DAORegistry::getDAO('SiteDAO');
$siteDao->updateObject($site);
AdminLanguagesHandler::removeLocalesFromConferences();
Locale::uninstallLocale($locale);
}
}
Request::redirect(null, null, null, 'languages');
}