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


PHP Locales类代码示例

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


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

示例1: indexAction

 function indexAction()
 {
     $params = array('locale_code' => $this->locale_code, 'request' => $this->getRequest());
     if ($this->_auth->hasIdentity()) {
         $params['is_admin'] = $this->_identity->isAdmin;
     } else {
         $params['is_admin'] = false;
     }
     $additional = $this->_Bolts_plugin->doFilter($this->_mca, $params);
     // FILTER HOOK
     foreach ($additional as $key => $value) {
         $this->view->{$key} = $value;
     }
     // $this->view->welcome = $this->_T("Welcome!");
     // TODO - find out if there is a valid cookie
     // then redirect to that locale
     // or redirect to the default locale
     // ONLY if localization is enabled
     // if localization is enabled and the URI does not contain a locale code
     // and there is not a valid locale cookie
     // redirect to a URI that contains the default locale code
     if (Bolts_Registry::get('enable_localization') == '1') {
         $locales_table = new Locales();
         $locale_codes = $locales_table->getLocaleCodes(true);
         $uri_parts = explode("/", trim($this->_uri, "/"));
         if (count($uri_parts) > 0 && !in_array($uri_parts[0], $locale_codes)) {
             // redirect method will automatically add the correct locale code to the URI
             $this->_redirect("/");
         }
     }
 }
开发者ID:jaybill,项目名称:Bolts,代码行数:31,代码来源:IndexController.php

示例2: execute

 function execute()
 {
     $locale = new Locales('connection');
     $list = $locale->getList();
     $this->smarty->assign('lang', $list);
     $this->smarty->assign('slide', connectionSliderModel::create()->where(array('id' => (int) Request::post('id')))->fetchOne());
 }
开发者ID:Yogurt933,项目名称:Made-Easy,代码行数:7,代码来源:connectionSliderEdite.action.php

示例3: execute

 function execute()
 {
     $app = strtolower(Request::get('app_local'));
     $locale = new Locales($app);
     $locale->deleteTranslate(Request::get('local_iso'), Request::post('var'));
     return false;
 }
开发者ID:Yogurt933,项目名称:Made-Easy,代码行数:7,代码来源:coreLocalizationDeleteValue.action.php

示例4: render

 function render()
 {
     // load all the locale files
     $locales = new Locales();
     $siteLocales = $locales->getLocales();
     $this->setValue("locales", $siteLocales);
     parent::render();
 }
开发者ID:BackupTheBerlios,项目名称:plogfr-svn,代码行数:8,代码来源:adminsitelocaleslistview.class.php

示例5: execute

 function execute()
 {
     $model = connectionSliderModel::create();
     $locale = new Locales('connection');
     $list = $locale->getList();
     $this->smarty->assign('slides', $model->sort('sort', -1)->fetchAll());
     $this->smarty->assign('lang', $list);
 }
开发者ID:Yogurt933,项目名称:Made-Easy,代码行数:8,代码来源:connectionSliderList.action.php

示例6: execute

 function execute()
 {
     $locale = new Locales('connection');
     $list = $locale->getList();
     $page = Request::post('page');
     $this->smarty->assign('seo', connectionSeoModel::create()->getByPage($page));
     $this->smarty->assign('lang', $list);
 }
开发者ID:Yogurt933,项目名称:Made-Easy,代码行数:8,代码来源:connectionSeoGetPage.action.php

示例7: Locales

 public function &GetLocales()
 {
     if (!isset($this->_locales)) {
         $locales = new Locales();
         $locales->LoadAll();
         $this->_locales = $locales;
     }
     return $this->_locales;
 }
开发者ID:jhogan,项目名称:nplay,代码行数:9,代码来源:GlobalSingleton.php

示例8: execute

 function execute()
 {
     $locale = new Locales('connection');
     $list = $locale->getList();
     $pageModel = new connectionPagesModel();
     $this->smarty->assign('pages', $pageModel->fetchAll());
     $this->smarty->assign('lang', $list);
     $this->smarty->assign('page_url', Settings::getValue('page_url'));
 }
开发者ID:Yogurt933,项目名称:Made-Easy,代码行数:9,代码来源:connectionPagesList.action.php

示例9: execute

 function execute()
 {
     $this->frame = false;
     $locale = new Locales('connection');
     $list = $locale->getList();
     $this->smarty->assign('lang', $list);
     $fieldID = Request::post('id');
     $model = new connectionFieldsModel();
     $this->smarty->assign('field', $model->getField($fieldID));
 }
开发者ID:Yogurt933,项目名称:Made-Easy,代码行数:10,代码来源:connectionFieldsEdite.action.php

示例10: execute

 function execute()
 {
     $locale = new Locales('connection');
     $list = $locale->getList();
     if (Request::post('id')) {
         $answer = connectionFaqAnswerModel::create()->where(array('id' => (int) Request::post('id')))->fetchOne();
         $this->smarty->assign('answer', $answer);
     }
     $this->smarty->assign('lang', $list);
 }
