本文整理汇总了PHP中language::init方法的典型用法代码示例。如果您正苦于以下问题:PHP language::init方法的具体用法?PHP language::init怎么用?PHP language::init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类language
的用法示例。
在下文中一共展示了language::init方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: listAvailableOrderingsForAdmin
function listAvailableOrderingsForAdmin(&$config)
{
$this->init();
$this->lang->init($GLOBALS['BE_USER']->uc['lang']);
// get orderings
$fieldLabel = $this->lang->sL('LLL:EXT:ke_search/locallang_db.php:tx_kesearch_index.relevance');
$notAllowedFields = 'uid,pid,tstamp,crdate,cruser_id,starttime,endtime,fe_group,targetpid,content,params,type,tags,abstract,language,orig_uid,orig_pid,hash';
if (!$config['config']['relevanceNotAllowed']) {
$config['items'][] = array($fieldLabel . ' UP', 'score asc');
$config['items'][] = array($fieldLabel . ' DOWN', 'score desc');
}
$res = $GLOBALS['TYPO3_DB']->sql_query('SHOW COLUMNS FROM tx_kesearch_index');
while ($col = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
if (TYPO3_VERSION_INTEGER >= 7000000) {
$isInList = TYPO3\CMS\Core\Utility\GeneralUtility::inList($notAllowedFields, $col['Field']);
} else {
$isInList = t3lib_div::inList($notAllowedFields, $col['Field']);
}
if (!$isInList) {
$file = $GLOBALS['TCA']['tx_kesearch_index']['columns'][$col['Field']]['label'];
$fieldLabel = $this->lang->sL($file);
$config['items'][] = array($fieldLabel . ' UP', $col['Field'] . ' asc');
$config['items'][] = array($fieldLabel . ' DOWN', $col['Field'] . ' desc');
}
}
}
示例2: getInitializedTranslator
/**
* Loads the language data and returns the corresponding translator instance.
*
* @return language
*/
protected function getInitializedTranslator()
{
if ($this->translator === NULL) {
if (isset($GLOBALS['LANG'])) {
$this->translator = $GLOBALS['LANG'];
} else {
$this->translator = t3lib_div::makeInstance('language');
if (isset($GLOBALS['BE_USER'])) {
$this->translator->init($GLOBALS['BE_USER']->uc['lang']);
} else {
$this->translator->init('default');
}
}
$this->translator->includeLLFile(t3lib_extMgm::extPath('lang') . 'locallang_general.xml');
$this->translator->includeLLFile(t3lib_extMgm::extPath('seminars') . 'locallang_db.xml');
$this->includeAdditionalLanguageFiles();
}
return $this->translator;
}
示例3: __construct
public function __construct()
{
if (!file_exists(\base_config::$baseDir . '/inc/config/config.php')) {
die('You have to install Affiliat*r before you can use it! <a href="install/">Start Install</a>');
}
$this->dbconnection = new \database();
$this->sysconfig = new \model\system_config($this->dbconnection);
$this->uploadDir = \base_config::$uploadDir;
\language::init($this->sysconfig->getSysLanguage());
\model\view::$version = $this->sysconfig->getSysVersion();
date_default_timezone_set($this->sysconfig->getTimeZone());
$this->request = array_merge($_REQUEST, $_COOKIE);
}
示例4: parsevCalendar
/**
* Parses a string containing vCalendar data.
*
* @param string $text
* The data to parse.
* @param string $base
* The type of the base object.
* @param string $charset
* The encoding charset for $text. Defaults to
* utf-8.
* @param boolean $clear
* If true clears the iCal object before parsing.
*
* @return boolean True on successful import, false otherwise.
*/
function parsevCalendar($text, $base = 'VCALENDAR', $charset = 'utf8', $clear = true)
{
if ($clear) {
$this->clear();
}
$matches = array();
if (preg_match('/(BEGIN:' . $base . '\\r?\\n?)([\\W\\w]*)(END:' . $base . '\\r?\\n?)/i', $text, $matches)) {
$vCal = $matches[2];
} else {
// Text isn't enclosed in BEGIN:VCALENDAR
// .. END:VCALENDAR. We'll try to parse it anyway.
$vCal = $text;
}
// All subcomponents.
$matches = null;
if (preg_match_all('/BEGIN:([\\W\\w]*)(\\r\\n|\\r|\\n)([\\W\\w]*)END:\\1(\\r\\n|\\r|\\n)/Ui', $vCal, $matches)) {
// vTimezone components are processed first. They are
// needed to process vEvents that may use a TZID.
foreach ($matches[0] as $key => $data) {
$type = trim($matches[1][$key]);
if ($type != 'VTIMEZONE') {
continue;
}
$component =& ICalendar::newComponent($type, $this);
if ($component === false) {
// return PEAR::raiseError("Unable to create object for type $type");
}
$component->parsevCalendar($data);
$this->addComponent($component);
// Remove from the vCalendar data.
$vCal = str_replace($data, '', $vCal);
}
// Now process the non-vTimezone components.
foreach ($matches[0] as $key => $data) {
$type = trim($matches[1][$key]);
if ($type == 'VTIMEZONE') {
continue;
}
$component =& ICalendar::newComponent($type, $this);
if ($component === false) {
// return PEAR::raiseError("Unable to create object for type $type");
}
$component->parsevCalendar($data);
$this->addComponent($component);
// Remove from the vCalendar data.
$vCal = str_replace($data, '', $vCal);
}
}
// Unfold any folded lines.
$vCal = preg_replace('/[\\r\\n]+[ \\t]/', '', $vCal);
// Unfold 'quoted printable' folded lines like:
// BODY;ENCODING=QUOTED-PRINTABLE:=
// another=20line=
// last=20line
while (preg_match_all('/^([^:]+;\\s*ENCODING=QUOTED-PRINTABLE(.*=\\r?\\n)+(.*[^=])?\\r?\\n)/mU', $vCal, $matches)) {
foreach ($matches[1] as $s) {
$r = preg_replace('/=\\r?\\n/', '', $s);
$vCal = str_replace($s, $r, $vCal);
}
}
if (is_object($GLOBALS['LANG'])) {
$csConvObj =& $GLOBALS['LANG']->csConvObj;
} elseif (is_object($GLOBALS['TSFE'])) {
$csConvObj =& $GLOBALS['TSFE']->csConvObj;
} else {
require_once \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('lang') . 'lang.php';
$LANG = new language();
if (TYPO3_MODE == 'BE') {
$LANG->init($GLOBALS['BE_USER']->uc['lang']);
$csConvObj =& $LANG->csConvObj;
} else {
$LANG->init($GLOBALS['TSFE']->config['config']['language']);
$csConvObj =& $GLOBALS['TSFE']->csConvObj;
}
}
$renderCharset = $csConvObj->parse_charset($GLOBALS['TYPO3_CONF_VARS']['BE']['forceCharset'] ? $GLOBALS['TYPO3_CONF_VARS']['BE']['forceCharset'] : $this->defaultCharSet);
// Parse the remaining attributes.
if (preg_match_all('/(.*):([^\\r\\n]*)[\\r\\n]+/', $vCal, $matches)) {
foreach ($matches[0] as $attribute) {
$parts = array();
preg_match('/([^;^:]*)((;[^:]*)?):([^\\r\\n]*)[\\r\\n]*/', $attribute, $parts);
$tag = $parts[1];
$value = $parts[4];
$params = array();
// Parse parameters.
//.........这里部分代码省略.........
示例5: CalcDate
require_once 'classes/video.class.php';
require_once 'classes/player.class.php';
require_once 'classes/cbemail.class.php';
require_once 'classes/pm.class.php';
require_once 'classes/cbpage.class.php';
require_once 'classes/reindex.class.php';
require_once 'classes/collections.class.php';
require_once 'classes/photos.class.php';
require_once 'classes/menuhandler.class.php';
require_once 'classes/cbfeeds.class.php';
require_once 'classes/resizer.class.php';
//Adding Gravatar
require_once 'classes/gravatar.class.php';
require 'defined_links.php';
require_once 'languages.php';
$lang_obj->init();
$LANG = $lang_obj->lang_phrases('file');
$calcdate = new CalcDate();
$signup = new signup();
$Upload = new Upload();
$cbgroup = new CBGroups();
$adsObj = new AdsManager();
$formObj = new formObj();
$cbplugin = new CBPlugin();
$eh = new EH();
$sess = new Session();
$cblog = new CBLogs();
$imgObj = new ResizeImage();
$cbvideo = $cbvid = new CBvideo();
$cbplayer = new CBPlayer();
$cbemail = new CBEmail();
示例6: __construct
/**
* The constructor.
*/
public function __construct()
{
$this->language = t3lib_div::makeInstance('language');
$this->language->init($GLOBALS['BE_USER']->uc['lang']);
$this->language->includeLLFile('EXT:seminars/Resources/Private/Language/FrontEnd/locallang.xml');
}
示例7: runInstall
private function runInstall()
{
$this->checkRequirements();
$step = $this->getRequestVar('step');
define('INSTALL_MODE', 0);
if (is_null($step)) {
\language::init('de');
$view = new \model\view_installer('start');
$view->assign('languages', \language::getLanguages());
$view->assign('lang', '');
$view->render();
} else {
$setupLang = $this->getRequestVar('lang');
if (empty($setupLang)) {
header('Location: index.php');
}
\language::init($setupLang);
$install = new \installclass();
if (!is_null($this->getRequestVar('pins'))) {
\messages::registerError(\language::returnLanguageConstant('SAVE_FAILED_PASSWORD'), true);
}
if (!is_null($this->getRequestVar('dbconfig'))) {
$install->createConfigFile($this->getRequestVar('dbconfig'));
}
if ($step > 1) {
$this->dbconnection = new \database();
$install->setDbconnection($this->dbconnection);
}
if (!is_null($this->getRequestVar('submsave'))) {
if (!$install->createConfigKey($this->getRequestVar('options'))) {
header('Location: index.php?step=2&lang=' . $setupLang . '&pins=yes');
}
}
if ($step == 1) {
if (!isset($_GET['lang'])) {
header('Location: index.php?step=1&lang=' . $setupLang);
}
$view = new \model\view_installer('dbconfig');
$view->assign('fields', array('DBHOST' => 'localhost', 'DBNAME' => '', 'DBUSER' => '', 'DBPASS' => '', 'DBPREF' => 'afltr'));
$view->assign('lang', $setupLang);
$view->assign('dbtypes', array('MySQL' => 'mysql'));
$view->render();
}
if ($step == 2) {
$tables = array('affiliates', 'categories', 'config', 'logins');
foreach ($tables as $table) {
$install->createTable($table);
}
$install->createStdCategory();
$fields = array('adminMail' => 'example@your.domain', 'iframecss' => '', 'sessionLength' => '3600', 'timeZone' => 'Europe/London', 'dateTimeMask' => 'd.m.Y H:i', 'antispamQuestion' => '', 'antispamAnswer' => '');
$timeZones = timezone_identifiers_list();
$timeZones = array_combine(array_values($timeZones), array_values($timeZones));
$view = new \model\view_installer('config');
$view->assign('fields', $fields);
$view->assign('modes', array('iframe' => 1, 'phpcinlude' => 2));
$view->assign('timeZones', $timeZones);
$view->assign('sysmode', 1);
$view->assign('languages', \language::getLanguages());
$view->assign('lang', $setupLang);
$view->render();
}
if ($step == 3) {
$view = new \model\view_installer('end');
$view->render();
$file = new \model\file();
$file->deleteRecursive(\base_config::$baseDir . '/install/');
}
}
}