本文整理汇总了PHP中EnmasseHelper::getSetting方法的典型用法代码示例。如果您正苦于以下问题:PHP EnmasseHelper::getSetting方法的具体用法?PHP EnmasseHelper::getSetting怎么用?PHP EnmasseHelper::getSetting使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EnmasseHelper
的用法示例。
在下文中一共展示了EnmasseHelper::getSetting方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: checkAccess
private function checkAccess()
{
$userGroup = JFactory::getUser()->groups;
$delivererGroup = EnmasseHelper::getSetting()->delivery_group;
if (!in_array($delivererGroup, $userGroup)) {
$msg = JText::_('NO_PRIVILEDGE_FOR_ACCESSING');
JFactory::getApplication()->redirect(JURI::base(), $msg, 'error');
} else {
return true;
}
}
示例2: payOutCoupons
public function payOutCoupons()
{
$nAuthorId = $this->checkAccess();
$arCouponId = JRequest::getVar('cid', array(), 'post', 'array');
$filter = JRequest::getVar('filter', array(), 'method', 'array');
$nDealId = isset($filter['deal_id']) ? $filter['deal_id'] : '';
//check deal belong to this merchant or not
if (empty($nDealId) || !JModel::getInstance('deal', 'EnmasseModel')->checkMerchantOfDeal($nAuthorId, $nDealId)) {
$msg = JText::_('INVALID_DEAL_ID');
$link = 'index.php?option=com_enmasse&controller=merchant&task=dealCouponMgmt';
JFactory::getApplication()->redirect($link, $msg, 'error');
}
//get coupon list with status is Not_Paid_Out of this deal
$arCoupon = JModel::getInstance('invty', 'EnmasseModel')->getNotPaidOutCouponByDealId($nDealId);
if (empty($arCoupon)) {
$msg = JText::_('MERCHANT_COUPONS_ALREADY_IN_PROCESS');
$link = JRoute::_("index.php?option=com_enmasse&controller=merchant&task=dealCouponMgmt&filter[deal_id]={$nDealId}");
JFactory::getApplication()->redirect($link, $msg, 'error');
}
//calculate the coupon ids that have status is "Not_Paid_Out"
//we must compare with cid array variable because merchant can also selected the paid out coupons at client
$arNPOId = array_keys($arCoupon);
$arCouponId = array_intersect($arCouponId, $arNPOId);
//update status of calculated coupon of the deal to 'Should_Be_Paid_Out'
if (empty($arCouponId)) {
$msg = JText::_('MERCHANT_COUPONS_ALREADY_IN_PROCESS');
$link = JRoute::_("index.php?option=com_enmasse&controller=merchant&task=dealCouponMgmt&filter[deal_id]={$nDealId}");
JFactory::getApplication()->redirect($link, $msg, 'error');
} else {
JModel::getInstance('invty', 'EnmasseModel')->payOutCoupons($arCouponId);
}
//send message to admin
$mailer = JFactory::getMailer();
$oMer = JModel::getInstance('merchant', 'enmasseModel')->getByUserName(JFactory::getUser()->get('username'));
$oDeal = JModel::getInstance('deal', 'enmasseModel')->getById($nDealId);
$sender = array(JFactory::getUser()->email, $oMer->name);
$mailto = EnmasseHelper::getSetting()->customer_support_email;
$recipient = array($mailto);
//admin email was config in enmasse_setting;
$subject = JText::sprintf('MERCHANT_PAY_OUT_EMAIL_SUBJECT', $oDeal->deal_code);
$body = JText::sprintf('MERCHANT_PAY_OUT_EMAIL_BODY', $oMer->name, $oDeal->name);
$mailer->setSubject($subject);
$mailer->setBody($body);
$mailer->addRecipient($recipient);
$mailer->setSender($sender);
$send =& $mailer->Send();
//update successful, redirect to merchant home page
$msg = JText::_('MERCHANT_COUPONS_PAY_OUT_SUCCESS');
$link = JRoute::_("index.php?option=com_enmasse&controller=merchant&task=dealCouponMgmt&filter[deal_id]={$nDealId}");
JFactory::getApplication()->redirect($link, $msg);
}
示例3: getCouponBg
function getCouponBg()
{
$oSetting = EnmasseHelper::getSetting();
return $oSetting->coupon_bg_url;
}