本文整理汇总了PHP中vmError函数的典型用法代码示例。如果您正苦于以下问题:PHP vmError函数的具体用法?PHP vmError怎么用?PHP vmError使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了vmError函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
function __construct($method,$paypalPlugin) {
parent::__construct($method,$paypalPlugin);
//Set the credentials
if ($this->_method->sandbox ) {
$this->api_login_id = $this->_method->sandbox_api_login_id;
$this->api_signature = $this->_method->sandbox_api_signature;
$this->api_password = $this->_method->sandbox_api_password;
$this->payflow_partner = $this->_method->sandbox_payflow_partner;
$this->payflow_vendor = $this->_method->sandbox_payflow_vendor;
} else {
$this->api_login_id = $this->_method->api_login_id;
$this->api_signature = $this->_method->api_signature;
$this->api_password = $this->_method->api_password;
}
if (empty($this->api_login_id) || empty($this->api_signature) || empty($this->api_password)) {
$text = JText::sprintf('VMPAYMENT_PAYPAL_CREDENTIALS_NOT_SET', $this->_method->payment_name, $this->_method->virtuemart_paymentmethod_id);
vmError($text, $text);
}
if ((empty ($this->_method->payflow_partner) OR empty($this->_method->sandbox_payflow_partner))) {
$sandbox = "";
if ($this->_method->sandbox ) {
$sandbox = 'SANDBOX_';
}
$text = JText::sprintf('VMPAYMENT_PAYPAL_PARAMETER_REQUIRED', JText::_('VMPAYMENT_PAYPAL_' . $sandbox . 'PAYFLOW_PARTNER'), $this->_method->payment_name, $this->_method->virtuemart_paymentmethod_id);
vmError($text);
}
}
示例2: __construct
function __construct($method, $paypalPlugin)
{
parent::__construct($method, $paypalPlugin);
//Set the credentials
if ($this->_method->sandbox) {
$this->api_login_id = $this->_method->sandbox_api_login_id;
if ($this->_method->authentication == 'signature') {
$this->api_signature = trim($this->_method->sandbox_api_signature);
$this->api_certificate = '';
} else {
$this->api_signature = '';
$this->api_certificate = trim($this->_method->sandbox_api_certificate);
}
$this->api_password = trim($this->_method->sandbox_api_password);
$this->merchant_email = trim($this->_method->sandbox_merchant_email);
} else {
$this->api_login_id = trim($this->_method->api_login_id);
$this->api_signature = trim($this->_method->api_signature);
$this->api_certificate = trim($this->_method->api_certificate);
$this->api_password = trim($this->_method->api_password);
$this->merchant_email = trim($this->_method->paypal_merchant_email);
}
if (!$this->ExpCredentialsValid() or !$this->isAacceleratedOnboardingValid()) {
$text = vmText::sprintf('VMPAYMENT_PAYPAL_CREDENTIALS_NOT_SET', $this->_method->payment_name, $this->_method->virtuemart_paymentmethod_id);
vmError($text, $text);
}
if (empty($this->_method->expected_maxamount)) {
$text = vmText::sprintf('VMPAYMENT_PAYPAL_PARAMETER_REQUIRED', vmText::_('VMPAYMENT_PAYPAL_EXPECTEDMAXAMOUNT'), $this->_method->payment_name, $this->_method->virtuemart_paymentmethod_id);
vmError($text, $text);
}
}
示例3: check
function check()
{
if (empty($this->shopper_group_name)) {
vmError('COM_VIRTUEMART_SHOPPERGROUP_RECORDS_MUST_HAVE_NAME');
return false;
} else {
if (function_exists('mb_strlen')) {
$length = mb_strlen($this->shopper_group_name);
} else {
$length = strlen($this->shopper_group_name);
}
if ($length > 128) {
vmError('COM_VIRTUEMART_SHOPPERGROUP_NAME_128');
}
}
if ($this->virtuemart_shoppergroup_id == 1) {
$this->default = 2;
$this->sgrp_additional = 0;
}
if ($this->virtuemart_shoppergroup_id == 2) {
$this->default = 1;
$this->sgrp_additional = 0;
}
return parent::check();
}
示例4: check
function check()
{
if (empty($this->shopper_group_name)) {
vmError(JText::_('COM_VIRTUEMART_SHOPPERGROUP_RECORDS_MUST_HAVE_NAME'));
return false;
} else {
if (function_exists('mb_strlen')) {
if (mb_strlen($this->shopper_group_name) > 32) {
vmError(JText::_('COM_VIRTUEMART_SHOPPERGROUP_NAME_LESS_THAN_32_CHARACTERS'));
return false;
}
} else {
if (strlen($this->shopper_group_name) > 32) {
vmError(JText::_('COM_VIRTUEMART_SHOPPERGROUP_NAME_LESS_THAN_32_CHARACTERS'));
return false;
}
}
}
/* commented by PATRICK This set always shoppergroup to 1 if you do a new shoppergroup
if(empty($this->virtuemart_shoppergroup_id)){
$q = 'SELECT `virtuemart_shoppergroup_id` FROM `#__virtuemart_shoppergroups` WHERE `default`="1" AND `virtuemart_vendor_id`="1" ';
$this->_db->setQuery($q);
$this->virtuemart_shoppergroup_id=$this->_db->loadResult();
}
*/
return parent::check();
}
示例5: filterPath
/**
* This function does not allow unicode, replacement for JPath::clean
* and makesafe
* @param $string
* @param bool $forceNoUni
* @return mixed|string
*/
static function filterPath($str)
{
if (empty($str)) {
vmError('filterPath empty string check your paths ');
vmTrace('Critical error, empty string in filterPath');
return VMPATH_ROOT;
}
$str = trim($str);
// Delete all '?'
$str = str_replace('?', '', $str);
// Replace double byte whitespaces by single byte (East Asian languages)
$str = preg_replace('/\\xE3\\x80\\x80/', ' ', $str);
$unicodeslugs = VmConfig::get('transliterateSlugs', false);
if ($unicodeslugs) {
$lang = JFactory::getLanguage();
$str = $lang->transliterate($str);
}
//This is a path, so remove all strange slashes
$str = str_replace('/', DS, $str);
//Clean from possible injection
while (strpos($str, '..') !== false) {
$str = str_replace('..', '', $str);
}
$str = preg_replace('#[/\\\\]+#', DS, $str);
$str = filter_var($str, FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_LOW);
return $str;
}
示例6: check
function check()
{
if (empty($this->shopper_group_name)) {
vmError(vmText::_('COM_VIRTUEMART_SHOPPERGROUP_RECORDS_MUST_HAVE_NAME'));
return false;
} else {
if (function_exists('mb_strlen')) {
if (mb_strlen($this->shopper_group_name) > 128) {
vmError(vmText::_('COM_VIRTUEMART_SHOPPERGROUP_NAME_LESS_THAN_32_CHARACTERS'));
return false;
}
} else {
if (strlen($this->shopper_group_name) > 128) {
vmError(vmText::_('COM_VIRTUEMART_SHOPPERGROUP_NAME_LESS_THAN_32_CHARACTERS'));
return false;
}
}
}
if ($this->virtuemart_shoppergroup_id == 1) {
$this->default = 2;
$this->sgrp_additional = 0;
}
if ($this->virtuemart_shoppergroup_id == 2) {
$this->default = 1;
$this->sgrp_additional = 0;
}
return parent::check();
}
示例7: store
/**
* Records in this table do not need to exist, so we might need to create a record even
* if the primary key is set. Therefore we need to overload the store() function.
*
* @author Max Milbers
* @see libraries/joomla/database/JTable#store($updateNulls)
*/
public function store($updateNulls = false) {
$this->setLoggableFieldsForStore();
$this->storeParams();
$tblKey = $this->_tbl_key;
$pKey = $this->_pkey;
if($tblKey == $pKey){
vmdebug('VmTableData '.get_class($this). ' need not to be a vmtabledata $tblKey == $pKey');
$res = false;
if(!empty($this->$tblKey)){
$_qry = 'SELECT `'.$this->_tbl_key.'` '
. 'FROM `'.$this->_tbl.'` '
. 'WHERE `'.$this->_tbl_key.'` = "' . $this->$tblKey.'" ';
$this->_db->setQuery($_qry);
$res = $this->_db->loadResult();
}
if($res){
$returnCode = $this->_db->updateObject($this->_tbl, $this, $this->_tbl_key, $updateNulls);
} else {
$returnCode = $this->_db->insertObject($this->_tbl, $this, $this->_tbl_key);
}
} else {
if(!empty($this->$pKey)){
$_qry = 'SELECT `'.$this->_tbl_key.'` '
. 'FROM `'.$this->_tbl.'` '
. 'WHERE `'.$this->_pkey.'` = "' . $this->$pKey.'" ';
$this->_db->setQuery($_qry);
//Yes, overwriting $this->$tblKey is correct !
$this->$tblKey = $this->_db->loadResult();
}
if ( !empty($this->$tblKey) ) {
$returnCode = $this->_db->updateObject($this->_tbl, $this, $this->_tbl_key, $updateNulls);
} else {
$returnCode = $this->_db->insertObject($this->_tbl, $this, $this->_tbl_key);
}
}
//reset Params
if(isset($this->_tmpParams)){
foreach($this->_tmpParams as $k => $v){
$this->$k = $v;
}
}
$this->_tmpParams = false;
if (!$returnCode) {
vmError(get_class($this) . '::store failed - ' . $this->_db->getErrorMsg());
return false;
}
else {
return true;
}
}
示例8: check
function check()
{
if (empty($this->notify_email) || !filter_var($this->notify_email, FILTER_VALIDATE_EMAIL)) {
vmError(tsmText::_('com_tsmart_ENTER_A_VALID_EMAIL_ADDRESS'), tsmText::_('com_tsmart_ENTER_A_VALID_EMAIL_ADDRESS'));
return false;
}
return parent::check();
}
示例9: check
function check()
{
if (empty($this->notify_email) || !filter_var($this->notify_email, FILTER_VALIDATE_EMAIL)) {
vmError(JText::_('COM_VIRTUEMART_ENTER_A_VALID_EMAIL_ADDRESS'), JText::_('COM_VIRTUEMART_ENTER_A_VALID_EMAIL_ADDRESS'));
return false;
}
return parent::check();
}
示例10: check
/**
* Validates the userfields record fields.
*
* @return boolean True if the table buffer is contains valid data, false otherwise.
*/
function check($nrOfValues)
{
if (preg_match('/[^a-z0-9\\._\\-]/i', $this->group_name) > 0) {
vmError(JText::_('COM_VIRTUEMART_PERMISSION_GROUP_NAME_INVALID_CHARACTERS'));
return false;
}
return parent::check();
}
示例11: displayErrors
function displayErrors($errors)
{
foreach ($errors as $error) {
vmError(vmText::sprintf('VMPAYMENT_SOFORT_ERROR_FROM', $error['message'], $error['field'], $error['code']));
vmInfo(vmText::sprintf('VMPAYMENT_SOFORT_ERROR_FROM', $error['message'], $error['field'], $error['code']));
if ($error['message'] == 401) {
vmdebug('check you payment parameters: custom_id, project_id, api key');
}
}
}
示例12: display
function display($tpl = 'pdf')
{
if (!file_exists(JPATH_VM_LIBRARIES . '/tcpdf/tcpdf.php')) {
vmError('View pdf: For the pdf invoice, you must install the tcpdf library at ' . JPATH_VM_LIBRARIES . '/tcpdf');
} else {
$viewName = jRequest::getWord('view', 'productdetails');
$class = 'VirtueMartView' . ucfirst($viewName);
JLoader::register($class, JPATH_VM_SITE . '/views/' . $viewName . '/view.html.php');
$view = new $class();
$view->display($tpl);
}
}
示例13: bindChecknStore
public function bindChecknStore(&$data, $preload = false)
{
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query->select('products_en_gb.tsmart_product_id')->from('#__tsmart_products AS products')->leftJoin('#__tsmart_products_en_gb AS products_en_gb USING(tsmart_product_id)')->where('products_en_gb.tsmart_product_id!=' . (int) $data['tsmart_product_id'])->where('products_en_gb.product_name = ' . $query->q("{$data['product_name']}"));
$db->setQuery($query);
$list_tour = $db->loadObjectList();
if (count($list_tour) > 0) {
vmError('tour name exists, please select other tour name');
return false;
}
return parent::bindChecknStore($data, $preload);
// TODO: Change the autogenerated stub
}
示例14: display
function display($tpl = 'pdf')
{
if (!file_exists(JPATH_VM_LIBRARIES . DS . 'tcpdf' . DS . 'tcpdf.php')) {
vmError('View pdf: For the pdf invoice, you must install the tcpdf library at ' . JPATH_VM_LIBRARIES . DS . 'tcpdf');
} else {
$viewName = jRequest::getWord('view', 'productdetails');
$class = 'VirtueMartView' . ucfirst($viewName);
if (!class_exists($class)) {
require JPATH_VM_SITE . DS . 'views' . DS . $viewName . DS . 'view.html.php';
}
$view = new $class();
$view->display($tpl);
}
}
示例15: bindChecknStore
public function bindChecknStore(&$data, $preload = false)
{
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query->select('itinerary.tsmart_itinerary_id')->from('#__tsmart_itinerary AS itinerary')->where('itinerary.tsmart_itinerary_id!=' . (int) $data['tsmart_itinerary_id'])->where('itinerary.tsmart_product_id=' . (int) $data['tsmart_product_id'])->where('itinerary.title = ' . $query->q("{$data['title']}"));
$db->setQuery($query);
$list_itinerary = $db->loadObjectList();
if (count($list_itinerary) > 0) {
vmError('itinerary title exists, please select other itinerary title');
return false;
}
return parent::bindChecknStore($data, $preload);
// TODO: Change the autogenerated stub
}