Yoshihisa Fukuhara
higef****@users*****
2005年 6月 26日 (日) 01:52:22 JST
Index: affelio/admin.cgi diff -u affelio/admin.cgi:1.3 affelio/admin.cgi:1.4 --- affelio/admin.cgi:1.3 Tue Jun 21 17:45:24 2005 +++ affelio/admin.cgi Sun Jun 26 01:52:22 2005 @@ -6,7 +6,7 @@ # http://affelio.jp/ (Japan) # http://affelio.jp/ (USA and other area) # -# $Id: admin.cgi,v 1.3 2005/06/21 08:45:24 slash5234 Exp $ +# $Id: admin.cgi,v 1.4 2005/06/25 16:52:22 higefuku Exp $ use strict; @@ -61,6 +61,7 @@ die_on_bad_params => 0); $tmpl->param(reason_msg => "You haven't been authenticated."); $tmpl->param("tmpl_path" => "$af->{site__web_root}/templates/$af->{site__template}/owner_side/"); + $tmpl->param("style_path" => $af->{site__web_root} . "/skins/" . $af->{userpref__skin}); print "Content-type: text/html; charset=UTF-8\n\n"; print $af->translate_templateL10N($tmpl->output); exit(1); @@ -77,7 +78,9 @@ #Invoking models ############################################################################ use Affelio::App::Admin::Messaging; -my %output_data = ("tmpl_path", "$af->{site__web_root}/templates/$af->{site__template}/owner_side/", +my %output_data = ( + "tmpl_path", "$af->{site__web_root}/templates/$af->{site__template}/owner_side/", + "style_path", $af->{site__web_root} . "/skins/" . $af->{userpref__skin}, "site_web_root", "$af->{site__web_root}", "my_nickname", $af->{user__nickname}, "my_currentstatus", $af->{user__currentstatus}, @@ -490,6 +493,11 @@ print "Location: $forward_URL", "\n\n"; }else{ + + print "Content-type: text/html; charset=UTF-8\n"; + print "Pragma: no-cache", "\n\n"; + print get_HTML_header(); + my $tmpl = new HTML::Template( filename => $TMPL_FILE, die_on_bad_params => 0); @@ -500,9 +508,64 @@ $tmpl->param("err_msg" => $err); $tmpl->param("site__locale" => $af->{site__locale}); - print "Content-type: text/html; charset=UTF-8\n"; - print "Pragma: no-cache", "\n\n"; +# print "Content-type: text/html; charset=UTF-8\n"; +# print "Pragma: no-cache", "\n\n"; print $af->translate_templateL10N($tmpl->output); + + print get_HTML_footer(); } + ###################################################################### + #Get_HTML_header + ###################################################################### + sub get_HTML_header{ + my $self = shift; + my $app__page_title = shift; + +# my $af = $self->{af}; + + #Set template file name + my $TMPL_FILE = "$af->{site__fs_root}/templates_dyn/header.tmpl"; + #Set data for template + my %output_data = (); + $output_data{'app__css_path'} = $af->{site__web_root}."/templates/default/owner_side"; + $output_data{'app__page_title'} = "Affelio Owner's page"; + $output_data{"site__skin_dir"} = $af->{site__web_root} . "/skins/" . $af->{userpref__skin}; + $output_data{'site__web_root'} = $af->{site__web_root}; + $output_data{'site__locale'} = $af->{site__locale}; + + $af->get_module_list(\%output_data, $af->{site__web_root},"self"); + + #Initiate Template + my $tmpl = new HTML::Template( filename => $TMPL_FILE, + die_on_bad_params => 0); + foreach my $data_key (keys(%output_data)) { + debug_print("$data_key = $output_data{$data_key}"); + $tmpl->param($data_key => $output_data{$data_key}); + } + + my $final_out = $af->translate_templateL10N($tmpl->output) + . '<div id="afPubMain">' . "\n"; + + return($final_out); + + } + + ###################################################################### + #get_HTML_footer + ###################################################################### + sub get_HTML_footer{ + my $self = shift; +# my $af = $self->{af}; + + #Set template file name + my $TMPL_FILE = "$af->{site__fs_root}/templates_dyn/footer.tmpl"; + my $tmpl = new HTML::Template(filename => $TMPL_FILE); + + my $final_out = "</div><!--afPubMain-->" + . $af->translate_templateL10N($tmpl->output); + + return($final_out); + } +