本文整理汇总了PHP中I18n::_方法的典型用法代码示例。如果您正苦于以下问题:PHP I18n::_方法的具体用法?PHP I18n::_怎么用?PHP I18n::_使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类I18n
的用法示例。
在下文中一共展示了I18n::_方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: smarty_function_bertaCopyright
function smarty_function_bertaCopyright($params, &$smarty)
{
$str = I18n::_('berta_copyright_text');
if (!empty($_SERVER['SERVER_ADDR']) && in_array($_SERVER['SERVER_ADDR'], BertaBase::$options['hip_ipaddr'])) {
$str .= ', hosted on <a href="http://hip-hosting.com/" target="_blank" title="Friendly web hosting">HIP</a>';
}
return $str;
}
示例2: preDispatch
public function preDispatch(Zend_Controller_Request_Abstract $request)
{
$session = Zend_Registry::get('session');
if (!isset($session->authdata) || !isset($session->authdata['authed']) || $session->authdata['authed'] === false) {
return;
}
$cur_ctrl = $request->getControllerName();
$cur_action = $request->getActionName();
$view = Zend_Registry::get('view');
if (is_dir(FWACTIONS_PATH)) {
$dir = opendir(FWACTIONS_PATH);
while (($file = readdir($dir)) !== false) {
if ($file == '.' || $file == '..') {
continue;
}
if (preg_match('/^Action([a-zA-Z0-9_]*)\\.php/', $file, $match)) {
$path = FWACTIONS_PATH . '/' . $file;
require_once $path;
$r = new ReflectionClass($match[1]);
if ($r->isSubclassOf('FWAction')) {
/**
* match Actions permission with the permissions of the currently logged in user,
* add to menu if user has access to that action
*/
$required = $r->getMethod('getRequiredPermissions')->invoke(null);
$menuprio = $r->getMethod('getTopNavPrio')->invoke(null);
$ctrl = $r->getMethod('getController')->invoke(null);
$action = $r->getMethod('getAction')->invoke(null);
$text = $r->getMethod('getMenutext')->invoke(null);
$role = $session->authdata['authed_role'];
if ($cur_ctrl == $ctrl) {
# && $cur_action == $action)
$aclass = ' class="active"';
} else {
$aclass = '';
}
$acl = $session->authdata['authed_permissions'];
if (is_array($required) && count($required) == 0) {
$view->topNav('<a href="' . $view->url(array('controller' => $ctrl, 'action' => $action), 'default', true) . '"' . $aclass . '>' . I18n::_($text) . '</a>', Zend_View_Helper_Placeholder_Container_Abstract::SET, $menuprio);
} else {
foreach ($required as $rperm) {
if ($acl->has($rperm) && $acl->isAllowed($role, $rperm, 'view')) {
$view->topNav('<a href="' . $view->url(array('controller' => $ctrl, 'action' => $action), 'default', true) . '"' . $aclass . '>' . I18n::_($text) . '</a>', Zend_View_Helper_Placeholder_Container_Abstract::SET, $menuprio);
break;
// exit on first match
}
}
}
}
}
}
closedir($dir);
}
}
示例3: _initDoctype
protected function _initDoctype()
{
$this->bootstrap('view');
$this->bootstrap('log');
$this->bootstrap('I18n');
$this->bootstrap('session');
$view = $this->getResource('view');
Zend_Registry::set('view', $view);
$view->doctype('XHTML1_STRICT');
$view->addHelperPath(APPLICATION_PATH . '/views/helpers/');
$view->headTitle = I18n::_('CAcert Test Manager');
}
示例4: postDispatch
public function postDispatch(Zend_Controller_Request_Abstract $request)
{
$session = Zend_Registry::get('session');
if (!isset($session->authdata) || !isset($session->authdata['authed']) || $session->authdata['authed'] === false) {
$controller = 'login';
$text = 'Login';
} else {
$controller = 'logout';
$text = 'Logout';
}
$cur_ctrl = $request->getControllerName();
if ($cur_ctrl == 'login') {
$aclass = ' class="active"';
} else {
$aclass = '';
}
$view = Zend_Registry::get('view');
$view->topNav('<a href="' . $view->url(array('controller' => $controller), 'default', true) . '"' . $aclass . '>' . I18n::_($text) . '</a>', Zend_View_Helper_Placeholder_Container_Abstract::SET, 1000);
}
示例5: array
'googleFont' => array('format' => 'text', 'default' => '', 'title' => 'Google web fonts', 'description' => I18n::_('googleFont_description')),
'fontSize' => array('format' => 'text', 'default' => '10px', 'title' => 'Font size', 'description' => ''),
'fontWeight' => array('format' => 'select', 'values' => array('normal', 'bold'), 'default' => 'normal', 'title' => 'Font weight', 'description' => ''),
'fontStyle' => array('format' => 'select', 'values' => array('normal', 'italic'), 'default' => 'normal', 'title' => 'Font style', 'description' => ''),
'lineHeight' => array('format' => 'text', 'default' => '16px', 'title' => 'Line height', 'description' => 'Height of text line. Use em, px or % values or the default value "normal"'),
'colorLink' => array('format' => 'color', 'default' => '#1a1a1a', 'title' => 'Color', 'description' => ''),
'colorHover' => array('format' => 'color', 'default' => '#0000ff', 'title' => 'Color when hovered', 'description' => ''),
'colorActive' => array('format' => 'color', 'default' => '#1a1a1a', 'title' => 'Color when opened', 'description' => ''),
'textDecorationLink' => array('format' => 'select', 'values' => array('none', 'underline', 'overline', 'line-through'), 'default' => 'none', 'title' => 'Decoration', 'description' => ''),
'textDecorationHover' => array('format' => 'select', 'values' => array('none', 'underline', 'overline', 'line-through'), 'default' => 'none', 'title' => 'Decoration when hovered', 'description' => ''),
'textDecorationActive' => array('format' => 'select', 'values' => array('none', 'underline', 'overline', 'line-through'), 'default' => 'underline', 'title' => 'Decoration when opened', 'description' => '')
),
'tagsMenu' => array(
'fontFamily' => array('format' => 'fontselect', 'values' => $fontOptionsWithInherit, 'default' => 'inherit', 'title' => 'Font face', 'description' => ''),
'googleFont' => array('format' => 'text', 'default' => '', 'title' => 'Google web fonts', 'description' => I18n::_('googleFont_description')),
'fontSize' => array('format' => 'text', 'default' => '11px', 'title' => 'Font size', 'description' => ''),
'fontWeight' => array('format' => 'select', 'values' => array('normal', 'bold'), 'default' => 'normal', 'title' => 'Font weight', 'description' => ''),
'fontStyle' => array('format' => 'select', 'values' => array('normal', 'italic'), 'default' => 'normal', 'title' => 'Font style', 'description' => ''),
'lineHeight' => array('format' => 'text', 'default' => '16px', 'title' => 'Line height', 'description' => 'Height of text line. Use em, px or % values or the default value "normal"'),
'colorLink' => array('format' => 'color', 'default' => '#1a1a1a', 'title' => 'Color', 'description' => ''),
'colorHover' => array('format' => 'color', 'default' => '#0000ff', 'title' => 'Color when hovered', 'description' => ''),
'colorActive' => array('format' => 'color', 'default' => '#1a1a1a', 'title' => 'Color when selected', 'description' => ''),
'textDecorationLink' => array('format' => 'select', 'values' => array('none', 'underline', 'overline', 'line-through'), 'default' => 'none', 'title' => 'Decoration', 'description' => ''),
'textDecorationHover' => array('format' => 'select', 'values' => array('none', 'underline', 'overline', 'line-through'), 'default' => 'none', 'title' => 'Decoration when hovered', 'description' => ''),
'textDecorationActive' => array('format' => 'select', 'values' => array('none', 'underline', 'overline', 'line-through'), 'default' => 'line-through', 'title' => 'Decoration when opened', 'description' => '')
),
'links' => array(
'colorLink' => array('format' => 'color', 'default' => '#0000ff', 'title' => 'Link color', 'description' => ''),
'colorVisited' => array('format' => 'color', 'default' => '#666666', 'title' => 'Visited link color', 'description' => ''),
示例6: response
$sql = '
SELECT * FROM pending_video
WHERE
pending_video_id = :pending_video_id AND
user_id = :user_id
LIMIT 1
';
$sth = $pdo->prepare($sql);
$sth->bindValue(':pending_video_id', $pendingVideoId, PDO::PARAM_INT);
$sth->bindValue(':user_id', $authUser->user_id, PDO::PARAM_INT);
if ($sth->execute()) {
$pendingVideo = $sth->fetch(PDO::FETCH_OBJ);
}
// Did we get a $pendingVideo?
if (!$pendingVideo) {
response(I18n::_(I18n::VIDEO_INVALID_ID), 400);
}
response($pendingVideo);
});
// The webhook that HeyWatch posts to when encoding is complete.
$slim->post('/pending_video/completed/:pending_video_id', function ($pendingVideoId) use($pdo) {
// Get results passed in from HeyWatch
$results = json_decode(file_get_contents('php://input'), true);
if ($results && is_array($results) && array_key_exists('errors', $results)) {
// Update the record to indicated processing is finished.
$sql = '
UPDATE pending_video
SET
date_processed = :date_processed, is_error = :is_error,
heywatch_id = :heywatch_id
WHERE
示例7: getForm
/**
* build login form and return to requesting method
* @return Zend_Form
*/
protected function getForm()
{
$form = new Zend_Form();
$form->setAction('/login/login')->setMethod('post');
#$form->setAttrib('id', 'loginform');
$username = new Zend_Form_Element_Text('login_name');
$username->setRequired(true)->setLabel(I18n::_('User Name'))->addFilter(new Zend_Filter_StringTrim())->addFilter(new Zend_Filter_StripTags());
$password = new Zend_Form_Element_Password('login_password');
$password->setRequired(true)->setLabel(I18n::_('Password'))->addFilter(new Zend_Filter_StringTrim());
$submit = new Zend_Form_Element_Submit('submit');
$submit->setLabel(I18n::_('Login'));
$form->addElement($username)->addElement($password)->addElement($submit);
return $form;
}
示例8:
$SITE_ROOT = '../../';
$ENGINE_ROOT = '../../engine/';
define('AUTH_AUTHREQUIRED', true);
define('SETTINGS_INSTALLREQUIRED', false);
include $ENGINE_ROOT . 'inc.page.php';
}
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><? echo $berta->settings->get('texts', 'pageTitle') ?> / <?php
echo I18n::_('welcome');
?>
</title>
<link href="<? echo $ENGINE_ABS_ROOT ?>css/default.css" rel="stylesheet" type="text/css" />
<link href="<? echo $ENGINE_ABS_ROOT ?>css/login.css" rel="stylesheet" type="text/css" />
<link href="<? echo $ENGINE_ABS_ROOT ?>css/editor.css.php" rel="stylesheet" type="text/css" />
</head>
<body class="xLoginPageBody">
<div class="xMAlign-container xPanel">
<div class="xMAlign-outer">
<div class="xMAlign-inner">
<?php
echo I18n::_('welcome_text__not_installed');
?>
</div>
</div>
</div>
</body>
</html>
示例9: getFlagsForm
protected function getFlagsForm(Default_Model_User $user)
{
$form = new Zend_Form();
$form->setAction('/manage-account/flags')->setMethod('post');
$flags = $user->getFlags();
// Add a checkbox for each flag
$labels = array();
$labels['admin'] = I18n::_('Support Engineer');
$labels['codesign'] = I18n::_('Code Signing');
$labels['orgadmin'] = I18n::_('Organisation Assurer');
$labels['ttpadmin'] = I18n::_('TTP Admin');
$labels['board'] = I18n::_('Board Member');
$labels['locadmin'] = I18n::_('Location Admin');
$labels['tverify'] = I18n::_('TVerify');
$labels['locked'] = I18n::_('Lock Account');
$labels['assurer_blocked'] = I18n::_('Block Assurer');
foreach ($labels as $flag => $label) {
$checkbox = new Zend_Form_Element_Checkbox($flag);
$checkbox->setLabel($label)->setChecked($flags[$flag]);
$form->addElement($checkbox);
}
$submit = new Zend_Form_Element_Submit('submit');
$submit->setLabel(I18n::_('Save Flags'));
$form->addElement($submit);
return $form;
}
示例10: if
<body class="xLoginPageBody">
<div class="xMAlign-container xPanel">
<div class="xMAlign-outer">
<div class="xMAlign-inner">
<form name="xLoginForm" action="<? echo $ENGINE_ABS_ROOT ?>login.php" method="post">
<div class="xLoginLogo">
<img src="<? echo $ENGINE_ABS_ROOT ?>layout/berta.png" alt="berta v <? echo BertaBase::$options['version'] ?>" />
</div>
<? if($errStr) { ?>
<div class="xLoginError"><? echo $errStr ?></div>
<? } ?>
<input type="hidden" name="auth_action" value="login" />
<!--[if IE ]> <input type="hidden" name="auth_browser" value="invalid" /> <![endif]-->
<!--[if (gte IE 9)|!(IE)]><!--> <input type="hidden" name="auth_browser" value="supported" /> <!--<![endif]-->
<input type="text" name="auth_user" id="auth_user" class="xLoginField" />
<input type="password" name="auth_pass" id="auth_pass" class="xLoginField" />
<input type="submit" name="auth_subm" id="auth_subm" class="xLoginSubmit" value="<?php
echo I18n::_('Log in');
?>
" />
<p>
berta v <? echo BertaBase::$options['version'] ?> - <? echo date('Y') ?>
</p>
</form>
</div>
</div>
</div>
</body>
</html>
示例11: date
" class="social_button social_button_google"><span class="icon-google-plus"></span>Log in with Google</a>
<p class="social_or">or</p>
<?php
}
?>
<input type="text" name="auth_user" id="auth_user" class="xLoginField" />
<input type="password" name="auth_pass" id="auth_pass" class="xLoginField" />
<input type="submit" name="auth_subm" id="auth_subm" class="xLoginSubmit" value="<?php
echo I18n::_('Log in');
?>
" />
<p><a href="<?php
echo $options['FORGOTPASSWORD_LINK'];
?>
" target="_blank"><?php
echo I18n::_('Forgot password?');
?>
</a></p>
<p>
berta v <?php
echo BertaBase::$options['version'];
?>
2008-<?php
echo date('Y');
?>
</p>
</form>
</div>
</div>
</div>
示例12: while
while(list($idx, ) = each($_COOKIE)) {
if(strpos($idx, '_berta_') === 0) {
//unset($_COOKIE[$idx]);
setcookie($idx, "", time() - 3600);
}
}
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><? echo $berta->settings->get('texts', 'page-title') ?> / logout</title>
<link href="<? echo $ENGINE_ABS_ROOT ?>css/default.css" rel="stylesheet" type="text/css" />
<link href="<? echo $ENGINE_ABS_ROOT ?>css/login.css" rel="stylesheet" type="text/css" />
<link href="<? echo $ENGINE_ABS_ROOT ?>css/editor.css.php" rel="stylesheet" type="text/css" />
</head>
<body class="xLoginPageBody" onload="setTimeout('window.location=\'<? echo $SITE_ABS_ROOT ?>\'', 1500)">
<div class="xMAlign-container xPanel">
<div class="xMAlign-outer">
<div class="xMAlign-inner">
<p class="xLogout"><?php
echo I18n::_('Logout ok. Please wait...');
?>
</p>
</div>
</div>
</div>
</body>
</html>
示例13: htmlspecialchars
<div id="allContainer">
<div id="contentContainer">
<h1 id="allPageTitle"><?= I18n::_('Profile') ?></h1>
<div id="xSectionsEditor">
<form name="password_form" id="password_form" method="get" action="<? echo htmlspecialchars($ENGINE_ROOT) ?>update.php" >
<label for="old_password"><?= I18n::_('Old password') ?></label><br />
<input type="password" name="old_password" id="old_password" value="" /><br />
<label for="new_password"><?= I18n::_('New password') ?></label><br />
<input type="password" name="new_password" id="new_password" value="" /><br />
<label for="retype_password"><?= I18n::_('Retype new password') ?></label><br />
<input type="password" name="retype_password" id="retype_password" value="" /><br />
<input type="submit" name="xBertaEditorChangePassword" id="xBertaEditorChangePassword" value="<?= I18n::_('Change password') ?>" />
</form>
<br class="clear" />
<hr />
<div class="entry">
<div class="value value-long">
<?= I18n::_('password_help_text') ?>
</div>
</div>
<p> </p>
</div>
</div>
</div>
</body>
</html>
示例14: getTopPanelHTML
public static function getTopPanelHTML($selectedSection = 'site')
{
$tickerClass = !empty($_COOKIE['_berta_newsticker_hidden']) ? 'xHidden' : '';
$tickerColorClass = empty($_COOKIE['_berta_newsticker_hilight']) ? 'xNewsTickerRed' : 'xNewsTickerGrey';
$newsTickerContent = false;
// $_SESSION['_berta_newsticker'] = false; // for testing...
//$_SESSION['_berta_newsticker_numtries'] = 0; // for testing...
if (!empty(self::$options['newsticker_update_uri'])) {
if (!empty($_SESSION['_berta_newsticker'])) {
$newsTickerContent = $_SESSION['_berta_newsticker'];
} elseif ((empty($_SESSION['_berta_newsticker_numtries']) || $_SESSION['_berta_newsticker_numtries'] < 5) && ini_get('allow_url_fopen')) {
$remoteResult = false;
reset(self::$options['newsticker_update_uri']);
while ((!$remoteResult || empty($remoteResult['content'])) && (list(, $remoteURL) = each(self::$options['newsticker_update_uri']))) {
$remoteResult = BertaUtils::getRemoteFile($remoteURL, 5);
}
//var_dump($remoteResult ); //$options['newsticker_update_uri_alt']);
if ($remoteResult && isset($remoteResult['content'])) {
$newsTickerContent = $_SESSION['_berta_newsticker'] = $remoteResult['content'];
setcookie('_berta_newsticker', $remoteResult['content']);
}
$_SESSION['_berta_newsticker_numtries'] = !empty($_SESSION['_berta_newsticker_numtries']) ? ++$_SESSION['_berta_newsticker_numtries'] : 1;
}
}
if (!$newsTickerContent) {
$tickerClass = 'xHidden';
}
$m0 = I18n::_('close this');
$m1 = I18n::_('my site');
$m2 = I18n::_('sections');
$m3 = I18n::_('settings');
$m4 = I18n::_('template design');
$m5 = I18n::_('profile');
$m6 = I18n::_('sign out');
$m1Class = $selectedSection == 'site' ? ' class="selected"' : '';
$m2Class = $selectedSection == 'sections' ? ' class="selected"' : '';
$m3Class = $selectedSection == 'settings' ? ' class="selected"' : '';
$m4Class = $selectedSection == 'template' ? ' class="selected"' : '';
$m5Class = $selectedSection == 'profile' ? ' selected' : '';
$str = <<<DOC
\t\t\t<div id="xTopPanelContainer" class="xPanel">
\t\t\t\t<div id="xTopPanel">
\t\t\t\t\t
\t\t\t\t\t<div id="xNewsTickerContainer" class="{$tickerClass}">
\t\t\t\t\t\t<div class="news-ticker-background {$tickerColorClass}"></div>
\t\t\t\t\t\t<div class="news-ticker-content">{$newsTickerContent}</div>
\t\t\t\t\t\t<a href="#" class="close">{$m0}</a>
\t\t\t\t\t\t<br class="clear" />
\t\t\t\t\t</div>
\t\t\t\t\t<ul id="xEditorMenu">
\t\t\t\t\t\t<li id="xEditorMenuBg"></li>
\t\t\t\t\t\t<li{$m1Class}><a href=".">{$m1}</a></li><li>|</li>
\t\t\t\t\t\t<li{$m2Class}><a href="sections.php">{$m2}</a></li><li>|</li>
\t\t\t\t\t\t<li{$m3Class}><a href="settings.php">{$m3}</a></li><li>|</li>
\t\t\t\t\t\t<li{$m4Class}><a href="settings.php?mode=template">{$m4}</a></li>
\t\t\t\t\t\t<li class="last{$m5Class}"><a href="profile.php">{$m5}</a> | <a href="logout.php">{$m6}</a></li>
\t\t\t\t\t</ul>
\t\t\t\t</div>
\t\t\t</div>
DOC;
return $str;
}
示例15:
echo I18n::_('Note: the fields that already have value appear yellow only when you roll over them with your mouse. Click on the text below to edit.');
?>
</p>
<p class="xFirstTimeField <?php
echo $xEditSelectorSimple;
?>
xProperty-texts/metaDescription xRequired-<?php
echo $berta->settings->isRequired('texts', 'metaDescription') ? '1' : '0';
?>
"><?php
echo $berta->settings->get('texts', 'metaDescription', true);
?>
</p>
<p><input type="button" value=" <?php
echo I18n::_('Done!');
?>
" id="xFirstTimeCheckContinue" onclick="window.location='<?php
echo $ENGINE_ABS_ROOT;
?>
?_berta_install_done=1<?php
echo !empty($options['MULTISITE']) ? '&site=' . $options['MULTISITE'] : '';
?>
'" /></p>
</div>
<?php
?>
</div>
</div>
</div>