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

raeburn raeburn at source.lon-capa.org
Sat May 11 20:00:24 EDT 2013


raeburn		Sun May 12 00:00:24 2013 EDT

  Modified files:              (Branch: version_2_11_X)
    /loncom/xml	lonxml.pm 
  Log:
  - For 2.11
    - Backport 1.539.
  
  
Index: loncom/xml/lonxml.pm
diff -u loncom/xml/lonxml.pm:1.531.2.6 loncom/xml/lonxml.pm:1.531.2.7
--- loncom/xml/lonxml.pm:1.531.2.6	Mon Mar 18 00:04:27 2013
+++ loncom/xml/lonxml.pm	Sun May 12 00:00:24 2013
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # XML Parser Module 
 #
-# $Id: lonxml.pm,v 1.531.2.6 2013/03/18 00:04:27 raeburn Exp $
+# $Id: lonxml.pm,v 1.531.2.7 2013/05/12 00:00:24 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1630,11 +1630,27 @@
 </script>
 FULLPAGE
       if ($filetype eq 'html') {
-          if ($symb || $folderpath) {
-              $deps_button = &Apache::lonhtmlcommon::dependencies_button()."\n";
-              $initialize .= 
-                  &Apache::lonhtmlcommon::dependencycheck_js($symb,$itemtitle,
-                                                             undef,$folderpath,$uri)."\n";
+          my $context;
+          if ($env{'request.course.id'}) {
+              my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'};
+              my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'};
+              if ($uri =~ m{^\Q/uploaded/$cdom/$cnum/portfolio/syllabus/\E}) {
+                  $context = 'syllabus';
+                  $deps_button = &Apache::lonhtmlcommon::dependencies_button()."\n";
+                  $initialize .=
+                      &Apache::lonhtmlcommon::dependencycheck_js(undef,&mt('Syllabus'),
+                                                                 $uri,undef,
+                                                                 "/public/$cdom/$cnum/syllabus").
+                      "\n";
+              }
+          }
+          unless ($context eq 'syllabus') {
+              if ($symb || $folderpath) {
+                  $deps_button = &Apache::lonhtmlcommon::dependencies_button()."\n";
+                  $initialize .=
+                      &Apache::lonhtmlcommon::dependencycheck_js($symb,$itemtitle,
+                                                                 undef,$folderpath,$uri)."\n";
+              }
           }
           $dragmath_button = '<span id="math_filecont">'.&Apache::lonhtmlcommon::dragmath_button('filecont',1).'</span>';
           $initialize .= "\n".&Apache::lonhtmlcommon::dragmath_js('EditMathPopup');
@@ -1900,15 +1916,20 @@
                 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/\Esupplemental/}) {
+                    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);
+                        $itemtitle = &mt('Syllabus');
                     }
                 }
-
-                ($symb,$itemtitle,$displayfile) = 
-                    &get_courseupload_hierarchy($request->uri,
-                                                $env{'form.folderpath'},$env{'form.title'});
+                unless ($itemtitle) {
+                    ($symb,$itemtitle,$displayfile) = 
+                        &get_courseupload_hierarchy($request->uri,
+                                                    $env{'form.folderpath'},
+                                                    $env{'form.title'});
+                }
             } else {
 	        $displayfile=~s/^\/[^\/]*//;
             }




More information about the LON-CAPA-cvs mailing list