delete @{$change->{pages}}[10 .. @{$change->{pages}}] if $is_excess;
$change->{pages} = [
map {
- $_->{link} = htmllink("", "", $_->{page}, 1, 0, pagetitle($_->{page}));
+ $_->{link} = htmllink("", "", $_->{page},
+ noimageinline => 1,
+ linktext => pagetitle($_->{page}));
$_;
} @{$change->{pages}}
];
$form->field(name => "do", type => "hidden");
$form->field(name => "email", size => 50);
$form->field(name => "subscriptions", size => 50,
- comment => "(".htmllink("", "", "PageSpec", 1).")");
+ comment => "(".htmllink("", "", "PageSpec", noimageinline => 1).")");
$form->field(name => "banned_users", size => 50);
my $user_name=$session->param("name");
elsif ($form->submitted eq 'Save Preferences' && $form->validate) {
foreach my $field (qw(email subscriptions)) {
if (defined $form->field($field) && length $form->field($field)) {
- userinfo_set($user_name, $field, $form->field($field)) || error("failed to set $field");
+ userinfo_set($user_name, $field, $form->field($field)) ||
+ error("failed to set $field");
}
}
if (is_admin($user_name)) {
set_banned_users(grep { ! is_admin($_) }
- split(' ', $form->field("banned_users")));
+ split(' ',
+ $form->field("banned_users"))) ||
+ error("failed saving changes");
}
$form->text(gettext("Preferences saved."));
}
if (exists $pagesources{$page}) {
$file=$pagesources{$page};
$type=pagetype($file);
+ if (! defined $type) {
+ error(sprintf(gettext("%s is not an editable page"), $page));
+ }
}
else {
$type=$form->param('type');
$form->tmpl_param("can_commit", $config{rcs});
$form->tmpl_param("indexlink", indexlink());
$form->tmpl_param("helponformattinglink",
- htmllink("", "", "HelpOnFormatting", 1));
+ htmllink("", "", "HelpOnFormatting", noimageinline => 1));
$form->tmpl_param("baseurl", baseurl());
if (! $form->submitted) {
$form->field(name => "rcsinfo", value => rcs_prepedit($file),
$content=~s/\r\n/\n/g;
$content=~s/\r/\n/g;
- writefile($file, $config{srcdir}, $content);
+
+ $config{cgi}=0; # avoid cgi error message
+ eval { writefile($file, $config{srcdir}, $content) };
+ $config{cgi}=1;
+ if ($@) {
+ $form->field(name => "rcsinfo", value => rcs_prepedit($file),
+ force => 1);
+ $form->tmpl_param("failed_save", 1);
+ $form->tmpl_param("error_message", $@);
+ $form->field("editcontent", value => $content, force => 1);
+ $form->field(name => "comments", value => $form->field('comments'), force => 1);
+ $form->field("do", "edit)");
+ $form->tmpl_param("page_select", 0);
+ $form->field(name => "page", type => 'hidden');
+ $form->field(name => "type", type => 'hidden');
+ $form->title(sprintf(gettext("editing %s"), $page));
+ print $form->render(submit => \@buttons);
+ return;
+ }
if ($config{rcs}) {
my $message="";
email => "",
password => "",
regdate => time,
- });
+ }) || error("failed adding user");
}
}
}
else {
return htmllink("", "", escapeHTML(
length $config{userdir} ? $config{userdir}."/".$user : $user
- ), 1);
+ ), noimageinline => 1);
}
} #}}}