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

tempelho tempelho@source.lon-capa.org
Tue, 09 Jun 2009 18:42:42 -0000


This is a MIME encoded message

--tempelho1244572962
Content-Type: text/plain

tempelho		Tue Jun  9 18:42:42 2009 EDT

  Modified files:              
    /loncom/interface	loncommon.pm londocs.pm 
  Log:
  Maked a few style changes for londocs. Put the help for the main course documents to the bottom.
  Opened tabs now stay open after doing an operation.
  
  
--tempelho1244572962
Content-Type: text/plain
Content-Disposition: attachment; filename="tempelho-20090609184242.txt"

Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.840 loncom/interface/loncommon.pm:1.841
--- loncom/interface/loncommon.pm:1.840	Mon Jun  8 18:04:45 2009
+++ loncom/interface/loncommon.pm	Tue Jun  9 18:42:42 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.840 2009/06/08 18:04:45 bisitz Exp $
+# $Id: loncommon.pm,v 1.841 2009/06/09 18:42:42 tempelho Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -5820,7 +5820,7 @@
 }
 
 .LC_Box > .LC_hcell {
-    margin: 0 -10px 10px -10px;
+    margin: 0 -10px;
 }
 
 .LC_noBorder {
@@ -5961,7 +5961,7 @@
 
 ul.LC_TabContent li:hover, ul.LC_TabContent li.active {
         background:#FFFFFF url(/adm/lonIcons/open.gif) no-repeat scroll right center;
-	border-bottom:solid 1px #FFFFFF;
+	border-bottom:solid 2px #FFFFFF;
 	padding-right: 16px;
 }
 
@@ -5971,7 +5971,11 @@
 	border-left:solid 1px $lg_border_color;
 	padding:5px 10px 5px 10px;
 	margin-left:2px;
-	background:url(/adm/lonIcons/lightGreyBG.png) repeat-x left top;
+	background: #d9d9d9;
+}
+
+#maincoursedoc {
+	clear:both;
 }
 
 ul.LC_TabContentBigger li:hover, 
Index: loncom/interface/londocs.pm
diff -u loncom/interface/londocs.pm:1.370 loncom/interface/londocs.pm:1.371
--- loncom/interface/londocs.pm:1.370	Mon Jun  8 18:04:45 2009
+++ loncom/interface/londocs.pm	Tue Jun  9 18:42:42 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Documents
 #
-# $Id: londocs.pm,v 1.370 2009/06/08 18:04:45 bisitz Exp $
+# $Id: londocs.pm,v 1.371 2009/06/09 18:42:42 tempelho Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2824,6 +2824,7 @@
 
 	my $fileuploadform=(<<FUFORM);
 	<form name="uploaddocument" action="/adm/coursedocs" method="post" enctype="multipart/form-data">
+	<input type="hidden" name="active" value="aa" />
 	$fileupload
 	<br />
 	$lt{'title'}:<br />
@@ -2845,6 +2846,7 @@
 
 	my $simpleeditdefaultform=(<<SEDFFORM);
 	<form action="/adm/coursedocs" method="post" name="simpleeditdefault">
+	<input type="hidden" name="active" value="bb" />
 	$lt{'pubd'}<br />
 	$uploadtag
 	<input type="button" onclick="javascript:groupsearch()" value="$lt{'srch'}" />
@@ -2939,8 +2941,6 @@
           $active = 'style="display: block;"';
        }
        $r->print('<div class="LC_ContentBox" id="mainCourseDocuments" '.$active.'>');
