# -*- cperl -*-
# -----------------------------------------------------------------------------
package Celaenito::Httpd::General;
use strict;
use warnings;
use HTTP::Status;
use URI::QueryParam;
use Celaenito::Template;
use Celaenito::StaticFile;
use Celaenito::Config;

sub confirm {
    # message : 出力するメッセージ
    # ok      : URI
    # cancel  : URI
    # response: HTTP::Response
    my %args = @_;

    my $t = {
	ok => {
	    action => $args{ok}->path,
	    hidden => $args{ok}->query_form_hash,
	},
	cancel => {
	    action => $args{cancel}->path,
	    hidden => $args{cancel}->query_form_hash,
	},
    };
    $t->{title}   = config('ui.title');
    $t->{message} = $args{message};

    my $out = '';
    TMPL->process('confirm.tt', $t, \$out)
      or die Template->error;

    $args{response}->content($out);
    return RC_OK;
}

1;
