Ok, I've been trying to modify add.pm to allow the multiple pages to work, but I'm missing something. I've modified as follows:
sub handle {
# -------------------------------------------------------------------
# Display either an add form or process an add request.
#
if ($CFG->{user_required} and ! $USER) {
print $IN->redirect( Links::redirect_login_url ('add') );
return;
}
# We are processing an add request.
if ($IN->param('pg1')) {
my $results = GT::Plugins->dispatch ($CFG->{admin_root_path} . '/Plugins', 'user_add_link', \&add_link, {});
if (defined $results->{error}) {
print $IN->header();
print Links::SiteHTML::display ('pg2', $results);
}
}
if ($IN->param('pg2')) {
my $results = GT::Plugins->dispatch ($CFG->{admin_root_path} . '/Plugins', 'user_add_link', \&add_link, {});
if (defined $results->{error}) {
print $IN->header();
print Links::SiteHTML::display ('pg3', $results);
}
}
......and of course the rest goes on for several more pages like above
Of course I'm including pg1.html in the add.cgi template directory. If I separate the basic fields, ie Title, URL, etc.. and use several pages like this, it works but reports the error of not being able to submit without "whatever" and continues to scroll through. If I set it up with all of the basic fields on the first page, it reverts back to page 1 after hitting submit and its added to the database.
The additional pages I've included hidden fields to record the values as they are passed along, but I'm getting no where reall fast right now.
Thanks for any info,
Perl Hopefull
Code:
sub handle {
# -------------------------------------------------------------------
# Display either an add form or process an add request.
#
if ($CFG->{user_required} and ! $USER) {
print $IN->redirect( Links::redirect_login_url ('add') );
return;
}
# We are processing an add request.
if ($IN->param('pg1')) {
my $results = GT::Plugins->dispatch ($CFG->{admin_root_path} . '/Plugins', 'user_add_link', \&add_link, {});
if (defined $results->{error}) {
print $IN->header();
print Links::SiteHTML::display ('pg2', $results);
}
}
if ($IN->param('pg2')) {
my $results = GT::Plugins->dispatch ($CFG->{admin_root_path} . '/Plugins', 'user_add_link', \&add_link, {});
if (defined $results->{error}) {
print $IN->header();
print Links::SiteHTML::display ('pg3', $results);
}
}
......and of course the rest goes on for several more pages like above
Of course I'm including pg1.html in the add.cgi template directory. If I separate the basic fields, ie Title, URL, etc.. and use several pages like this, it works but reports the error of not being able to submit without "whatever" and continues to scroll through. If I set it up with all of the basic fields on the first page, it reverts back to page 1 after hitting submit and its added to the database.
The additional pages I've included hidden fields to record the values as they are passed along, but I'm getting no where reall fast right now.
Thanks for any info,
Perl Hopefull