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

ehlerst ehlerst@source.lon-capa.org
Tue, 10 Mar 2009 22:15:43 -0000


ehlerst		Tue Mar 10 22:15:43 2009 EDT

  Modified files:              
    /loncom/interface	londocs.pm 
  Log:
  Insert hidden form field with the name "suppactive", to keep supplemental course documents tab active, when a form from the supp course docs is used.
  
  
Index: loncom/interface/londocs.pm
diff -u loncom/interface/londocs.pm:1.354 loncom/interface/londocs.pm:1.355
--- loncom/interface/londocs.pm:1.354	Tue Mar 10 18:49:22 2009
+++ loncom/interface/londocs.pm	Tue Mar 10 22:15:43 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Documents
 #
-# $Id: londocs.pm,v 1.354 2009/03/10 18:49:22 tempelho Exp $
+# $Id: londocs.pm,v 1.355 2009/03/10 22:15:43 ehlerst Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2889,22 +2889,22 @@
     }
 # --------------------------------------------------------- Main tab structure
     my $activeClass = 1;
+    my $active = '';
     $r->print('<ul class="LC_TabContentBigger" id="mainnav">');
-    if (($standard) && ($allowed) && (!$forcesupplement)) {
-	my $active = '';
+    if (($standard) && ($allowed) && (!$forcesupplement) && (!$env{'form.suppactive'})) {
         if($activeClass == 1){
            $active = 'class="active"';
 	   $activeClass = 0;
 	}
-	$r->print('<li '.$active.'onclick="javascript:showPage(this,\'Main Course Documents\',\'mainnav\',\'maincoursedoc\');">'.&mt('Main Course Documents').'</li>');
     }
-    if (!$forcestandard) {
-	my $active = '';
+    $r->print('<li '.$active.'onclick="javascript:showPage(this,\'Main Course Documents\',\'mainnav\',\'maincoursedoc\');">'.&mt('Main Course Documents').'</li>');
+    $active = '';
+    if (!$forcestandard || $env{'form.suppactive'} ) {
         if($activeClass == 1){
            $active = 'class="active"';
         }
-	$r->print('<li '.$active.'onclick="javascript:showPage(this,\'Supplemental Course Documents\',\'mainnav\',\'maincoursedoc\');">'.&mt('Supplemental Course Documents').'</li>');
     }
+    $r->print('<li '.$active.'onclick="javascript:showPage(this,\'Supplemental Course Documents\',\'mainnav\',\'maincoursedoc\');">'.&mt('Supplemental Course Documents').'</li>');
     $r->print('</ul><div class="LC_ContentBoxSpecial" style="margin:0 0;padding:0 0;"><div id="maincoursedoc" style="margin:0 0;padding:0 0;">');
 # --------------------------------------------------------- Standard documents
     if (($standard) && ($allowed) && (!$forcesupplement)) {
@@ -3192,6 +3192,7 @@
 	</textarea>
 	<br />
 	<input type="hidden" name="folderpath" value="$path" />
+	<input type="hidden" name="suppactive" value="true" />
 	<input type="hidden" name="cmd" value="upload_supplemental" />
 	<span class="LC_nobreak">
 	<input type="submit" value="$lt{'upld'}" />
@@ -3204,6 +3205,7 @@
 	<form action="/adm/coursedocs" method="post" name="supnewfolder">
 	<input type="hidden" name="folderpath" value="$path" />
 	<input type="hidden" name="importdetail" value="" />
+	<input type="hidden" name="suppactive" value="true" />
 	<span class="LC_nobreak">
 	<input name="newfolder" type="button"
 	onClick="javascript:makenewfolder(this.form,'$folderseq');"
@@ -3217,6 +3219,7 @@
 	<form action="/adm/coursedocs" method="post" name="supnewext">
 	<input type="hidden" name="folderpath" value="$path" />
 	<input type="hidden" name="importdetail" value="" />
+	<input type="hidden" name="suppactive" value="true" />
 	<span class="LC_nobreak">
 	<input name="newext" type="button" 
 	onClick="javascript:makenewext('supnewext');"
@@ -3230,6 +3233,7 @@
 	<input type="hidden" name="folderpath" value="$path" />
 	<input type="hidden" name="importdetail" 
 	value="Syllabus=/public/$coursedom/$coursenum/syllabus" />
+	<input type="hidden" name="suppactive" value="true" />
 	<span class="LC_nobreak">
 	<input name="newsyl" type="submit" value="$lt{'syll'}" />
 	$help{'Syllabus'}
@@ -3242,6 +3246,7 @@
 	<input type="hidden" name="folderpath" value="$path" />
 	<input type="hidden" name="importdetail" 
 	value="$plainname=/adm/$udom/$uname/aboutme" />
+	<input type="hidden" name="suppactive" value="true" />
 	<span class="LC_nobreak">
 	<input name="newaboutme" type="submit" value="$lt{'mypi'}" />
 	$help{'My Personal Information Page'}