More work on the form.
[pivip.git] / project / modules / install / controllers / InstallController.php
blob5d0e0b8edeffb8e2b7faaa19d867df01682cb228
1 <?php
3 /**
4 * Pivip
5 * Copyright (C) 2008 Vincent Tunru
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; version 2
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
20 * @license http://www.fsf.org/licensing/licenses/info/GPLv2.html GPL v.2
21 * @category PivipModulesDefault
22 * @package Module_Install
23 * @subpackage Controllers
24 * @copyright (C) 2008 Vincent Tunru
25 * @author Vincent Tunru <email@vincentt.org>
28 /**
29 * Manage the installation
31 class Install_InstallController extends Pivip_Controller_Module_Abstract
33 /**
34 * Manage the installation
36 public function indexAction()
38 $dbName = new Zend_Form_Element_Text('dbname');
39 $dbName->setLabel('Database name');
40 $dbUser = new Zend_Form_Element_Text('username');
41 $dbUser->setLabel('Username')
42 ->setRequired(true);
43 $dbPassword = new Zend_Form_Element_Password('password');
44 $dbPassword->setLabel('Password')
45 ->setRequired(true);
46 $form = new Zend_Form();
47 $form->setAction('/')
48 ->setMethod('post')
49 ->setAttrib('id', 'generalSettings')
50 ->setAttrib('class', 'install')
51 ->addElement($dbName)
52 ->addElement($dbUser)
53 ->addElement($dbPassword)
54 ->addDisplayGroup(array('dbname', 'username', 'password'), 'db')
55 ->db->setLegend('Inloggegevens database');
56 $siteName = new Zend_Form_Element_Text('sitename');
57 $siteName->setLabel('Site name')
58 ->setRequired(true)
59 ->addFilter('HtmlEntities');
60 $form->addElement($siteName)
61 ->addDisplayGroup(array('sitename'), 'site');
62 $submit = new Zend_Form_Element_Submit('s');
63 $submit->setValue('Next step');
64 $form->addElement($submit);
65 $this->view->form = $form;