本文整理汇总了PHP中jText::sprintf方法的典型用法代码示例。如果您正苦于以下问题:PHP jText::sprintf方法的具体用法?PHP jText::sprintf怎么用?PHP jText::sprintf使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类jText
的用法示例。
在下文中一共展示了jText::sprintf方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display
function display($field, $value, $map, $inside, $options = '', $test = false, $allFields = null, $allValues = null)
{
if (JFactory::getApplication()->isSite()) {
$plugin = JPluginHelper::getPlugin('hikashop', 'bforderdeliveryslot');
$params = new JRegistry($plugin->params);
if ($params->get('refreshshipping', '0')) {
$field_namekey = $field->field_namekey;
if (isset($_REQUEST["data"]["order"][$field_namekey])) {
$value = $_REQUEST["data"]["order"][$field_namekey];
}
$js = '
function bforderdeliverydateChange(el) {
var el$ = jQuery(el.form.step);
var step = el$.val();
if (step > 0) {
step -= 1;
var form$ = jQuery(el.form);
var formaction = form$.attr("action");
formaction = formaction.replace(/task-step.step-[0-9]+/, "task-step/step-" + step);
form$.attr("action", formaction);
el$.val(step);
}
el.form.submit();
}
jQuery(document).ready(function() {
jQuery("#' . $field_namekey . '").attr("onchange", "bforderdeliverydateChange(this);");
});
';
JFactory::getDocument()->addScriptDeclaration($js);
}
}
if ($field->field_namekey != 'order_delivery_date') {
JError::raiseWarning(4711, jText::sprintf('PLG_HIKASHOP_BFORDERDELIVERYSLOT_ADMINERROR', '003'));
if (JFactory::getApplication()->isAdmin()) {
echo '<div style="color:#ff0000;font-weight:bold;">Invalid column name defined. ' . "Only 'order_delivery_date' is permitted. " . "Please correct before continuing.</div>";
}
}
if (JFactory::getApplication()->isAdmin()) {
if (!empty($field->field_value)) {
switch (count($field->field_value)) {
case 0:
break;
case 1:
if (!empty($field->field_value[0])) {
JError::raiseWarning(4711, jText::sprintf('PLG_HIKASHOP_BFORDERDELIVERYSLOT_ADMINERROR', '002'));
echo '<div style="color:#ff0000;font-weight:bold;">Invalid value defined. ' . "Only an empty default value is permitted. " . "Please correct before continuing.</div>";
}
break;
default:
JError::raiseWarning(4711, jText::sprintf('PLG_HIKASHOP_BFORDERDELIVERYSLOT_ADMINERROR', '001'));
echo '<div style="color:#ff0000;font-weight:bold;">Too many values defined. ' . "Only only one empty value with title of 'Please select...' (or equivalent) is permitted. " . "The others have been deleted, please SAVE before continuing.</div>";
break;
}
}
$js = '
jQuery(document).ready(function() {
jQuery("#hikashop_field_values_table #tablevalues tr").each(function( index ) {
if (index > 0) {
this.remove();
}
else {
jQuery(\'[name="field_values[title][]"]\').val(\'\');
jQuery(\'[name="field_values[title][]"]\').prop("readonly", true);
}
});
jQuery("#fieldopt_required_1").hide();
jQuery("#fieldopt_regex").hide();
jQuery("#fieldopt_multivalues a.btn.btn-success").hide();
});
';
JFactory::getDocument()->addScriptDeclaration($js);
}
return parent::display($field, $value, $map, $inside, $options, $test, $allFields, $allValues);
}
示例2: defined
* @author RolandD
* @link http://www.virtuemart.net
* @copyright Copyright (c) 2004 - 2010 VirtueMart Team. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* VirtueMart is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* @version $Id: product_edit_waitinglist.php 3872 2011-08-15 16:56:50Z electrocity $
*/
// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die('Restricted access');
?>
<div class="mailing">
<input type="text" class="mail-subject" size="40" value ="<?php
echo jText::sprintf('COM_VIRTUEMART_PRODUCT_EMAIL_SHOPPERS_SUBJECT', $this->product->product_name);
?>
">
<div class="button2-left" data-type="sendmail" >
<div class="blank" style="padding:0 6px;cursor: pointer;" title="<?php
echo jText::_('COM_VIRTUEMART_PRODUCT_EMAIL_SEND_TIP');
?>
">
<span class="vmicon vmicon-16-email" ></span>
<?php
echo Jtext::_('COM_VIRTUEMART_PRODUCT_EMAIL_SEND');
?>
</div>
</div>
<br />
<div><?php
示例3: onBeforeOrderCreate
function onBeforeOrderCreate(&$order, &$do)
{
if (!empty($order->order_delivery_date)) {
if (!self::checkDeliveryDate($order)) {
$do = false;
} else {
$deliveryTime = self::orderDateValue2Time($order->order_delivery_date);
$raiseWarning = false;
$order_delivery_date = explode('@', $order->order_delivery_date);
if ($order_delivery_date[1] == '0') {
if (!self::canDeliverySameDay(time())) {
$do = false;
$raiseWarning = true;
$order->order_delivery_date = null;
}
} else {
if ($order_delivery_date[2] == '0') {
if (!self::canDeliveryNextDay(time())) {
$do = false;
$raiseWarning = true;
$order->order_delivery_date = null;
}
}
}
if ($raiseWarning) {
JError::raiseWarning(4720, jText::sprintf('PLG_HIKASHOP_BFORDERDELIVERYDATE_MISSEDTIMEERR', self::getFormattedDate(null, $deliveryTime, true)));
}
}
}
}