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

ng lon-capa-cvs@mail.lon-capa.org
Tue, 22 Jul 2003 19:00:51 -0000


ng		Tue Jul 22 15:00:51 2003 EDT

  Modified files:              
    /loncom/interface	lonindexer.pm 
  Log:
  Remove review link and change refresh to update display.
  
  
  
Index: loncom/interface/lonindexer.pm
diff -u loncom/interface/lonindexer.pm:1.70 loncom/interface/lonindexer.pm:1.71
--- loncom/interface/lonindexer.pm:1.70	Mon Jul 21 14:35:25 2003
+++ loncom/interface/lonindexer.pm	Tue Jul 22 15:00:51 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Directory Indexer
 #
-# $Id: lonindexer.pm,v 1.70 2003/07/21 18:35:25 ng Exp $
+# $Id: lonindexer.pm,v 1.71 2003/07/22 19:00:51 ng Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -320,7 +320,11 @@
 <script type="text/javascript">
 $catalogmodefunctions
 function openWindow(url, wdwName, w, h, toolbar,scrollbar,locationbar) {
-    var options = "width=" + w + ",height=" + h + ",";
+    var xpos = (screen.width-w)/2;
+    xpos = (xpos < 0) ? '0' : xpos;
+    var ypos = (screen.height-h)/2-30;
+    ypos = (ypos < 0) ? '0' : ypos;
+    var options = "width=" + w + ",height=" + h + ",screenx="+xpos+",screeny="+ypos+",";
     options += "resizable=yes,scrollbars="+scrollbar+",status=no,";
     options += "menubar=no,toolbar="+toolbar+",location="+locationbar+",directories=no";
     var newWin = window.open(url, wdwName, options);
@@ -391,6 +395,8 @@
 	    }
 	}
 # ------------------------------- output state of file attributes to be showing
+#                                 All versions has to the last item
+#                                 since it does not take an extra col
 	$r->print(<<END);
 <form method="post" name="fileattr" action="$uri"
  enctype="application/x-www-form-urlencoded">
@@ -410,8 +416,7 @@
 </tr></table>
 <input type="hidden" name="dirPointer" value="on" />
 <input type="hidden" name="acts" value="" />
-<input type="submit" name="attrs" value="Review" />&nbsp;
-<input type="submit" name="attrs" value="Refresh" />
+<input type="submit" name="attrs" value="Update Display" />
 $closebutton
 $groupimportbutton
 </form>
@@ -578,7 +583,7 @@
     my @list;
     (my $luri = $uri) =~ s/\//_/g;
 
-    if ($ENV{'form.attrs'} eq 'Refresh') {
+    if ($ENV{'form.attrs'} eq 'Update Display') {
 	foreach (keys %hash) {
 	    delete $hash{$_} if ($_ =~ /^dirlist_files_/);
 	    }
@@ -828,7 +833,7 @@
 		   " TARGET=_self>$listname</a> ");
 
 	$r->print (" (<a href=\"javascript:openWindow('".$filelink.
-		   ".meta', 'metadatafile', '400', '450', 'no', 'yes','no')\"; ".
+		   ".meta', 'metadatafile', '500', '550', 'no', 'yes','no')\"; ".
 		   "TARGET=_self>metadata</a>) ") if ($metafile == 1);
 
 	$r->print("</td>\n");
@@ -886,9 +891,9 @@
         }
 	if ($hash{'display_attrs_8'} == 1) {
 	    my (%stat) = &Apache::lonmeta::dynamicmeta($filelink) if ($metafile == 1);
-	    my $stat = ($stat{'course'} eq '' ? '' : $stat{'course'}).
-		(($stat{'course'} ne '' || $stat{'count'} ne '') ? '/' : '').
-		($stat{'count'} eq '' ? '' : $stat{'count'});
+	    my $stat = (exists($stat{'course'}) ? $stat{'course'} : '').
+		((exists($stat{'course'}) || exists($stat{'count'})) ? '/' : '').
+		(exists($stat{'count'}) ? $stat{'count'} : '');
 	    $r->print('<td align=center> '.($stat eq '' ? '&nbsp;' : $stat).
 		      ' </td>'."\n");
 	}