Tadashi Okoshi
slash****@users*****
2005年 6月 27日 (月) 16:19:08 JST
Index: affelio/lib/Affelio/App/Admin/Configuration.pm diff -u /dev/null affelio/lib/Affelio/App/Admin/Configuration.pm:1.1 --- /dev/null Mon Jun 27 16:19:08 2005 +++ affelio/lib/Affelio/App/Admin/Configuration.pm Mon Jun 27 16:19:08 2005 @@ -0,0 +1,113 @@ +# Affelio: Open social networking software +# Copyright 2004-2005 Fish Grove +# For more information, please refer following web site. +# http://affelio.jp/ (Japan) +# http://affelio.jp/ (USA and other area) +# +# $Id: Configuration.pm,v 1.1 2005/06/27 07:19:08 slash5234 Exp $ + +package Affelio::App::Admin::Configuration; +{ + use strict; + + use lib("../../../../extlib/"); + use lib("../../../"); + use Affelio; + use Affelio::misc::CGIError; + use Affelio::misc::Debug qw(debug_print); + use Affelio::misc::Encoding qw(db_encode db_decode); + use Affelio::misc::Time qw(timestamp2string); + use Affelio::misc::WebInput; + + use Exporter; + @Affelio::App::Admin::Configuration::ISA = "Exporter"; + @Affelio::App::Admin::Configuration::EXPORT = qw (show configure); + + ####################################################################### + #configure + ####################################################################### + sub configure{ + my $af= shift; + my $cgi = shift; + + debug_print("Config::conf: start."); + my $wi = new Affelio::misc::WebInput; + + ############################################## + #Top page + ############################################## + my $toppage = $wi->PTN_word($cgi->param("toppage")); + $af->{userpref__toppage_app_installname} = $toppage; + debug_print("Config::conf: toppage=[$toppage]"); + + ############################################## + #Preferred Hosting Service + ############################################## + $af->{userpref__preferred_hosting_service} = + $wi->PTN_URL($cgi->param("pref_hosting_service")); + + $af->write_user_prefs(); + debug_print("Config::conf: end."); + } + + + + ####################################################################### + #show + ####################################################################### + sub show{ + my $af= shift; + my $output_ref = shift; + + debug_print("Config::show start."); + + ############################################## + #Top Page + ############################################## + my @applications=(); + my $install_name; + my $app; + my $core_flag=""; + my $app_flag=""; + + $output_ref->{"applications"} = \@applications; + if($af->{userpref__toppage_app_installname} eq "Affelio"){ + $core_flag="true"; + } + ############### + #Core + ############### + push(@applications, {install_title => "Affelio Core", + install_name => "Affelio", + selected => $core_flag} ); + ############### + #Apps + ############### + while (($install_name, $app) = each(%{$af->{am}->{apps}})){ + + if($af->{userpref__toppage_app_installname} + eq $app->{install_name}){ + $app_flag="true"; + }else{ + $app_flag=""; + } + + push(@applications, {install_title => "(Application) " . + $app->{install_title}, + install_name => $app->{install_name}, + selected => $app_flag} + ); + } + + ############################################## + #Preferred Hosting Service + ############################################## + $output_ref->{"pref_hosting_service"} = + $af->{userpref__preferred_hosting_service}; + + debug_print("Config::show end."); + } + + +} +1;