| Jifty documentation | Contained in the Jifty distribution. |
Jifty::Plugin::SetupWizard - make it easy for end-users to set up your app
http://your.app/__jifty/admin/setupwizard
Add the following to your site_config.yml
framework:
Plugins:
- SetupWizard: {}
Sets up a post_init hook.
Adds another step to the setup wizard. It will go at the end, but before the "finalize" step if it exists.
This plugin depends on Jifty::Plugin::Config.
Copyright 2007-2010 Best Practical Solutions
This is free software and may be modified and distributed under the same terms as Perl itself.
| Jifty documentation | Contained in the Jifty distribution. |
package Jifty::Plugin::SetupWizard; use strict; use warnings; use base 'Jifty::Plugin'; __PACKAGE__->mk_accessors(qw(steps)); sub prereq_plugins { 'Config' } sub init { my $self = shift; return if $self->_pre_init; my %opt = @_; if ($opt{steps}) { $self->steps($opt{steps}); } else { $self->steps([ { template => 'welcome', header => 'Welcome', hide_button => 1, }, # Not sure this is worth doing quite yet. # { # template => 'language', # header => 'Choose a Language', # }, { template => 'database', header => 'Database', }, { template => 'web', header => 'Web', }, { template => 'finalize', header => 'Finalize', hide_button => 1, }, ]); } for my $step (@{ $opt{add_steps} || [] }) { $self->add_step(%$step); } } sub add_step { my $self = shift; my %step = @_; # Keep finalize at the end if ($self->steps->[-1]->{template} eq 'finalize') { splice @{ $self->steps }, -1, 0, \%step; } else { push @{ $self->steps }, \%step; } } 1; __END__