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

taceyjo1 lon-capa-cvs@mail.lon-capa.org
Tue, 11 May 2004 07:35:12 -0000


taceyjo1		Tue May 11 03:35:12 2004 EDT

  Modified files:              
    /loncom/interface	lonindexer.pm 
  Log:
  There we go, titles are nice and happy for when you do a single pick, Group import is being left alone, as it works just great for group imports.  This should 
  work just fine, will work with all modes, however, it only seems to be useful in edit mode.  If there are more modes it needs to workwith.  it's just a quick 
  couple of lines of code in the data javascript function and everything is good.
  
  I'm closing bug 2884 now, really, stop reopening it.... <cough> guy </cough> :P
  
  
  
Index: loncom/interface/lonindexer.pm
diff -u loncom/interface/lonindexer.pm:1.104 loncom/interface/lonindexer.pm:1.105
--- loncom/interface/lonindexer.pm:1.104	Tue May 11 01:19:30 2004
+++ loncom/interface/lonindexer.pm	Tue May 11 03:35:12 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Directory Indexer
 #
-# $Id: lonindexer.pm,v 1.104 2004/05/11 05:19:30 albertel Exp $
+# $Id: lonindexer.pm,v 1.105 2004/05/11 07:35:12 taceyjo1 Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -127,7 +127,28 @@
     {
 	if ($ENV{'form.launch'} eq '1') {
 	    &start_fresh_session();
-        }
+   }
+  #Hijack lonindexer to verify a title and be close down.
+   if ($ENV{'form.launch'} eq '2') {
+   	#$r->content_type('text/html');
+   	my $verify_title = &Apache::lonnet::gettitle($ENV{'form.acts'});
+   	title: $verify_title");
+   	$r->print(<<ENDSUBM);
+		<html>
+		<script type="text/javascript">
+		function load() {
+			window.opener.document.forms["$ENV{'form.form'}"].elements["$ENV{'form.element'}"].value='$ENV{'form.acts'}';
+			window.opener.document.forms["$ENV{'form.form'}"].elements["$ENV{'form.titleelement'}"].value='$verify_title';
+			window.close();
+		}
+   	</script>
+    	<body onLoad=load();>
+     	</body>
+    	</html>
+ENDSUBM
+		return OK;
+   }
+    
 # -------------------- refresh environment with user database values (in %hash)
 	&setvalues(\%hash,'form.catalogmode',\%ENV,'form.catalogmode'   );
 
@@ -236,11 +257,9 @@
 		$catalogmodefunctions=<<END;
 // mode = $mode
 function select_data(title,url) {
-    changeURL(url);
-    changeTitle(title);
-    self.close();
+var location = "/res/?launch=2&form=$form&element=$element&titleelement=$titleelement&acts=" + url;
+   window.location=location;
 }
-
 function select_group() {
     window.location="$location"+document.forms.fileattr.acts.value;
 }