Commit info for scoop/lib/Scoop/Admin:
Modified Files:
Special.pm
Log Message:
panner's fix for bug 9, Delete special pages
-janra
Index: Special.pm
===================================================================
RCS file: /cvs/scoop/scoop/lib/Scoop/Admin/Special.pm,v
retrieving revision 1.11
retrieving revision 1.12
diff -r1.11 -r1.12
17a18
> my $delete = $S->{CGI}->param('delete');
20c21
<
---
>
28c29
<
---
>
31c32
<
---
>
36,37c37,38
<
< if ($id) {
---
>
> if ($id && !$delete) {
60c61,68
< </tr>
---
> </tr>|;
> if ($id && !$delete) {
> $page .= qq|
> <tr>
> <td>%%norm_font%%<input type="checkbox" name="delete" value="1" /> Delete this page%%norm_font_end%%</td>
> </tr>|;
> }
> $page .= qq|
134c142
<
---
>
136c144
<
---
>
144a153,164
> my $q_id = $S->{DBH}->quote($pageid);
> # get this out of the way first, since it doesn't depend on anything else
> if ($S->{CGI}->param('delete') && $id) {
> my ($rv, $sth) = $S->db_delete({
> FROM => 'special',
> WHERE => "pageid = $q_id"
> });
> $sth->finish;
>
> return "Page \"$title\" deleted.";
> }
>
201c221,223
<
---
> my $q_title = $S->{DBH}->quote($title);
> my $q_desc = $S->{DBH}->quote($description);
>
206,207c228,229
< SET => qq|title = "$title", description = "$description", content = $write_cont|,
< WHERE => qq|pageid = "$pageid"|});
---
> SET => qq|title = $q_title, description = $q_desc, content = $write_cont|,
> WHERE => qq|pageid = $q_id|});
212c234
< VALUES => qq|"$pageid", "$title", "$description", $write_cont|});
---
> VALUES => qq|$q_id, $q_title, $q_desc, $write_cont|});
215c237
<
---
>