本文整理汇总了PHP中cmsCore::getLanguageName方法的典型用法代码示例。如果您正苦于以下问题:PHP cmsCore::getLanguageName方法的具体用法?PHP cmsCore::getLanguageName怎么用?PHP cmsCore::getLanguageName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cmsCore
的用法示例。
在下文中一共展示了cmsCore::getLanguageName方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setQuery
public function setQuery($query)
{
$this->original_query = $query;
$this->query = array();
$stopwords = string_get_stopwords(cmsCore::getLanguageName());
$words = explode(' ', $query);
foreach ($words as $word) {
$word = strip_tags(mb_strtolower(trim(urldecode($word))));
if (mb_strlen($word) < 3 || is_numeric($word)) {
continue;
}
if ($stopwords && in_array($word, $stopwords)) {
continue;
}
if (mb_strlen($word) == 3) {
$this->query[] = $this->db->escape($word);
continue;
}
if (mb_strlen($word) >= 12) {
$word = mb_substr($word, 0, mb_strlen($word) - 4);
} else {
if (mb_strlen($word) >= 10) {
$word = mb_substr($word, 0, mb_strlen($word) - 3);
} else {
if (mb_strlen($word) >= 6) {
$word = mb_substr($word, 0, mb_strlen($word) - 2);
} else {
$word = mb_substr($word, 0, mb_strlen($word) - 1);
}
}
}
$this->query[] = $this->db->escape($word) . '*';
}
if (empty($this->query)) {
return false;
}
return true;
}
示例2: html_datepicker
<?php
$this->addJSFromContext('templates/default/js/jquery-ui.js');
$this->addJSFromContext('templates/default/js/i18n/jquery-ui/' . cmsCore::getLanguageName() . '.js');
$this->addCSSFromContext('templates/default/css/jquery-ui.css');
?>
<?php
if ($field->title) {
?>
<label for="<?php
echo $field->id;
?>
"><?php
echo $field->title;
?>
</label><?php
}
?>
<?php
echo html_datepicker($field->data['fname_date'], $field->data['date'], array('id' => $field->id), array('minDate' => date(cmsConfig::get('date_format'), 86400)));
?>
<?php
if ($field->data['show_time']) {
?>
<?php
echo html_select_range($field->data['fname_hours'], 0, 23, 1, true, $field->data['hours']);
?>
:
示例3: displayEditor
public function displayEditor($field_id, $content = '')
{
$lang = cmsCore::getLanguageName();
$user = cmsUser::getInstance();
$template = cmsTemplate::getInstance();
$template->addCSSFromContext('wysiwyg/redactor/css/redactor.css');
$template->addJSFromContext('wysiwyg/redactor/js/redactor.js');
$template->addJSFromContext('wysiwyg/redactor/js/video.js');
$template->addJSFromContext('wysiwyg/redactor/js/fullscreen.js');
$template->addJSFromContext('wysiwyg/redactor/js/fontsize.js');
//$template->addJSFromContext('wysiwyg/redactor/js/fontfamily.js');
$template->addJSFromContext('wysiwyg/redactor/js/fontcolor.js');
$template->addJSFromContext('wysiwyg/redactor/js/table.js');
$template->addJSFromContext("wysiwyg/redactor/langs/{$lang}.js");
$dom_id = str_replace(array('[', ']'), array('_', ''), $field_id);
echo html_textarea($field_id, $content, array('id' => $dom_id));
?>
<script type="text/javascript">
$(function(){
$('#<?php
echo $dom_id;
?>
').redactor({
lang: '<?php
echo $lang;
?>
',
plugins: ['video', 'fontsize', 'fontcolor', 'fullscreen', 'table'],
imageUpload: '<?php
echo href_to('redactor/upload');
?>
',
minHeight: 190,
replaceDivs: false,
removeComments: true,
convertLinks: false,
pastePlainText: true,
<?php
if (!$user->is_admin) {
?>
buttonsHide: ['html']
<?php
}
?>
});
<?php
if (!cmsCore::getInstance()->request->isAjax()) {
?>
$(window).on('resize', function (){
$('#<?php
echo $dom_id;
?>
').width($('#f_<?php
echo $dom_id;
?>
').width());
}).triggerHandler('resize');
<?php
}
?>
});
</script>
<?php
}
示例4: html
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title><?php
html($feed_title);
?>
</title>
<link><?php
html($config->host);
?>
</link>
<description><?php
html($feed['description']);
?>
</description>
<language><?php
html(cmsCore::getLanguageName());
?>
</language>
<pubDate><?php
html(date('r'));
?>
</pubDate>
<?php
if (!empty($feed['image'])) {
?>
<image>
<url><?php
echo $config->upload_host_abs . '/' . $feed['image']['normal'];
?>
</url>
<title><?php
示例5:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<?php
$this->addMainCSS('templates/default/css/theme-modal.css');
?>
<?php
$this->addMainCSS('templates/default/css/jquery-ui.css');
?>
<?php
$this->addMainJS('templates/default/js/jquery.js');
?>
<?php
$this->addMainJS('templates/default/js/jquery-ui.js');
?>
<?php
$this->addMainJS('templates/default/js/i18n/jquery-ui/' . cmsCore::getLanguageName() . '.js');
?>
<?php
$this->addMainJS('templates/default/js/jquery-modal.js');
?>
<?php
$this->addMainJS('templates/default/js/core.js');
?>
<?php
$this->addMainJS('templates/default/js/modal.js');
?>
<?php
$this->head(false);
?>
</head>
<body>
示例6: string_get_meta_keywords
/**
* Возвращает строку с перечислением самых часто используемых
* слов из исходного текста
*
* @param string $text
* @param int $min_length Минимальная длина каждого слова
* @param int $limit Количество слов в результирующей строке
* @return string
*/
function string_get_meta_keywords($text, $min_length = 5, $limit = 10)
{
$stat = array();
$text = str_replace(array("\n", '<br>', '<br/>'), ' ', $text);
$text = strip_tags($text);
$text = mb_strtolower($text);
$stopwords = string_get_stopwords(cmsCore::getLanguageName());
$words = explode(' ', $text);
foreach ($words as $word) {
$word = trim($word);
$word = str_replace(array('(', ')', '+', '-', '.', '!', ':', '{', '}', '|', '"', ',', "'"), '', $word);
$word = preg_replace("/\\.,\\(\\)\\{\\}/i", '', $word);
if ($stopwords && in_array($word, $stopwords)) {
continue;
}
if (mb_strlen($word) >= $min_length) {
$stat[$word] = isset($stat[$word]) ? $stat[$word] + 1 : 1;
}
}
asort($stat);
$stat = array_reverse($stat, true);
$stat = array_slice($stat, 0, $limit, true);
return implode(', ', array_keys($stat));
}