[comment] ui_template: Yes ui_template_name: noleft [/comment] [tmp page_title]__COMPANY__ -- [L]Edit Page Content[/L][/tmp] [set bounce_error][/set] [set bounce_success][/set] [set pagename][/set] [set pagedata][/set] [if !scratch dealer] [error name=edit_permission set="Not authorized to edit pages, not dealer=[scratch dealer]."] [bounce page=admin/edit_error] [/if] [perl] my $pn = $CGI->{page_name}; $pn =~ s/\.html$//; my $fn = "pages/$pn.html"; if(! -f $fn) { $Tag->error({ name => 'edit_page', set => "$fn does not exist"}); $Scratch->{bounce_error} = 1; } my $pagedata = $Tag->file($fn); my $preamble; my $postamble; ( $pagedata =~ s{(.*)\n", $newdata, "\n", $postamble; $Tag->write_relative_file($fn, $newpage); $Scratch->{bounce_success} = 1; $Scratch->{bounce_page} = $pn; } else { $Scratch->{allowed_pages} ||= {}; $Scratch->{allowed_pages}{$pn} = 1; } $Scratch->{pagename} = $pn; $Scratch->{pagedata} = $pagedata; return; [/perl] [bounce page=admin/edit_error if="[scratch bounce_error]"] [bounce page="[scratch bounce_page]" if="[scratch bounce_success]"] @_NOLEFT_TOP_@ [form-session-id] [display type=textarea width=80 height=50 name=page_data value="[scratch pagedata]"]
@_NOLEFT_BOTTOM_@