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

albertel lon-capa-cvs@mail.lon-capa.org
Fri, 27 Aug 2004 21:41:39 -0000


albertel		Fri Aug 27 17:41:39 2004 EDT

  Modified files:              
    /loncom/interface	lonannounce.pm 
  Log:
  - filter out parmaeters that don't effect me
  
  
Index: loncom/interface/lonannounce.pm
diff -u loncom/interface/lonannounce.pm:1.30 loncom/interface/lonannounce.pm:1.31
--- loncom/interface/lonannounce.pm:1.30	Tue Aug 17 11:38:58 2004
+++ loncom/interface/lonannounce.pm	Fri Aug 27 17:41:39 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Announce
 #
-# $Id: lonannounce.pm,v 1.30 2004/08/17 15:38:58 www Exp $
+# $Id: lonannounce.pm,v 1.31 2004/08/27 21:41:39 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -79,6 +79,13 @@
 		    ($thiskey=~/^(\w+)\.(?:(.+)\.)*([\w\s]+)\.(\w+)$/);
 		my $section=&mt('All Students');
 		if ($middle=~/^\[(.*)\]\./) {
+		    my $sec=$1;
+		    # if we have a section don't show ones that aren't ours
+		    if ($ENV{'request.course.sec'} &&
+			$ENV{'request.course.sec'} ne $sec) { next; }
+		    # if a student without a section don't show any section ones
+		    if (!$ENV{'request.role.adv'} &&
+			!$ENV{'request.course.sec'}) { next; }
 		    $section=&mt('Group/Section').': '.$1;
 		    $middle=~s/^\[(.*)\]\.//;
 		}