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

muellerd muellerd@source.lon-capa.org
Mon, 02 Feb 2009 11:23:56 -0000


muellerd		Mon Feb  2 11:23:56 2009 EDT

  Modified files:              
    /loncom/interface	londocs.pm 
  Log:
  - deleted table structure
  - revised code
  
  
Index: loncom/interface/londocs.pm
diff -u loncom/interface/londocs.pm:1.332 loncom/interface/londocs.pm:1.333
--- loncom/interface/londocs.pm:1.332	Fri Jan 30 11:39:38 2009
+++ loncom/interface/londocs.pm	Mon Feb  2 11:23:56 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Documents
 #
-# $Id: londocs.pm,v 1.332 2009/01/30 11:39:38 tempelho Exp $
+# $Id: londocs.pm,v 1.333 2009/02/02 11:23:56 muellerd Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2878,12 +2878,7 @@
 		     &mt('Editing the Table of Contents for your '.$type)));
     }
 # --------------------------------------------------------- Standard documents
-    $r->print('<table class="LC_docs_documents">');
-
     if (($standard) && ($allowed) && (!$forcesupplement)) {
-	$r->print('<tr><td class="LC_docs_document">');
-#  '<h2>'.&mt('Main Course Documents').
-#  ($allowed?' '.$help{'Main_Course_Documents'}:'').'</h2>');
        my $folder=$env{'form.folder'};
        if ($folder eq '' || $folder eq 'supplemental') {
            $folder='default';
@@ -3037,38 +3032,9 @@
 	</form>
 NROSTFORM
 
-       $r->print(<<ENDFORM);
-
-
-<table class="LC_docs_adddocs">
-<!-- <tr>
-<th>$lt{'uplm'}</th>
-<th>$lt{'impp'}</th>
-<th>$lt{'spec'}</th>
-</tr> -->
-<tr>
-<td>
-$fileuploadform
-</td>
-<td>
-$simpleeditdefaultform
-<hr />
-$recoverform
-ENDFORM
-       unless ($env{'form.pagepath'}) {
-	   $r->print(<<ENDFORM);
-<hr />
-$extresourcesform
-	<br />
-$imspform
-ENDFORM
-       }
-       $r->print('</td><td>');
        unless ($env{'form.pagepath'}) {
 	   my $path = &HTML::Entities::encode($env{'form.folderpath'},'<>&"');
 
-
-
 	my $newpageform=(<<NPFORM);
 	<form action="/adm/coursedocs" method="post" name="newpage">
 	<input type="hidden" name="folderpath" value="$path" />
@@ -3118,36 +3084,22 @@
 NGFFORM
 
 
-           my $specialdocumentsform=(<<ENDFORM);
-<br />
-$newfolderform
-<br />
-$newpageform
-<br />
-$newsylform
-<br />
-$newnavform
-<br />
-$newsmppageform
-<br />
-$newsmpproblemform
-<br />
-$newdropboxform
-<br />
-$newexuploadform
-<br />
-$newbulform
-<br />
-$newaboutmeform
-<br />
-$newaboutsomeoneform
-<br />
-$newgroupfileform
-<br />
-$newrosterform
-ENDFORM
+        my $specialdocumentsform=(<<SPDOFORM);
+	<br />$newfolderform
+	<br />$newpageform
+	<br />$newsylform
+	<br />$newnavform
+	<br />$newsmppageform
+	<br />$newsmpproblemform
+	<br />$newdropboxform
+	<br />$newexuploadform
+	<br />$newbulform
+	<br />$newaboutmeform
+	<br />$newaboutsomeoneform
+	<br />$newgroupfileform
+	<br />$newrosterform
+SPDOFORM
 
-$r->print($specialdocumentsform);
 
 my %orderhash = (
                 'aa' => 'New Document',
@@ -3163,27 +3115,15 @@
 		'More Options' => $extresourcesform.'<br />'.$imspform.'<br />'.$recoverform,
                 'drei' => 'dr',
                 );
+my $tid = '1';
 my $varcd = 'Course Documents';
 $r->print(&generate_edit_table($varcd,\%namehash,\%orderhash)); 
-
       }
        if ($env{'form.pagepath'}) {
-           $r->print(<<ENDBLOCK);
-$newsmpproblemform
-<br />
-$newexuploadform
-ENDBLOCK
        }
-       $r->print('</td></tr>'."\n".
-'</table>');
-#$r->print(&generate_edit_table(\%namehash,\%orderhash));
-       $r->print('</td></tr>');
     }
 # ----------------------------------------------------- Supplemental documents
     if (!$forcestandard) {
-       $r->print('<tr><td class="LC_docs_document">');
-# '<h2>'.&mt('Supplemental Course Documents').
-#  ($allowed?' '.$help{'Supplemental'}:'').'</h2>');
        my $folder=$env{'form.folder'};
        unless ($folder=~/^supplemental/) {
 	   $folder='supplemental';
@@ -3275,30 +3215,32 @@
 	</form>
 SNAMFORM
 
-	   $r->print(<<ENDSUPFORM);
+
+
+my %suporderhash = (
+                'ee' => 'New Document',
+                'ff' => 'Special Documents',
+                'zz' => 'Hide all Options',
+                );
+
+my %supnamehash = (
+                'New Document' => $supupdocform,
+                'Special Documents' => $supnewfolderform.'<br />'.$supnewextform.'<br />'.$supnewsylform.'<br />'.$supnewaboutmeform,
+                );
+my $tid='2';
+my $varscd = 'Supplemented Course Documents';
+
+$r->print(<<FORM);
 <ul class="LC_TabContent">
-<li>$lt{'nd'}</li>
-<li>$lt{'sd'}</li>
-<li>$lt{'hao'}</li>
+	<li>New Document</li>
+	<li>Special Documents</li>
 </ul>
-<table class="LC_docs_adddocs">
-<tr><td>
-$supupdocform
-</td>
-<td>
-$supnewfolderform
-<br />
-$supnewextform
-<br />
-$supnewsylform
-<br />
-$supnewaboutmeform
-</td></tr>
-</table></td></tr>
-ENDSUPFORM
-       }
-    }
-    $r->print('</table>');
+FORM
+
+#$r->print(&generate_edit_table($varscd,\%supnamehash,\%suporderhash));
+
+	} 
+   }
     if ($allowed) {
 	$r->print('
 <form method="post" name="extimport" action="/adm/coursedocs">
@@ -3308,7 +3250,6 @@
   <input type="hidden" name="residx" />
 </form>');
     }
-
   } else {
       unless ($upload_result eq 'phasetwo') {
 # -------------------------------------------------------- This is showdoc mode
@@ -3377,9 +3318,9 @@
     my %orderhash = %{$orderhash_ref};           #name mit kürzel verlinkt mit name
     my $form;
 
-    #foreach my $id (keys(%tablehash)){
+    {
+
     $form = '<div class="LC_ContentBoxSpecial"><h4 class="LC_hcell">'.&mt('Upload '.$varcd).'</h4>';
-    
     $form .= '<ul id="navigation" class="LC_TabContent">';
     foreach my $name (sort(keys(%orderhash))){
         if($name eq 'zz'){
@@ -3393,7 +3334,7 @@
         $form .= '<div id="'.$field.'" class="LC_ContentBox" style="display: none;">'.$namehash{$field}.'</div>';
       }
     $form .= '</div></div>';
-#}
+    }
     return $form;
 }
 
@@ -3599,11 +3540,12 @@
 }
 
 function unselectInactive() {
-currentNav = document.getElementById('navigation');
-currentLis = currentNav.getElementsByTagName('LI');
-for (i = 0; i < currentLis.length; i++) {
-currentLis[i].className = 'i';
-}
+	currentTable = document.getElementById('tableId');
+	currentNav = document.getElementById('navigation');
+	currentLis = currentNav.getElementsByTagName('LI');
+	for (i = 0; i < currentLis.length; i++) {
+		currentLis[i].className = 'i';
+	}
 }
 
 function hideAll(current) {
@@ -3612,7 +3554,7 @@
 	currentData = document.getElementById('content');
 	currentDivs = currentData.getElementsByTagName('DIV');
 	for (i = 0; i < currentDivs.length; i++) {
-	currentDivs[i].style.display = 'none';
+		currentDivs[i].style.display = 'none';
 	}
 }