本文整理汇总了PHP中SimpleSAML_XHTML_Template::includeInlineTranslation方法的典型用法代码示例。如果您正苦于以下问题:PHP SimpleSAML_XHTML_Template::includeInlineTranslation方法的具体用法?PHP SimpleSAML_XHTML_Template::includeInlineTranslation怎么用?PHP SimpleSAML_XHTML_Template::includeInlineTranslation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SimpleSAML_XHTML_Template
的用法示例。
在下文中一共展示了SimpleSAML_XHTML_Template::includeInlineTranslation方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: includeTranslation
/**
* @param string $dictionaryName
* @param string $translationName
* @param array $translations
*/
private function includeTranslation($dictionaryName, $translationName, array $translations)
{
if (!isset($translations[$this->languageCode])) {
return;
}
$translation = $translations[$this->languageCode];
$this->template->includeInlineTranslation($this->createTagForTranslation($dictionaryName, $translationName), $translation);
}
示例2: array
}
$liveClients = array();
foreach ($user['clients'] as $id) {
$client = $clientStore->getClient($id);
if (!is_null($client)) {
array_push($clients, $client);
array_push($liveClients, $client['id']);
}
}
if (count($liveAuthorizationCodes) != count($user['authorizationCodes']) || count($liveRefreshTokens) != count($user['refreshTokens']) || count($liveAccessTokens) != count($user['accessTokens']) || count($liveClients) != count($user['clients'])) {
$user['authorizationCodes'] = $liveAuthorizationCodes;
$user['refreshTokens'] = $liveRefreshTokens;
$user['accessTokens'] = $liveAccessTokens;
$user['clients'] = $liveClients;
$userStore->updateUser($user);
}
}
$t = new SimpleSAML_XHTML_Template($globalConfig, 'oauth2server:manage/status.php');
$t->data['authorizationCodes'] = $authorizationCodes;
$t->data['refreshTokens'] = $refreshTokens;
$t->data['accessTokens'] = $accessTokens;
if ($config->getValue('enable_client_registration', false)) {
$t->data['clients'] = $clients;
foreach ($clients as $client) {
$t->includeInlineTranslation('{oauth2server:oauth2server:client_description_' . $client['id'] . '}', $client['description']);
}
}
$t->data['statusForm'] = SimpleSAML_Module::getModuleURL('oauth2server/manage/status.php');
$t->data['tokenForm'] = SimpleSAML_Module::getModuleURL('oauth2server/manage/token.php');
$t->data['clientForm'] = SimpleSAML_Module::getModuleURL('oauth2server/manage/client.php');
$t->show();
示例3: array
$token = $tokenStore->getRefreshToken($_REQUEST['tokenId']);
if (is_array($token) && isset($_POST['revoke'])) {
$tokenStore->removeRefreshToken($_REQUEST['tokenId']);
SimpleSAML\Utils\HTTP::redirectTrustedURL(SimpleSAML_Module::getModuleURL('oauth2server/manage/status.php'));
}
} else {
if (array_search($_REQUEST['tokenId'], $user['accessTokens']) !== false) {
$token = $tokenStore->getAccessToken($_REQUEST['tokenId']);
if (is_array($token) && isset($_POST['revoke'])) {
$tokenStore->removeAccessToken($_REQUEST['tokenId']);
SimpleSAML\Utils\HTTP::redirectTrustedURL(SimpleSAML_Module::getModuleURL('oauth2server/manage/status.php'));
}
}
}
}
}
$globalConfig = SimpleSAML_Configuration::getInstance();
$t = new SimpleSAML_XHTML_Template($globalConfig, 'oauth2server:manage/token.php');
foreach ($config->getValue('scopes', array()) as $scope => $translations) {
$t->includeInlineTranslation('{oauth2server:oauth2server:' . $scope . '}', $translations);
}
if (isset($token)) {
$clientStore = new sspmod_oauth2server_OAuth2_ClientStore($config);
$client = $clientStore->getClient($token['clientId']);
if (!is_null($client)) {
$t->data['token'] = $token;
$t->includeInlineTranslation('{oauth2server:oauth2server:client_description_text}', $client['description']);
}
}
$t->data['form'] = SimpleSAML_Module::getModuleURL('oauth2server/manage/token.php');
$t->show();
示例4: array
}
} else {
if (array_key_exists('deny', $_REQUEST)) {
$response = \sspmod_oauth2server_Utility_Uri::buildErrorResponse('access_denied', 'request denied by resource owner', 'CONSENT_NOT_GRANTED', array());
$response['error_uri'] = SimpleSAML\Utils\HTTP::addURLParameters(SimpleSAML_Module::getModuleURL('oauth2server/authorization/error.php'), $response);
if (array_key_exists('state', $state)) {
$response['state'] = $state['state'];
}
unset($response['error_code_internal']);
unset($response['error_parameters_internal']);
sspmod_oauth2server_Utility_Uri::redirectUri(sspmod_oauth2server_Utility_Uri::addQueryParametersToUrl($state['returnUri'], $response));
}
}
$t = new SimpleSAML_XHTML_Template($globalConfig, 'oauth2server:authorization/consent.php');
foreach ($config->getValue('scopes', array()) as $scope => $translations) {
$t->includeInlineTranslation('{oauth2server:oauth2server:' . $scope . '}', $translations);
}
$t->includeInlineTranslation('{oauth2server:oauth2server:client_description}', array_key_exists('description', $client) ? $client['description'] : array('' => ''));
$t->data['clientId'] = $state['clientId'];
$t->data['stateId'] = $_REQUEST['stateId'];
$t->data['scopes'] = array();
$scopes = isset($client['scope']) ? $client['scope'] : array();
foreach ($state['requestedScopes'] as $scope) {
$t->data['scopes'][$scope] = isset($scopes[$scope]) && $scopes[$scope];
}
$t->data['form'] = SimpleSAML_Module::getModuleURL('oauth2server/authorization/consent.php');
foreach ($tokenTTLs as $ttl => $translations) {
$t->includeInlineTranslation('{oauth2server:oauth2server:ttl_' . $ttl . '}', $translations);
}
$t->data['ttlChoices'] = array_keys($tokenTTLs);
$t->data['ttlDefault'] = $t->data['ttlChoices'][0];