4 * @defgroup manager_form_setup
8 * @file classes/manager/form/setup/PressSetupForm.inc.php
10 * Copyright (c) 2003-2008 John Willinsky
11 * Distributed under the GNU GPL v2. For full terms see the file docs/COPYING.
13 * @class PressSetupForm
14 * @ingroup manager_form_setup
16 * @brief Base class for press setup forms.
19 // $Id: PressSetupForm.inc.php,v 1.3 2009/03/09 22:43:19 tylerl Exp $
22 import('ui.grid.Grid');
24 class PressSetupForm
extends Form
{
30 * @param $step the step number
31 * @param $settings an associative array with the setting names as keys and associated types as values
33 function PressSetupForm($step, $settings) {
34 parent
::Form(sprintf('manager/setup/step%d.tpl', $step));
35 $this->addCheck(new FormValidatorPost($this));
37 $this->settings
= $settings;
44 $templateMgr =& TemplateManager
::getManager();
45 $templateMgr->assign('setupStep', $this->step
);
46 $templateMgr->assign('helpTopicId', 'press.managementPages.setup');
47 $templateMgr->setCacheability(CACHEABILITY_MUST_REVALIDATE
);
50 Locale
::requireComponents(array(LOCALE_COMPONENT_PKP_GRID
));
55 * Initialize data from current settings.
58 $press =& Request
::getPress();
59 $this->_data
= $press->getSettings();
65 function readInputData() {
66 $this->readUserVars(array_keys($this->settings
));
70 * Save modified settings.
73 $press =& Request
::getPress();
74 $settingsDao =& DAORegistry
::getDAO('PressSettingsDAO');
76 foreach ($this->_data
as $name => $value) {
77 if (isset($this->settings
[$name])) {
78 $isLocalized = in_array($name, $this->getLocaleFieldNames());
79 $settingsDao->updateSetting(
83 $this->settings
[$name],