-        $r->print(&Apache::loncommon::help_open_topic('Docs_Adding_Course_Doc',
-                     &mt('Editing the Table of Contents for your '.$type)));
        my $folder=$env{'form.folder'};
        if ($folder eq '' || $folder=~/^supplemental/) {
            $folder='default';
@@ -2987,6 +2987,7 @@
 
 	my $newnavform=(<<NNFORM);
 	<form action="/adm/coursedocs" method="post" name="newnav">
+	<input type="hidden" name="active" value="cc" />
 	$uploadtag
 	<input type="hidden" name="importdetail" 
 	value="$lt{'navc'}=/adm/navmaps" />
@@ -2998,6 +2999,7 @@
 NNFORM
 	my $newsmppageform=(<<NSPFORM);
 	<form action="/adm/coursedocs" method="post" name="newsmppg">
+	<input type="hidden" name="active" value="cc" />
 	$uploadtag
 	<input type="hidden" name="importdetail" value="" />
 	<span class="LC_nobreak">
@@ -3009,6 +3011,7 @@
 
 	my $newsmpproblemform=(<<NSPROBFORM);
 	<form action="/adm/coursedocs" method="post" name="newsmpproblem">
+	<input type="hidden" name="active" value="cc" />
 	$uploadtag
 	<input type="hidden" name="importdetail" value="" />
 	<span class="LC_nobreak">
@@ -3021,6 +3024,7 @@
 
 	my $newdropboxform=(<<NDBFORM);
 	<form action="/adm/coursedocs" method="post" name="newdropbox">
+	<input type="hidden" name="active" value="cc" />
 	$uploadtag
 	<input type="hidden" name="importdetail" value="" />
 	<span class="LC_nobreak">
@@ -3032,6 +3036,7 @@
 
 	my $newexuploadform=(<<NEXUFORM);
 	<form action="/adm/coursedocs" method="post" name="newexamupload">
+	<input type="hidden" name="active" value="cc" />
 	$uploadtag
 	<input type="hidden" name="importdetail" value="" />
 	<span class="LC_nobreak">
@@ -3044,6 +3049,7 @@
 
 	my $newbulform=(<<NBFORM);
 	<form action="/adm/coursedocs" method="post" name="newbul">
+	<input type="hidden" name="active" value="cc" />
 	$uploadtag
 	<input type="hidden" name="importdetail" value="" />
 	<span class="LC_nobreak">
@@ -3056,6 +3062,7 @@
 
 	my $newaboutmeform=(<<NAMFORM);
 	<form action="/adm/coursedocs" method="post" name="newaboutme">
+	<input type="hidden" name="active" value="cc" />
 	$uploadtag
 	<input type="hidden" name="importdetail" 
 	value="$plainname=/adm/$udom/$uname/aboutme" />
@@ -3068,6 +3075,7 @@
 
 	my $newaboutsomeoneform=(<<NASOFORM);
 	<form action="/adm/coursedocs" method="post" name="newaboutsomeone">
+	<input type="hidden" name="active" value="cc" />
 	$uploadtag
 	<input type="hidden" name="importdetail" value="" />
 	<span class="LC_nobreak">
@@ -3080,6 +3088,7 @@
 
 	my $newrosterform=(<<NROSTFORM);
 	<form action="/adm/coursedocs" method="post" name="newroster">
+	<input type="hidden" name="active" value="cc" />
 	$uploadtag
 	<input type="hidden" name="importdetail" 
 	value="$lt{'rost'}=/adm/viewclasslist" />
@@ -3100,6 +3109,7 @@
 	<form action="/adm/coursedocs" method="post" name="newpage">
 	<input type="hidden" name="folderpath" value="$path" />
 	<input type="hidden" name="importdetail" value="" />
+	<input type="hidden" name="active" value="cc" />
 	<span class="LC_nobreak">
 	<input name="newpage" type="button"
 	onclick="javascript:makenewpage(this.form,'$pageseq');"
@@ -3112,6 +3122,7 @@
 	<form action="/adm/coursedocs" method="post" name="newfolder">
 	<input type="hidden" name="folderpath" value="$path" />
 	<input type="hidden" name="importdetail" value="" />
+	<input type="hidden" name="active" value="aa" />
 	<span class="LC_nobreak">
 	<input name="newfolder" type="button"
 	onclick="javascript:makenewfolder(this.form,'$folderseq');"
@@ -3122,6 +3133,7 @@
 
 	my $newsylform=(<<NSYLFORM);
 	<form action="/adm/coursedocs" method="post" name="newsyl">
+	<input type="hidden" name="active" value="cc" />
 	$uploadtag
 	<input type="hidden" name="importdetail" 
 	value="$lt{'syll'}=/public/$coursedom/$coursenum/syllabus" />
@@ -3134,6 +3146,7 @@
 
 	my $newgroupfileform=(<<NGFFORM);
 	<form action="/adm/coursedocs" method="post" name="newgroupfiles">
+	<input type="hidden" name="active" value="cc" />
 	$uploadtag
 	<input type="hidden" name="importdetail"
 	value="$lt{'grpo'}=/adm/$coursedom/$coursenum/aboutme" />
@@ -3175,6 +3188,8 @@
        }
 
        &changewarning($r,'');
+ $r->print(&Apache::loncommon::help_open_topic('Docs_Adding_Course_Doc',
+                     &mt('Editing the Table of Contents for your '.$type)));
 $r->print('</div>');
        if ($env{'form.pagepath'}) {
        }
@@ -3205,6 +3220,7 @@
 
 	my $supupdocform=(<<SUPDOCFORM);
 	<form action="/adm/coursedocs" method="post" enctype="multipart/form-data">
