diff options
author | matthieu_ <matthieu_@59fd770c-687e-43c8-a1e3-f5a4ff64c105> | 2007-09-20 17:23:44 +0400 |
---|---|---|
committer | matthieu_ <matthieu_@59fd770c-687e-43c8-a1e3-f5a4ff64c105> | 2007-09-20 17:23:44 +0400 |
commit | 9826a7b5b070707242ee4c055ac127daae27e207 (patch) | |
tree | 515a13ebce62ef8af5cb9dd342ed4c2db4063176 /plugins/Installation/FormDatabaseSetup.php | |
parent | 3e7db635b03fbb124f1aa766e6aaa7b524869c5c (diff) |
Implemented the Installation process
needs testing :-)
Diffstat (limited to 'plugins/Installation/FormDatabaseSetup.php')
-rw-r--r-- | plugins/Installation/FormDatabaseSetup.php | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/plugins/Installation/FormDatabaseSetup.php b/plugins/Installation/FormDatabaseSetup.php new file mode 100644 index 0000000000..2f3c15e693 --- /dev/null +++ b/plugins/Installation/FormDatabaseSetup.php @@ -0,0 +1,30 @@ +<?php +require_once "modules/Form.php"; +class Piwik_Installation_FormDatabaseSetup extends Piwik_Form +{ + function init() + { + $urlToGoAfter = Piwik_Url::getCurrentUrl(); + + $formElements = array( + array('text', 'host', 'mysql server', 'value='.'localhost'), + array('text', 'username', 'login'), + array('password', 'password', 'password'), + array('text', 'dbname', 'database name'), + array('text', 'tables_prefix', 'table prefix', 'value='.'piwik_'), + ); + $this->addElements( $formElements ); + + $formRules = array(); + foreach($formElements as $row) + { + if($row[1] != 'password') + { + $formRules[] = array($row[1], sprintf('%s required', $row[2]), 'required'); + } + } + $this->addRules( $formRules ); + + $this->addElement('submit', 'submit', 'Go!'); + } +} |