[LON-CAPA-cvs] cvs: loncom /interface lonblockingstatus.pm loncommon.pm lonmsgdisplay.pm lonrss.pm

kalberla kalberla@source.lon-capa.org
Mon, 27 Jul 2009 12:12:48 -0000


This is a MIME encoded message

--kalberla1248696768
Content-Type: text/plain

kalberla		Mon Jul 27 12:12:48 2009 EDT

  Modified files:              
    /loncom/interface	lonmsgdisplay.pm lonrss.pm loncommon.pm 
                     	lonblockingstatus.pm 
  Log:
  Moved build_blocking_table from loncommon.pm to lonblockingstatus.pm
  Added blocking table popup to blogs in lonrss.pm
  
  
--kalberla1248696768
Content-Type: text/plain
Content-Disposition: attachment; filename="kalberla-20090727121248.txt"

Index: loncom/interface/lonmsgdisplay.pm
diff -u loncom/interface/lonmsgdisplay.pm:1.130 loncom/interface/lonmsgdisplay.pm:1.131
--- loncom/interface/lonmsgdisplay.pm:1.130	Mon Jul 27 11:30:05 2009
+++ loncom/interface/lonmsgdisplay.pm	Mon Jul 27 12:12:47 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines for messaging display
 #
-# $Id: lonmsgdisplay.pm,v 1.130 2009/07/27 11:30:05 kalberla Exp $
+# $Id: lonmsgdisplay.pm,v 1.131 2009/07/27 12:12:47 kalberla Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1222,7 +1222,7 @@
     #                                                 $setters);
     
     my ($blocked, $blocktext) = &Apache::loncommon::blocking_status("com");
-    $output .="<br />".$blocktext;
+    $output .="<br /><br />".$blocktext;
 
     return $output;
 }
Index: loncom/interface/lonrss.pm
diff -u loncom/interface/lonrss.pm:1.47 loncom/interface/lonrss.pm:1.48
--- loncom/interface/lonrss.pm:1.47	Mon Apr 20 15:20:23 2009
+++ loncom/interface/lonrss.pm	Mon Jul 27 12:12:47 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # RSS Feeder
 #
-# $Id: lonrss.pm,v 1.47 2009/04/20 15:20:23 amueller Exp $
+# $Id: lonrss.pm,v 1.48 2009/07/27 12:12:47 kalberla Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -258,9 +258,11 @@
         if ($blockcause eq 'user') {
             $output .= &mt('This is because you are a student in one or more courses in which communication is being blocked.');
             if ($html) {
-                $output .= '<br />'.
-                       &Apache::loncommon::build_block_table($startblock,
-                                                        $endblock,\%setters);
+                #$output .= '<br />'.
+                       #&Apache::loncommon::build_block_table($startblock,
+                       #                                 $endblock,\%setters);
+                 my ($blocked, $blocktext) = Apache::loncommon::blocking_status('blogs');
+                 $output .= '<br /><br />'.$blocktext;
             }
         } else {
             $output .= &mt('This is because the blog owner is a student in one or more courses in which communication is being blocked.');
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.867 loncom/interface/loncommon.pm:1.868
--- loncom/interface/loncommon.pm:1.867	Mon Jul 27 11:30:05 2009
+++ loncom/interface/loncommon.pm	Mon Jul 27 12:12:47 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.867 2009/07/27 11:30:05 kalberla Exp $
+# $Id: loncommon.pm,v 1.868 2009/07/27 12:12:47 kalberla Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -3831,46 +3831,6 @@
     return ($setuname,$setudom,$title,$blocks);
 }
 
