journalId = $journalId; $this->plugin =& $plugin; parent::Form($plugin->getTemplatePath() . 'settingsForm.tpl'); $this->addCheck(new FormValidatorUrl($this, 'phpmvUrl', 'required', 'plugins.generic.phpmv.manager.settings.phpmvUrlRequired')); $this->addCheck(new FormValidator($this, 'phpmvSiteId', 'required', 'plugins.generic.phpmv.manager.settings.phpmvSiteIdRequired')); } /** * Initialize form data. */ function initData() { $journalId = $this->journalId; $plugin =& $this->plugin; $this->_data = array( 'phpmvUrl' => $plugin->getSetting($journalId, 'phpmvUrl'), 'phpmvSiteId' => $plugin->getSetting($journalId, 'phpmvSiteId') ); } /** * Assign form data to user-submitted data. */ function readInputData() { $this->readUserVars(array('phpmvUrl', 'phpmvSiteId')); } /** * Save settings. */ function execute() { $plugin =& $this->plugin; $journalId = $this->journalId; $plugin->updateSetting($journalId, 'phpmvUrl', rtrim($this->getData('phpmvUrl'), "/"), 'string'); $plugin->updateSetting($journalId, 'phpmvSiteId', $this->getData('phpmvSiteId'), 'int'); } } ?>