addCheck(new FormValidatorPost($this)); $this->step = $step; $this->settings = $settings; } /** * Display the form. */ function display($request, $dispatcher) { $templateMgr =& TemplateManager::getManager(); $templateMgr->assign('setupStep', $this->step); $templateMgr->assign('helpTopicId', 'journal.managementPages.setup'); $templateMgr->setCacheability(CACHEABILITY_MUST_REVALIDATE); parent::display(); } /** * Initialize data from current settings. */ function initData() { $journal =& Request::getJournal(); $this->_data = $journal->getSettings(); } /** * Read user input. */ function readInputData() { $this->readUserVars(array_keys($this->settings)); } /** * Save modified settings. */ function execute() { $journal =& Request::getJournal(); $settingsDao =& DAORegistry::getDAO('JournalSettingsDAO'); foreach ($this->_data as $name => $value) { if (isset($this->settings[$name])) { $isLocalized = in_array($name, $this->getLocaleFieldNames()); $settingsDao->updateSetting( $journal->getId(), $name, $value, $this->settings[$name], $isLocalized ); } } } } ?>