Diff for /loncom/interface/londocs.pm between versions 1.444 and 1.445

version 1.444, 2010/12/07 21:34:04 version 1.445, 2010/12/08 02:08:21
Line 2715  sub handler { Line 2715  sub handler {
       &init_breadcrumbs('exportcourse','IMS Export');        &init_breadcrumbs('exportcourse','IMS Export');
       &exportcourse($r);        &exportcourse($r);
   } else {    } else {
 # is this a standard course?  #
   # Done catching special calls
   # The whole rest is for course and supplemental documents
   # Get the parameters that may be needed
   #
       &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
                                               ['folderpath','pagepath',
                                                'pagesymb','forcesupplement','forcestandard']);
   
   # standard=1: this is a "new-style" course with an uploaded map as top level
   # standard=2: this is a "old-style" course, and there is nothing we can do
   
     my $standard=($env{'request.course.uri'}=~/^\/uploaded\//);      my $standard=($env{'request.course.uri'}=~/^\/uploaded\//);
     my $forcestandard = 0;  
     my $forcesupplement;  # Decide whether this should display supplemental or main content
   # supplementalflag=1: show supplemental documents
   # supplementalflag=0: show standard documents
   
   
       my $supplementalflag=($env{'form.folderpath'}=~/^supplemental/);
       if (($env{'form.folderpath'}=~/^default/) || $env{'form.folderpath'} eq "" || ($env{'form.pagepath'})) {
          $supplementalflag=0;
       }
       if ($env{'form.forcesupplement'}) { $supplementalflag=1; }
       if ($env{'form.forcestandard'})   { $supplementalflag=0; }
       unless ($allowed) { $supplementalflag=1; }
       unless ($standard) { $supplementalflag=1; }
   
     my $script='';      my $script='';
     my $showdoc=0;      my $showdoc=0;
     my $containertag;      my $containertag;
     my $uploadtag;      my $uploadtag;
   
   # Where do we store these for when we come back?
     &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},      my $stored_folderpath='docs_folderpath';
     ['folderpath','pagepath',      if ($supplementalflag) {
      'pagesymb','forcesupplement','forcestandard']);         $stored_folderpath='docs_sup_folderpath';
       }
          
 # No folderpath, no pagepath, see if we have something stored  # No folderpath, no pagepath, see if we have something stored
     if ((!$env{'form.folderpath'}) && (!$env{'form.pagepath'})) {      if ((!$env{'form.folderpath'}) && (!$env{'form.pagepath'})) {
         &Apache::loncommon::restore_course_settings('docs_folderpath',          &Apache::loncommon::restore_course_settings($stored_folderpath,
                                               {'folderpath' => 'scalar'});                                                {'folderpath' => 'scalar'});
     }      }
     if (!$allowed) {      if (!$allowed) {
Line 2740  sub handler { Line 2765  sub handler {
         }          }
     }      }
     if (!$env{'form.folderpath'} && $allowed) {      if (!$env{'form.folderpath'} && $allowed) {
         &Apache::loncommon::restore_course_settings('docs_folderpath',          &Apache::loncommon::restore_course_settings($stored_folderpath,
                                               {'pagepath' => 'scalar'});                                                {'pagepath' => 'scalar'});
     }      }
     if ($env{'form.pagepath'}) {      if ($env{'form.pagepath'}) {
Line 2751  sub handler { Line 2776  sub handler {
                                   &escape(&mt('Supplemental '.$crstype.' Documents')).'&'.                                    &escape(&mt('Supplemental '.$crstype.' Documents')).'&'.
                                   $env{'form.folderpath'};                                    $env{'form.folderpath'};
     }      }
     &Apache::loncommon::store_course_settings('docs_folderpath',  # Store this
       if ($allowed) {
          &Apache::loncommon::store_course_settings($stored_folderpath,
                                                 {'pagepath' => 'scalar',                                                  {'pagepath' => 'scalar',
                                                  'folderpath' => 'scalar'});                                                   'folderpath' => 'scalar'});
       }
     if ($env{'form.folderpath'}) {      if ($env{'form.folderpath'}) {
  my (@folderpath)=split('&',$env{'form.folderpath'});   my (@folderpath)=split('&',$env{'form.folderpath'});
  $env{'form.foldername'}=&unescape(pop(@folderpath));   $env{'form.foldername'}=&unescape(pop(@folderpath));
Line 2787  sub handler { Line 2815  sub handler {
     if ($showdoc) { # got called in sequence from course      if ($showdoc) { # got called in sequence from course
  $allowed=0;    $allowed=0; 
     } else {      } else {
        if (($env{'form.folder'}=~/^(?:group|default)_/) ||  
           ($env{'form.folder'} =~ m:^\d+/(pages|sequences)/:)) {  
            $forcestandard = 1;  
        }  
        $forcesupplement=($env{'form.folder'}=~/^supplemental_/);  
   
        if ($allowed) {         if ($allowed) {
          &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['cmd']);           &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['cmd']);
          $script=&Apache::lonratedt::editscript('simple');           $script=&Apache::lonratedt::editscript('simple');
Line 2962  CHBO Line 2984  CHBO
  $checkbox   $checkbox
  </span>   </span>
 FUFORM  FUFORM
     #$list .= Apache::lonhtmlcommon::htmltag('li', $picture.' '.$button->{$picture}, {class => 'LC_menubuttons_inline_text'});  
     #$fileuploadform .= create_form_ul(create_list_elements(@fileuploada));  
     $fileuploadform .= &create_form_ul(&Apache::lonhtmlcommon::htmltag('li',$fileuploada,{class => 'LC_menubuttons_inline_text'})).'</form>';      $fileuploadform .= &create_form_ul(&Apache::lonhtmlcommon::htmltag('li',$fileuploada,{class => 'LC_menubuttons_inline_text'})).'</form>';
   
  my $simpleeditdefaultform=(<<SEDFFORM);   my $simpleeditdefaultform=(<<SEDFFORM);
Line 3022  ERFORM Line 3042  ERFORM
 HIDDENFORM  HIDDENFORM
     }      }
   
 #  
 # Decide whether this should display supplemental or main content  
 # supplementalflag=1: show supplemental documents  
 # supplementalflag=0: show standard documents  
   
     my $supplementalflag=($env{'form.folderpath'}=~/^supplemental/);  
     if (($standard) && (($env{'form.folderpath'}=~/^default/) || $env{'form.folderpath'} eq "" || ($env{'form.pagepath'}))) {  
        $supplementalflag=0;  
     }  
     if ($env{'form.forcesupplement'}) { $supplementalflag=1; }  
     if ($env{'form.forcestandard'})   { $supplementalflag=0; }  
     unless ($allowed) { $supplementalflag=1; }  
   
 # Generate the tabs  # Generate the tabs
     &startContentScreen($r,($supplementalflag?'supdocs':'docs'));      &startContentScreen($r,($supplementalflag?'supdocs':'docs'));
   

Removed from v.1.444  
changed lines
  Added in v.1.445


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>