]> jspc29.x-matter.uni-frankfurt.de Git - coral.git/commitdiff
has settings is now a real package, settings methods are properly inherited
authorMichael Wiebusch <m.wiebusch@gsi.de>
Thu, 15 Jan 2015 14:47:54 +0000 (15:47 +0100)
committerMichael Wiebusch <m.wiebusch@gsi.de>
Thu, 15 Jan 2015 14:47:54 +0000 (15:47 +0100)
user_interface/has_settings.pm [moved from user_interface/settings_subs.pm with 93% similarity]
user_interface/table_control.pm

similarity index 93%
rename from user_interface/settings_subs.pm
rename to user_interface/has_settings.pm
index 89f610843d85bbc1b6de8ff529a7e69a7c7afd69..5205402abbb0daa04e9579e544df43821825a027 100644 (file)
@@ -1,7 +1,10 @@
+package has_settings;
 
 use Storable qw(lock_store lock_retrieve);
 require misc_subs;
 
+
+
 sub load_settings {
   my $self=shift;
   my $settings_file = $self->{settings_file};
@@ -22,7 +25,8 @@ sub save_settings {
   
   $self->{settings} = { %{$self->{settings}}, %options};
   lock_store($self->{settings},$settings_file);
-  return $self->{settings}
+  print "settings were saved!\n";
+  return $self->{settings};
 }
 
 sub reset_settings {
@@ -61,7 +65,7 @@ span.dropt:hover span {margin: 20px 0 0 170px; background: #ffffff; z-index:6;}
 </style>
 
   
-<form action="'.__PACKAGE__.'.pl" method="get" target="_self">
+<form action="'.ref($self).'.pl" method="get" target="_self">
   <input type="text" name="sub" value="save_settings" class="hidden"><br>
   <table>
   ';
index 8a151be05dcc04b066e60f6c487a4996b6368a53..58c0a6e698f6af78d5215bc08e2d4071cba89724 100644 (file)
@@ -12,7 +12,9 @@ use SVG;
 
 use CGI;
 
-require settings_subs;
+use has_settings;
+our @ISA = qw/has_settings/; # assimilate the methods of the has_settings class
+
 require misc_subs;