本文整理汇总了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;
}
示例2: getLanguages
private function getLanguages()
{
return TikiLib::get_language_map();
}
示例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;
}