本文整理汇总了PHP中SimpleSAML_XHTML_Template::getLanguage方法的典型用法代码示例。如果您正苦于以下问题:PHP SimpleSAML_XHTML_Template::getLanguage方法的具体用法?PHP SimpleSAML_XHTML_Template::getLanguage怎么用?PHP SimpleSAML_XHTML_Template::getLanguage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SimpleSAML_XHTML_Template
的用法示例。
在下文中一共展示了SimpleSAML_XHTML_Template::getLanguage方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: process
/**
* Apply filter to add or replace attributes.
*
* Add or replace existing attributes with the configured values.
*
* @param array &$request The current request
*/
public function process(&$request)
{
assert('is_array($request)');
assert('array_key_exists("Attributes", $request)');
$attributes =& $request['Attributes'];
$attrlang = NULL;
if (array_key_exists($this->langattr, $attributes)) {
$attrlang = $attributes[$this->langattr][0];
}
$config = SimpleSAML_Configuration::getInstance();
$t = new SimpleSAML_XHTML_Template($config, 'frontpage');
$lang = $t->getLanguage(FALSE, FALSE);
if (isset($attrlang)) {
SimpleSAML_Logger::debug('LanguageAdaptor: Language in attribute was set [' . $attrlang . ']');
}
if (isset($lang)) {
SimpleSAML_Logger::debug('LanguageAdaptor: Language in session was set [' . $lang . ']');
}
if (isset($attrlang)) {
if (!isset($lang)) {
$t->setLanguage($attrlang);
$_GET['language'] = $attrlang;
} else {
// Language was set in both attributes and session.
if ($lang !== $attrlang) {
// Different language set in attributes and session.
}
}
} else {
if (isset($lang)) {
$request['Attributes'][$this->langattr] = array($lang);
} else {
// Language was neighter set in attributes or in session
}
}
}
示例2: foreach
$history = $mcontroller->getHistory(10, $history_size);
foreach ($history as $data) {
$rid = $data->getRevisionid();
$rnote = $data->getRevisionnote();
$output .= '<section class="revision"><a href="?eid=' . $data->getEid() . '&revisionid=' . $rid . '">' . $et->t('tab_edit_entity_connection_revision') . ' ' . $rid . '</a>';
if ($data->getRevisionid() !== $currentRevisionId) {
$output .= ' - <a class="janus_button" href="?compareRevision=true&eid=' . $data->getEid() . '&compareRevisiondid=' . $data->getRevisionid() . '&revisionid=' . $currentRevisionId . '&selectedtab=' . $historyTab . '">Revision history</a>';
}
$output .= strlen($rnote) > 80 ? ' - ' . substr($rnote, 0, 79) . '...' : ' - ' . $rnote;
// Show edit user if present
$user->setUid($data->getUser());
if ($user->load()) {
$output .= ' - ' . $user->getUserid();
}
$output .= ' - ' . date('Y-m-d H:i', strtotime($data->getCreated()));
if (isset($workflowstates[$data->getWorkflow()]['name'][$et->getLanguage()])) {
$curLang = $et->getLanguage();
} else {
$curLang = 'en';
}
if (isset($workflowstates[$data->getWorkflow()]['name'][$curLang])) {
$output .= ' - ' . $workflowstates[$data->getWorkflow()]['name'][$curLang];
} else {
$output .= ' - ' . $data->getWorkflow();
}
$output .= '</revision>';
}
} else {
$output .= $et->t('error_no_access');
}
echo $output;
示例3: __construct
/**
* @param SimpleSAML_XHTML_Template $template
*/
public function __construct($template)
{
$this->template = $template;
$this->languageCode = $template->getLanguage();
}
示例4: markForUpdate
}
} else {
// Revision not set, get latest
if (!($entity = $entityController->setEntity($eid))) {
throw new SimpleSAML_Error_Exception('Error in setEntity');
}
}
// load entity
$entityController->loadEntity();
// Check if user is allowed to se entity
$securityContext = \sspmod_janus_DiContainer::getInstance()->getSecurityContext();
if (!$securityContext->isGranted('access', $entity)) {
SimpleSAML_Utilities::redirectTrustedUrl(SimpleSAML_Module::getModuleURL('janus/index.php'));
}
$et = new SimpleSAML_XHTML_Template($config, 'janus:editentity.php', 'janus:editentity');
$language = $et->getLanguage();
$update = FALSE;
function markForUpdate()
{
global $update;
$update = true;
}
$note = '';
if (!empty($_POST)) {
// Whether to redirect to importing.
$redirectToImport = false;
// Array for collecting addresses to notify
$addresses = array();
$csrf_provider = sspmod_janus_DiContainer::getInstance()->getCsrfProvider();
if (empty($_POST['csrf_token']) || !$csrf_provider->isCsrfTokenValid('entity_update', $_POST['csrf_token'])) {
SimpleSAML_Logger::warning('Janus: [SECURITY] Valid CSRF token not found');