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

kalberla kalberla@source.lon-capa.org
Mon, 27 Jul 2009 11:30:06 -0000


This is a MIME encoded message

--kalberla1248694206
Content-Type: text/plain

kalberla		Mon Jul 27 11:30:06 2009 EDT

  Modified files:              
    /loncom/interface	lonmsgdisplay.pm loncommon.pm 
                     	lonblockingstatus.pm 
  Log:
  Moved blocking_status_print from loncommon.pm to lonblockingstatus.pm
  
  
--kalberla1248694206
Content-Type: text/plain
Content-Disposition: attachment; filename="kalberla-20090727113006.txt"

Index: loncom/interface/lonmsgdisplay.pm
diff -u loncom/interface/lonmsgdisplay.pm:1.129 loncom/interface/lonmsgdisplay.pm:1.130
--- loncom/interface/lonmsgdisplay.pm:1.129	Sun Jul 26 20:39:46 2009
+++ loncom/interface/lonmsgdisplay.pm	Mon Jul 27 11:30:05 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines for messaging display
 #
-# $Id: lonmsgdisplay.pm,v 1.129 2009/07/26 20:39:46 kalberla Exp $
+# $Id: lonmsgdisplay.pm,v 1.130 2009/07/27 11:30:05 kalberla Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1221,7 +1221,7 @@
     #$output .= &Apache::loncommon::build_block_table($startblock,$endblock,
     #                                                 $setters);
     
-    my ($blocked, $blocktext) = &Apache::loncommon::blocking_status("msgdisplay");
+    my ($blocked, $blocktext) = &Apache::loncommon::blocking_status("com");
     $output .="<br />".$blocktext;
 
     return $output;
@@ -2281,7 +2281,7 @@
         &printheader($r,'/adm/email',&mt('Display a Message'));
         #$r->print(&mt('You attempted to display a message that is currently blocked because you are enrolled in one or more courses for which there is an ongoing online exam.'));
         #&build_block_table($r,$startblock,$endblock,\%setters);
-        my($blocked, $blocktext) = &Apache::loncommon::blocking_status("msgdisplay");
+        my($blocked, $blocktext) = &Apache::loncommon::blocking_status("com");
         $r->print("<br />".$blocktext);
         return;
     }
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.866 loncom/interface/loncommon.pm:1.867
--- loncom/interface/loncommon.pm:1.866	Sun Jul 26 20:39:46 2009
+++ loncom/interface/loncommon.pm	Mon Jul 27 11:30:05 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.866 2009/07/26 20:39:46 kalberla Exp $
+# $Id: loncommon.pm,v 1.867 2009/07/27 11:30:05 kalberla Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -3872,19 +3872,19 @@
     $output .= &end_data_table();
 }
 sub blocking_status {
-  my $blocked = blocking_status_print(@_);
+  my $blocked;
   my ($activity,$uname,$udom) = @_;
+  my %setters;
+  my ($startblock,$endblock)=&blockcheck(\%setters,$activity,$uname,$udom);
+  if ($startblock && $endblock) {
+    $blocked = 1;
+  }
   if(!wantarray) {
     return $blocked;
   }
   my $output;
   my $querystring;
   $querystring = "?activity=$activity";
-  if(defined($uname)) { 
-    $querystring .= "&uname=$uname";
-  }if(defined($udom)) {
-    $querystring .= "&udom=$udom";
-  }
 
       $output .= <<"END_MYBLOCK";
 <script type="text/javascript">
@@ -3901,73 +3901,17 @@
 </script>
 END_MYBLOCK
   my $popupUrl = "/adm/blockingstatus/$querystring";
-  $output.="\n<img src='/res/adm/pages/emblem-readonly.png' /><a onclick='openWindow(\"$popupUrl\",\"Blocking Table\",600,300,\"no\",\"no\");return false;' href='/adm/blockingstatus/$querystring'>Blocking Table</a>";
+  $output .= <<"END_BLOCK";
+<div class='LC_comblock'>
+  <a onclick='openWindow("$popupUrl","Blocking Table",600,300,"no","no");return false;' href='/adm/blockingstatus/$querystring'>
+  <img class='LC_noBorder LC_middle' src='/res/adm/pages/comblock.png' alt='Communication Blocking'/></a>
+  <a onclick='openWindow("$popupUrl","Blocking Table",600,300,"no","no");return false;' href='/adm/blockingstatus/$querystring'>Communication Blocking</a>
+</div>
+
+END_BLOCK
 
   return ($blocked, $output);
 }
