[Rt-commit] r11101 - rt/branches/3.8-TESTING/html/Install
ruz at bestpractical.com
ruz at bestpractical.com
Tue Mar 18 11:05:34 EDT 2008
Author: ruz
Date: Tue Mar 18 11:05:34 2008
New Revision: 11101
Added:
rt/branches/3.8-TESTING/html/Install/
rt/branches/3.8-TESTING/html/Install/index.html
Log:
* add proto of web installer
Added: rt/branches/3.8-TESTING/html/Install/index.html
==============================================================================
--- (empty file)
+++ rt/branches/3.8-TESTING/html/Install/index.html Tue Mar 18 11:05:34 2008
@@ -0,0 +1,101 @@
+Hello, looks like it's new intallation of RT.
+
+We're going to bla-bla... intstall RT
+
+<form method="post">
+% for ( my $i = 0; $i < @db_options; $i += 2 ) {
+% my $option = $db_options[$i];
+% my $meta = $db_options[$i+1];
+<& $meta->{'Widget'},
+ Default => 0,
+ %{ $meta->{'WidgetArguments'} },
+ Name => $option,
+ CurrentValue => scalar RT->Config->Get( $option ),
+&>
+% }
+
+<& /Elements/Submit, Name => 'DatabaseCreate', Label => loc('Create database') &>
+
+</form>
+
+<%FLAGS>
+inherit => undef
+</%FLAGS>
+<%ARGS>
+</%ARGS>
+<%INIT>
+my @db_options = (
+ DatabaseType => {
+ Section => 'Database', #loc
+ Widget => '/Widgets/Form/Select',
+ WidgetArguments => {
+ Description => 'Type of the database where RT will store its data', #loc
+ Values => [qw(mysql Pg Oracle SQLite)],
+ ValuesLabel => {
+ mysql => 'MySQL', #loc
+ Pg => 'PostgreSQL', #loc
+ Oracle => 'Oracle', #loc
+ SQLite => 'SQLite (for experiments and development only)', #loc
+ },
+ },
+ },
+ DatabaseHost => {
+ Section => 'Database', #loc
+ Widget => '/Widgets/Form/String',
+ WidgetArguments => {
+ Description => 'The domain name of your database server', #loc
+ },
+ },
+ DatabasePort => {
+ Section => 'Database', #loc
+ Widget => '/Widgets/Form/Integer',
+ WidgetArguments => {
+ Description => 'Port number database server listen to', #loc
+ Default => 1,
+ DefaultLabel => 'Leave empty to use default value of the RDBMS', #loc
+ },
+ },
+ DatabaseName => {
+ Section => 'Database', #loc
+ Widget => '/Widgets/Form/String',
+ WidgetArguments => {
+ Description => 'Name of the database', #loc
+ },
+ },
+ DatabaseUser => {
+ Section => 'Database', #loc
+ Widget => '/Widgets/Form/String',
+ WidgetArguments => {
+ Description => 'The name of the user RT will use to connect to the DB', #loc
+ },
+ },
+ DatabasePassword => {
+ Section => 'Database', #loc
+ Widget => '/Widgets/Form/String',
+ WidgetArguments => {
+ Description => 'Password for the above user RT will use to connect to the DB', #loc
+ },
+ },
+);
+
+
+if ( $ARGS{'DatabaseCreate'} ) {
+ my %config = ();
+ for ( my $i = 0; $i < @db_options; $i += 2 ) {
+ my $option = $db_options[$i];
+ my $meta = $db_options[$i+1];
+ my $value = $m->comp( $meta->{'Widget'} .':Process',
+ Arguments => \%ARGS,
+ Default => 0,
+ %{ $meta->{'WidgetArguments'} },
+ Name => $option,
+ CurrentValue => scalar RT->Config->Get( $option ),
+ );
+ $config{ $option } = $value;
+ $config{ $option } = scalar RT->Config->Get( $option )
+ if !defined $value && $meta->{'WidgetArguments'}{'Default'};
+ }
+ use Data::Dumper;
+ warn(Dumper(\%config));
+}
+</%INIT>
More information about the Rt-commit
mailing list