Tadashi Okoshi
slash****@users*****
2005年 12月 26日 (月) 19:15:39 JST
Index: affelio/lib/Affelio/App/Admin/ConfigApps.pm
diff -u affelio/lib/Affelio/App/Admin/ConfigApps.pm:1.3 affelio/lib/Affelio/App/Admin/ConfigApps.pm:1.4
--- affelio/lib/Affelio/App/Admin/ConfigApps.pm:1.3 Wed Nov 23 13:00:19 2005
+++ affelio/lib/Affelio/App/Admin/ConfigApps.pm Mon Dec 26 19:15:39 2005
@@ -14,7 +14,7 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
-# $Id: ConfigApps.pm,v 1.3 2005/11/23 04:00:19 slash5234 Exp $
+# $Id: ConfigApps.pm,v 1.4 2005/12/26 10:15:39 slash5234 Exp $
package Affelio::App::Admin::ConfigApps;
{
@@ -47,6 +47,14 @@
if($sub_mode eq "install_app" ){
install_app($af, $cgi, $out_ref);
}
+
+ if($sub_mode eq "modify_app" ){
+ modify_app($af, $cgi, $out_ref);
+ }
+
+ if($sub_mode eq "delete_app" ){
+ delete_app($af, $cgi, $out_ref);
+ }
}catch Error with{
my $e = shift;
$out_ref->{err_msg} .= $e->stacktrace . '<BR>';
@@ -80,6 +88,55 @@
}
#######################################################################
+ #modify_app
+ #######################################################################
+ sub modify_app{
+ my $af= shift;
+ my $cgi = shift;
+ my $out_ref = shift;
+
+ debug_print("ConfigApps::modify: start.");
+
+ my $wi = new Affelio::misc::WebInput;
+ my $install_title = $cgi->param("install_title");
+ my $app_id = $wi->PTN_num($cgi->param("app_id"));
+
+ debug_print("ConfigApps::modify: app_id =[$app_id]");
+ debug_print("ConfigApps::modify: title =[$install_title]");
+
+ if(($app_id eq "" ) || ($app_id < 0)){
+ return;
+ }else{
+ $af->getAM()->rename_title($app_id, $install_title);
+
+ $out_ref->{ret_msg} = "Title has changed to $install_title.";
+ }
+ }
+
+ #######################################################################
+ #delete_app
+ #######################################################################
+ sub delete_app{
+ my $af= shift;
+ my $cgi = shift;
+ my $out_ref = shift;
+
+ debug_print("ConfigApps::delete: start.");
+
+ my $wi = new Affelio::misc::WebInput;
+ my $app_id = $wi->PTN_num($cgi->param("app_id"));
+
+ debug_print("ConfigApps::delete: app_id =[$app_id]");
+
+ if(($app_id eq "" ) || ($app_id < 0)){
+ return;
+ }else{
+ $af->getAM()->uninstall_app($app_id);
+ $out_ref->{ret_msg} = "Application uninstalled.";
+ }
+ }
+
+ #######################################################################
#show
#######################################################################
sub show{
@@ -96,6 +153,12 @@
$output_ref->{"registered_apps"} = \@registered_apps;
$output_ref->{"unregistered_apps"} = \@unregistered_apps;
+ my $modify_URL=
+ "admin.cgi?mode=config_apps&action=modify_app";
+
+ my $delete_URL=
+ "admin.cgi?mode=config_apps&action=delete_app";
+
##############################################
#Registered Applications
##############################################
@@ -106,7 +169,9 @@
install_title => $this_app_ref->{install_title},
app_name => $this_app_ref->{app_name},
app_version => $this_app_ref->{app_version},
- } );
+ modify_URL => $modify_URL,
+ delete_URL => $delete_URL
+ } );
}
##############################################