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

raeburn raeburn@source.lon-capa.org
Fri, 30 Oct 2009 20:24:39 -0000


raeburn		Fri Oct 30 20:24:39 2009 EDT

  Modified files:              
    /loncom/interface	londocs.pm 
  Log:
  - Accommodate Communities.
    Titles of tabs in Course/Community Editor depend on type of course.
  
  
Index: loncom/interface/londocs.pm
diff -u loncom/interface/londocs.pm:1.406 loncom/interface/londocs.pm:1.407
--- loncom/interface/londocs.pm:1.406	Fri Oct 30 19:50:24 2009
+++ loncom/interface/londocs.pm	Fri Oct 30 20:24:39 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Documents
 #
-# $Id: londocs.pm,v 1.406 2009/10/30 19:50:24 raeburn Exp $
+# $Id: londocs.pm,v 1.407 2009/10/30 20:24:39 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -3016,7 +3016,16 @@
  
     my $activeClass = 1;
     my $active = '';
-
+    my %tabtitles = (
+                       main => {
+                                 Course => &mt('Main Course Documents'),
+                                 Community => &mt('Main Community Documents'),
+                               },
+                       supplemental => {
+                                 Course => &mt('Supplemental Course Documents'),        
+                                 Community => &mt('Supplemental Community Documents'),
+                               },
+                    );
     if ($allowed) {
         $r->print('<ul class="LC_TabContentBigger" id="mainnav">');
         if (($standard) && ($allowed) && (!$forcesupplement) && (($env{'form.folderpath'}=~/^default/) || $env{'form.folderpath'}eq"" || ($env{'form.pagepath'}))) {
@@ -3025,14 +3034,14 @@
 	        $activeClass = 0;
 	    }
         }
-        $r->print('<li '.$active.' onclick="javascript:showPage(this,\'mainCourseDocuments\',\'mainnav\',\'maincoursedoc\');"><a href="#"><b>'.&mt('Main Course Documents').'</b></a></li>');
+        $r->print('<li '.$active.' onclick="javascript:showPage(this,\'mainCourseDocuments\',\'mainnav\',\'maincoursedoc\');"><a href="#"><b>'.$tabtitles{'main'}{$type}.'</b></a></li>');
         $active = '';
         if (!$forcestandard || ($env{'form.folderpath'}=~/^supplemental/)) {
             if($activeClass == 1){
                 $active = 'class="active"';
             }
         }
-        $r->print('<li '.$active.' onclick="javascript:showPage(this,\'supplCourseDocuments\',\'mainnav\',\'maincoursedoc\');"><a href="#"><b>'.&mt('Supplemental Course Documents').'</b></a></li>');
+        $r->print('<li '.$active.' onclick="javascript:showPage(this,\'supplCourseDocuments\',\'mainnav\',\'maincoursedoc\');"><a href="#"><b>'.$tabtitles{'supplemental'}{$type}.'</b></a></li>');
         $r->print('</ul>');
     } else {
         $r->print('<br />');
@@ -3051,7 +3060,7 @@
        if ($folder eq '' || $folder=~/^supplemental/) {
            $folder='default';
 	   $savefolderpath = $env{'form.folderpath'};
-	   $env{'form.folderpath'}='default&'.&escape(&mt('Main '.$type.' Documents'));
+	   $env{'form.folderpath'}='default&'.&escape($tabtitles{'main'}{$type});
            $uploadtag = '<input type="hidden" name="folderpath" value="'.
 	       &HTML::Entities::encode($env{'form.folderpath'},'<>&"').'" />';
        }