本文整理汇总了PHP中XoopsLocale::getLangCode方法的典型用法代码示例。如果您正苦于以下问题:PHP XoopsLocale::getLangCode方法的具体用法?PHP XoopsLocale::getLangCode怎么用?PHP XoopsLocale::getLangCode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XoopsLocale
的用法示例。
在下文中一共展示了XoopsLocale::getLangCode方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct()
{
parent::__construct();
// SMARTY_PLUGINS_DIR is initialized into parent
$xoops = Xoops::getInstance();
$xoops->preload()->triggerEvent('core.template.construct.start', array($this));
$this->left_delimiter = '<{';
$this->right_delimiter = '}>';
$this->setTemplateDir(\XoopsBaseConfig::get('themes-path'));
$this->setCacheDir(\XoopsBaseConfig::get('smarty-cache'));
$this->setCompileDir(\XoopsBaseConfig::get('smarty-compile'));
$this->compile_check = $xoops->getConfig('theme_fromfile') == 1;
$this->setPluginsDir(\XoopsBaseConfig::get('smarty-xoops-plugins'));
$this->addPluginsDir(SMARTY_PLUGINS_DIR);
$this->setCompileId();
$this->assign(array('xoops_url' => \XoopsBaseConfig::get('url'), 'xoops_rootpath' => \XoopsBaseConfig::get('root-path'), 'xoops_langcode' => XoopsLocale::getLangCode(), 'xoops_charset' => XoopsLocale::getCharset(), 'xoops_version' => \Xoops::VERSION, 'xoops_upload_url' => \XoopsBaseConfig::get('uploads-url')));
}
示例2: test__construct
public function test__construct()
{
$xoops = \Xoops::getInstance();
$this->assertSame('{', $this->object->left_delimiter);
$this->assertSame('}', $this->object->right_delimiter);
$this->assertTrue(in_array(\XoopsBaseConfig::get('themes-path') . DIRECTORY_SEPARATOR, $this->object->getTemplateDir()));
$this->assertSame(\XoopsBaseConfig::get('var-path') . '/caches/smarty_cache' . DIRECTORY_SEPARATOR, $this->object->getCacheDir());
$this->assertSame(\XoopsBaseConfig::get('var-path') . '/caches/smarty_compile' . DIRECTORY_SEPARATOR, $this->object->getCompileDir());
$this->assertSame($xoops->getConfig('theme_fromfile') == 1, $this->object->compile_check);
$this->assertSame(array(\XoopsBaseConfig::get('lib-path') . '/smarty/xoops_plugins' . DIRECTORY_SEPARATOR, SMARTY_DIR . 'plugins' . DS), $this->object->plugins_dir);
$this->assertSame(\XoopsBaseConfig::get('url'), $this->object->getTemplateVars('xoops_url'));
$this->assertSame(\XoopsBaseConfig::get('root-path'), $this->object->getTemplateVars('xoops_rootpath'));
$this->assertSame(\XoopsLocale::getLangCode(), $this->object->getTemplateVars('xoops_langcode'));
$this->assertSame(\XoopsLocale::getCharset(), $this->object->getTemplateVars('xoops_charset'));
$this->assertSame(\Xoops::VERSION, $this->object->getTemplateVars('xoops_version'));
$this->assertSame(\XoopsBaseConfig::get('uploads-url'), $this->object->getTemplateVars('xoops_upload_url'));
}
示例3: htmlspecialchars
$myts = MyTextSanitizer::getInstance();
if (!$tpl->isCached('module:publisher/publisher_rss.tpl')) {
$channel_category = $publisher->getModule()->getVar('name');
$tpl->assign('channel_charset', XoopsLocale::getCharset());
$tpl->assign('channel_title', htmlspecialchars($xoops->getConfig('sitename'), ENT_QUOTES));
$tpl->assign('channel_link', PUBLISHER_URL);
$tpl->assign('channel_desc', htmlspecialchars($xoops->getConfig('slogan'), ENT_QUOTES));
$tpl->assign('channel_lastbuild', XoopsLocale::formatTimestamp(time(), 'rss'));
$tpl->assign('channel_webmaster', $xoops->getConfig('adminmail'));
$tpl->assign('channel_editor', $xoops->getConfig('adminmail'));
if ($categoryid != -1) {
$channel_category .= " > " . $categoryObj->getVar('name');
}
$tpl->assign('channel_category', htmlspecialchars($channel_category));
$tpl->assign('channel_generator', $publisher->getModule()->getVar('name'));
$tpl->assign('channel_language', XoopsLocale::getLangCode());
$tpl->assign('image_url', \XoopsBaseConfig::get('url') . '/images/logo.gif');
$dimention = getimagesize(\XoopsBaseConfig::get('root-path') . '/images/logo.gif');
if (empty($dimention[0])) {
$width = 140;
$height = 140;
} else {
$width = $dimention[0] > 140 ? 140 : $dimention[0];
$dimention[1] = $dimention[1] * $width / $dimention[0];
$height = $dimention[1] > 140 ? $dimention[1] * $dimention[0] / 140 : $dimention[1];
}
$tpl->assign('image_width', $width);
$tpl->assign('image_height', $height);
$sarray = $publisher->getItemHandler()->getAllPublished(10, 0, $categoryid);
if (is_array($sarray)) {
$count = $sarray;
示例4: simpleHeader
/**
* Render Simple Header
*
* @param bool $closehead true to close the HTML head element
*
* @return void
*/
public function simpleHeader($closehead = true)
{
$this->events()->triggerEvent('core.header.start');
$this->theme();
$xoopsConfigMetaFooter = $this->getConfigs();
if (!headers_sent()) {
header('Content-Type:text/html; charset=' . XoopsLocale::getCharset());
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header('Cache-Control: no-store, no-cache, max-age=1, s-maxage=1, must-revalidate, post-check=0, pre-check=0');
header("Pragma: no-cache");
}
echo "<!DOCTYPE html>\n";
$xoops_url = \XoopsBaseConfig::get('url');
echo '<html lang="' . XoopsLocale::getLangCode() . '">
<head>
<meta http-equiv="content-type" content="text/html; charset=' . XoopsLocale::getCharset() . '" />
<meta name="robots" content="' . htmlspecialchars($xoopsConfigMetaFooter['meta_robots']) . '" />
<meta name="keywords" content="' . htmlspecialchars($xoopsConfigMetaFooter['meta_keywords']) . '" />
<meta name="description" content="' . htmlspecialchars($xoopsConfigMetaFooter['meta_description']) . '" />
<meta name="rating" content="' . htmlspecialchars($xoopsConfigMetaFooter['meta_rating']) . '" />
<meta name="author" content="' . htmlspecialchars($xoopsConfigMetaFooter['meta_author']) . '" />
<meta name="generator" content="XOOPS" />
<title>' . htmlspecialchars($this->getConfig('sitename')) . '</title>
<script type="text/javascript" src="' . $xoops_url . '/include/xoops.js"></script>
<script type="text/javascript" src="' . $xoops_url . '/media/jquery/jquery.js"></script>
<script type="text/javascript" src="' . $xoops_url . '/media/bootstrap/js/bootstrap.min.js"></script>';
$themecss = $this->getCss($this->getConfig('theme_set'));
echo '<link rel="stylesheet" type="text/css" media="all" href="' . $xoops_url . '/xoops.css" />';
$locale = $this->getConfig('locale');
if (XoopsLoad::fileExists($this->path('locale/' . $locale . '/style.css'))) {
echo '<link rel="stylesheet" type="text/css" media="all" href="' . $xoops_url . '/locale/' . $locale . '/style.css" />';
}
if ($themecss) {
echo '<link rel="stylesheet" type="text/css" media="all" href="' . $themecss . '" />';
echo '<link rel="stylesheet" type="text/css" media="screen" href="' . $this->url('themes/' . $this->getConfig('theme_set') . '/media/bootstrap/css/xoops.bootstrap.css') . '" />';
}
if ($closehead) {
echo '</head><body>';
}
}
示例5: getLanguage
/**
* get language
*
* @return string
*/
function getLanguage()
{
if ($this->language) {
return $this->language;
}
if (defined("_XOOPS_EDITOR_TINYMCE_LANGUAGE")) {
$this->language = strtolower(constant("_XOOPS_EDITOR_TINYMCE_LANGUAGE"));
} else {
$this->language = str_replace('_', '-', strtolower(XoopsLocale::getLangCode()));
if (strtolower(XoopsLocale::getCharset()) == "utf-8") {
$this->language .= "_utf8";
}
}
return $this->language;
}
示例6: isset
include $path . '/mainfile.php';
if (!defined('XOOPS_ROOT_PATH')) {
exit;
}
include_once XOOPS_ROOT_PATH . '/language/' . $xoopsConfig['language'] . '/user.php';
$op = isset($_POST['op']) && $_POST['op'] == 'dologin' ? 'dologin' : 'login';
$username = isset($_POST['username']) ? trim($_POST['username']) : '';
$password = isset($_POST['userpass']) ? trim($_POST['userpass']) : '';
if ($username == '' || $password == '') {
$op = 'login';
}
echo '
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=' . XoopsLocale::getCharset() . '" />
<meta http-equiv="content-language" content="' . XoopsLocale::getLangCode() . '" />
<title>' . $xoopsConfig['sitename'] . '</title>
<link rel="stylesheet" type="text/css" media="all" href="' . XOOPS_URL . '/xoops.css" />
';
$style = xoops_getcss($xoopsConfig['theme_set']);
if ($style == '') {
$style = xoops_getcss($xoopsConfig['theme_set']);
}
if ($style != '') {
echo '<link rel="stylesheet" type="text/css" media="all" href="' . $style . '" />';
}
echo '
</head>
<body>
';
if ($op == 'dologin') {
示例7: init
/**
* init - called by parent::_construct
*
* @return void
*/
protected function init()
{
$this->setTemplate('module:xmf/xmf_feed.tpl');
//$this->disableLogger();
global $xoopsConfig;
$this->_title = $xoopsConfig['sitename'];
$this->_url = \XoopsBaseConfig::get('url');
$this->_description = $xoopsConfig['slogan'];
$this->_language = \XoopsLocale::getLangCode();
$this->_charset = \XoopsLocale::getCharset();
$this->_pubdate = \XoopsLocale::formatTimestamp(time(), 'short');
$this->_lastbuild = \XoopsLocale::formatTimestamp(time(), 'D, d M Y H:i:s');
$this->_webmaster = $xoopsConfig['adminmail'];
$this->_editor = $xoopsConfig['adminmail'];
$this->_generator = \Xoops::VERSION;
$this->_copyright = 'Copyright ' . \XoopsLocale::formatTimestamp(time(), 'Y') . ' ' . $xoopsConfig['sitename'];
$this->_image_title = $this->_title;
$this->_image_url = \XoopsBaseConfig::get('url') . '/images/logo.gif';
$this->_image_link = $this->_url;
}
示例8: dump
/**
* Dump output
*
* @param string $mode unused
*
* @return string output
*/
public function dump($mode = '')
{
$ret = '';
// -------------------------------------------------------------
$xoops = Xoops::getInstance();
/* @var $this LoggerLegacy */
$ret = '';
if ($mode == 'popup') {
$dump = $this->dump('');
$content = '
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head>
<meta http-equiv="content-language" content="' . XoopsLocale::getLangCode() . '" />
<meta http-equiv="content-type" content="text/html; charset=' . XoopsLocale::getCharset() . '" />
<title>' . $xoops->getConfig('sitename') . ' - ' . _MD_LOGGER_DEBUG . ' </title>
<meta name="generator" content="XOOPS" />
<link rel="stylesheet" type="text/css" media="all" href="' . $xoops->getCss($xoops->getConfig('theme_set')) . '" />
</head>
<body>' . $dump . '
<div style="text-align:center;">
<input class="formButton" value="' . XoopsLocale::A_CLOSE . '" type="button" onclick="javascript:window.close();" />
</div>
';
$ret .= '
<script type="text/javascript">
debug_window = openWithSelfMain("about:blank", "popup", 680, 450, true);
debug_window.document.clear();
';
$lines = preg_split("/(\r\n|\r|\n)( *)/", $content);
foreach ($lines as $line) {
$ret .= "\n" . 'debug_window.document.writeln("' . str_replace(array('"', '</'), array('\\"', '<\\/'), $line) . '");';
}
$ret .= '
debug_window.focus();
debug_window.document.close();
</script>
';
}
$this->addExtra(_MD_LOGGER_INCLUDED_FILES, sprintf(_MD_LOGGER_FILES, count(get_included_files())));
/*
$included_files = get_included_files();
foreach ($included_files as $filename) {
$this->addExtra('files',$filename);
}
if (function_exists('memory_get_peak_usage')) {
$this->addExtra('Peak memory',memory_get_peak_usage());
}
*/
$memory = 0;
if (function_exists('memory_get_usage')) {
$memory = memory_get_usage() . ' bytes';
} else {
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
$out = array();
exec('tasklist /FI "PID eq ' . getmypid() . '" /FO LIST', $out);
if (isset($out[5])) {
$memory = sprintf(_MD_LOGGER_MEM_ESTIMATED, substr($out[5], strpos($out[5], ':') + 1));
}
}
}
if ($memory) {
$this->addExtra(_MD_LOGGER_MEM_USAGE, $memory);
}
if (empty($mode)) {
$views = array('errors', 'deprecated', 'queries', 'blocks', 'extra');
$ret .= "\n<div id=\"xo-logger-output\">\n<div id='xo-logger-tabs'>\n";
$ret .= "<a href='javascript:xoSetLoggerView(\"none\")'>" . _MD_LOGGER_NONE . "</a>\n";
$ret .= "<a href='javascript:xoSetLoggerView(\"\")'>" . _MD_LOGGER_ALL . "</a>\n";
foreach ($views as $view) {
$count = count($this->{$view});
$ret .= "<a href='javascript:xoSetLoggerView(\"{$view}\")'>" . constant('_MD_LOGGER_' . strtoupper($view)) . " ({$count})</a>\n";
}
$count = count($this->logstart);
$ret .= "<a href='javascript:xoSetLoggerView(\"timers\")'>" . _MD_LOGGER_TIMERS . "({$count})</a>\n";
$ret .= "</div>\n";
}
if (empty($mode) || $mode == 'errors') {
$class = 'even';
$ret .= '<table id="xo-logger-errors" class="outer"><thead><tr><th>' . _MD_LOGGER_ERRORS . '</th></tr></thead><tbody>';
foreach ($this->errors as $error) {
$ret .= "\n<tr><td class='{$class}'>";
$ret .= $error;
$ret .= "<br />\n</td></tr>";
$class = $class == 'odd' ? 'even' : 'odd';
}
$ret .= "\n</tbody></table>\n";
}
if (empty($mode) || $mode == 'deprecated') {
$class = 'even';
$ret .= '<table id="xo-logger-deprecated" class="outer"><thead><tr><th>' . _MD_LOGGER_DEPRECATED . '</th></tr></thead><tbody>';
foreach ($this->deprecated as $message) {
$ret .= "\n<tr><td class='{$class}'>";
//.........这里部分代码省略.........
示例9: copyrighted
<?php
/*
You may not change or alter any portion of this comment or credits
of supporting developers from this source code or any supporting source code
which is considered copyrighted (c) material of the original comment or credit authors.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/
/**
* CAPTCHA configurations for Recaptcha mode
*
* @category Xoops\Class\Captcha\config.recaptcha
* @package config.recaptcha
* @author trabis <lusopoemas@gmail.com>
* @copyright 2013 XOOPS Project (http://xoops.org)
* @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
* @version $Id$
* @link http://xoops.org
* @since 2.6.0
*/
return $config = array('private_key' => 'YourPrivateApiKey', 'public_key' => 'YourPublicApiKey', 'theme' => 'white', 'lang' => XoopsLocale::getLangCode());