-sub blocking_status_print {
-    my ($activity,$uname,$udom) = @_;
-    my %setters;
-    my ($blocked,$output,$ownitem,$is_course);
-    my ($startblock,$endblock)=&blockcheck(\%setters,$activity,$uname,$udom);
-    if ($startblock && $endblock) {
-        $blocked = 1;
-        if (wantarray) {
-            my $category;
-            if ($activity eq 'boards') {
-                $category = 'Discussion posts in this course';
-            } elsif ($activity eq 'chat') {
-                $category = 'Chat';
-            } elsif ($activity eq 'msgdisplay') {
-                $category = 'This message';
-            } elsif ($activity eq 'blogs') {
-                $category = 'Blogs'; 
-            } elsif ($activity eq 'port') {
-                if (defined($uname) && defined($udom)) {
-                    if ($uname eq $env{'user.name'} &&
-                        $udom eq $env{'user.domain'}) {
-                        $ownitem = 1;
-                    }
-                }
-                $is_course = &Apache::lonnet::is_course($udom,$uname);
-                if ($ownitem) { 
-                    $category = 'Your portfolio files';  
-                } elsif ($is_course) {
-                    my $coursedesc;
-                    foreach my $course (keys(%setters)) {
-                        my %courseinfo =
-                             &Apache::lonnet::coursedescription($course);
-                        $coursedesc = $courseinfo{'description'};
-                    }
-                    $category = "Group portfolio in the course '$coursedesc'";
-                } else {
-                    $category = 'Portfolio files belonging to ';
-                    if ($env{'user.name'} eq 'public' && 
-                        $env{'user.domain'} eq 'public') {
-                        $category .= &plainname($uname,$udom);
-                    } else {
-                        $category .= &aboutmewrapper(&plainname($uname,$udom),$uname,$udom);  
-                    }
-                }
-            } elsif ($activity eq 'groups') {
-                $category = 'Groups in this course';
-            } else {
-                $category = 'Communication';
-            }
-            my $showstart = &Apache::lonlocal::locallocaltime($startblock);
-            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 .= &build_block_table($startblock,$endblock,\%setters);
-            }
-        }
-    }
-    if (wantarray) {
-        return ($blocked,$output);
-    } else {
-        return $blocked;
-    }
-}
 
 ###############################################
 
@@ -5447,12 +5391,27 @@
 
 div.LC_feedback_link img {
   height: 22px;
+  vertical-align:middle;
 }
 
 div.LC_feedback_link a{
   text-decoration: none;
 }
 
+div.LC_comblock {
+  display:inline; 
+  color:$font;
+  font-size:90%;
+}
+
+div.LC_feedback_link div.LC_comblock {
+  padding-left:5px;
+}
+
+div.LC_feedback_link div.LC_comblock a {
+  color:$font;
+}
+
 span.LC_feedback_link {
   /* background: $feedback_link_bg; */
   font-size: larger;
@@ -6506,6 +6465,8 @@
              inherit_jsmath -> when creating popup window in a page,
                                     should it have jsmath forced on by the
                                     current page
+             bread_crumbs ->             Array containing breadcrumbs
+             bread_crumbs_components ->  if exists show it as headline else show only the breadcrumbs
 
 =back
 
Index: loncom/interface/lonblockingstatus.pm
diff -u loncom/interface/lonblockingstatus.pm:1.3 loncom/interface/lonblockingstatus.pm:1.4
--- loncom/interface/lonblockingstatus.pm:1.3	Sun Jul 26 20:39:46 2009
+++ loncom/interface/lonblockingstatus.pm	Mon Jul 27 11:30:05 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # displays the blocking status table
 #
-# $Id: lonblockingstatus.pm,v 1.3 2009/07/26 20:39:46 kalberla Exp $
+# $Id: lonblockingstatus.pm,v 1.4 2009/07/27 11:30:05 kalberla Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -59,13 +59,69 @@
             'Communication Blocking Status Information',
             undef, {'only_body' => 1, }));
     Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['activity']);
-    my ($blocked, $blocktext) = &Apache::loncommon::blocking_status_print($env{'form.activity'});
+    my ($blocked, $blocktext) = print_blocking_table($env{'form.activity'});
     $r->print($blocktext);
 
     $r->print(Apache::loncommon::end_page());
     return OK;
 }
-
+sub print_blocking_table{
+    my ($activity,$uname,$udom) = @_;
+    my %setters;
+    my ($blocked,$output,$ownitem,$is_course);
+    my ($startblock,$endblock)=&Apache::loncommon::blockcheck(\%setters,$activity,$uname,$udom);
+    if ($startblock && $endblock) {
+        $blocked = 1;
+            my $category;
+            if ($activity eq 'boards') {
+                $category = 'Discussion posts in this course';
+            } elsif ($activity eq 'chat') {
+                $category = 'Chat';
+            } elsif ($activity eq 'msgdisplay') {
+                $category = 'This message';
+            } elsif ($activity eq 'blogs') {
+                $category = 'Blogs';
+            } elsif ($activity eq 'port') {
+                if (defined($uname) && defined($udom)) {
+                    if ($uname eq $env{'user.name'} &&
+                        $udom eq $env{'user.domain'}) {
+                        $ownitem = 1;
+                    }
+                }
+                $is_course = &Apache::lonnet::is_course($udom,$uname);
+                if ($ownitem) {
+                    $category = 'Your portfolio files';
+                } elsif ($is_course) {
+                    my $coursedesc;
+                    foreach my $course (keys(%setters)) {
+                        my %courseinfo =
+                             &Apache::lonnet::coursedescription($course);
+                        $coursedesc = $courseinfo{'description'};
+                    }
+                    $category = "Group portfolio in the course '$coursedesc'";
+                } else {
+                    $category = 'Portfolio files belonging to ';
+                    if ($env{'user.name'} eq 'public' &&
+                        $env{'user.domain'} eq 'public') {
+                        $category .= &plainname($uname,$udom);
+                    } else {
+                        $category .= &aboutmewrapper(&plainname($uname,$udom),$uname,$udom);
+                    }
+                }
+            } elsif ($activity eq 'groups') {
+                $category = 'Groups in this course';
+            } else {
+                $category = 'Communication';
+            }
+            my $showstart = &Apache::lonlocal::locallocaltime($startblock);
+            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);
+            }
+    }
+    return ($blocked,$output);
+}
 
 1;
 __END__

--kalberla1248694206--