/**
  * Setup the config based on either the Configure::read() values
  * or the PaypalIpnConfig in config/paypal_ipn_config.php
  *
  * Will attempt to read configuration in the following order:
  *   Configure::read('PaypalIpn')
  *   App::import() of config/paypal_ipn_config.php
  *   App::import() of plugin's config/paypal_ipn_config.php
  */
 function __construct()
 {
     $this->config = Configure::read('PaypalIpn');
     if (empty($this->config)) {
         $importConfig = array('type' => 'File', 'name' => 'PaypalIpn.PaypalIpnConfig', 'file' => CONFIGS . 'paypal_ipn_config.php');
         if (!class_exists('PaypalIpnConfig')) {
             App::import($importConfig);
         }
         if (!class_exists('PaypalIpnConfig')) {
             // Import from paypal plugin configuration
             $importConfig['file'] = 'config' . DS . 'paypal_ipn_config.php';
             App::import($importConfig);
         }
         if (!class_exists('PaypalIpnConfig')) {
             trigger_error(__d('paypal_ipn', 'PaypalIpnConfig: The configuration could not be loaded.', true), E_USER_ERROR);
         }
         if (!PHP5) {
             $config =& new PaypalIpnConfig();
         } else {
             $config = new PaypalIpnConfig();
         }
         $vars = get_object_vars($config);
         foreach ($vars as $property => $configuration) {
             if (strpos($property, 'encryption_') === 0) {
                 $name = substr($property, 11);
                 $this->encryption[$name] = $configuration;
             } else {
                 $this->config[$property] = $configuration;
             }
         }
     }
     parent::__construct();
 }
示例#2
0
 public static function create()
 {
     self::$urls = \Config::get('panel.panelControllers');
     $config = \Serverfireteam\Panel\Link::allCached();
     $dashboard = array();
     $appHelper = new AppHelper();
     // Make Dashboard Items
     foreach ($config as $value) {
         $modelName = $value['url'];
         if (in_array($modelName, self::$urls)) {
             $model = "Serverfireteam\\Panel\\" . $modelName;
         } else {
             $model = $appHelper->getNameSpace() . $modelName;
         }
         //if (class_exists($value)) {
         if ($value['show_menu']) {
             $user = \Auth::guard('panel')->user();
             if (!$user->hasRole('super')) {
                 if (!\Auth::guard('panel')->user()->hasPermission($modelName . 'all')) {
                     continue;
                 }
             }
             $dashboard[] = array('modelName' => $modelName, 'title' => $value['display'], 'count' => $model::count(), 'showListUrl' => 'panel/' . $modelName . '/all', 'addUrl' => 'panel/' . $modelName . '/edit');
         }
     }
     return $dashboard;
 }
示例#3
0
 /**
  * Initializes context.
  * Every scenario gets its own context object.
  */
 public function __construct()
 {
     $this->doctrineHelper = new DoctrineHelper();
     $appHelper = new AppHelper();
     $appHelper->initApp();
     $appBuilderFactory = new TestAppBuilderFactory();
     $appBuilder = $appBuilderFactory->createAppBuilder("Web", ".");
     $appBuilder->buildApp();
     $this->container = $appBuilder->getContainer();
     $this->passwordHasher = $this->container->resolve('Conpago\\Helpers\\Contract\\IPasswordHasher');
     $this->jar = new CookieJar();
     $this->client = new Client();
 }
 public function beforeLayout($viewFile)
 {
     parent::beforeLayout($viewFile);
     $js = array('/high_charts/js/highcharts');
     $theme = $this->_getTheme($this->chart_name);
     $exportingEnabled = $this->_checkExporting($this->chart_name);
     if ($exportingEnabled) {
         $js[] = '/high_charts/js/modules/exporting';
     }
     switch ($theme) {
         case 'gray':
         case 'grid':
         case 'dark-blue':
         case 'dark-green':
         case 'skies':
             $js[] = '/high_charts/js/themes/' . $theme;
             break;
         default:
             // $js[] = '/high_charts/js/themes/highroller';
             break;
     }
     $this->Html->css('high_charts/css/highroller');
     $this->Html->script($js, FALSE);
     return true;
 }
示例#5
0
 /**
  * Constructor
  *
  */
 public function __construct($View = null, $config = array())
 {
     $config += $this->_defaultConfig;
     // Default the secure option to match the current URL.
     $config['secure'] = env('HTTPS');
     parent::__construct($View, $config);
 }
示例#6
0
 public function beforeLayout($viewFile)
 {
     parent::beforeLayout($viewFile);
     $js = array('/highcharts/js/highcharts', '/highcharts/js/highcharts-more');
     $theme = $this->_getTheme($this->chart_name);
     $exportingEnabled = $this->_checkExporting($this->chart_name);
     $options3dEnabled = $this->_checkOptions3d($this->chart_name);
     $drillDownEnabled = $this->_checkDrillDown($this->chart_name);
     if ($exportingEnabled) {
         $js[] = '/highcharts/js/modules/exporting';
     }
     if ($options3dEnabled) {
         $js[] = '/highcharts/js/highcharts-3d.js';
     }
     if ($drillDownEnabled) {
         array_push($js, '/highcharts/js/modules/drilldown');
     }
     switch ($theme) {
         case 'gray':
         case 'grid':
         case 'dark-blue':
         case 'dark-green':
         case 'skies':
             $js[] = '/highcharts/js/themes/' . $theme;
             break;
         default:
             // $js[] = '/highcharts/js/themes/highroller';
             break;
     }
     $this->Html->css('highcharts/css/highroller');
     $this->Html->script($js, false);
     return true;
 }
