00001 <?php
00002
00019
00020
00021
00022 import("manager.form.setup.JournalSetupForm");
00023 import('form.Form');
00024
00025 class JournalSetupForm extends Form {
00026 var $step;
00027 var $settings;
00028
00034 function JournalSetupForm($step, $settings) {
00035 parent::Form(sprintf('manager/setup/step%d.tpl', $step));
00036 $this->addCheck(new FormValidatorPost($this));
00037 $this->step = $step;
00038 $this->settings = $settings;
00039 }
00040
00044 function display() {
00045 $templateMgr = &TemplateManager::getManager();
00046 $templateMgr->assign('setupStep', $this->step);
00047 $templateMgr->assign('helpTopicId', 'journal.managementPages.setup');
00048 $templateMgr->setCacheability(CACHEABILITY_MUST_REVALIDATE);
00049 parent::display();
00050 }
00051
00055 function initData() {
00056 $journal = &Request::getJournal();
00057 $this->_data = $journal->getSettings();
00058 }
00059
00063 function readInputData() {
00064 $this->readUserVars(array_keys($this->settings));
00065 }
00066
00070 function execute() {
00071 $journal = &Request::getJournal();
00072 $settingsDao = &DAORegistry::getDAO('JournalSettingsDAO');
00073
00074 foreach ($this->_data as $name => $value) {
00075 if (isset($this->settings[$name])) {
00076 $isLocalized = in_array($name, $this->getLocaleFieldNames());
00077 $settingsDao->updateSetting(
00078 $journal->getJournalId(),
00079 $name,
00080 $value,
00081 $this->settings[$name],
00082 $isLocalized
00083 );
00084 }
00085 }
00086 }
00087 }
00088
00089 ?>