[LON-CAPA-cvs] cvs: loncom(loncapaMITrelate_1) /interface lonpreferences.pm

raeburn raeburn at source.lon-capa.org
Thu Feb 16 22:32:34 EST 2012


raeburn		Fri Feb 17 03:32:34 2012 EDT

  Modified files:              (Branch: loncapaMITrelate_1)
    /loncom/interface	lonpreferences.pm 
  Log:
  - Customization for MITrelate.
    - Eliminate domain select box if user is in "relate" domain.
  
  
Index: loncom/interface/lonpreferences.pm
diff -u loncom/interface/lonpreferences.pm:1.186.2.8.2.1 loncom/interface/lonpreferences.pm:1.186.2.8.2.2
--- loncom/interface/lonpreferences.pm:1.186.2.8.2.1	Tue Feb  7 16:21:32 2012
+++ loncom/interface/lonpreferences.pm	Fri Feb 17 03:32:34 2012
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Preferences
 #
-# $Id: lonpreferences.pm,v 1.186.2.8.2.1 2012/02/07 16:21:32 raeburn Exp $
+# $Id: lonpreferences.pm,v 1.186.2.8.2.2 2012/02/17 03:32:34 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1360,7 +1360,7 @@
 	my $jsh=Apache::File->new($include."/londes.js");
 	$r->print(<$jsh>);
     }
-    $r->print(&jscript_send($caller));
+    $r->print(&jscript_send($caller,$domain));
     $r->print(<<ENDFORM);
 $errormessage
 
@@ -1377,7 +1377,7 @@
 }
 
 sub jscript_send {
-    my ($caller) = @_;
+    my ($caller,$domain) = @_;
     my $output = qq|
 <script type="text/javascript" language="JavaScript">
 
@@ -1405,8 +1405,19 @@
         $output .= qq|
         this.document.pserver.elements.uname.value =
                    this.document.client.elements.uname.value;
+|;
+        if ($domain eq 'relate') {
+            $output .= qq|
+        this.document.pserver.elements.udom.value =
+                   this.document.client.elements.udom.value;
+|;
+        } else {
+            $output .= qq|
         this.document.pserver.elements.udom.value =
                    this.document.client.elements.udom.options[this.document.client.elements.udom.selectedIndex].value;
+|;
+        }
+        $output .= qq| 
         this.document.pserver.elements.email.value =
                    this.document.client.elements.email.value;
 |;
@@ -1440,12 +1451,17 @@
                   .&Apache::lonhtmlcommon::row_title(
                        '<label for="uname">'.$lt{'username'}.'</label>')
                   .'<input type="text" name="uname" size="30" />'
-                  .'<input type="hidden" name="currentpass" value="'.$currentpass.'" />'
-                  .&Apache::lonhtmlcommon::row_closure()
-                  .&Apache::lonhtmlcommon::row_title(
-                       '<label for="udom">'.$lt{'domain'}.'</label>')
-                  .&Apache::loncommon::select_dom_form($defdom,'udom')
-                  .&Apache::lonhtmlcommon::row_closure();
+                  .'<input type="hidden" name="currentpass" value="'.$currentpass.'" />';
+        if ($defdom eq 'relate') {
+            $output .= '<input type="hidden" name="udom" value="'.$defdom.'" />'
+                      .&Apache::lonhtmlcommon::row_closure(); 
+        } else {
+            $output .= &Apache::lonhtmlcommon::row_closure()
+                      .&Apache::lonhtmlcommon::row_title(
+                           '<label for="udom">'.$lt{'domain'}.'</label>')
+                      .&Apache::loncommon::select_dom_form($defdom,'udom')
+                      .&Apache::lonhtmlcommon::row_closure();
+        }
     } else {
         $output .= &Apache::lonhtmlcommon::row_title(
                        '<label for="currentpass">'.$lt{'currentpass'}.'</label>')




More information about the LON-CAPA-cvs mailing list