[wifky] 一時的なページのプラグイン

一時的なページを作りそれを表示します。 入力したデータはファイルに書き出さず破棄されます。

push(@::menubar, qq(<a href="$::me?a=temppage_in" rel="nofollow">TempPage</a>) );

$main::action_plugin{'temppage_in'} = sub{
  &print_header( divclass=>'max' );
  &puts(qq(<h1>Input text for TempPage</h1>
           <form action="$::postme" method="post">
           <p>
           <textarea cols="60" rows="15" name="honbun"></textarea>
           <input type="hidden" name="a" value="temppage_out">
           <input type="submit" value="Input"></p></form>));
  &print_footer;
};


$main::action_plugin{'temppage_out'} = sub{
  my $html  = &enc($::form{honbun});
  my $title = 'TempPage';
  $::form{p} = $title;
  &print_header( userheader=>1 );
  &begin_day( $title );
  &print_page( title=>$title , html=>$html , index=>1 , main=>1 );
  &end_day();
  &print_page( title=>'Footer' , class=>$::ss{terminator} );
  &print_copyright;
  &print_sidebar_and_footer;
};