示例#7
0
 /**
  * Constructor
  *
  * @param View $View the view object the helper is attached to.
  * @param array $settings Settings array Settings array
  */
 public function __construct(View $View, $settings = array())
 {
     if (isset($settings['niceFormat'])) {
         $this->niceFormat = $settings['niceFormat'];
     }
     parent::__construct($View, $settings);
 }
示例#8
0
 /**
  * Default Constructor
  *
  * @param View $View The View this helper is being attached to.
  * @param array $settings Configuration settings for the helper.
  */
 public function __construct(View $View, $settings = array())
 {
     $defaults = array('chaining' => true);
     $settings = array_merge($defaults, $settings);
     $this->chaining = $settings['chaining'];
     parent::__construct($View, $settings);
 }
 function __construct(View $view, $settings = array())
 {
     parent::__construct($view, $settings);
     foreach ($settings as $key => $value) {
         $this->{$key} = $value;
     }
 }
示例#10
0
 /**
  * Constructor
  *
  * @access public
  */
 public function __contruct()
 {
     foreach ($this->config['full'] as $key => $value) {
         $this->{$key} = $value;
     }
     return parent::__construct();
 }
示例#11
0
 public function __set($name, $val)
 {
     switch ($name) {
         default:
             return parent::__set($name, $val);
     }
 }
示例#12
0
 /**
  * @depends testWrite
  */
 public function testRead()
 {
     $help = AppHelper::Instance();
     $drive = new File_d();
     $key = "testFile";
     $this->assertTrue($drive->enabled(), "is drive ok?(testRead)");
     $this->assertTrue($drive->Info() == $drive->Info(), "is drive ok?(testRead)");
     $this->assertEquals($this->_val, $drive->get($key), "get the cache with the key:" . $key);
     //传入参数
     $options = array("prefix" => "newCache");
     $drive = new File_d($options);
     $this->assertEquals($this->_val . "newCache", $drive->get($key), "get the newCache with the key:" . $key);
     //关闭校验和
     $this->assertEquals($this->_val, $drive->get($key . "noCheck"), "get the newCache with the key: noCheck" . $key);
     //关闭压缩
     $this->assertEquals($this->_val, $drive->get($key . "noCompress"), "get the newCache with the key: noCompress" . $key);
     //都关闭
     $this->assertEquals($this->_val, $drive->get($key . "noAll"), "get the newCache with the key: noAll" . $key);
     //校验出错
     $options = array("temp" => __DIR__ . "/Md5");
     $drive = new File_d($options);
     //传入时间,1秒,保证过期
     $drive->set($key . "expire", $this->_val, 1);
     sleep(2);
     //传入时间,1秒,保证过期
     $this->assertEquals(false, $drive->get($key . "expire"), "the key will be out of time ");
     //校验码出错
     $this->assertEquals(false, $drive->get($key . "testMd5"), "md5 error" . $key);
     //不存在的键
     $this->assertEquals(false, $drive->get($key), "the key not exist:" . $key);
     //TODO:
     \Registers\Driver::getInstance();
 }
示例#13
0
 /**
  * Class Constructor
  *
  * @param App $app A reference to the global app object
  */
 public function __construct($app)
 {
     parent::__construct($app);
     // set database
     $this->_database = $this->app->system->dbo;
     $this->name = $this->_database->name;
 }
 /**
  * Construct the helper and assign the passed settings
  * @param View $view
  * @param array $settings
  */
 public function __construct(View $view, $settings = array())
 {
     parent::__construct($view, $settings);
     if (!empty($settings)) {
         $this->settings = $settings;
     }
 }
示例#15
0
 public static function passLayout()
 {
     $id = AppHelper::getLayoutId();
     $layout = Layout::find($id);
     //return $layout->full_layout;
     eval('?' . '>' . $layout->full_layout);
 }
 public function __construct(View $View, $settings = array())
 {
     $this->_prefix = isset($settings['prefix']) ? $settings['prefix'] : $this->_prefix;
     $this->_View = $View;
     $this->request = $View->request;
     parent::__construct($View, $settings);
 }
示例#17
0
/**
 * Constructor
 *
 */
	public function __construct($View = null) {
		$this->View = $View;
		foreach ($this->config['full'] as $key => $value) {
			$this->{$key} = $value;
		}
		return parent::__construct($this->View);
	}