-sub build_block_table {
-    my ($startblock,$endblock,$setters) = @_;
-    my %lt = &Apache::lonlocal::texthash(
-        'cacb' => 'Currently active communication blocks',
-        'cour' => 'Course',
-        'dura' => 'Duration',
-        'blse' => 'Block set by'
-    );
-    my $output;
-    $output = '<br />'.$lt{'cacb'}.':<br />';
-    $output .= &start_data_table();
-    $output .= '
-<tr>
- <th>'.$lt{'cour'}.'</th>
- <th>'.$lt{'dura'}.'</th>
- <th>'.$lt{'blse'}.'</th>
-</tr>
-';
-    foreach my $course (keys(%{$setters})) {
-        my %courseinfo=&Apache::lonnet::coursedescription($course);
-        for (my $i=0; $i<@{$$setters{$course}{staff}}; $i++) {
-            my ($uname,$udom) = @{$$setters{$course}{staff}[$i]};
-            my $fullname = &plainname($uname,$udom);
-            if (defined($env{'user.name'}) && defined($env{'user.domain'})
-                && $env{'user.name'} ne 'public' 
-                && $env{'user.domain'} ne 'public') {
-                $fullname = &aboutmewrapper($fullname,$uname,$udom);
-            }
-            my ($openblock,$closeblock) = @{$$setters{$course}{times}[$i]};
-            $openblock = &Apache::lonlocal::locallocaltime($openblock);
-            $closeblock= &Apache::lonlocal::locallocaltime($closeblock);
-            $output .= &Apache::loncommon::start_data_table_row().
-                       '<td>'.$courseinfo{'description'}.'</td>'.
-                       '<td>'.$openblock.' to '.$closeblock.'</td>'.
-                       '<td>'.$fullname.'</td>'.
-                        &Apache::loncommon::end_data_table_row();
-        }
-    }
-    $output .= &end_data_table();
-}
 sub blocking_status {
   my $blocked;
   my ($activity,$uname,$udom) = @_;
Index: loncom/interface/lonblockingstatus.pm
diff -u loncom/interface/lonblockingstatus.pm:1.4 loncom/interface/lonblockingstatus.pm:1.5
--- loncom/interface/lonblockingstatus.pm:1.4	Mon Jul 27 11:30:05 2009
+++ loncom/interface/lonblockingstatus.pm	Mon Jul 27 12:12:48 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # displays the blocking status table
 #
-# $Id: lonblockingstatus.pm,v 1.4 2009/07/27 11:30:05 kalberla Exp $
+# $Id: lonblockingstatus.pm,v 1.5 2009/07/27 12:12:48 kalberla Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -59,13 +59,13 @@
             'Communication Blocking Status Information',
             undef, {'only_body' => 1, }));
     Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['activity']);
-    my ($blocked, $blocktext) = print_blocking_table($env{'form.activity'});
+    my $blocktext = get_blocking_table($env{'form.activity'});
     $r->print($blocktext);
 
     $r->print(Apache::loncommon::end_page());
     return OK;
 }
-sub print_blocking_table{
+sub get_blocking_table{
     my ($activity,$uname,$udom) = @_;
     my %setters;
     my ($blocked,$output,$ownitem,$is_course);
@@ -117,16 +117,52 @@
             my $showend = &Apache::lonlocal::locallocaltime($endblock);
             $output = '<br />'.&mt('[_1] will be inaccessible between [_2] and [_3] because communication is being blocked.',$category,$showstart,$showend).'<br />';
             if (!($activity eq 'port' && !($ownitem) && !($is_course))) {
-                $output .= &Apache::loncommon::build_block_table($startblock,$endblock,\%setters);
+                $output .= build_block_table($startblock,$endblock,\%setters);
             }
     }
-    return ($blocked,$output);
+    return $output;
+}
+
+sub build_block_table {
+    my ($startblock,$endblock,$setters) = @_;
+    my %lt = &Apache::lonlocal::texthash(
+        'cacb' => 'Currently active communication blocks',
+        'cour' => 'Course',
+        'dura' => 'Duration',
+        'blse' => 'Block set by'
+    );
+    my $output;
+    $output = '<br />'.$lt{'cacb'}.':<br />';
+    $output .= Apache::loncommon::start_data_table();
+    $output .= '
+<tr>
+ <th>'.$lt{'cour'}.'</th>
+ <th>'.$lt{'dura'}.'</th>
+ <th>'.$lt{'blse'}.'</th>
+</tr>
+';
+    foreach my $course (keys(%{$setters})) {
+        my %courseinfo=&Apache::lonnet::coursedescription($course);
+        for (my $i=0; $i<@{$$setters{$course}{staff}}; $i++) {
+            my ($uname,$udom) = @{$$setters{$course}{staff}[$i]};
+            my $fullname = Apache::loncommon::plainname($uname,$udom);
+            if (defined($env{'user.name'}) && defined($env{'user.domain'})
+                && $env{'user.name'} ne 'public'
+                && $env{'user.domain'} ne 'public') {
+                $fullname = Apache::loncommon::aboutmewrapper($fullname,$uname,$udom);
+            }
+            my ($openblock,$closeblock) = @{$$setters{$course}{times}[$i]};
+            $openblock = &Apache::lonlocal::locallocaltime($openblock);
+            $closeblock= &Apache::lonlocal::locallocaltime($closeblock);
+            $output .= &Apache::loncommon::start_data_table_row().
+                       '<td>'.$courseinfo{'description'}.'</td>'.
+                       '<td>'.$openblock.' to '.$closeblock.'</td>'.
+                       '<td>'.$fullname.'</td>'.
+                        &Apache::loncommon::end_data_table_row();
+        }
+    }
+    $output .= Apache::loncommon::end_data_table();
 }
 
 1;
 __END__
-
-
-
-
-

--kalberla1248696768--