+	<input type="hidden" name="active" value="ee" />	
 	$fileupload
 	<br />
 	<br />
@@ -3227,6 +3243,7 @@
 
 	my $supnewfolderform=(<<SNFFORM);
 	<form action="/adm/coursedocs" method="post" name="supnewfolder">
+	<input type="hidden" name="active" value="ee" />
 	<input type="hidden" name="folderpath" value="$path" />
 	<input type="hidden" name="importdetail" value="" />
 	<span class="LC_nobreak">
@@ -3240,6 +3257,7 @@
 
 	my $supnewextform=(<<SNEFORM);
 	<form action="/adm/coursedocs" method="post" name="supnewext">
+	<input type="hidden" name="active" value="ff" />
 	<input type="hidden" name="folderpath" value="$path" />
 	<input type="hidden" name="importdetail" value="" />
 	<span class="LC_nobreak">
@@ -3252,6 +3270,7 @@
 
 	my $supnewsylform=(<<SNSFORM);
 	<form action="/adm/coursedocs" method="post" name="supnewsyl">
+	<input type="hidden" name="active" value="ff" />
 	<input type="hidden" name="folderpath" value="$path" />
 	<input type="hidden" name="importdetail" 
 	value="Syllabus=/public/$coursedom/$coursenum/syllabus" />
@@ -3264,6 +3283,7 @@
 
 	my $supnewaboutmeform=(<<SNAMFORM);
 	<form action="/adm/coursedocs" method="post" name="subnewaboutme">
+	<input type="hidden" name="active" value="ff" />
 	<input type="hidden" name="folderpath" value="$path" />
 	<input type="hidden" name="importdetail" 
 	value="$plainname=/adm/$udom/$uname/aboutme" />
@@ -3347,21 +3367,40 @@
     my ($tid,$varcd,$orderhash_ref) = @_;
     my %orderhash = %{$orderhash_ref};
     my $form;
-
+    my $activetab;
+    my $active;
+    if($env{'form.active'} ne ''){
+        $activetab = $env{'form.active'};
+    }
     $form = '<div class="LC_Box"><h4 class="LC_hcell">'.&mt($varcd).'</h4>';
     $form .= '<ul id="navigation'.$tid.'" class="LC_TabContent">';
     foreach my $name (sort(keys(%orderhash))){
         if($name eq 'zz'){
-            $form .= '<span class="LC_Right"><li onclick="javascript:hideAll(this, \'navigation'.$tid.'\' ,\'content'.$tid.'\');" class="active">'.&mt(${$orderhash{$name}}[0]).'</li></span>';
+            if($activetab ne ''){
+               $active = '';
+            }else{
+               $active = 'class="active"';
+            }
+            $form .= '<span class="LC_Right"><li onclick="javascript:hideAll(this, \'navigation'.$tid.'\' ,\'content'.$tid.'\');" '.$active.'>'.&mt(${$orderhash{$name}}[0]).'</li></span>';
         }else{
-            $form .= '<li onclick="javascript:showPage(this, \''.substr(${$orderhash{$name}}[0],0,3).$tid.'\', \'navigation'.$tid.'\',\'content'.$tid.'\');">'.&mt(${$orderhash{$name}}[0]).'</li>';
+            if($activetab eq '' || $activetab ne $name){
+               $active = '';
+            }elsif($activetab eq $name){
+               $active = 'class="active"';
+            }
+            $form .= '<li '.$active.' onclick="javascript:showPage(this, \''.substr(${$orderhash{$name}}[0],0,3).$tid.'\', \'navigation'.$tid.'\',\'content'.$tid.'\');">'.&mt(${$orderhash{$name}}[0]).'</li>';
         }
     }
     $form .= '</ul>';
     $form .= '<div id="content'.$tid.'" style="padding: 0 0; margin: 0 0;">';
     foreach my $field (keys(%orderhash)){
 	if($field ne 'zz'){
-           $form .= '<div id="'.substr(${$orderhash{$field}}[0],0,3).$tid.'" class="LC_ContentBox" style="display: none;">'.${$orderhash{$field}}[1].'</div>';
+        if($activetab eq '' || $activetab ne $field){
+                $active = 'style="display: none;"';
+        }elsif($activetab eq $field){
+                $active = 'style="display:block;"';
+        }
+           $form .= '<div id="'.substr(${$orderhash{$field}}[0],0,3).$tid.'" class="LC_ContentBox" '.$active.'">'.${$orderhash{$field}}[1].'</div>';
         }
     }
     $form .= '</div></div>';

--tempelho1244572962--