journalId = $journalId; $this->plugin =& $plugin; parent::Form($plugin->getTemplatePath() . 'settingsForm.tpl'); $this->addCheck(new FormValidatorPost($this)); } /** * Initialize form data. */ function initData() { $journalId = $this->journalId; $plugin =& $this->plugin; $this->setData('apiKey', $plugin->getSetting($journalId, 'apiKey')); $this->setData('depositArticles', $plugin->getSetting(CONTEXT_ID_NONE, 'depositArticles')); $this->setData('depositUrl', $plugin->getSetting(CONTEXT_ID_NONE, 'depositUrl')); } /** * Assign form data to user-submitted data. */ function readInputData() { $this->readUserVars(array('apiKey', 'depositArticles', 'depositUrl')); } /** * Save settings. */ function execute() { $plugin =& $this->plugin; $journalId = $this->journalId; $plugin->updateSetting($journalId, 'apiKey', $this->getData('apiKey')); $plugin->updateSetting(CONTEXT_ID_NONE, 'depositArticles', $this->getData('depositArticles')); $plugin->updateSetting(CONTEXT_ID_NONE, 'depositUrl', $this->getData('depositUrl')); } } ?>