本文整理汇总了PHP中OPCLang::sprintf方法的典型用法代码示例。如果您正苦于以下问题:PHP OPCLang::sprintf方法的具体用法?PHP OPCLang::sprintf怎么用?PHP OPCLang::sprintf使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OPCLang
的用法示例。
在下文中一共展示了OPCLang::sprintf方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getPayment
public static function getPayment(&$ref, &$OPCloader, &$num, $ajax = false, $isexpress = false)
{
if ($isexpress) {
$reta = array();
$reta['html'] = '<input type="hidden" name="virtuemart_paymentmethod_id" value="' . $ref->cart->virtuemart_paymentmethod_id . '" />';
$reta['extra'] = '';
return $reta;
}
include JPATH_ROOT . DS . 'components' . DS . 'com_onepage' . DS . 'config' . DS . 'onepage.cfg.php';
$payment_not_found_text = '';
$payments_payment_rates = array();
if (!class_exists('OPCrenderer')) {
require JPATH_SITE . DS . 'components' . DS . 'com_onepage' . DS . 'helpers' . DS . 'renderer.php';
}
$renderer = OPCrenderer::getInstance();
if (!$renderer->checkPaymentMethodsConfigured()) {
if (method_exists($renderer, 'assignRef')) {
$renderer->assignRef('paymentplugins_payments', $payments_payment_rates);
$renderer->assignRef('found_payment_method', $found_payment_method);
}
}
$p = JRequest::getVar('payment_method_id', $payment_default);
if (empty($p)) {
$selectedPayment = empty($ref->cart->virtuemart_paymentmethod_id) ? 0 : $ref->cart->virtuemart_paymentmethod_id;
} else {
$selectedPayment = $p;
}
// set missing fields for klarna
OPCloader::prepareBT($ref->cart);
$dpps = array();
$shipping = JRequest::getVar('shipping_rate_id', '');
//if ($ajax)
if (!empty($shipping)) {
if (!empty($disable_payment_per_shipping)) {
$session = JFactory::getSession();
$dpps = $session->get('dpps', null);
if (empty($dpps)) {
$OPCloader->getShipping($ref, $ref->cart, true);
}
$dpps = $session->get('dpps', null);
if (!empty($dpps)) {
}
}
}
//
if (!empty($shipping)) {
if (!empty($shipping)) {
$ref->cart->virtuemart_shipmentmethod_id = $shipping;
}
$vm2015 = false;
$ref->cart->prices = $ref->cart->pricesUnformatted = OPCloader::getCheckoutPrices($ref->cart, false, $vm2015, 'opc');
}
$paymentplugins_payments = array();
if ($p === 'none') {
$p = 0;
}
if ($payment_default === 'none') {
$paymentplugins = array();
$psel = '<input onclick="javascript: Onepage.runPay(\'\',\'\',op_textinclship, op_currency, 0)" type="radio" name="virtuemart_paymentmethod_id" id="payment_id_0" value="0" not_a_valid_payment="not_a_valid_payment" ';
if (empty($p) || $p === 'none') {
$psel .= ' selected="selected" ';
$payment_default = 0;
}
$psel .= ' />
<label for="payment_id_0"><span class="vmpayment"><span class="vmpayment_name">-' . OPCLang::_('COM_VIRTUEMART_CART_EDIT_PAYMENT') . '- </span></span></label>';
$paymentplugins[] = $psel;
}
if (!class_exists('vmPSPlugin')) {
require JPATH_VM_PLUGINS . DS . 'vmpsplugin.php';
}
JPluginHelper::importPlugin('vmpayment');
$dispatcher = JDispatcher::getInstance();
require_once JPATH_SITE . DS . 'components' . DS . 'com_onepage' . DS . 'helpers' . DS . 'ajaxhelper.php';
$bhelper = new basketHelper();
//$bhelper->createDefaultAddress($ref, $ref->cart);
//old: 2.0.208 and prior: $returnValues = $dispatcher->trigger('plgVmDisplayListFEPayment', array($ref->cart, $selectedPayment, &$paymentplugins_payments));
//plgVmDisplayListFEPaymentOPCNocache
$returnValues = $dispatcher->trigger('plgVmDisplayListFEPaymentOPCNocache', array(&$ref->cart, $selectedPayment, &$paymentplugins_payments));
if (empty($returnValues)) {
$returnValues = $dispatcher->trigger('plgVmDisplayListFEPayment', array($ref->cart, $selectedPayment, &$paymentplugins_payments));
}
// if no payment defined
$found_payment_method = false;
$n = 0;
$debug = '';
foreach ($paymentplugins_payments as $p1) {
if (is_array($p1)) {
$n += count($p1);
}
}
if ($n > 0) {
$found_payment_method = true;
}
$num = $n;
if (!$found_payment_method) {
$link = '';
// todo
$payment_not_found_text = OPCLang::sprintf('COM_VIRTUEMART_CART_NO_PAYMENT_METHOD_PUBLIC', '<a href="' . $link . '">' . $link . '</a>');
}
require_once JPATH_SITE . DS . 'components' . DS . 'com_onepage' . DS . 'helpers' . DS . 'ajaxhelper.php';
//.........这里部分代码省略.........
示例2: getBTfields
//.........这里部分代码省略.........
unset($userFields['fields'][$key]);
continue;
}
foreach ($corefields as $f) {
if ($f == $uf['name']) {
// will move the email to bt section
if (empty($no_login_in_template) || $unlg) {
if ($f == 'email') {
if (empty($opc_email_in_bt)) {
if (!$this->isNoLogin()) {
unset($userFields['fields'][$key]);
}
}
} else {
unset($userFields['fields'][$key]);
}
continue;
}
}
}
if (empty($custom_rendering_fields)) {
$custom_rendering_fields = array();
}
if (!empty($custom_rendering_fields)) {
if (in_array($uf['name'], $custom_rendering_fields)) {
unset($userFields['fields'][$key]);
continue;
}
}
if ($key == 'name') {
if (!empty($op_no_display_name)) {
if (!empty($userFields['fields']['name'])) {
unset($userFields['fields']['name']);
}
}
}
}
}
// end of for each
require_once JPATH_ROOT . DS . 'components' . DS . 'com_onepage' . DS . 'helpers' . DS . 'userfields.php';
$skipreorder = array('email');
OPCUserFields::getUserFields($userFields, $this, $cart, array(), array(), $skipreorder);
// logic reversed, if email is not in BT, remove it
if (!((!empty($opc_email_in_bt) || $this->isNoLogin()) && !empty($double_email))) {
unset($userFields['fields']['email2']);
// email is in BT, let's check for double mail
}
$skipreorder = array();
if (!empty($opc_email_in_bt) || $this->isNoLogin()) {
$skipreorder[] = 'email';
if (!empty($opc_check_email)) {
if (!OPCloader::logged($cart) && empty($uid)) {
if (!empty($userFields['fields']['email'])) {
$un = $userFields['fields']['email']['formcode'];
if (stripos($un, 'id="email_already_exists"') === false) {
//if (!$double_email)
$un = str_replace('id=', ' onblur="javascript: Onepage.email_check(this);" id=', $un);
$un .= '<span class="email_already_exist" style="display: none; position: relative; color: red; font-size: 10px; background: none; border: none; padding: 0; margin: 0;" id="email_already_exists">';
$un .= OPCLang::sprintf('COM_ONEPAGE_EMAIL_ALREADY_EXISTS', OPCLang::_('COM_VIRTUEMART_USER_FORM_EMAIL'));
$un .= '</span>';
$userFields['fields']['email']['formcode'] = $un;
}
}
}
}
}
require_once JPATH_ROOT . DS . 'components' . DS . 'com_onepage' . DS . 'helpers' . DS . 'userfields.php';
OPCUserFields::reorderFields($userFields, $skipreorder);
require_once JPATH_ROOT . DS . 'components' . DS . 'com_onepage' . DS . 'helpers' . DS . 'mini.php';
$this->_model = OPCmini::getModel('user');
//new VirtuemartModelUser();
$layout = 'default';
$hidden = array();
$hidden_html = '';
if (!empty($userFields['fields'])) {
foreach ($userFields['fields'] as $key => $val) {
if (!empty($val['hidden'])) {
$hidden[] = $val;
$hidden_html .= $val['formcode'];
unset($userFields['fields'][$key]);
}
}
}
$vars = array('rowFields' => $userFields, 'cart' => $obj, 'is_logged' => $unlg);
$html = $this->fetch($this, 'list_user_fields.tpl', $vars);
$hidden_html = str_replace('"required"', '""', $hidden_html);
$html .= $hidden_html;
$html = $this->addListeners($html);
if (empty($custom_rendering_fields)) {
$custom_rendering_fields = array();
}
if (in_array('virtuemart_country_id', $custom_rendering_fields)) {
$html .= '<input type="hidden" id="virtuemart_country_id" name="virtuemart_country_id" value="' . $default_shipping_country . '" />';
}
if (in_array('virtuemart_state_id', $custom_rendering_fields)) {
$html .= '<input type="hidden" id="virtuemart_state_id" name="virtuemart_state_id" value="0" />';
}
return $html;
}
}
示例3: sendRegistrationMail
function sendRegistrationMail($user)
{
// Compile the notification mail values.
$data = $user->getProperties();
$config = JFactory::getConfig();
if (method_exists($config, 'get')) {
$data['fromname'] = $config->get('fromname');
$data['mailfrom'] = $config->get('mailfrom');
$data['sitename'] = $config->get('sitename');
} else {
$data['fromname'] = $config->getValue('config.fromname');
$data['mailfrom'] = $config->getValue('config.mailfrom');
$data['sitename'] = $config->getValue('config.sitename');
}
$data['siteurl'] = JUri::base();
$usersConfig = JComponentHelper::getParams('com_users');
$useractivation = $usersConfig->get('useractivation');
// Handle account activation/confirmation emails.
if ($useractivation == 2) {
// Set the link to confirm the user email.
$uri = JURI::getInstance();
$base = $uri->toString(array('scheme', 'user', 'pass', 'host', 'port'));
$data['activate'] = $base . JRoute::_('index.php?option=com_users&task=registration.activate&token=' . $data['activation'], false);
$emailSubject = OPCLang::sprintf('COM_USERS_EMAIL_ACCOUNT_DETAILS', $data['name'], $data['sitename']);
$emailBody = OPCLang::sprintf('COM_USERS_EMAIL_REGISTERED_WITH_ADMIN_ACTIVATION_BODY', $data['name'], $data['sitename'], $data['siteurl'] . 'index.php?option=com_users&task=registration.activate&token=' . $data['activation'], $data['siteurl'], $data['username'], $data['password_clear']);
} elseif ($useractivation == 1) {
// Set the link to activate the user account.
$uri = JURI::getInstance();
$base = $uri->toString(array('scheme', 'user', 'pass', 'host', 'port'));
$data['activate'] = $base . JRoute::_('index.php?option=com_users&task=registration.activate&token=' . $data['activation'], false);
$emailSubject = OPCLang::sprintf('COM_USERS_EMAIL_ACCOUNT_DETAILS', $data['name'], $data['sitename']);
$emailBody = OPCLang::sprintf('COM_USERS_EMAIL_REGISTERED_WITH_ACTIVATION_BODY', $data['name'], $data['sitename'], $data['siteurl'] . 'index.php?option=com_users&task=registration.activate&token=' . $data['activation'], $data['siteurl'], $data['username'], $data['password_clear']);
} else {
$emailSubject = OPCLang::sprintf('COM_USERS_EMAIL_ACCOUNT_DETAILS', $data['name'], $data['sitename']);
$emailBody = OPCLang::sprintf('COM_USERS_EMAIL_REGISTERED_BODY', $data['name'], $data['sitename'], $data['siteurl']);
}
// Send the registration email.
$return = JUtility::sendMail($data['mailfrom'], $data['fromname'], $data['email'], $emailSubject, $emailBody);
}
示例4: getUserFields
//.........这里部分代码省略.........
if (!empty($password_clear_text)) {
$userFields['fields']['password2']['formcode'] = str_replace('type="password"', 'type="text" ', $userFields['fields']['password2']['formcode']);
}
$userFields['fields']['opc_password2'] = $userFields['fields']['password2'];
unset($userFields['fields']['password2']);
}
if ($key == 'email') {
$userFields['fields'][$key]['formcode'] = str_replace('class="required', 'class="required email ', $userFields['fields']['email']['formcode']);
$userFields['fields'][$key]['formcode'] = str_replace('type="text"', 'type="email"', $userFields['fields'][$key]['formcode']);
if (!empty($double_email)) {
$email2 = $userFields['fields']['email'];
$email2['name'] = 'email2';
$title = OPCLang::_('COM_ONEPAGE_EMAIL2');
if ($title != 'COM_ONEPAGE_EMAIL2') {
$email2['title'] = $title;
}
$email2['formcode'] = str_replace('"email', '"email2', $email2['formcode']);
$email2['formcode'] = str_replace('id=', ' onblur="javascript: doublemail_checkMail();" id=', $email2['formcode']);
$email2['formcode'] = str_replace('type="email2"', 'type="email"', $email2['formcode']);
$h = '<span style="display: none; position: relative; color: red; font-size: 10px; background: none; border: none; padding: 0; margin: 0;" id="email2_info" class="email2_class">';
$emailerr = OPCLang::_('COM_ONEPAGE_EMAIL_DONT_MATCH');
if ($emailerr != 'COM_ONEPAGE_EMAIL_DONT_MATCH') {
$h .= $emailerr;
} else {
$h .= "Emails don't match!";
}
$h .= '</span>';
$email2['formcode'] .= $h;
}
if (!empty($opc_check_email)) {
if (!OPCloader::logged($cart) && empty($uid)) {
if (!empty($userFields['fields']['email'])) {
$un = $userFields['fields']['email']['formcode'];
$un = str_replace('id=', ' onblur="javascript: Onepage.email_check(this);" id=', $un);
$un .= '<span class="email_already_exist" style="display: none; position: relative; color: red; font-size: 10px; background: none; border: none; padding: 0; margin: 0;" id="email_already_exists">';
$un .= OPCLang::sprintf('COM_ONEPAGE_EMAIL_ALREADY_EXISTS', OPCLang::_('COM_VIRTUEMART_USER_FORM_EMAIL'));
$un .= '</span>';
$userFields['fields']['email']['formcode'] = $un;
}
}
}
}
if ($key == 'EUVatID' || $key == 'eu_vat_id') {
$h = '<br /><span style="display: none; position: relative; float: left; clear: both; color: red; font-size: 10px; background: none; border: none; padding: 0; margin: 0;" id="vat_info" class="vat_info">';
$h .= '</span>';
$userFields['fields'][$key]['formcode'] .= $h;
}
if ($key == 'opc_vat') {
if (!empty($opc_euvat)) {
if (!empty($userFields['fields']['opc_vat'])) {
$un = $userFields['fields']['opc_vat']['formcode'];
if (!empty($opc_euvat_button)) {
$un .= '<br /><input type="button" value="' . OPCLang::_('COM_ONEPAGE_VALIDATE_VAT_BUTTON') . '" onclick="javascript: Onepage.validateOpcEuVat(this);" class="opc_euvat_button" />';
}
$un .= '<br /><span class="vat_info" style="display: none; position: relative; color: red; font-size: 10px; background: none; border: none; padding: 0; margin: 0;" id="vat_info">';
$un .= OPCLang::_('COM_ONEPAGE_VAT_CHECKER_INVALID');
$un .= '</span>';
$userFields['fields']['opc_vat']['formcode'] = $un;
}
}
}
if ($key == 'username') {
if (!empty($opc_check_username)) {
if (!OPCloader::logged($cart) && empty($uid)) {
if (!empty($userFields['fields']['username'])) {
$u = OPCLang::_('COM_VIRTUEMART_REGISTER_UNAME');
$un = $userFields['fields']['username']['formcode'];
$un = str_replace('id=', ' onblur="javascript: Onepage.username_check(this);" id=', $un);
$un .= '<span class="username_already_exist" style="display: none; position: relative; color: red; font-size: 10px; background: none; border: none; padding: 0; margin: 0;" id="username_already_exists">';
$un .= OPCLang::sprintf('COM_ONEPAGE_EMAIL_ALREADY_EXISTS', $u);
$un .= '</span>';
$userFields['fields']['username']['formcode'] = $un;
}
}
}
}
}
}
if (!empty($email2)) {
$userFields['fields']['email2'] = $email2;
}
if (!defined('OPC_IN_REGISTRATION_MODE')) {
jimport('joomla.html.parameter');
$plugin = JPluginHelper::getPlugin('system', 'vm_mailchimp');
if (!empty($plugin)) {
if (class_exists('JParameter')) {
$params = new JParameter($plugin->params);
} else {
$params = new JRegistry($plugin->params);
}
$opc = $params->get('disable_in_opc', false);
if (!empty($opc)) {
unset($userFields['fields']['mailchimp']);
}
}
}
if (!empty($userFields)) {
self::reorderFields($userFields, $skipreorder);
}
}
示例5: checkShipmentMethodsConfigured
function checkShipmentMethodsConfigured()
{
//For the selection of the shipment method we need the total amount to pay.
require_once JPATH_ROOT . DS . 'components' . DS . 'com_onepage' . DS . 'helpers' . DS . 'mini.php';
$shipmentModel = OPCmini::getModel('Shipmentmethod');
$shipments = $shipmentModel->getShipments();
if (empty($shipments)) {
$text = '';
if (JVM_VERSION <= 2) {
if (!class_exists('Permissions')) {
require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'permissions.php';
}
if (Permissions::getInstance()->check("admin,storeadmin")) {
$uri = JFactory::getURI();
$link = $uri->root() . 'administrator/index.php?option=com_virtuemart&view=shipmentmethod';
$text = OPCLang::sprintf('COM_VIRTUEMART_NO_SHIPPING_METHODS_CONFIGURED_LINK', '<a href="' . $link . '">' . $link . '</a>');
}
}
if (!defined('COM_VIRTUEMART_NO_SHIPPING_METHODS_CONFIGURED')) {
vmInfo('COM_VIRTUEMART_NO_SHIPPING_METHODS_CONFIGURED', $text);
define('COM_VIRTUEMART_NO_SHIPPING_METHODS_CONFIGURED', $text);
}
$tmp = 0;
//$this->assignRef('found_shipment_method', $tmp);
return false;
}
return true;
}
示例6: getJavascript
//.........这里部分代码省略.........
} else {
$extJs .= ' var op_usernameisemail = false; ';
}
$url = OPCloader::getURL(true);
if (!empty($op_loader)) {
$extJs .= ' var op_loader = true; ';
} else {
$extJs .= ' var op_loader = false; ';
}
$extJs .= ' var op_loader_img = "' . $url . 'media/system/images/mootree_loader.gif";';
if (!empty($double_email)) {
if (!defined('op_doublemail_js')) {
JHTMLOPC::script('doublemail.js', 'components/com_onepage/ext/doublemail/js/', false);
define('op_doublemail_js', '1');
}
}
if (!empty($onlyd)) {
$extJs .= ' var op_onlydownloadable = "1"; ';
} else {
$extJs .= ' var op_onlydownloadable = ""; ';
}
if (!empty($op_last_field)) {
$extJs .= ' var op_last_field = true; ';
} else {
$extJs .= ' var op_last_field = false; ';
}
$extJs .= ' var op_refresh_html = ""; ';
if (!empty($no_alerts)) {
$extJs .= ' var no_alerts = true; ';
} else {
$extJs .= ' var no_alerts = false; ';
}
require_once JPATH_ROOT . DS . 'components' . DS . 'com_onepage' . DS . 'helpers' . DS . 'mini.php';
$extJs .= " var username_error = '" . OPCmini::slash(OPCLang::sprintf('COM_VIRTUEMART_STRING_ERROR_NOT_UNIQUE_NAME', OPCLang::_('COM_VIRTUEMART_USERNAME'))) . "';";
$extJs .= " var email_error = '" . OPCmini::slash(OPCLang::sprintf('COM_ONEPAGE_EMAIL_ALREADY_EXISTS', OPCLang::_('COM_VIRTUEMART_USER_FORM_EMAIL'))) . "';";
if (!empty($opc_no_duplicit_username)) {
$extJs .= ' var opc_no_duplicit_username = true; ';
} else {
$extJs .= ' var opc_no_duplicit_username = false; ';
}
if (!empty($opc_no_duplicit_email)) {
$extJs .= ' var opc_no_duplicit_email = true; ';
} else {
$extJs .= ' var opc_no_duplicit_email = false; ';
}
$extJs .= ' var last_username_check = true; ';
$extJs .= ' var last_email_check = true; ';
// stAn mod for OPC2
/*
if (!empty($op_delay_ship))
$extJs .= " var op_delay = true; ";
else $extJs .= " var op_delay = false; ";
*/
if (!empty($op_delay_ship)) {
$extJs .= " var op_delay = false; ";
} else {
$extJs .= " var op_delay = false; ";
}
if (empty($last_ship2_field)) {
$last_ship2_field = '';
}
if (empty($last_ship_field)) {
$last_ship_field = '';
}
$extJs .= " var op_last1 = '" . OPCmini::slash($last_ship_field) . "'; ";
$extJs .= " var op_last2 = '" . OPCmini::slash($last_ship2_field) . "'; ";