当前位置: 首页>>代码示例>>PHP>>正文


PHP Translator::negotiateLoginPageLanguage方法代码示例

本文整理汇总了PHP中Translator::negotiateLoginPageLanguage方法的典型用法代码示例。如果您正苦于以下问题:PHP Translator::negotiateLoginPageLanguage方法的具体用法?PHP Translator::negotiateLoginPageLanguage怎么用?PHP Translator::negotiateLoginPageLanguage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Translator的用法示例。


在下文中一共展示了Translator::negotiateLoginPageLanguage方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: array

 * Clear node and layout variable in $_SESSION
 * $_SESSION was destroyed, so we do not need to clear data in session.
 */
$allowedUsersAr = array(AMA_TYPE_VISITOR, AMA_TYPE_STUDENT, AMA_TYPE_TUTOR, AMA_TYPE_AUTHOR, AMA_TYPE_ADMIN);
/**
 * Performs basic controls before entering this module
 */
require_once ROOT_DIR . '/include/module_init.inc.php';
$self = index;
include_once 'include/' . $self . '_functions.inc.php';
/**
 * Negotiate login page language
 */
Translator::loadSupportedLanguagesInSession();
$supported_languages = Translator::getSupportedLanguages();
$login_page_language_code = Translator::negotiateLoginPageLanguage();
$_SESSION['sess_user_language'] = $login_page_language_code;
/**
 * Track kiosk accesses
 */
$_SESSION['ada_access_from'] = ADA_KIOSK_ACCESS;
$_SESSION['ada_remote_address'] = $_SERVER['REMOTE_ADDR'];
/*
 * Load news file
 */
$newsfile = 'news_' . $login_page_language_code . '.txt';
$infofile = 'info_' . $login_page_language_code . '.txt';
$helpfile = 'help_' . $login_page_language_code . '.txt';
/*
   $infomsg = '';
   $newsmsg = '';
开发者ID:eguicciardi,项目名称:ada,代码行数:31,代码来源:kiosk.php

示例2: implode

      */
     if (is_object($userObj)) {
         $userActualLangId = $userObj->getLanguage();
         if ($userActualLangId != false) {
             $userActualLang = Translator::getLanguageInfoForLanguageId($userActualLangId);
             $userActualLangCod = $userActualLang['codice_lingua'];
         }
         if (isset($userActualLangCod)) {
             $filename = implode('_', $underscoreDelimited) . '_' . $userActualLangCod . $extension;
             $foundFile = is_file(ROOT_DIR . '/docs/' . $filename) && is_readable(ROOT_DIR . '/docs/' . $filename);
         }
     }
     /**
      * build the array of candidate languages
      */
     $tryLangs = array($login_page_language_code = Translator::negotiateLoginPageLanguage());
     if (!in_array(ADA_LOGIN_PAGE_DEFAULT_LANGUAGE, $tryLangs)) {
         $tryLangs[] = ADA_LOGIN_PAGE_DEFAULT_LANGUAGE;
     }
     /**
      * loop the array until a file has been found
      * or end of array has been reached
      */
     for ($currentLang = reset($tryLangs); current($tryLangs) !== false && !$foundFile; $currentLang = next($tryLangs)) {
         $filename = implode('_', $underscoreDelimited) . '_' . $currentLang . $extension;
         $foundFile = is_file(ROOT_DIR . '/docs/' . $filename) && is_readable(ROOT_DIR . '/docs/' . $filename);
     }
 }
 if ($foundFile) {
     $http_path_to_file = HTTP_ROOT_DIR . '/docs/' . $filename;
     $pdf_filename = $exploded_filename[0] . '.pdf';
开发者ID:eguicciardi,项目名称:ada,代码行数:31,代码来源:external_link.php


注:本文中的Translator::negotiateLoginPageLanguage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。