当前位置: 首页>>代码示例>>PHP>>正文


PHP AppLocale::uninstallLocale方法代码示例

本文整理汇总了PHP中AppLocale::uninstallLocale方法的典型用法代码示例。如果您正苦于以下问题:PHP AppLocale::uninstallLocale方法的具体用法?PHP AppLocale::uninstallLocale怎么用?PHP AppLocale::uninstallLocale使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AppLocale的用法示例。


在下文中一共展示了AppLocale::uninstallLocale方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: uninstallLocale

 /**
  * Uninstall a locale.
  * @param $args array
  * @param $request Request
  * @return JSONMessage JSON object
  */
 function uninstallLocale($args, $request)
 {
     $site = $request->getSite();
     $locale = $request->getUserVar('rowId');
     $gridData = $this->getGridDataElements($request);
     if (array_key_exists($locale, $gridData)) {
         $localeData = $gridData[$locale];
         if (!$localeData['primary']) {
             $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->_updateContextLocaleSettings($request);
                 AppLocale::uninstallLocale($locale);
                 $notificationManager = new NotificationManager();
                 $user = $request->getUser();
                 $notificationManager->createTrivialNotification($user->getId(), NOTIFICATION_TYPE_SUCCESS, array('contents' => __('notification.localeUninstalled', array('locale' => $localeData['name']))));
             }
         }
     }
     return DAO::getDataChangedEvent($locale);
 }
开发者ID:selwyntcy,项目名称:pkp-lib,代码行数:33,代码来源:PKPAdminLanguageGridHandler.inc.php

示例2: reloadLocale

 /**
  * Reload locale-specific data.
  * @param $locale string
  */
 function reloadLocale($locale)
 {
     AppLocale::uninstallLocale($locale);
     AppLocale::installLocale($locale);
 }
开发者ID:ingmarschuster,项目名称:MindResearchRepository,代码行数:9,代码来源:PKPLocale.inc.php

示例3: 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->_removeLocalesFromJournals($request);
             AppLocale::uninstallLocale($locale);
         }
     }
     $request->redirect(null, null, 'languages');
 }
开发者ID:yuricampos,项目名称:ojs,代码行数:26,代码来源:AdminLanguagesHandler.inc.php


注:本文中的AppLocale::uninstallLocale方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。