コード例 #1
0
ファイル: paypal.class.php プロジェクト: JohnToro/paypal
 /**
  *   Prepare to save the configuraiton.
  *   This copies the new config values into our local variables, then
  *   calls the parent function to save to the database.
  *
  *   @param  array   $A      Array of name=>value pairs (e.g. $_POST)
  */
 function SaveConfig($A)
 {
     if (!is_array($A)) {
         return false;
     }
     foreach ($this->config as $name => $value) {
         switch ($name) {
             case 'encrypt':
                 // Check if the "encrypt" value has changed.  If so, clear the
                 // button cache
                 $encrypt = isset($A['encrypt']) ? 1 : 0;
                 if ($encrypt != $this->config['encrypt']) {
                     $this->ClearButtonCache();
                 }
                 $this->config['encrypt'] = $encrypt;
                 break;
             case 'test_mode':
                 $this->config[$name] = isset($A[$name]) ? 1 : 0;
                 break;
             default:
                 $this->config[$name] = $A[$name];
                 break;
         }
     }
     return parent::SaveConfig($A);
 }
コード例 #2
0
ファイル: amazon.class.php プロジェクト: NewRoute/paypal
 /**
  *   Prepare to save the configuraiton.
  *   This copies the new config values into our local variables, then
  *   calls the parent function to save to the database.
  *
  *   @uses   PaymentGw::SaveConfig()
  *   @param  array   $A      Array of name=>value pairs (e.g. $_POST)
  *   @return boolean         Results of parent SaveConfig function
  */
 public function SaveConfig($A)
 {
     if (!is_array($A)) {
         return false;
     }
     foreach ($this->config as $name => $value) {
         switch ($name) {
             case 'test_mode':
                 $this->config[$name] = isset($A[$name]) ? 1 : 0;
                 break;
             default:
                 $this->config[$name] = $A[$name];
                 break;
         }
     }
     return parent::SaveConfig($A);
 }