本文整理汇总了PHP中common::GetLangFile方法的典型用法代码示例。如果您正苦于以下问题:PHP common::GetLangFile方法的具体用法?PHP common::GetLangFile怎么用?PHP common::GetLangFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类common
的用法示例。
在下文中一共展示了common::GetLangFile方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testKeys
function testKeys()
{
global $langmessage, $languages;
//get en language
common::GetLangFile('main.inc', 'en');
$keys_en = array_keys($langmessage);
//compare keys in other languages
foreach ($languages as $code => $lang) {
$langmessage = array();
common::GetLangFile('main.inc', $code);
$keys = array_keys($langmessage);
self::AssertEquals($keys_en, $keys, 'Keys in language file don\'t match for ' . $lang . ' (' . $code . ')');
}
}
示例2: __construct
function __construct()
{
global $languages, $install_language, $langmessage;
//language preferences
$install_language = 'en';
if (isset($_GET['lang']) && isset($languages[$_GET['lang']])) {
$install_language = $_GET['lang'];
} elseif (isset($_COOKIE['lang']) && isset($languages[$_COOKIE['lang']])) {
$install_language = $_COOKIE['lang'];
}
setcookie('lang', $install_language);
common::GetLangFile('main.inc', $install_language);
echo '<h1>';
echo $langmessage['Installation'];
echo ' - v' . gpversion;
echo '</h1>';
$installed = false;
$cmd = common::GetCommand();
switch ($cmd) {
case 'Continue':
$this->FTP_Prepare();
break;
case 'Install':
$installed = $this->Install_Normal();
break;
}
if (!$installed) {
$this->LanguageForm();
$this->CheckFolders();
} else {
$this->Installed();
}
}
示例3: GetConfig
/**
* Set the $config array from /data/_site/config.php
*
*/
static function GetConfig()
{
global $config, $gp_hooks;
$config = gpFiles::Get('_site/config');
if (!is_array($config) || !array_key_exists('gpversion', $config)) {
common::stop();
}
//remove old values
if (isset($config['linkto'])) {
unset($config['linkto']);
}
if (isset($config['menu_levels'])) {
unset($config['menu_levels']);
}
//2.3.2
if (isset($config['hidegplink'])) {
//2.4RC2
if ($config['hidegplink'] === 'hide') {
$config['showgplink'] = false;
}
unset($config['hidegplink']);
}
//make sure defaults are set
$config += array('maximgarea' => '691200', 'maxthumbsize' => '100', 'check_uploads' => false, 'colorbox_style' => 'example1', 'combinecss' => true, 'combinejs' => true, 'etag_headers' => true, 'customlang' => array(), 'showgplink' => true, 'showsitemap' => true, 'showlogin' => true, 'auto_redir' => 90, 'resize_images' => true, 'jquery' => 'local', 'addons' => array(), 'themes' => array(), 'gadgets' => array(), 'passhash' => 'sha1', 'hooks' => array());
//shahash deprecated 4.0
if (isset($config['shahash']) && !$config['shahash']) {
$config['passhash'] = 'md5';
}
// default gadgets
$config['gadgets'] += array('Contact' => array('script' => '/include/special/special_contact.php', 'class' => 'special_contact_gadget'), 'Search' => array('script' => '/include/special/special_search.php', 'method' => array('special_gpsearch', 'gadget')));
foreach ($config['hooks'] as $hook => $hook_info) {
if (isset($gp_hooks[$hook])) {
$gp_hooks[$hook] += $hook_info;
} else {
$gp_hooks[$hook] = $hook_info;
}
}
common::GetLangFile();
common::GetPagesPHP();
//upgrade?
if (version_compare($config['gpversion'], '2.3.4', '<')) {
includeFile('tool/upgrade.php');
new gpupgrade();
}
}
示例4: GetConfig
/**
* Set the $config array from /data/_site/config.php
*
*/
function GetConfig()
{
global $config, $gp_index, $dataDir, $gp_menu;
require $dataDir . '/data/_site/config.php';
if (!is_array($config)) {
common::stop();
}
$GLOBALS['fileModTimes']['config.php'] = $fileModTime;
common::GetPagesPHP();
if (!is_array($gp_menu)) {
common::stop();
}
//remove old values
if (isset($config['linkto'])) {
unset($config['linkto']);
}
if (isset($config['menu_levels'])) {
unset($config['menu_levels']);
}
//2.3.2
if (isset($config['hidegplink'])) {
//2.4RC2
if ($config['hidegplink'] === 'hide') {
$config['showgplink'] = false;
}
unset($config['hidegplink']);
}
//set values
$config += common::ConfigDefaults();
if (isset($GLOBALS['dirPrefix'])) {
$config['dirPrefix'] = $GLOBALS['dirPrefix'];
// deprecated 2.4b4 $config['dirPrefix'], $GLOBALS['dirPrefix'] won't always be set (example: cron jobs)
}
$config['homepath_key'] = key($gp_menu);
$config['homepath'] = common::IndexToTitle($config['homepath_key']);
if (!isset($config['gadgets']['Contact'])) {
$config['gadgets']['Contact'] = array('script' => '/include/special/special_contact.php', 'class' => 'special_contact_gadget');
}
gp_defined('gp_session_cookie', common::SessionCookie($config['gpuniq']));
//get language file
common::GetLangFile();
//upgrade?
if (version_compare($config['gpversion'], '2.3.4', '<')) {
includeFile('tool/upgrade.php');
new gpupgrade();
}
}
示例5: setUP
function setUP()
{
common::GetLangFile();
}
示例6: define
<?php
define('is_running', true);
//define('gpdebug',true);
require_once '../common.php';
common::EntryPoint(2, 'update.php');
/* check permissions */
if (!common::LoggedIn()) {
die('You must be logged in to access this area.');
}
if (!isset($gpAdmin['granted']) || $gpAdmin['granted'] !== 'all') {
die('Sorry, you do not have sufficient privileges to access this area.');
}
includeFile('tool/update.php');
common::GetLangFile();
$page = new update_class();
gpOutput::HeadContent();
includeFile('install/template.php');