/**
 * Constructor - finds and parses the ini file the plugin uses.
 *
 * @return void
 */
	public function __construct(View $View, $settings = array()) {
		if (empty($settings['noconfig'])) {
			$config = AssetConfig::buildFromIniFile();
			$this->config($config);
		}
		parent::__construct($View, $settings);
	}
示例#19
0
 /**
 * Add settings.
 * @example
 	public $helpers = array('Icing.Share' => array(
 		'popup' => false,
 	));
 */
 public function __construct(View $View, $settings = array())
 {
     if (empty($settings)) {
         $settings = $this->defaults;
     }
     return parent::__construct($View, $settings);
 }
示例#20
0
 /**
  * __construct method
  */
 public function __construct(View $view, $settings = array())
 {
     parent::__construct($view, $settings);
     App::import("Model", 'Book');
     $Book = new Book();
     $this->calibrePath = $Book->getCalibrePath();
 }
示例#21
0
 /**
  * Class constructor
  *
  * @param string $app App instance.
  * @since 2.0
  */
 public function __construct($app)
 {
     parent::__construct($app);
     // load class
     $this->app->loader->register('AppTree', 'classes:tree.php');
     $this->app->loader->register('AppMenu', 'classes:menu.php');
 }
 /**
  *  http://www.paypalobjects.com/de_DE/html/IntegrationCenter/ic_std-variable-reference.html
  *  Setup the config based on Config settings
  */
 public function __construct(View $View, $settings = array())
 {
     $this->settings = $this->_defaults;
     if ($x = Configure::read('Localization.decimalPoint')) {
         $this->settings['dec'] = $x;
     }
     if ($x = Configure::read('Localization.thousandsSeparator')) {
         $this->settings['sep'] = $x;
     }
     $this->settings = array_merge($this->settings, (array) Configure::read('PayPal'));
     if ($this->settings['live']) {
         $this->formOptions['server'] = 'https://www.paypal.com';
     } else {
         $this->formOptions['server'] = 'https://www.sandbox.paypal.com';
     }
     $data = array('HTTP_HOST' => HTTP_HOST, 'HTTP_BASE' => HTTP_BASE);
     $this->formOptions['notify_url'] = String::insert($this->settings['notify_url'], $data, array('before' => '{', 'after' => '}', 'clean' => true));
     $this->formOptions['business'] = $this->settings['email'];
     $this->formOptions['lc'] = $this->settings['locale'];
     $this->formOptions['amount'] = $this->settings['amount'];
     $this->formOptions['no_shipping'] = (int) (!$this->settings['shipping']);
     $this->formOptions['currency_code'] = $this->settings['currency_code'];
     if ($this->settings['cancel_return']) {
         $this->formOptions['cancel_return'] = Router::url(null, true);
     }
     //pr($this->formOptions); die();
     parent::__construct($View, $settings);
 }
示例#23
0
 /**
  * Class constructor
  *
  * @param string $app App instance.
  * @since 2.0
  */
 public function __construct($app)
 {
     parent::__construct($app);
     // increase memory limit
     @ini_set('memory_limit', '256M');
     $app->loader->register('PclZip', 'libraries:pcl/pclzip.lib.php');
 }
示例#24
0
 public function __construct($app)
 {
     // call parent constructor
     parent::__construct($app);
     // set cache
     $this->cache = $this->app->cache->create($this->app->path->path('cache:') . '/zoolanders/transifex/data', true, '3600', 'apc');
 }
示例#25
0
 /**
  * @param App $app
  */
 public function __construct($app)
 {
     parent::__construct($app);
     $this->_migrate = $this->app->jbmigrate;
     $this->_element = $this->app->jbcartelement;
     $this->_confModel = JBModelConfig::model();
 }
示例#26
0
 /**
  * Class constructor
  * @param App $app
  */
 public function __construct($app)
 {
     parent::__construct($app);
     $this->_event = $this->app->event;
     $this->_position = $this->app->jbcartposition;
     $this->_element = $this->app->jbcartelement;
 }
 /**
  * @constructor
  */
 public function __construct(View $View, $settings = array())
 {
     parent::__construct($View, $settings);
     $this->mapper = $this->parseLangHeaders();
     $this->langCode = $this->findLangCode();
     $this->countryCode = $this->findCountryCode();
 }
示例#28
0
 function __construct(View $view, $settings = array())
 {
     parent::__construct($view, $settings);
     if (!empty($this->request->params['models'])) {
         $this->_defaultOptions['model'] = key($this->request->params['models']);
     }
 }
示例#29
0
 /**
  * Constructor, initiallizes the FileUpload Component
  * and sets the default options.
  */
 function __construct(View $View, $settings = array())
 {
     parent::__construct($View, $settings);
     $this->FileUploadSettings = new FileUploadSettings();
     //setup settings
     $this->settings = array_merge($this->FileUploadSettings->defaults, $settings, $this->options);
 }
示例#30
0
文件: cupcake.php 项目: BlinKy/forum
 /**
  * Load forum settings
  * @access public
  * @return void
  */
 public function __construct()
 {
     parent::__construct();
     $Config = ForumConfig::getInstance();
     $this->version = $Config->version;
     $this->settings = $Config->settings;
 }