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

version 1.443, 2010/12/07 17:33:36 version 1.445, 2010/12/08 02:08:21
Line 2636  sub startContentScreen { Line 2636  sub startContentScreen {
     $r->print('<li'.(($mode eq 'navmaps')?' class="active"':'').'><a href="/adm/navmaps"><b>&nbsp;&nbsp;&nbsp;&nbsp;'.&mt('Content Overview').'&nbsp;&nbsp;&nbsp;&nbsp;</b></a></li>');      $r->print('<li'.(($mode eq 'navmaps')?' class="active"':'').'><a href="/adm/navmaps"><b>&nbsp;&nbsp;&nbsp;&nbsp;'.&mt('Content Overview').'&nbsp;&nbsp;&nbsp;&nbsp;</b></a></li>');
   
     my $active = '';      my $active = '';
 # does this user have privileges to modify docs  # does this user have privileges to modify docs?
     my $allowed=&Apache::lonnet::allowed('mdc',$env{'request.course.id'});      my $allowed=&Apache::lonnet::allowed('mdc',$env{'request.course.id'});
   
     my $onclick;      my $onclick;
     my $href;      my $href;
   
     if ($allowed) {      if ($allowed) {
 #        if (($mode eq 'navmaps') || ($mode eq 'tools')) {          $r->print('<li '.(($mode eq 'docs')?' class="active"':'').
            $href="/adm/coursedocs?forcestandard=1";                 '><a href="/adm/coursedocs?forcestandard=1"><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'.&mt('Content Editor').'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b></a></li>');
            $onclick='';       }
 #        } else {      $r->print('<li '.(($mode eq 'supdocs')?' class="active"':'').
 #           $href='#';             '><a href="/adm/coursedocs?forcesupplement=1"><b>'.&mt('Supplemental Documents').'</b></a></li>');
 #           $onclick=' onclick="javascript:showPage(this,\'mainCourseDocuments\',\'mainnav\',\'maincoursedoc\');"';  
 #        }  
         $r->print('<li '.(($mode eq 'docs')?' class="active"':'').$onclick.  
                '><a href="'.$href.'"><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'.&mt('Content Editor').'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b></a></li>');  
     }  
 #    if (($mode eq 'navmaps') || ($mode eq 'tools')) {  
        $href="/adm/coursedocs?forcesupplement=1";  
        $onclick='';  
 #    } else {  
 #       $href='#';  
 #       $onclick=' onclick="javascript:showPage(this,\'mainCourseDocuments\',\'mainnav\',\'maincoursedoc\');"';  
 #   }  
   
     $r->print('<li '.(($mode eq 'supdocs')?' class="active"':'').$onclick.  
            '><a href="'.$href.'"><b>'.&mt('Supplemental Documents').'</b></a></li>');  
     $r->print('</ul>');      $r->print('</ul>');
     $r->print('<div class="LC_Box" style="clear:both;margin:0;">'      $r->print('<div class="LC_Box" style="clear:both;margin:0;">'
              .'<div id="maincoursedoc" style="margin:0 0;padding:0 0;">');               .'<div id="maincoursedoc" style="margin:0 0;padding:0 0;">');
Line 2730  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 2755  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 2766  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 2802  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 2977  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 3037  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) && ($allowed) && (($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; }  
   
 # Generate the tabs  # Generate the tabs
     &startContentScreen($r,($supplementalflag?'supdocs':'docs'));      &startContentScreen($r,($supplementalflag?'supdocs':'docs'));
   

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


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