开发者ID:Yogurt933,项目名称:Made-Easy,代码行数:10,代码来源:connectionFaqEditeAnswer.action.php

示例11: execute

 function execute()
 {
     $locale = new Locales('connection');
     $list = $locale->getList();
     $notification = connectionNotificationModel::create()->where(array('id' => (int) Request::post('id')))->fetchOne();
     $eventList = connectionNotificationModel::getEventList();
     $this->smarty->assign('eventInfo', $eventList[$notification['event']]);
     $this->smarty->assign('lang', $list);
     $this->smarty->assign('notification', $notification);
 }
开发者ID:Yogurt933,项目名称:Made-Easy,代码行数:10,代码来源:connectionNotificationEdite.action.php

示例12: execute

 function execute()
 {
     $event = Request::post('event');
     $eventList = connectionNotificationModel::getEventList();
     $locale = new Locales('connection');
     $list = $locale->getList();
     $this->smarty->assign('eventInfo', $eventList[$event]);
     $this->smarty->assign('lang', $list);
     $this->smarty->assign('event', connectionNotificationModel::create()->getEvent($event));
 }
开发者ID:Yogurt933,项目名称:Made-Easy,代码行数:10,代码来源:connectionNotificationGetEvent.action.php

示例13: execute

 function execute()
 {
     $locale = new Locales('connection');
     $list = $locale->getList();
     $this->smarty->assign('lang', $list);
     $model = new connectionFieldsModel();
     $fields = array();
     $fields['info'] = $model->getGroup('info');
     $fields['interest'] = $model->getGroup('interest');
     $this->smarty->assign('fields', $fields);
 }
开发者ID:Yogurt933,项目名称:Made-Easy,代码行数:11,代码来源:connectionBackendFields.action.php

示例14: chooseAction

 function chooseAction()
 {
     // TODO maybe? - prevent people from viewing this page if localization is not enabled
     $default_locale = strtolower(Bolts_Registry::get('default_locale', 'default'));
     $request = new Bolts_Request($this->getRequest());
     // TODO - get cookie value and validate it
     // TODO - only redirect if a valid cookie value exists !
     if (!$request->has('change') && false) {
         $this->_redirect("/" . $this->locale_code);
     }
     // Force the use of en-US
     if ($this->locale_code != $default_locale) {
         $this->locale_code = $default_locale;
         $this->_redirect("/" . $this->_request->getModuleName() . "/" . $this->_request->getControllerName() . "/" . $this->_request->getActionName() . "/");
     }
     $locales_table = new Locales();
     $tmp_regions = $locales_table->getDistinctRegions();
     $choices = array();
     foreach ($tmp_regions as $tmp_region) {
         if ($tmp_region['region_name'] == 'Global') {
             continue;
         }
         $tmp_countries = $locales_table->getDistinctCountries($tmp_region['region_name']);
         $tmp_pseudo_countries = $locales_table->getDistinctPseudoCountryCodes($tmp_region['region_name']);
         foreach ($tmp_countries as $tmp_country) {
             if (!empty($tmp_pseudo_countries) && in_array($tmp_country['country_code'], $tmp_pseudo_countries[0])) {
                 continue;
             }
             $tmp_lang = $locales_table->getLanguages($tmp_region['region_name'], $tmp_country['country_code']);
             $tmp_country['languages'] = array();
             foreach ($tmp_lang as $lan) {
                 if (!is_null($lan['pseudo_country_code'])) {
                     $tmp_locale_code = strtolower($lan['language_code'] . "-" . $lan['pseudo_country_code']);
                 } else {
                     $tmp_locale_code = strtolower($lan['language_code'] . "-" . $tmp_country['country_code']);
                 }
                 if (in_array($tmp_locale_code, $this->live_locales)) {
                     $tmp_country['languages'][] = $lan;
                 }
             }
             if (count($tmp_country['languages']) > 0) {
                 $tmp_region['countries'][] = $tmp_country;
             }
         }
         if (array_key_exists('countries', $tmp_region) && count($tmp_region['countries']) > 0) {
             $choices[] = $tmp_region;
         }
     }
     $this->view->choices = $choices;
     if ($request->has('inline')) {
         $this->view->inline = $request->inline;
     }
 }
开发者ID:jaybill,项目名称:Bolts,代码行数:53,代码来源:LocaleController.php

示例15: execute

 function execute()
 {
     $locale = new Locales('connection');
     $list = $locale->getList();
     $this->smarty->assign('lang', $list);
     $model = new connectionCountryModel();
     $countries = array();
     foreach ($list as $lang) {
         $countries[$lang['iso']] = $model->getList($lang['iso']);
     }
     $this->smarty->assign('country', $countries);
 }
开发者ID:Yogurt933,项目名称:Made-Easy,代码行数:12,代码来源:connectionBackendCountry.action.php


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