本文整理汇总了PHP中Localization::Translate方法的典型用法代码示例。如果您正苦于以下问题:PHP Localization::Translate方法的具体用法?PHP Localization::Translate怎么用?PHP Localization::Translate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Localization
的用法示例。
在下文中一共展示了Localization::Translate方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: processAccountData
/**
* function to verify user data
*
* @param $aFormValues (array) login form data
$aFormValues['username']
$aFormValues['password']
$aFormValues['locate']
* @return $objResponse
* @session
$_SESSION['curuser']['username']
$_SESSION['curuser']['extension']
$_SESSION['curuser']['extensions']
$_SESSION['curuser']['country']
$_SESSION['curuser']['language']
$_SESSION['curuser']['channel']
$_SESSION['curuser']['accountcode']
*/
function processAccountData($aFormValues)
{
global $db, $config;
list($_SESSION['curuser']['country'], $_SESSION['curuser']['language']) = split("_", $aFormValues['locate']);
//get locate parameter
$locate = new Localization($_SESSION['curuser']['country'], $_SESSION['curuser']['language'], 'login');
$objResponse = new xajaxResponse();
$bError = false;
$loginError = false;
if (isset($_SERVER["HTTP_X_FORWARDED_FOR"])) {
if ($_SERVER["HTTP_CLIENT_IP"]) {
$proxy = $_SERVER["HTTP_CLIENT_IP"];
} else {
$proxy = $_SERVER["REMOTE_ADDR"];
}
} else {
if (isset($_SERVER["HTTP_CLIENT_IP"])) {
$ip = $_SERVER["HTTP_CLIENT_IP"];
} else {
$ip = $_SERVER["REMOTE_ADDR"];
}
}
$log = array();
$log['action'] = 'login';
$log['ip'] = $ip;
$log['username'] = $aFormValues['username'];
$log['usertype'] = 'clid';
$query = "SELECT * FROM account_log WHERE ip='" . $ip . "' AND action='login' ORDER BY id DESC LIMIT 1";
$res = $db->query($query);
if ($res->fetchInto($this_ip_log)) {
$failedtimes = $this_ip_log['failedtimes'];
}
if ($failedtimes >= $config['system']['max_incorrect_login'] && $config['system']['max_incorrect_login'] > 0) {
$objResponse->addAlert($locate->Translate("login failed,your ip is locked for login"));
$objResponse->addAssign("loginButton", "value", $locate->Translate("submit"));
$objResponse->addAssign("loginButton", "disabled", false);
return $objResponse;
}
if (!$bError) {
$query = "SELECT * from clid where clid ='" . $aFormValues['username'] . "'";
$res = $db->query($query);
if ($res->fetchInto($clid)) {
$log['account_id'] = $clid['id'];
if ($clid['pin'] == $aFormValues['password']) {
$log['status'] = 'success';
$log['failedtimes'] = 0;
if ($aFormValues['rememberme'] == "forever") {
// set cookies for three years
setcookie("username", $aFormValues['username'], time() + 94608000);
setcookie("password", $aFormValues['password'], time() + 94608000);
setcookie("language", $aFormValues['locate'], time() + 94608000);
} else {
// destroy cookies
setcookie("username", "", time() - 3600);
setcookie("password", "", time() - 3600);
setcookie("language", "", time() - 3600);
$username = '';
$password = '';
$language = 'en_US';
$checked = false;
}
$_SESSION['curuser']['username'] = trim($aFormValues['username']);
$_SESSION['curuser']['usertype'] = "clid";
$_SESSION['curuser']['clidid'] = $clid['id'];
$_SESSION['curuser']['groupid'] = $clid['groupid'];
list($_SESSION['curuser']['country'], $_SESSION['curuser']['language']) = split("_", $aFormValues['locate']);
$configstatus = common::read_ini_file($config['system']['astercc_path'] . '/astercc.conf', $asterccConfig);
if ($configstatus == -2) {
$html = "(fail to read " . $config['system']['astercc_path'] . "/astercc.conf)";
return $html;
} else {
$billingfield = trim($asterccConfig['system']['billingfield']);
if ($billingfield == 'accountcode') {
$_SESSION['curuser']['billingfield'] = $billingfield;
}
}
//$objResponse->addAlert($locate->Translate("login_success"));
$objResponse->addScript('window.location.href="cdr.php";');
} else {
$log['failedtimes'] = $failedtimes + 1;
$log['status'] = 'failed';
$log['failedcause'] = 'incorrect password';
$loginError = true;
//.........这里部分代码省略.........
示例2: processAccountData
/**
* function to verify user data
*
* @param $aFormValues (array) login form data
$aFormValues['username']
$aFormValues['password']
$aFormValues['locate']
* @return $objResponse
* @session
$_SESSION['curuser']['username']
$_SESSION['curuser']['extension']
$_SESSION['curuser']['extensions']
$_SESSION['curuser']['country']
$_SESSION['curuser']['language']
$_SESSION['curuser']['channel']
$_SESSION['curuser']['accountcode']
*/
function processAccountData($aFormValues)
{
global $db, $config;
list($_SESSION['curuser']['country'], $_SESSION['curuser']['language']) = split("_", $aFormValues['locate']);
//get locate parameter
$locate = new Localization($_SESSION['curuser']['country'], $_SESSION['curuser']['language'], 'login');
$objResponse = new xajaxResponse();
/* check whether the pear had been installed */
$pear_exists_result = class_exists('PEAR');
if (empty($pear_exists_result)) {
$objResponse->addAlert($locate->Translate("Please install php pear"));
$objResponse->addAssign("loginButton", "value", $locate->Translate("submit"));
$objResponse->addAssign("loginButton", "disabled", false);
return $objResponse;
}
if (isset($_SERVER["HTTP_X_FORWARDED_FOR"])) {
if ($_SERVER["HTTP_CLIENT_IP"]) {
$proxy = $_SERVER["HTTP_CLIENT_IP"];
} else {
$proxy = $_SERVER["REMOTE_ADDR"];
}
} else {
if (isset($_SERVER["HTTP_CLIENT_IP"])) {
$ip = $_SERVER["HTTP_CLIENT_IP"];
} else {
$ip = $_SERVER["REMOTE_ADDR"];
}
}
$query = "SELECT * FROM account_log WHERE ip='" . $ip . "' AND action='login' ORDER BY id DESC LIMIT 1";
$res = $db->query($query);
if ($res->fetchInto($this_ip_log)) {
$failedtimes = $this_ip_log['failedtimes'];
}
$log = array();
$log['action'] = 'login';
$log['ip'] = $ip;
$log['username'] = $aFormValues['username'];
if ($failedtimes >= $config['system']['max_incorrect_login'] && $config['system']['max_incorrect_login'] > 0) {
$objResponse->addAlert($locate->Translate("login failed,your ip is locked for login"));
$objResponse->addAssign("loginButton", "value", $locate->Translate("submit"));
$objResponse->addAssign("loginButton", "disabled", false);
return $objResponse;
}
$bError = false;
$loginError = false;
if (!$bError) {
$query = "SELECT account.*, accountgroup.accountcode,accountgroup.allowcallback as allowcallbackgroup,resellergroup.allowcallback as allowcallbackreseller,accountgroup.limittype FROM account LEFT JOIN accountgroup ON accountgroup.id = account.groupid LEFT JOIN resellergroup ON resellergroup.id = account.resellerid WHERE username='" . $aFormValues['username'] . "'";
$res = $db->query($query);
if ($res->fetchInto($list)) {
$log['account_id'] = $list['id'];
$log['usertype'] = $list['usertype'];
if ($list['password'] == $aFormValues['password']) {
$log['status'] = 'success';
$log['failedtimes'] = 0;
if ($aFormValues['rememberme'] == "forever") {
// set cookies for three years
setcookie("username", $aFormValues['username'], time() + 94608000);
setcookie("password", $aFormValues['password'], time() + 94608000);
setcookie("language", $aFormValues['locate'], time() + 94608000);
setcookie("pagestyle", $aFormValues['pagestyle'], time() + 94608000);
} else {
// destroy cookies
setcookie("username", "", time() - 3600);
setcookie("password", "", time() - 3600);
setcookie("language", "", time() - 3600);
setcookie("pagestyle", $aFormValues['pagestyle'], time() + 94608000);
$username = '';
$password = '';
$language = 'en_US';
$checked = false;
}
$_SESSION = array();
$_SESSION['curuser']['username'] = trim($aFormValues['username']);
$_SESSION['curuser']['usertype'] = $list['usertype'];
$_SESSION['curuser']['ipaddress'] = $_SERVER["REMOTE_ADDR"];
$_SESSION['curuser']['userid'] = $list['id'];
$_SESSION['curuser']['groupid'] = $list['groupid'];
$_SESSION['curuser']['resellerid'] = $list['resellerid'];
$_SESSION['curuser']['limittype'] = $list['limittype'];
$configstatus = common::read_ini_file($config['system']['astercc_path'] . '/astercc.conf', $asterccConfig);
if ($configstatus == -2) {
$html = "(fail to read " . $config['system']['astercc_path'] . "/astercc.conf)";
return $html;
//.........这里部分代码省略.........
示例3: elseif
$logstr .= 'resellerid:' . $resellerid . "\n";
$logstr .= 'groupid:' . $groupid . "\n";
}
$reseller_row = astercrm::getRecordByID($resellerid, 'resellergroup');
if ($uesrtype == 'reseller') {
$account = astercrm::getRecordByID($userid, 'account');
$srcCredit = $reseller_row['curcredit'];
if ($config['epayment']['callshop_pay_fee']) {
$credit = $p->ipn_data['mc_gross'] - $p->ipn_data['mc_fee'];
} else {
$credit = $p->ipn_data['mc_gross'];
}
$updateCurCredit = $srcCredit - $p->ipn_data['mc_gross'];
$sql = "UPDATE resellergroup SET curcredit = curcredit - " . $credit . " WHERE id = '" . $account['resellerid'] . "'";
$mailto = $config['epayment']['notify_mail'];
$mailTitle = $locate->Translate('Reseller') . ': ' . $account['username'] . ' ' . $locate->Translate('Paymented') . ' ' . $config['epayment']['currency_code'] . ' ' . $p->ipn_data['mc_gross'] . ' ' . $locate->Translate('for') . ' ' . $config['epayment']['item_name'] . ',' . $locate->Translate('Please check it') . ' - ipn';
} elseif ($uesrtype == 'groupadmin') {
$account = astercrm::getRecordByID($userid, 'account');
$group_row = astercrm::getRecordByID($account['groupid'], 'accountgroup');
$srcCredit = $group_row['curcredit'];
if ($reseller_row['callshop_pay_fee']) {
$credit = $p->ipn_data['mc_gross'] - $p->ipn_data['mc_fee'];
} else {
$credit = $p->ipn_data['mc_gross'];
}
$updateCurCredit = $srcCredit - $p->ipn_data['mc_gross'];
$sql = "UPDATE accountgroup SET curcredit = curcredit - {$credit} WHERE id = '" . $account['groupid'] . "'";
$mailto = $reseller_row['epayment_notify_mail'];
$mailTitle = $locate->Translate('Callshop') . ': ' . $account['username'] . ' ' . $locate->Translate('Paymented') . ' ' . $config['epayment']['currency_code'] . ' ' . $p->ipn_data['mc_gross'] . ' ' . $locate->Translate('for') . ' ' . $reseller_row['epayment_item_name'] . ',' . $locate->Translate('Please check it') . ' - ipn';
}
if ($config['epayment']['ipn_log']) {
示例4: waitingCalls
function waitingCalls($myValue)
{
global $db, $config;
$locate = new Localization($_SESSION['curuser']['country'], $_SESSION['curuser']['language'], 'portal');
$objResponse = new xajaxResponse();
$curid = trim($myValue['curid']);
// to improve system efficiency
/**************************
**************************/
// modified 2007/10/30 by solo
// start
//print_r($_SESSION);exit;
//if ($_SESSION['curuser']['channel'] == '')
$call = asterEvent::checkNewCall($curid, $_SESSION['curuser']['extension'], $_SESSION['curuser']['channel'], $_SESSION['curuser']['agent']);
//else
// $call = asterEvent::checkNewCall($curid,$_SESSION['curuser']['channel']);
// end
if ($call['status'] == '') {
$title = $locate->Translate("waiting");
$status = 'idle';
//$call['curid'] = $curid;
$direction = '';
$info = $locate->Translate("extension") . $_SESSION['curuser']['extension'] . "-" . $locate->Translate("stand_by");
} elseif ($call['status'] == 'incoming') {
//incoming calls here
$title = $call['callerid'];
$stauts = 'ringing';
$direction = 'in';
$info = $locate->Translate("incoming") . ' ' . $call['callerid'];
$trunk = split("-", $call['callerChannel']);
//print_r($trunk);exit;
$trunk_name = split('@', $trunk[0]);
$info = $info . ' channel: ' . $trunk_name[0];
// get trunk info
$mytrunk = astercrm::getTrunkinfo($trunk[0], $call['didnumber']);
if ($mytrunk) {
$infomsg = "<strong>" . $mytrunk['trunkname'] . "</strong><br>";
$infomsg .= mb_substr(astercrm::db2html($mytrunk['trunknote']), 0, 10, "UTF-8") . '...';
if ($call['didnumber'] != '') {
$infomsg .= " |" . $locate->Translate("Callee id") . " : <b>" . $call['didnumber'] . "</b>";
}
$objResponse->addAssign('divTrunkinfo', "innerHTML", $infomsg);
} else {
$trunk_name = split('@', $trunk[0]);
$infomsg = $locate->Translate("no information get for trunk") . ": " . $trunk_name[0];
$objResponse->addAssign('divTrunkinfo', "innerHTML", $infomsg);
}
$objResponse->addAssign("iptSrcNumber", "value", $call['callerid']);
$objResponse->addAssign("iptCallerid", "value", $call['callerid']);
$objResponse->addAssign("btnHangup", "disabled", false);
if ($config['system']['pop_up_when_dial_in']) {
if (strlen($call['callerid']) > $config['system']['phone_number_length'] && $call['callerid'] != '<unknown>') {
if ($myValue['popup'] == 'yes') {
if ($config['system']['enable_external_crm'] == false) {
$objResponse->loadXML(getContact($call['callerid']));
if ($config['system']['browser_maximize_when_pop_up'] == true) {
$objResponse->addScript('maximizeWin();');
}
} else {
//use external link
$myurl = $config['system']['external_crm_url'];
$myurl = preg_replace("/\\%method/", "dial_in", $myurl);
$myurl = preg_replace("/\\%callerid/", $call['callerid'], $myurl);
$myurl = preg_replace("/\\%calleeid/", $_SESSION['curuser']['extension'], $myurl);
if ($config['system']['open_new_window'] == false) {
$mycrm = '<iframe id="mycrm" name="mycrm" src="' . $myurl . '" width="100%" frameBorder=0 scrolling=auto height="100%"></iframe>';
$objResponse->addAssign("divCrm", "innerHTML", $mycrm);
} else {
$javascript = "openwindow('" . $myurl . "')";
$objResponse->addScript($javascript);
}
}
}
} else {
}
}
} elseif ($call['status'] == 'dialout') {
//dailing out here
$title = $call['callerid'];
$status = 'dialing';
$direction = 'out';
$info = $locate->Translate("dial_out") . ' ' . $call['callerid'];
$objResponse->addAssign("iptCallerid", "value", $call['callerid']);
$objResponse->addAssign("btnHangup", "disabled", false);
if ($call['didnumber'] != '') {
$didinfo = $locate->Translate("Callee id") . " : " . $call['didnumber'];
$objResponse->addAssign('divDIDinfo', 'innerHTML', $didinfo);
}
if ($config['system']['pop_up_when_dial_out']) {
if (strlen($call['callerid']) > $config['system']['phone_number_length']) {
if ($myValue['popup'] == 'yes') {
if ($config['system']['enable_external_crm'] == false) {
$objResponse->loadXML(getContact($call['callerid']));
if ($config['system']['browser_maximize_when_pop_up'] == true) {
$objResponse->addScript('maximizeWin();');
}
} else {
//use external link
$myurl = $config['system']['external_crm_url'];
$myurl = preg_replace("/\\%method/", "dial_out", $myurl);
//.........这里部分代码省略.........
示例5: generateManageNav
function generateManageNav($skin, $curcountry = 'en', $curuserlanguage = 'US')
{
//global $locate_common;
// echo $curcountry;exit;
$locate_common = new Localization($curcountry, $curuserlanguage, 'common.class');
/*
$html .= "<a href='contact.php' >".$locate_common->Translate("contact_manager")."</a> | ";
$html .= "<a href='note.php' >".$locate_common->Translate("note_manager")."</a> | ";
$html .= "<a href='diallist.php' >".$locate_common->Translate("diallist_manager")."</a> | ";
*/
$html = '
<div class="top_banner">
<ul>
<li><a href="import.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage(\'import\',\'\',\'skin/default/images_' . $_SESSION['curuser']['country'] . '/import.gif\',1)"><img src="skin/default/images_' . $_SESSION['curuser']['country'] . '/import_sml.gif" alt="import" name="import" width="71" height="126" border="0" id="import" /></a></li>
<li><a href="surveyresult.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage(\'statisic\',\'\',\'skin/default/images_' . $_SESSION['curuser']['country'] . '/statisic.gif\',1)"><img src="skin/default/images_' . $_SESSION['curuser']['country'] . '/statisic_sml.gif" alt="statisic" name="statisic" width="71" height="126" border="0" id="statisic" /></a></li>
<li><a href="account.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage(\'extension\',\'\',\'skin/default/images_' . $_SESSION['curuser']['country'] . '/extension.gif\',1)"><img src="skin/default/images_' . $_SESSION['curuser']['country'] . '/extension_sml.gif" alt="extension" name="extension" width="71" height="126" border="0" id="extension" /></a></li>
<li><a href="customer.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage(\'customer\',\'\',\'skin/default/images_' . $_SESSION['curuser']['country'] . '/customer.gif\',1)"><img src="skin/default/images_' . $_SESSION['curuser']['country'] . '/customer_sml.gif" alt="customer" name="customer" width="71" height="126" border="0" id="customer" /></a></li>
<li><a href="predictivedialer.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage(\'dialer\',\'\',\'skin/default/images_' . $_SESSION['curuser']['country'] . '/dialer.gif\',1)"><img src="skin/default/images_' . $_SESSION['curuser']['country'] . '/dialer_sml.gif" alt="dialer" name="dialer" width="71" height="126" border="0" id="dialer" /></a></li>
<li><a href="systemstatus.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage(\'system\',\'\',\'skin/default/images_' . $_SESSION['curuser']['country'] . '/system.gif\',1)"><img src="skin/default/images_' . $_SESSION['curuser']['country'] . '/system_sml.gif" alt="system" name="system" width="71" height="126" border="0" id="system" /></a></li>
<li><a href="survey.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage(\'survey\',\'\',\'skin/default/images_' . $_SESSION['curuser']['country'] . '/survey.gif\',1)"><img src="skin/default/images_' . $_SESSION['curuser']['country'] . '/survey_sml.gif" alt="survey" name="survey" width="71" height="126" border="0" id="survey" /></a></li>
<li><a href="diallist.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage(\'diallist\',\'\',\'skin/default/images_' . $_SESSION['curuser']['country'] . '/diallist.gif\',1)"><img src="skin/default/images_' . $_SESSION['curuser']['country'] . '/diallist_sml.gif" alt="diallist" name="diallist" width="71" height="126" border="0" id="diallist" /></a></li>
<li><a href="preferences.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage(\'preference\',\'\',\'skin/default/images_' . $_SESSION['curuser']['country'] . '/preference.gif\',1)"><img src="skin/default/images_' . $_SESSION['curuser']['country'] . '/preference_sml.gif" alt="preference" name="preference" width="71" height="126" border="0" id="preference" /></a></li>
<li><a href="portal.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage(\'back\',\'\',\'skin/default/images_' . $_SESSION['curuser']['country'] . '/back.gif\',1)"><img src="skin/default/images_' . $_SESSION['curuser']['country'] . '/back_sml.gif" alt="back" name="back" width="71" height="126" border="0" id="back" /></a></li>
<li><a href="login.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage(\'logout\',\'\',\'skin/default/images_' . $_SESSION['curuser']['country'] . '/logout.gif\',1)"><img src="skin/default/images_' . $_SESSION['curuser']['country'] . '/logout_sml.gif" alt="logout" name="logout" width="71" height="126" border="0" id="logout" /></a></li>
<li><img src="skin/default/images_' . $_SESSION['curuser']['country'] . '/logo_bn.gif"/></li>
</ul>
</div>
<div style="clear:both">
<a href="trunkinfo.php">' . $locate_common->Translate("Trunkinfo") . '</a> <a href="cdr.php">' . $locate_common->Translate("CDR") . '</a> <a href="speeddial.php">' . $locate_common->Translate("SpeedDial") . '</a> <a href="report.php">' . $locate_common->Translate("Report") . '</a> <a href="campaignresult.php">' . $locate_common->Translate("Campaign Result") . '</a> <a href="queuestatus.php">' . $locate_common->Translate("Queue Status") . '</a> <a href="agent.php">' . $locate_common->Translate("Agent Settings") . '</a> <a href="knowledge.php">' . $locate_common->Translate("knowledge") . '</a> <a href="dnc.php">' . $locate_common->Translate("DNC list") . '</a> <a href="ticketcategory.php">' . $locate_common->Translate("Ticket Category") . '</a> <a href="useronline.php">' . $locate_common->Translate("User Online") . '</a> <a href="user_online.php">' . $locate_common->Translate("UserOnline Report") . '</a> <a href="codes.php">' . $locate_common->Translate("Code") . '</a> <a href="sms_templates.php">' . $locate_common->Translate("SMS Templates") . '</a> <a href="user_types.php">' . $locate_common->Translate("User Type") . '</a> <a href="agent_queue_logs.php">' . $locate_common->Translate("Agent Queue Log") . '</a>
</div><br>
';
return $html;
}