コード例 #1
0
ファイル: PaymentSettings.php プロジェクト: kirkbauer2/kirkxc
 /**
  * Handle request 
  *
  * @return void
  */
 public function handleRequest()
 {
     if (\XLite\Core\Request::getInstance()->action != 'add' && \XLite\Module\CDev\XPaymentsConnector\Core\Settings::getInstance()->checkUpdateAllowedModules()) {
         \XLite\Module\CDev\XPaymentsConnector\Core\Settings::getInstance()->importAllowedModules();
     }
     parent::handleRequest();
 }
コード例 #2
0
ファイル: Settings.php プロジェクト: kirkbauer2/kirkxc
 /**
  * Get editable options
  *
  * @return array
  */
 protected function getEditableOptions()
 {
     $options = parent::getEditableOptions();
     $pageOptions = \XLite\Module\CDev\XPaymentsConnector\Core\Settings::getInstance()->getFieldsForPage(\XLite\Core\Request::getInstance()->page);
     foreach ($options as $key => $option) {
         // Remove options from other pages
         if (!in_array($option->name, $pageOptions)) {
             unset($options[$key]);
         }
     }
     return $options;
 }
コード例 #3
0
ファイル: Settings.php プロジェクト: kewaunited/xcart
 /**
  * Check and deploy configuration
  *
  * @param string $deployConfig String containing a deployment configuration
  *
  * @return string
  */
 public function deployConfiguration($deployConfig)
 {
     $xpcConfig = $this->getConfiguration($deployConfig);
     $errorMsg = '';
     if (true === $this->checkDeployConfiguration($xpcConfig)) {
         $this->setConfiguration($xpcConfig);
         \XLite\Core\Config::updateInstance();
         if (true !== \XLite\Module\CDev\XPaymentsConnector\Core\Settings::getInstance()->testConnection(false)) {
             $errorMsg = 'Configuration has been deployed, but X-Cart is unable to connect to X-Payments';
         } else {
             $this->importPaymentMethods();
         }
     } else {
         $errorMsg = 'Your configuration string is not correct';
     }
     return $errorMsg;
 }
コード例 #4
0
ファイル: Xpc.php プロジェクト: kirkbauer2/kirkxc
 /**
  * Initialize settings 
  *
  * @return void
  * @access protected
  * @see    ____func_see____
  * @since  1.0.0
  */
 public function init()
 {
     parent::init();
     $this->settings = \XLite\Module\CDev\XPaymentsConnector\Core\Settings::getInstance();
 }