當前位置: 首頁>>代碼示例>>PHP>>正文


PHP TikiLib::get_language_map方法代碼示例

本文整理匯總了PHP中TikiLib::get_language_map方法的典型用法代碼示例。如果您正苦於以下問題:PHP TikiLib::get_language_map方法的具體用法?PHP TikiLib::get_language_map怎麽用?PHP TikiLib::get_language_map使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在TikiLib的用法示例。


在下文中一共展示了TikiLib::get_language_map方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: indexConnection

 private function indexConnection($created, $data)
 {
     $doc = new Zend_Search_Lucene_Document();
     $doc->addField(Zend_Search_Lucene_Field::Keyword('created', $created));
     $doc->addField(Zend_Search_Lucene_Field::Text('version', $data['version']));
     if (!empty($data['site'])) {
         if (!empty($data['site']['connect_site_title'])) {
             $doc->addField(Zend_Search_Lucene_Field::Text('title', $data['site']['connect_site_title']));
         }
         if (!empty($data['site']['connect_site_url'])) {
             $doc->addField(Zend_Search_Lucene_Field::Keyword('url', $data['site']['connect_site_url']));
         }
         if (!empty($data['site']['connect_site_email'])) {
             $doc->addField(Zend_Search_Lucene_Field::Keyword('email', $data['site']['connect_site_email']));
             // hmm
         }
         if (!empty($data['site']['connect_site_keywords'])) {
             $doc->addField(Zend_Search_Lucene_Field::Text('keywords', $data['site']['connect_site_keywords']));
         }
         if (!empty($data['site']['connect_site_location'])) {
             $loc = TikiLib::lib('geo')->parse_coordinates($data['site']['connect_site_location']);
             if (count($loc) > 1) {
                 $doc->addField(Zend_Search_Lucene_Field::Keyword('geo_lat', $loc['lat']));
                 $doc->addField(Zend_Search_Lucene_Field::Keyword('geo_lon', $loc['lon']));
                 if (count($loc) > 2) {
                     $doc->addField(Zend_Search_Lucene_Field::Keyword('geo_zoom', $loc['zoom']));
                 }
             }
         }
     } else {
         $doc->addField(Zend_Search_Lucene_Field::Text('title', tra('Anonymous')));
     }
     if (!empty($data['tables'])) {
         $doc->addField(Zend_Search_Lucene_Field::UnIndexed('tables', serialize($data['tables'])));
     }
     if (!empty($data['prefs'])) {
         $doc->addField(Zend_Search_Lucene_Field::UnIndexed('prefs', serialize($data['prefs'])));
         if (!empty($data['prefs']['language'])) {
             $languages = TikiLib::get_language_map();
             $doc->addField(Zend_Search_Lucene_Field::Text('language', $languages[$data['prefs']['language']]));
         }
     }
     if (!empty($data['server'])) {
         $doc->addField(Zend_Search_Lucene_Field::UnIndexed('server', serialize($data['server'])));
     }
     if (!empty($data['votes'])) {
         $doc->addField(Zend_Search_Lucene_Field::UnIndexed('votes', serialize($data['votes'])));
     }
     return $doc;
 }
開發者ID:jkimdon,項目名稱:cohomeals,代碼行數:50,代碼來源:Server.php

示例2: getLanguages

 private function getLanguages()
 {
     return TikiLib::get_language_map();
 }
開發者ID:jkimdon,項目名稱:cohomeals,代碼行數:4,代碼來源:Language.php

示例3: getSearchFilters

 private function getSearchFilters($type, $object)
 {
     $translations = $this->utilities->getTranslations($type, $object);
     $languages = TikiLib::get_language_map();
     foreach ($translations as $trans) {
         unset($languages[$trans['lang']]);
     }
     unset($languages[$this->utilities->getLanguage($type, $object)]);
     $language = '"' . implode('" OR "', array_keys($languages)) . '"';
     if ($language == '""') {
         $language = null;
     }
     $filters = array('type' => $type, 'language' => $language);
     if ($type == 'trackeritem') {
         $info = TikiLib::lib('trk')->get_tracker_item($object);
         $filters['tracker_id'] = $info['trackerId'];
     }
     return $filters;
 }
開發者ID:jkimdon,項目名稱:cohomeals,代碼行數:19,代碼來源:TranslationController.php


注:本文中的TikiLib::get_language_map方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。