[LON-CAPA-cvs] cvs: loncom /interface lonhelper.pm

bowersj2 lon-capa-cvs@mail.lon-capa.org
Fri, 11 Apr 2003 19:07:48 -0000


bowersj2		Fri Apr 11 15:07:48 2003 EDT

  Modified files:              
    /loncom/interface	lonhelper.pm 
  Log:
  Brain-o: <message> should take nextstate as an attribute, not a sub-tag,
  and we can do away with the <message_text> entirely.
  
  <nextstate> is OK for the rest of the tags that use it, I think, because 
  it doesn't cause such clumsiness.
  
  I plead temporary insanity.
  
  
Index: loncom/interface/lonhelper.pm
diff -u loncom/interface/lonhelper.pm:1.9 loncom/interface/lonhelper.pm:1.10
--- loncom/interface/lonhelper.pm:1.9	Fri Apr 11 15:01:46 2003
+++ loncom/interface/lonhelper.pm	Fri Apr 11 15:07:48 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # .helper XML handler to implement the LON-CAPA helper
 #
-# $Id: lonhelper.pm,v 1.9 2003/04/11 19:01:46 bowersj2 Exp $
+# $Id: lonhelper.pm,v 1.10 2003/04/11 19:07:48 bowersj2 Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -680,7 +680,7 @@
 
 BEGIN {
     &Apache::lonhelper::register('Apache::lonhelper::message',
-                              ('message', 'message_text'));
+                              ('message'));
 }
 
 sub new {
@@ -690,31 +690,30 @@
 
 # CONSTRUCTION: Construct the message element from the XML
 sub start_message {
-    return '';
-}
-
-sub end_message {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
 
     if ($target ne 'helper') {
         return '';
     }
-    Apache::lonhelper::message->new();
+
+    $paramHash->{MESSAGE_TEXT} = &Apache::lonxml::get_all_text('/message',
+                                                               $parser);
+
+    if (defined($token->[2]{'nextstate'})) {
+        $paramHash->{NEXTSTATE} = $token->[2]{'nextstate'};
+    }
     return '';
 }
 
-sub start_message_text {
+sub end_message {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
 
     if ($target ne 'helper') {
         return '';
     }
-
-    $paramHash->{MESSAGE_TEXT} = &Apache::lonxml::get_all_text('/message_text',
-                                                               $parser);
+    Apache::lonhelper::message->new();
+    return '';
 }
-    
-sub end_message_text { return 1; }
 
 sub render {
     my $self = shift;