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

kalberla kalberla@source.lon-capa.org
Thu, 09 Jul 2009 12:53:28 -0000


kalberla		Thu Jul  9 12:53:28 2009 EDT

  Modified files:              
    /loncom/interface	loncommon.pm lonfeedback.pm lonblockingstatus.pm 
  Log:
  Moved blocking status table to popup.
  
  
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.853 loncom/interface/loncommon.pm:1.854
--- loncom/interface/loncommon.pm:1.853	Thu Jul  9 08:53:39 2009
+++ loncom/interface/loncommon.pm	Thu Jul  9 12:53:28 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.853 2009/07/09 08:53:39 droeschl Exp $
+# $Id: loncommon.pm,v 1.854 2009/07/09 12:53:28 kalberla Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -3871,8 +3871,41 @@
     }
     $output .= &end_data_table();
 }
-
 sub blocking_status {
+  my $blocked = blocking_status_print(@_);
+  my ($activity,$uname,$udom) = @_;
+  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">
+// <![CDATA[
+    function openWindow(url, wdwName, w, h, toolbar,scrollbar) {
+        var options = "width=" + w + ",height=" + h + ",";
+        options += "resizable=yes,scrollbars="+scrollbar+",status=no,";
+        options += "menubar=no,toolbar="+toolbar+",location=no,directories=no";
+        var newWin = window.open(url, wdwName, options);
+        newWin.focus();
+    }
+
+// ]]>
+</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>";
+
+  return ($blocked, $output);
+}
+sub blocking_status_print {
     my ($activity,$uname,$udom) = @_;
     my %setters;
     my ($blocked,$output,$ownitem,$is_course);
Index: loncom/interface/lonfeedback.pm
diff -u loncom/interface/lonfeedback.pm:1.274 loncom/interface/lonfeedback.pm:1.275
--- loncom/interface/lonfeedback.pm:1.274	Thu May 28 19:38:33 2009
+++ loncom/interface/lonfeedback.pm	Thu Jul  9 12:53:28 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Feedback
 #
-# $Id: lonfeedback.pm,v 1.274 2009/05/28 19:38:33 kalberla Exp $
+# $Id: lonfeedback.pm,v 1.275 2009/07/09 12:53:28 kalberla Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -103,9 +103,12 @@
     my ($blocked,$blocktext) = 
         &Apache::loncommon::blocking_status('boards');
     if ($blocked) {
+        $blocktext = '<br /><div class="LC_feedback_link"><span class="LC_feedback_link">'.$blocktext."</span>";
         &Apache::lonenc::check_encrypt(\$ressymb);
         if ($mode ne 'board') {
-            $blocktext.='<br /><div class="LC_feedback_link">'.&send_message_link($ressymb).'</div>';
+            $blocktext.=&send_message_link($ressymb).'</div>';
+        }else{
+            $blocktext.="</div>";
         }
         return $blocktext; 
     }
Index: loncom/interface/lonblockingstatus.pm
diff -u loncom/interface/lonblockingstatus.pm:1.1 loncom/interface/lonblockingstatus.pm:1.2
--- loncom/interface/lonblockingstatus.pm:1.1	Tue Jul  7 19:50:47 2009
+++ loncom/interface/lonblockingstatus.pm	Thu Jul  9 12:53:28 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # displays the blocking status table
 #
-# $Id: lonblockingstatus.pm,v 1.1 2009/07/07 19:50:47 droeschl Exp $
+# $Id: lonblockingstatus.pm,v 1.2 2009/07/09 12:53:28 kalberla Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -44,8 +44,8 @@
             'Communication Blocking Status Information',
             undef, {'only_body' => 1, }));
 
-    my $table = 'Status table goes here';
-    $r->print($table);
+    my ($blocked, $blocktext) = &Apache::loncommon::blocking_status_print('boards');
+    $r->print($blocktext);
 
     $r->print(Apache::loncommon::end_page());
     return OK;