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')) . '"); } }); }); //]]> '; $doc = JFactory::getDocument(); $doc->addScriptDeclaration($js); if (!class_exists('pbxRequest')) { require JPATH_SITE . DS . 'plugins' . DS . 'vmpayment' . DS . 'paybox' . DS . 'paybox' . DS . 'helpers' . DS . 'pbxrequest.php'; } $cid = pbxRequest::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; }
/** * Create the table for this plugin if it does not yet exist. * This functions checks if the called plugin is active one. * When yes it is calling the standard method to create the tables * * @author Valérie Isaksen * */ function plgVmOnStoreInstallPaymentPluginTable($jplugin_id) { if ($res = $this->selectedThisByJPluginId($jplugin_id)) { $virtuemart_paymentmethod_id = pbxRequest::getInt('virtuemart_paymentmethod_id'); $method = $this->getPluginMethod($virtuemart_paymentmethod_id); vmdebug('plgVmOnStoreInstallPaymentPluginTable', $method, $virtuemart_paymentmethod_id); //$this->createRootFile($method->virtuemart_paymentmethod_id); /* $mandatory_fields = array('site_id', 'rang', 'identifiant', 'key'); foreach ($mandatory_fields as $mandatory_field) { if (empty($method->$mandatory_field)) { vmError(vmText::sprintf('VMPAYMENT_'.$this->_name.'_CONF_MANDATORY_PARAM', vmText::_('VMPAYMENT_'.$this->_name.'_CONF_' . $mandatory_field))); } } */ if (!extension_loaded('curl')) { vmError(vmText::sprintf('VMPAYMENT_' . $this->_name . '_CONF_MANDATORY_PHP_EXTENSION', 'curl')); } if (!extension_loaded('openssl')) { vmError(vmText::sprintf('VMPAYMENT_' . $this->_name . '_CONF_MANDATORY_PHP_EXTENSION', 'openssl')); } } return $this->onStoreInstallPluginTable($jplugin_id); }
/** * Checks for a form token in the request. * Use in conjunction with JHtml::_('form.token') or JSession::getFormToken. * * @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved. * @param string $method The request method in which to look for the token key. * * @return boolean True if found and valid, false otherwise. * * @since 12.1 */ public static function vmCheckToken($redirectMsg = 0) { $token = self::getFormToken(); if (!self::uword($token, FALSE)) { if ($rToken = self::uword('token', FALSE)) { if ($rToken == $token) { return true; } } $session = JFactory::getSession(); if ($session->isNew()) { // Redirect to login screen. $app = JFactory::getApplication(); $app->redirect(JRoute::_('index.php'), vmText::_('JLIB_ENVIRONMENT_SESSION_EXPIRED')); $app->close(); } else { if ($redirectMsg === 0) { $redirectMsg = 'Invalid Token, in ' . pbxRequest::getCmd('options') . ' view=' . pbxRequest::getCmd('view') . ' task=' . pbxRequest::getCmd('task'); //jexit('Invalid Token, in ' . pbxRequest::getCmd('options') .' view='.pbxRequest::getCmd('view'). ' task='.pbxRequest::getCmd('task')); } else { $redirectMsg = vmText::_($redirectMsg); } // Redirect to login screen. $app = JFactory::getApplication(); $session->close(); $app->redirect(JRoute::_('index.php'), vmText::_($redirectMsg)); $app->close(); return false; } } else { return false; } }
/** * */ function redirectToCart() { $app = JFactory::getApplication(); $app->redirect(JRoute::_('index.php?option=com_virtuemart&view=cart&lg=&Itemid=' . pbxRequest::getInt('Itemid'), false), vmText::_('VMPAYMENT_PAYBOX_ERROR_TRY_AGAIN')); }