[LON-CAPA-cvs] cvs: loncom /interface loncommunicate.pm lonindexer.pm lonmsg.pm

www lon-capa-cvs@mail.lon-capa.org
Fri, 26 Mar 2004 19:35:59 -0000


www		Fri Mar 26 14:35:59 2004 EDT

  Modified files:              
    /loncom/interface	loncommunicate.pm lonindexer.pm lonmsg.pm 
  Log:
  Improve workflow after sending messages, fix "Cancel"
  Start of experiment with lonindexer.pm to display pages and sequences
  
  
Index: loncom/interface/loncommunicate.pm
diff -u loncom/interface/loncommunicate.pm:1.20 loncom/interface/loncommunicate.pm:1.21
--- loncom/interface/loncommunicate.pm:1.20	Sun Feb 29 21:21:57 2004
+++ loncom/interface/loncommunicate.pm	Fri Mar 26 14:35:59 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Communicate
 #
-# $Id: loncommunicate.pm,v 1.20 2004/03/01 02:21:57 www Exp $
+# $Id: loncommunicate.pm,v 1.21 2004/03/26 19:35:59 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -35,21 +35,9 @@
 use Apache::loncommon;
 use Apache::lonlocal;
 
-sub handler {
-    my $r = shift;
-    &Apache::loncommon::content_type($r,'text/html');
-    $r->send_http_header;
-    return OK if $r->header_only;
-#
-# Start document
-#
-    $r->print(<<END);
-<html>
-<head>
-<title>The LearningOnline Network with CAPA</title>
-</head>
-END
-   my %lt=&Apache::lonlocal::texthash(
+sub menu {
+    my $r=shift;
+    my %lt=&Apache::lonlocal::texthash(
 'vam' => 'View All Messages',
 'vcm' => 'View Critical Messages',
 'smu' => 'Send Message to User(s)',
@@ -69,17 +57,6 @@
 	     'Course_Broadcast_Message') {
 	$help{$_}=&Apache::loncommon::help_open_topic($_);
     }
-
-# ----------------------------------------------------------------- Breadcrumbs
-    &Apache::lonhtmlcommon::clear_breadcrumbs();
-    &Apache::lonhtmlcommon::add_breadcrumb
-        ({href=>"/adm/communicate",
-          text=>"Communication/Messages",
-          faq=>12,bug=>'Communication Tools',});
-
-# ---------------------------------------------------------------------- Header
-    &Apache::lonmsg::header($r);
-
 # ------------------------------------------------------------------------ Menu
    $r->print(<<END);
 <table cellspacing="10" cellpadding="2">
@@ -150,6 +127,33 @@
     } else {
         $r->print("<h3>".&mt('You have no unread messages')."</h3>");
     }
+}
+
+sub handler {
+    my $r = shift;
+    &Apache::loncommon::content_type($r,'text/html');
+    $r->send_http_header;
+    return OK if $r->header_only;
+#
+# Start document
+#
+    $r->print(<<END);
+<html>
+<head>
+<title>The LearningOnline Network with CAPA</title>
+</head>
+END
+
+# ----------------------------------------------------------------- Breadcrumbs
+    &Apache::lonhtmlcommon::clear_breadcrumbs();
+    &Apache::lonhtmlcommon::add_breadcrumb
+        ({href=>"/adm/communicate",
+          text=>"Communication/Messages",
+          faq=>12,bug=>'Communication Tools',});
+
+# ---------------------------------------------------------------------- Header
+    &Apache::lonmsg::header($r);
+    &menu($r);
     return OK;
 }
 
Index: loncom/interface/lonindexer.pm
diff -u loncom/interface/lonindexer.pm:1.93 loncom/interface/lonindexer.pm:1.94
--- loncom/interface/lonindexer.pm:1.93	Wed Feb 18 16:15:37 2004
+++ loncom/interface/lonindexer.pm	Fri Mar 26 14:35:59 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Directory Indexer
 #
-# $Id: lonindexer.pm,v 1.93 2004/02/18 21:15:37 albertel Exp $
+# $Id: lonindexer.pm,v 1.94 2004/03/26 19:35:59 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -47,6 +47,7 @@
 use Apache::lonnet();
 use Apache::loncommon();
 use Apache::lonhtmlcommon();
+use Apache::lonsequence();
 use Apache::Constants qw(:common);
 use Apache::lonmeta;
 use Apache::File;
@@ -618,7 +619,12 @@
 
     if ($hash{'dirlist_files_'.$luri}) {
 	@list = split(/\n/,$hash{'dirlist_files_'.$luri});
+    } elsif ($uri=~/\.(page|sequence)$/) {
+# is a page or a sequence
+	@list= &Apache::lonsequence::attemptread(&Apache::lonnet::filelocation('',$uri)); 
+	$hash{'dirlist_files_'.$luri} = join("\n",@list);
     } else {
+# is really a directory
 	@list = &Apache::lonnet::dirlist($uri);
 	$hash{'dirlist_files_'.$luri} = join("\n",@list);
     }
Index: loncom/interface/lonmsg.pm
diff -u loncom/interface/lonmsg.pm:1.94 loncom/interface/lonmsg.pm:1.95
--- loncom/interface/lonmsg.pm:1.94	Fri Mar 26 12:13:59 2004
+++ loncom/interface/lonmsg.pm	Fri Mar 26 14:35:59 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines for messaging
 #
-# $Id: lonmsg.pm,v 1.94 2004/03/26 17:13:59 www Exp $
+# $Id: lonmsg.pm,v 1.95 2004/03/26 19:35:59 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -101,6 +101,7 @@
 use HTML::Entities();
 use Mail::Send;
 use Apache::lonlocal;
+use Apache::loncommunicate;
 
 # Querystring component with sorting type
 my $sqs;
@@ -1249,13 +1250,15 @@
 		$r->print($thismsg.'<br />');
 		$sendstatus.=' '.$thismsg;
 	    }
+	} else {
+	    &printheader($r,'','No messages sent.'); 
 	}
 	if ($sendstatus=~/^(\s*(?:ok|con_delayed)\s*)*$/) {
 	    $r->print('<br /><font color="green">'.&mt('Completed.').'</font>');
 	    if ($ENV{'form.displayedcrit'}) {
 		&discrit($r);
 	    } else {
-		&disall($r);
+		&Apache::loncommunicate::menu($r);
 	    }
 	} else {
 	    $r->print(