Permalink
Browse files

Can now load from local app config instead of just plugin config

  • Loading branch information...
1 parent c2b63ed commit f60882dec4ed4e355e06d4a29c3326a2aace9428 Nick Baker committed Dec 31, 2010
Showing with 9 additions and 2 deletions.
  1. +9 −2 views/helpers/paypal.php
View
@@ -13,8 +13,15 @@ class PaypalHelper extends AppHelper {
* Setup the config based on the paypal_ipn_config in /plugins/paypal_ipn/config/paypal_ipn_config.php
*/
function __construct(){
- App::import(array('type' => 'File', 'name' => 'PaypalIpn.PaypalIpnConfig', 'file' => 'config'.DS.'paypal_ipn_config.php'));
- $this->config =& new PaypalIpnConfig();
+ if(App::import(array('type' => 'File', 'name' => 'PaypalIpn.PaypalIpnConfig', 'file' => CONFIGS .'paypal_ipn_config.php'))){
+ $this->config =& new PaypalIpnConfig();
+ }
+ else {
+ //Import from paypal plugin configuration
+ App::import(array('type' => 'File', 'name' => 'PaypalIpn.PaypalIpnConfig', 'file' => 'config'.DS.'paypal_ipn_config.php'));
+ $this->config =& new PaypalIpnConfig();
+ }
+
parent::__construct();
}

0 comments on commit f60882d

Please sign in to comment.