[LON-CAPA-cvs] cvs: loncom(version_2_11_X) /xml lonxml.pm

raeburn raeburn at source.lon-capa.org
Sun May 12 09:32:16 EDT 2013


raeburn		Sun May 12 13:32:16 2013 EDT

  Modified files:              (Branch: version_2_11_X)
    /loncom/xml	lonxml.pm 
  Log:
  - For 2.11
    - Backport 1.540
  
  
Index: loncom/xml/lonxml.pm
diff -u loncom/xml/lonxml.pm:1.531.2.7 loncom/xml/lonxml.pm:1.531.2.8
--- loncom/xml/lonxml.pm:1.531.2.7	Sun May 12 00:00:24 2013
+++ loncom/xml/lonxml.pm	Sun May 12 13:32:16 2013
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # XML Parser Module 
 #
-# $Id: lonxml.pm,v 1.531.2.7 2013/05/12 00:00:24 raeburn Exp $
+# $Id: lonxml.pm,v 1.531.2.8 2013/05/12 13:32:16 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1629,6 +1629,7 @@
 // ]]>
 </script>
 FULLPAGE
+      my $textareaclass;
       if ($filetype eq 'html') {
           my $context;
           if ($env{'request.course.id'}) {
@@ -1642,6 +1643,9 @@
                                                                  $uri,undef,
                                                                  "/public/$cdom/$cnum/syllabus").
                       "\n";
+                  if (&Apache::lonhtmlcommon::htmlareabrowser()) {
+                      $textareaclass = 'class="LC_richDefaultOn"';
+                  }
               }
           }
           unless ($context eq 'syllabus') {
@@ -1663,7 +1667,6 @@
       }
 
       my $titledisplay=&display_title();
-      my $textareaclass;
       my %lt=&Apache::lonlocal::texthash('st' => 'Save and Edit',
 					 'vi' => 'Save and View',
 					 'dv' => 'Discard Edits and View',
@@ -1679,7 +1682,9 @@
               $htmlerror='<span class="LC_error">'.$htmlerror.'</span>';
           }
           if (&Apache::lonhtmlcommon::htmlareabrowser()) {
-              $textareaclass = 'class="LC_richDefaultOff"';
+              unless ($textareaclass) {
+                  $textareaclass = 'class="LC_richDefaultOff"';
+              }
           }
       }
       my $editfooter=(<<ENDFOOTER);
@@ -1785,6 +1790,19 @@
         &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
                                                 ['todocs']);
     }
+    my ($cdom,$cnum);
+    if ($env{'request.course.id'}) {
+        $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'};
+        $cnum = $env{'course.'.$env{'request.course.id'}.'.num'};
+        if ($filetype eq 'html') {
+            if ($request->uri =~ m{^\Q/uploaded/$cdom/$cnum/portfolio/syllabus/\E.+$}) {
+                if (&Apache::lonnet::allowed('mdc',$env{'request.course.id'})) {
+                    &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
+                                                            ['editmode']);
+                }
+            }
+        }
+    }
     if ($filetype eq 'sty') {
         $breadcrumbtext = 'Style File Editor';
     } elsif ($filetype eq 'js') {
@@ -1914,13 +1932,16 @@
 	    $displayfile=$request->uri;
             if ($request->uri =~ m{^/uploaded/}) {
                 if ($env{'request.course.id'}) {
-                    my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'};
-                    my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'};
                     if ($request->uri =~ m{^\Q/uploaded/$cdom/$cnum/supplemental/\E}) {
                         &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
                                                                 ['folderpath','title']);
                     } elsif ($request->uri =~ m{^\Q/uploaded/$cdom/$cnum/portfolio/syllabus/\E(.+)$}) {
-                        $displayfile = &mt('Syllabus file: [_1]',$1);
+                        my $filename = $1;
+                        if ($1 eq 'loncapa.html') {
+                            $displayfile = &mt('Syllabus (minimal template)');
+                        } else {
+                            $displayfile = &mt('Syllabus file: [_1]',$1);
+                        }
                         $itemtitle = &mt('Syllabus');
                     }
                 }




More information about the LON-CAPA-cvs mailing list