_journalId = $journalId; $this->_plugin = $plugin; parent::__construct($plugin->getTemplatePath() . 'settingsForm.tpl'); $this->addCheck(new FormValidator($this, 'googleAnalyticsSiteId', 'required', 'plugins.generic.googleAnalytics.manager.settings.googleAnalyticsSiteIdRequired')); $this->addCheck(new FormValidatorPost($this)); $this->addCheck(new FormValidatorCSRF($this)); } /** * Initialize form data. */ function initData() { $this->_data = array( 'googleAnalyticsSiteId' => $this->_plugin->getSetting($this->_journalId, 'googleAnalyticsSiteId'), ); } /** * Assign form data to user-submitted data. */ function readInputData() { $this->readUserVars(array('googleAnalyticsSiteId')); } /** * Fetch the form. * @copydoc Form::fetch() */ function fetch($request) { $templateMgr = TemplateManager::getManager($request); $templateMgr->assign('pluginName', $this->_plugin->getName()); return parent::fetch($request); } /** * Save settings. */ function execute() { $this->_plugin->updateSetting($this->_journalId, 'googleAnalyticsSiteId', trim($this->getData('googleAnalyticsSiteId'), "\"\';"), 'string'); } } ?>