/** * The constructor. * * @param array $configuration * TS setup configuration, may be empty */ public function __construct(array $configuration) { // Calls the base class' constructor manually as this isn't done // automatically. parent::__construct(); $this->conf = $configuration; $this->pi_setPiVarDefaults(); $this->pi_loadLL(); }
/** * Initializes the FE plugin stuff and reads the configuration. * * It is harmless if this function gets called multiple times as it * recognizes this and ignores all calls but the first one. * * This is merely a convenience function. * * If the parameter is omitted, the configuration for plugin.tx_[extkey] is * used instead, e.g. plugin.tx_seminars. * * @param array|NULL $configuration TypoScript configuration for the plugin, set to NULL to load the configuration from a BE page * * @return void */ public function init(array $configuration = NULL) { if ($this->isInitialized) { return; } $frontEnd = $this->getFrontEndController(); if ($frontEnd !== NULL && !isset($frontEnd->config['config'])) { $frontEnd->config['config'] = array(); } // Calls the base class's constructor manually as this isn't done automatically. parent::__construct(); if ($configuration !== NULL) { $this->conf = $configuration; } else { $pageId = $this->getCurrentBePageId(); if (isset(self::$cachedConfigurations[$pageId])) { $this->conf = self::$cachedConfigurations[$pageId]; } else { // We need to create our own template setup if we are in the // BE and we aren't currently creating a DirectMail page. if (TYPO3_MODE === 'BE' && $frontEnd === NULL) { $this->conf = $this->retrievePageConfig($pageId); } else { // On the front end, we can use the provided template setup. $this->conf = $frontEnd->tmpl->setup['plugin.']['tx_' . $this->extKey . '.']; } self::$cachedConfigurations[$pageId] = $this->conf; } } $this->ensureContentObject(); $this->pi_setPiVarDefaults(); $this->pi_loadLL(); if ($this->extKey !== '' && Tx_Oelib_ConfigurationProxy::getInstance($this->extKey)->getAsBoolean('enableConfigCheck')) { $configurationCheckClassName = 'tx_' . $this->extKey . '_configcheck'; if (class_exists($configurationCheckClassName, TRUE)) { $this->configurationCheck = t3lib_div::makeInstance($configurationCheckClassName, $this); } } $this->isInitialized = TRUE; }