public function __construct(ComponentCollection $collection, $settings = array()) { $configSettings = (array) Configure::read('PaymentNetwork'); $settings = array_merge($this->settings, $configSettings, (array) $settings); $this->Controller = $collection->getController(); parent::__construct($collection, $settings); }
public function __construct(ComponentCollection $collection, $settings = array()) { $settings = array_merge($this->settings, (array) $settings); $this->Controller = $collection->getController(); parent::__construct($collection, $settings); $this->init(); }
public function __construct(ComponentCollection $collection, $settings = array()) { //$settings = array_merge($this->settings, (array)$settings); $this->FormalWord = ClassRegistry::init('FormalWord'); $this->Controller = $collection->getController(); parent::__construct($collection, $settings); }
public function __construct(ComponentCollection $Collection, $settings = array()) { $settings = array_merge($this->settings, (array) $settings, (array) Configure::read('Auth')); $this->Controller = $Collection->getController(); parent::__construct($Collection, $settings); # auto-select multi if necessary if ($this->settings['multi'] === null) { $Model = $this->getModel(); if (!empty($Model->hasMany)) { foreach ($Model->hasMany as $name => $relation) { if ($name != $this->roleModel) { continue; } $this->settings['multi'] = false; return; } } $Model = $this->getModel(); if (!empty($Model->hasAndBelongsToMany)) { foreach ($Model->hasAndBelongsToMany as $name => $relation) { if ($name != $this->roleModel) { continue; } $this->settings['multi'] = true; return; } } //$this->log('AuthExt component not configured properly (auto select multi failed)'); } }
/** * Constructor * * @param ComponentCollection $collection The controller for this request. * @param string $settings An array of settings. This class does not use any settings. */ public function __construct(ComponentCollection $collection, $settings = array()) { $this->_Collection = $collection; $controller = $collection->getController(); $this->controller($controller); $this->settings = Hash::merge($this->settings, $settings); }
public function __construct(ComponentCollection $collection, $settings = array()) { $settings = array_merge($this->settings, (array) $settings); $this->Controller = $collection->getController(); $this->Model = $this->Controller->{$this->Controller->modelClass}; $this->modelAlias = $this->Model->alias; parent::__construct($collection, $settings); }
/** * Constructor * * @author Anthony Putignano <*****@*****.**> * @author Everton Yoshitani <*****@*****.**> * @since 0.1 * @param ComponentCollection $collection The Component collection used on this request. * @param array $settings Array of settings to use. * @return void */ public function __construct(ComponentCollection $Collection, $settings = array()) { $this->Controller = $Collection->getController(); $this->settings = Hash::merge($this->settings, $settings); // This needs to be called here instead in the top of this file App::uses('OAuth2Component', 'OAuth2.Controller' . DS . 'Component'); $this->OAuth2Component = new OAuth2Component($Collection, $this->settings); $this->OAuth2Component->initialize($this->Controller); }
/** * Overrides base class constructor, sets properties and merges supplied user settings. */ public function __construct(ComponentCollection $collection, $settings = array()) { $settings = am($this->defaults, $settings); $this->_parseSettings($settings); $this->controller = $collection->getController(); $this->request = $this->controller->request; $this->_setupControllersPaths(); parent::__construct($collection, $settings); }
public function __construct(ComponentCollection $collection, $settings = array()) { $this->Controller = $collection->getController(); $defaults = array('redirect' => array('add' => array(array($this, 'redirect'), array(array('action' => 'index'))), 'edit' => array(array($this, 'redirect'), array(array('action' => 'index'))), 'delete' => array(array($this, 'redirect'), array(array('action' => 'index'))))); $settings = Hash::merge($defaults, $settings); // configure. $this->_set($settings); parent::__construct($collection, $settings); }
/** * Setup settings * * @param ComponentCollection $collection * @param array $settings [optional] */ public function __construct(ComponentCollection $collection, $settings = array()) { $this->__controller = $collection->getController(); parent::__construct($collection, $settings); //setup settings $this->__setupSettings($settings); //setup error message $this->__errorMsg = __d('cloggy', 'An error has detected'); }
public function __construct(ComponentCollection $collection, $settings = array()) { $settings = array_merge($this->settings, (array) $settings); $this->Controller = $collection->getController(); $this->CleanTweet = ClassRegistry::init('CleanTweet'); $this->CleanRepository = ClassRegistry::init('CleanRepository'); $this->dir = new Folder(WWW_ROOT . 'files', true, 0755); $this->filetraining = new File(WWW_ROOT . 'files/jan.train', true, 0644); $this->filetesting = new File(WWW_ROOT . 'files/jan.test', true, 0644); parent::__construct($collection, $settings); }
/** * Constructor * * @param ComponentCollection $collection * @param array $settings * @return void */ public function __construct(ComponentCollection $collection, $settings = array()) { $settings = array_merge($this->settings, (array) $settings); $this->Controller = $collection->getController(); if (isset($settings['helper']) and $settings['helper'] !== false) { $this->Controller->helpers['Search'] = array('prefix' => $this->_prefix); } // <-- Cargar helper Search $this->setRequest($this->configs); parent::__construct($collection, $settings); }
/** * Constructor * * @param object Controller object */ public function __construct(ComponentCollection $collection, $settings) { $this->controller = $collection->getController(); $this->_defaults = Set::merge($this->_defaults, $settings); # fix for not throwing warning if (!isset($this->controller->presetVars)) { $this->controller->presetVars = array(); } $model = $this->controller->modelClass; if (!empty($settings['model'])) { $model = $settings['model']; } if ($this->controller->presetVars === true) { // auto-set the presetVars based on search defitions in model $this->controller->presetVars = array(); $filterArgs = $this->controller->{$model}->filterArgs; foreach ($filterArgs as $key => $arg) { if ($var = $this->_parseFromModel($arg, $key)) { $this->controller->presetVars[] = $var; } } } foreach ($this->controller->presetVars as $key => $field) { if ($field === true) { if (isset($this->controller->{$model}->filterArgs[$key])) { $field = $this->_parseFromModel($this->controller->{$model}->filterArgs[$key], $key); } else { $field = array('type' => 'value'); } } if (!isset($field['field'])) { $field['field'] = $key; } $this->controller->presetVars[$key] = $field; } }
/** * Public constructor for the SassComponent * * @param ComponentCollection $collection * @param array $settings */ public function __construct(ComponentCollection $collection, $settings = array()) { $this->controller = $collection->getController(); $settings = array_merge($settings, (array) Configure::read('SassCompiler')); parent::__construct($collection, array_merge($this->settings, (array) $settings)); // Don't execute the component if the debuglevel is 0 // unless compileSass requestparameter is supplied // if autoRun is true then ALWAYS run the component if (!Configure::read('debug') && !isset($this->controller->request->query['forceSassToCompile']) && false === $this->settings['autoRun']) { $this->enabled = false; return false; } if (isset($this->controller->request->query['forceSassToCompile'])) { $this->settings['forceCompiling'] = true; } $this->_checkVersion(); $this->cacheKey .= $this->Session->read('Config.userAgent'); $this->_createCacheConfig(); $this->_setFolders(); }
/** * Constructor * * @param ComponentCollection $collection A ComponentCollection this component can use to lazy load its components * @param array $settings Array of configuration settings. */ public function __construct(ComponentCollection $collection, $settings = array()) { $settings = array_merge(array('page' => 1, 'limit' => 20), (array) $settings); $this->Controller = $collection->getController(); parent::__construct($collection, $settings); }
/** * Constructor * * @param ComponentCollection $collection instance for the ComponentCollection * @param array $settings Settings to set to the component * @return void */ public function __construct(ComponentCollection $collection, $settings = array()) { // set default $this->messages = array('invalid' => __d('transition', 'Input Data was not able to pass validation. Please, try again.', true), 'prev' => __d('transition', 'Session timed out.', true)); // configure. $this->_set($settings); $this->Controller = $collection->getController(); parent::__construct($collection, $settings); }
/** * Constructor * * If debug is off the component will be disabled and not do any further time tracking * or load the toolbar helper. * * @return bool **/ public function __construct(ComponentCollection $collection, $settings = array()) { $panels = $this->_defaultPanels; if (isset($settings['panels'])) { $panels = $this->_makePanelList($settings['panels']); unset($settings['panels']); } $this->controller = $collection->getController(); parent::__construct($collection, array_merge($this->settings, (array)$settings)); if (!Configure::read('debug') && empty($this->settings['forceEnable'])) { $this->enabled = false; return false; } if ($this->settings['autoRun'] == false && !isset($this->controller->request->query['debug'])) { $this->enabled = false; return false; } App::uses('DebugKitDebugger', 'DebugKit.Lib'); DebugKitDebugger::setMemoryPoint(__d('debug_kit', 'Component initialization')); DebugKitDebugger::startTimer('componentInit', __d('debug_kit', 'Component initialization and startup')); $this->cacheKey .= $this->Session->read('Config.userAgent'); if (in_array('history', $panels) || (isset($settings['history']) && $settings['history'] !== false)) { $this->_createCacheConfig(); } $this->_loadPanels($panels, $settings); return false; }
/** * Constructor * * If debug is off the component will be disabled and not do any further time tracking * or load the toolbar helper. * * @param ComponentCollection $collection * @param array $settings * @return \ToolbarComponent */ public function __construct(ComponentCollection $collection, $settings = array()) { $settings = array_merge((array) Configure::read('DebugKit'), $settings); $panels = $this->_defaultPanels; if (isset($settings['panels'])) { $panels = $this->_makePanelList($settings['panels']); unset($settings['panels']); } $this->controller = $collection->getController(); parent::__construct($collection, array_merge($this->settings, (array) $settings)); if (!Configure::read('debug') && empty($this->settings['forceEnable'])) { $this->enabled = false; return false; } if ($this->settings['autoRun'] === false && !isset($this->controller->request->query['debug'])) { $this->enabled = false; return false; } $this->controller->getEventManager()->attach($this); DebugMemory::record(__d('debug_kit', 'Component initialization')); $this->cacheKey .= $this->Session->read('Config.userAgent'); if (in_array('DebugKit.History', $panels) || isset($settings['history']) && $settings['history'] !== false) { $this->_createCacheConfig(); } $this->_loadPanels($panels, $settings); return false; }
/** * Constructor * * @param object Controller object */ public function __construct(ComponentCollection $collection, $settings) { $this->controller = $collection->getController(); $this->_defaults = Set::merge($this->_defaults, $settings); }
public function __construct(\ComponentCollection $collection, $settings = array()) { $this->settings['Apis'] = $collection->getController()->Apis; parent::__construct($collection, $settings); }
public function __construct(ComponentCollection $collection, $settings) { $this->controller = $collection->getController(); $this->model = $this->controller->modelClass; }
public function __construct(ComponentCollection $collection, $settings = array()) { //$this->System_Inc = ClassRegistry::init('System_Inc'); $this->Controller = $collection->getController(); parent::__construct($collection, $settings); }
/** * Constructor * * @param ComponentCollection $collection A ComponentCollection this component can use to lazy load its components * @param array $settings Array of configuration settings. */ public function __construct(ComponentCollection $collection, $settings = array()) { $this->_controller = $collection->getController(); parent::__construct($collection, $settings); }
/** * Initialize component * * @param Object $controller reference to controller * @access Public */ public function __construct(ComponentCollection $collection, $settings = array()) { $this->_controller = $collection->getController(); if (defined('__SYSTEM_SMTP')) { extract(unserialize(__SYSTEM_SMTP)); $smtp = base64_decode($smtp); $smtp = Security::cipher($smtp, Configure::read('Security.salt')); if (@($smtp = parse_ini_string($smtp))) { $this->smtpUsername = !empty($smtp['smtpUsername']) ? $smtp['smtpUsername'] : $this->smtpUsername; $this->smtpPassword = !empty($smtp['smtpPassword']) ? $smtp['smtpPassword'] : $this->smtpPassword; $this->smtpHost = !empty($smtp['smtpHost']) ? $smtp['smtpHost'] : $this->smtpHost; $this->smtpPort = !empty($smtp['smtpPort']) ? $smtp['smtpPort'] : $this->smtpPort; $this->from = !empty($smtp['from']) ? $smtp['from'] : $this->from; $this->fromName = !empty($smtp['fromName']) ? $smtp['fromName'] : $this->fromName; // debug($this->smtpUsername); // debug($this->smtpPassword); // debug($this->smtpHost); // debug($this->smtpPort); // debug($this->from); // debug($this->fromName); // exit; } else { return false; } } else { return false; } parent::__construct($collection, $settings); }