本文整理汇总了PHP中vmJsApi类的典型用法代码示例。如果您正苦于以下问题:PHP vmJsApi类的具体用法?PHP vmJsApi怎么用?PHP vmJsApi使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了vmJsApi类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: onBeforeRender
function onBeforeRender()
{
if ($this->app->isAdmin()) {
return;
}
$app = JFactory::getApplication();
$option = $app->input->get('option');
$view = $app->input->get('view');
$tmpl = $app->input->get('tmpl');
$document = JFactory::getDocument();
if ($app->isSite() && $tmpl != 'component') {
if (!defined('SMART_JQUERY') && (int) $this->params->get('include_jquery', '1')) {
$document->addScript(JURI::root(true) . '/plugins/system/plg_sj_vm_quickview/assets/js/jquery-1.8.2.min.js');
$document->addScript(JURI::root(true) . '/plugins/system/plg_sj_vm_quickview/assets/js/jquery-noconflict.js');
define('SMART_JQUERY', 1);
}
if (!class_exists('VmConfig')) {
require JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_virtuemart' . DS . 'helpers' . DS . 'config.php';
}
VmConfig::loadConfig();
if (class_exists('vmJsApi')) {
vmJsApi::jPrice();
}
$document->addScript(JURI::root(true) . '/plugins/system/plg_sj_vm_quickview/assets/js/jquery.fancybox.js');
$document->addStyleSheet(JURI::root(true) . '/plugins/system/plg_sj_vm_quickview/assets/css/jquery.fancybox.css');
$document->addStyleSheet(JURI::root(true) . '/plugins/system/plg_sj_vm_quickview/assets/css/quickview.css');
}
return true;
}
示例2: plgVmDisplayListFEPayment
/**
* This shows the plugin for choosing in the payment list of the checkout process.
*
* @author Valerie Cartan Isaksen
*/
public function plgVmDisplayListFEPayment(VirtueMartCart $cart, $selected = 0, &$htmlIn)
{
if ($this->getPluginMethods($cart->vendorId) === 0) {
if (empty($this->_name)) {
$app = JFactory::getApplication();
$app->enqueueMessage(vmText::_('COM_VIRTUEMART_CART_NO_' . strtoupper($this->_psType)));
return false;
} else {
return false;
}
}
$html = array();
$method_name = $this->_psType . '_name';
VmConfig::loadJLang('com_virtuemart', true);
vmJsApi::jCreditCard();
$htmla = '';
$html = array();
foreach ($this->methods as $_currentMethod) {
$this->_currentMethod = $_currentMethod;
if ($this->checkConditions($cart, $this->_currentMethod, $cart->cartPrices)) {
$cartPrices = $cart->cartPrices;
$methodSalesPrice = $this->setCartPrices($cart, $cartPrices, $this->_currentMethod);
$this->_currentMethod->{$method_name} = $this->renderPluginName($this->_currentMethod);
$sandbox = $this->_currentMethod->sandbox;
$html = $this->getPluginHtml($this->_currentMethod, $selected, $methodSalesPrice);
if ($selected == $this->_currentMethod->virtuemart_paymentmethod_id && $this->hasBillingAddress($cart)) {
$html .= $this->displayForm($cart, $sandbox);
}
$htmla[] = $html;
}
}
$htmlIn[] = $htmla;
return true;
}
示例3: display
function display($tpl = null)
{
$document = JFactory::getDocument();
$document->setMimeEncoding('application/json');
if ($virtuemart_media_id = vRequest::getInt('virtuemart_media_id')) {
//JResponse::setHeader( 'Content-Disposition', 'attachment; filename="media'.$virtuemart_media_id.'.json"' );
$model = VmModel::getModel('Media');
$image = $model->createMediaByIds($virtuemart_media_id);
if (isset($image[0]) and is_object($image[0])) {
$image[0]->file_url_thumb_dyn = $image[0]->getFileUrlThumb();
// echo '<pre>'.print_r($image,1).'</pre>';
$this->json = $image[0];
//echo json_encode($this->json);
if (isset($this->json->file_url)) {
$this->json->file_root = JURI::root(true) . '/';
$this->json->msg = 'OK';
echo vmJsApi::safe_json_encode($this->json);
} else {
$this->json->msg = '<b>' . vmText::_('COM_VIRTUEMART_NO_IMAGE_SET') . '</b>';
echo @json_encode($this->json);
}
}
} else {
if (!class_exists('VmMediaHandler')) {
require VMPATH_ADMIN . DS . 'helpers' . DS . 'mediahandler.php';
}
$start = vRequest::getInt('start', 0);
$type = vRequest::getCmd('mediatype', 0);
$list = VmMediaHandler::displayImages($type, $start);
echo vmJsApi::safe_json_encode($list);
}
jExit();
}
示例4: withKeepAlive
public function withKeepAlive()
{
if (!class_exists('VirtueMartCart')) {
require VMPATH_SITE . DS . 'helpers' . DS . 'cart.php';
}
$cart = VirtueMartCart::getCart();
if (!empty($cart->cartProductsData)) {
vmJsApi::keepAlive(1, 4);
}
}
示例5: display
function display($tpl = null)
{
$db = JFactory::getDBO();
if ($virtuemart_media_id = vRequest::getInt('virtuemart_media_id')) {
//$db = JFactory::getDBO();
$query = 'SELECT `file_url`,`file_title` FROM `#__virtuemart_medias` where `virtuemart_media_id`=' . $virtuemart_media_id;
$db->setQuery($query);
$json = $db->loadObject();
if (isset($json->file_url)) {
$json->file_url = JURI::root() . $json->file_url;
$json->msg = 'OK';
echo vmJsApi::safe_json_encode($json);
} else {
$json->msg = '<b>' . vmText::_('COM_VIRTUEMART_NO_IMAGE_SET') . '</b>';
echo json_encode($json);
}
} elseif ($custom_jplugin_id = vRequest::getInt('custom_jplugin_id')) {
$table = '#__extensions';
$ext_id = 'extension_id';
$q = 'SELECT `params`,`element` FROM `' . $table . '` WHERE `' . $ext_id . '` = "' . $custom_jplugin_id . '"';
$db->setQuery($q);
$this->jCustom = $db->loadObject();
$customModel = VmModel::getModel('custom');
$this->custom = $customModel->getCustom();
// Get the payment XML.
$formFile = vRequest::filterPath(VMPATH_ROOT . DS . 'plugins' . DS . 'vmcustom' . DS . $this->jCustom->element . DS . $this->jCustom->element . '.xml');
if (file_exists($formFile)) {
VmConfig::loadJLang('plg_vmpsplugin', false);
if (!class_exists('vmPlugin')) {
require VMPATH_PLUGINLIBS . DS . 'vmplugin.php';
}
$filename = 'plg_vmcustom_' . $this->jCustom->element;
vmPlugin::loadJLang($filename, 'vmcustom', $this->jCustom->element);
$this->custom = VmModel::getModel('custom')->getCustom();
$varsToPush = vmPlugin::getVarsToPushByXML($formFile, 'customForm');
$this->custom->form = JForm::getInstance($this->jCustom->element, $formFile, array(), false, '//vmconfig | //config[not(//vmconfig)]');
$this->custom->params = new stdClass();
foreach ($varsToPush as $k => $field) {
if (strpos($k, '_') != 0) {
$this->custom->params->{$k} = $field[0];
}
}
$this->custom->form->bind($this->custom->getProperties());
$form = $this->custom->form;
include VMPATH_ADMIN . DS . 'fields' . DS . 'formrenderer.php';
echo '<input type="hidden" value="' . $this->jCustom->element . '" name="custom_value">';
} else {
$this->custom->form = null;
//VmConfig::$echoDebug = 1;
vmdebug('File does not exist ' . $formFile);
}
}
jExit();
}
示例6: getInput
protected function getInput()
{
vmJsApi::addJScript('/plugins/vmpayment/realex_hpp_api/realex_hpp_api/assets/js/admin.js');
vmJsApi::css('admin', 'plugins/vmpayment/realex_hpp_api/realex_hpp_api/assets/css/');
$url = "http://www.realexpayments.com/partner-referral?id=tsmart";
$logo = '<img src="http://www.realexpayments.com/images/logo_realex_large.png" width="150"/>';
$html = '<p><a target="_blank" href="' . $url . '" >' . $logo . '</a></p>';
$html .= '<p><a target="_blank" href="' . $url . '" class="signin-button-link">' . tsmText::_('VMPAYMENT_REALEX_HPP_API_REGISTER') . '</a>';
$html .= ' <a target="_blank" href="http://docs.tsmart.net/manual/shop-menu/payment-methods/realex-hpp-and-api.html" class="signin-button-link">' . tsmText::_('VMPAYMENT_REALEX_HPP_API_DOCUMENTATION') . '</a></p>';
return $html;
}
示例7: display
public function display($tpl = null)
{
$result = $this->loadTemplate($tpl);
if ($result instanceof Exception) {
return $result;
}
echo $result;
if ($this->writeJs and get_class($this) != 'VirtueMartViewProductdetails') {
echo vmJsApi::writeJS();
}
}
示例8: getInput
function getInput()
{
$js = '
//<![CDATA[
jQuery(document).ready(function( $ ) {
jQuery("#paybox_getpaybox_link").click( function() {
if ( $("#paybox_getpaybox_show_hide").is(":visible") ) {
$("#paybox_getpaybox_show_hide").hide("slow");
$("#paybox_getpaybox_link").html("' . addslashes(vmText::_('VMPAYMENT_PAYBOX_ALREADY_ACCOUNT')) . '");
} else {
$("#paybox_getpaybox_show_hide").show("slow");
$("#paybox_getpaybox_link").html("' . addslashes(vmText::_('VMPAYMENT_PAYBOX_GET_PAYBOX_HIDE')) . '");
}
});
});
//]]>
';
vmJsApi::addJScript("vm.getPaybox", $js);
vmJsApi::addJScript('/plugins/vmpayment/paybox/paybox/assets/js/admin.js');
vmJsApi::css('admin', 'plugins/vmpayment/paybox/paybox/assets/css/');
$cid = vRequest::getvar('cid', NULL, 'array');
if (is_Array($cid)) {
$virtuemart_paymentmethod_id = $cid[0];
} else {
$virtuemart_paymentmethod_id = $cid;
}
$query = "SELECT * FROM `#__virtuemart_paymentmethods` WHERE virtuemart_paymentmethod_id = '" . $virtuemart_paymentmethod_id . "'";
$db = JFactory::getDBO();
$db->setQuery($query);
$params = $db->loadObject();
$html = '<img src="http://virtuemart.boutique-paybox.com/PayboxLogo.jpg" width="200px"/><br />';
if ($params->created_on == $params->modified_on) {
$id = "paybox_getpaybox_link";
$html .= '<a href="#" id="' . $id . '">' . vmText::_('VMPAYMENT_PAYBOX_GET_PAYBOX_HIDE') . '</a>';
$display = '';
$html .= '<div id="paybox_getpaybox_show_hide" align=""' . $display . ' >';
} else {
$id = "paybox_getpaybox_link";
$html .= '<a href="#" id="' . $id . '">' . vmText::_('VMPAYMENT_PAYBOX_ALREADY_ACCOUNT') . '</a>';
$display = ' style="display: none;"';
$html .= '<div id="paybox_getpaybox_show_hide" align=""' . $display . ' >';
}
$id = "";
$lang = $this->getLang();
if ($lang == 'fr') {
$url = "http://virtuemart.boutique-paybox.com/PayboxPres.html";
} else {
$url = "http://virtuemart.boutique-paybox.com/PayboxPres.html";
}
$html .= '<iframe src="' . $url . '" scrolling="yes" style="x-overflow: none;" frameborder="0" height="1400px" width="800px"></iframe>';
$html .= "</div>";
return $html;
}
示例9: getInput
protected function getInput()
{
JHtml::_('behavior.colorpicker');
vmJsApi::addJScript('/plugins/vmpayment/paypal/paypal/assets/js/admin.js');
vmJsApi::css('paypal', 'plugins/vmpayment/paypal/paypal/assets/css/');
$url = "https://www.paypal.com/us/webapps/mpp/referral/paypal-payments-standard?partner_id=83EP5DJG9FU6L";
$logo = '<img src="https://www.paypalobjects.com/en_US/i/logo/PayPal_mark_60x38.gif" />';
$html = '<p><a target="_blank" href="' . $url . '" >' . $logo . '</a></p>';
$html .= '<p><a target="_blank" href="' . $url . '" class="signin-button-link">' . vmText::_('VMPAYMENT_PAYPAL_REGISTER') . '</a>';
$html .= ' <a target="_blank" href="http://docs.virtuemart.net/manual/shop-menu/payment-methods/paypal.html" class="signin-button-link">' . vmText::_('VMPAYMENT_PAYPAL_DOCUMENTATION') . '</a></p>';
return $html;
}
示例10: getInput
function getInput()
{
vmJsApi::addJScript('/plugins/vmpayment/klikandpay/klikandpay/assets/js/admin.js');
$lang = $this->getLang();
if ($lang == 'fr') {
$url = "https://www.klikandpay.com/cgi-bin/connexion.pl?FROM=869B834067";
} else {
$url = "https://www.klikandpay.com/cgi-bin/connexion.pl?FROM=869B834067&L=en";
}
$logo = '<img src="https://www.klikandpay.com/images/logo_en.png" style="width: 150px;">';
$html = '<p><a target="_blank" href="' . $url . '" >' . $logo . '</a></p>';
$html .= '<p><a class="signin-button-link" href="' . $url . '" target="_blank">' . vmText::_('VMPAYMENT_KLIKANDPAY_GET') . '</a>';
$html .= ' <a target="_blank" href="https://www.youtube.com/watch?v=DVcUU3FiuMM" class="signin-button-link">' . vmText::_('VMPAYMENT_KLIKANDPAY_DOCUMENTATION') . '</a></p>';
return $html;
}
示例11: display
function display($tpl = null)
{
$states = array();
$db = JFactory::getDBO();
//retrieving countries id
$country_ids = vRequest::getString('tsmart_country_id');
$country_ids = explode(',', $country_ids);
foreach ($country_ids as $country_id) {
$q = 'SELECT `tsmart_state_id`, `state_name` FROM `#__tsmart_states` WHERE `tsmart_country_id`= "' . (int) $country_id . '"
ORDER BY `#__tsmart_states`.`state_name`';
$db->setQuery($q);
$states[$country_id] = $db->loadAssocList();
}
echo vmJsApi::safe_json_encode($states);
}
示例12: getInput
function getInput()
{
vmJsApi::addJScript('/plugins/vmpayment/klarnacheckout/klarnacheckout/assets/js/admin.js');
vmJsApi::css('klarnacheckout', 'plugins/vmpayment/klarnacheckout/klarnacheckout/assets/css/');
$jlang = JFactory::getLanguage();
$lang = $jlang->getTag();
$langArray = explode("-", $lang);
$lang = strtolower($langArray[1]);
$countriesData = KlarnaHandler::countriesData();
$signLang = "en";
foreach ($countriesData as $countryData) {
if ($countryData['country_code'] == $lang) {
$signLang = $lang;
break;
}
}
/*
$logo = '<a href="https://merchants.klarna.com/signup?locale=' . $signLang . '&partner_id=7829355537eae268a17667c199e7c7662d3391f7" target="_blank">
<img src="' . JURI::root () . VMKLARNAPLUGINWEBROOT . '/klarna/assets/images/logo/get_klarna_now.png" /></a> ';
*/
$logo = '<img src="' . JURI::root() . VMKLARNAPLUGINWEBROOT . '/klarna/assets/images/logo/get_klarna_now.jpg" style="margin-bottom: 10px"/>';
$html = '<p><a href="#" id="klarna_getklarna_link" ">' . $logo . '</a></p>';
// https://merchants.klarna.com/signup?locale=en&partner_id=7829355537eae268a17667c199e7c7662d3391f7&utm_campaign=Platform&utm_medium=Partners&utm_source=Virtuemart
$html .= '<div id="klarna_getklarna_show_hide" >';
$url = "https://merchants.klarna.com/signup/?locale=" . $signLang . "&partner_id=7829355537eae268a17667c199e7c7662d3391f7&utm_campaign=Platform&utm_medium=Partners&utm_source=Virtuemart";
$js = '
jQuery(document).ready(function( $ ) {
$("#klarna_getklarna_show_hide").hide();
jQuery("#klarna_getklarna_link").click( function() {
if ( $("#klarna_getklarna_show_hide").is(":visible") ) {
$("#klarna_getklarna_show_hide").hide("slow");
$("#klarna_getklarna_link").html("' . addslashes($logo) . '");
} else {
$("#klarna_getklarna_show_hide").show("slow");
$("#klarna_getklarna_link").html("' . addslashes(vmText::_('VMPAYMENT_KLARNA_GET_KLARNA_HIDE')) . '");
}
});
});
';
vmJsApi::addJScript('vm.getKlarna', $js);
$html .= '<iframe src="' . $url . '" scrolling="yes" style="x-overflow: none;" frameborder="0" height="600px" width="850px"></iframe>';
$html .= '</div>';
$html .= '<p><a target="_blank" href="http://cdn.klarna.com/1.0/shared/content/integration/guide/virtuemart.pdf" class="signin-button-link">' . vmText::_('VMPAYMENT_KLARNA_DOCUMENTATION') . '</a></p>';
return $html;
}
示例13: sendPostRequest
function sendPostRequest () {
$post_variables = $this->getPostVariables();
$jump_url = $this->getJumpUrl();
$html = '';
if ($this->_method->debug) {
$html .= '<form action="' . $jump_url . '" method="post" name="vm_realex_form" target="realex">';
} else {
if (vmconfig::get('css')) {
$msg = vmText::_('VMPAYMENT_REALEX_HPP_API_REDIRECT_MESSAGE', true);
} else {
$msg='';
}
vmJsApi::addJScript('vm.paymentFormAutoSubmit', '
jQuery(document).ready(function($){
jQuery("body").addClass("vmLoading");
var msg="'.$msg.'";
jQuery("body").append("<div class=\"vmLoadingDiv\"><div class=\"vmLoadingDivMsg\">"+msg+"</div></div>");
jQuery("#vmPaymentForm").submit();
})
');
$html .= '<form action="' . $jump_url . '" method="post" name="vm_realex_form" id="vmPaymentForm" accept-charset="UTF-8">';
}
$html .= '<input type="hidden" name="charset" value="utf-8">';
foreach ($post_variables as $name => $value) {
$html .= '<input type="hidden" name="' . $name . '" value="' . $value . '" />';
}
if ($this->_method->debug) {
$html .= '<div style="background-color:red;color:white;padding:10px;">
<input type="submit" value="The method is in debug mode. Click here to be redirected to Realex" />
</div>';
$this->debugLog($post_variables, 'sendPostRequest:', 'debug');
}
$html .= '</form>';
return $html;
}
示例14: getInput
protected function getInput()
{
$pluginpath = '/plugins/vmshopper/ordernumber/ordernumber/';
$doc = JFactory::getDocument()->addStyleSheet(JURI::root(true) . $pluginpath . 'assets/css/ordernumber.css');
$doc->addScript(JURI::root(true) . $pluginpath . 'assets/js/ordernumber.js');
vmJsApi::jQuery();
$this->makeJSTranslationsAvailable();
// Look up the current counters
$db = JFactory::getDBO();
$db->setQuery('SELECT `number_format`, `count` FROM `#__virtuemart_shopper_plg_ordernumber` WHERE `number_type`=' . $db->quote($this->countertype) . ' ORDER BY `number_format`;');
$counters = $db->loadObjectList();
// Joomla 2.x uses <li> for the params and float:left on the controls, so we need to add that too
$float = "";
if (version_compare(JVERSION, '3.0', 'lt')) {
$float = "float: left; ";
}
$html = array();
$html[] = "<img src='" . JURI::root(true) . $pluginpath . "assets/images/loading.gif' class='vm-ordernumber-loading' style=\"display: none; position: absolute; top: 2px; left: 0px; z-index: 9999;\"/><table class=\"vmordernumber-countertable table-striped \" style=\"display: inline-table; {$float}\">";
$html[] = " <tr>";
$html[] = " <th class='counter_format'>" . JText::_('PLG_ORDERNUMBER_COUNTERLIST_HEADER_COUNTER') . "</th>";
$html[] = " <th class='counter_value'>" . JText::_('PLG_ORDERNUMBER_COUNTERLIST_HEADER_VALUE') . "</th>";
$html[] = " <th class='counter_buttons'></th>";
$html[] = " </tr>";
$html[] = " <colgroup><col class='counter_type'><col style=\"text-align: center\" ><col ></colgroup>";
foreach ($counters as $c) {
$displayfmt = $c->number_format;
if ($displayfmt == "") {
$displayfmt = JText::_('PLG_ORDERNUMBER_COUNTERLIST_GLOBAL');
}
$html[] = " <tr class='counter_row counter_type_{$this->countertype}'>";
$html[] = " <td class='counter_format'>" . (string) $displayfmt . "</td>";
$html[] = " <td class='counter_value'>" . (string) $c->count . "</td>";
$html[] = " <td class='counter_buttons'><div class='ordernumber-ajax-loading'><img src='" . JURI::root(true) . $pluginpath . "assets/images/icon-16-edit.png' class='vmordernumber-counter-editbtn vmordernumber-btn' onClick='ajaxEditCounter(this, {$this->countertype}, " . json_encode($c->number_format) . ", {$c->count})' /></div><div class='ordernumber-ajax-loading'><img src='" . JURI::root(true) . $pluginpath . "assets/images/icon-16-delete.png' class='vmordernumber-counter-deletebtn vmordernumber-btn' onClick='ajaxDeleteCounter(this, {$this->countertype}, " . json_encode($c->number_format) . ", {$c->count})' /></div></td>";
$html[] = " </tr>";
}
$html[] = " <tr class='addcounter_row'>";
$html[] = " <td colspan=3 class='counter_add'><div class='vmordernumber-counter-addbtn vmordernumber-btn' onClick='ajaxAddCounter(this, {$this->countertype})'><div class='ordernumber-ajax-loading'><img src='" . JURI::root(true) . $pluginpath . "assets/images/icon-16-new.png' class='vmordernumber-counter-addbtn' /></div>" . JText::_('PLG_ORDERNUMBER_COUNTERLIST_ADD') . "</div></td>";
$html[] = " </tr>";
$html[] = "</table>";
return implode("\n", $html);
}
示例15: __construct
function __construct(&$subject, $config)
{
//if (self::$_this)
// return self::$_this;
parent::__construct($subject, $config);
$this->_loggable = TRUE;
$this->tableFields = array_keys($this->getTableSQLFields());
$this->_tablepkey = 'id';
$this->_tableId = 'id';
$varsToPush = $this->getVarsToPush();
$this->setConfigParameterable($this->_configTableFieldName, $varsToPush);
$this->setCryptedFields(array('accessKey', 'secretKey'));
$amazon_library = JPATH_SITE . DS . 'plugins' . DS . 'vmpayment' . DS . 'amazon' . DS . 'library';
//set_include_path(get_include_path() . PATH_SEPARATOR . realpath(dirname(__FILE__) . "/../../."));
set_include_path($amazon_library);
$this->loadAmazonClass('OffAmazonPaymentsService_Client');
if (!JFactory::getApplication()->isSite()) {
vmJsApi::jQuery();
JFactory::getDocument()->addScript(JURI::root(true) . '/plugins/vmpayment/amazon/assets/js/admin.js');
JFactory::getDocument()->addStyleSheet(JURI::root(true) . '/plugins/vmpayment/amazon/assets/css/amazon-admin.css');
}
}