Diff for /loncom/interface/londocs.pm between versions 1.484.2.20 and 1.519

version 1.484.2.20, 2013/01/04 00:17:48 version 1.519, 2012/12/03 14:47:30
Line 651  sub print_paste_buffer { Line 651  sub print_paste_buffer {
         $is_external = 1;          $is_external = 1;
     }      }
   
     my ($canpaste,$nopaste,$othercrs,$areachange);      my ($canpaste,$nopaste,$othercrs,$areachange,$is_uploaded_map);
     if ($folder =~ /^supplemental/) {      if ($folder =~ /^supplemental/) {
         $canpaste = &supp_pasteable($env{'docs.markedcopy_url'});          $canpaste = &supp_pasteable($env{'docs.markedcopy_url'});
         unless ($canpaste) {          unless ($canpaste) {
Line 1543  sub apply_fixups { Line 1543  sub apply_fixups {
             if ($folder !~ /^supplemental/) {              if ($folder !~ /^supplemental/) {
                 $report = 1;                  $report = 1;
             }              }
             (my $outtext,$errtext) =              my ($outtext,$errtext) =
                 &LONCAPA::map::storemap("/uploaded/$cdom/$cnum/$storefn",1,$report);                  &LONCAPA::map::storemap("/uploaded/$cdom/$cnum/$storefn",1,$report);
             if ($errtext) {              if ($errtext) {
                 return &mt('Paste failed: an error occurred saving the folder or page.');                  return &mt('Paste failed: an error occurred saving the folder or page.');
Line 1862  sub editor { Line 1862  sub editor {
     &Apache::loncommon::end_data_table_count();      &Apache::loncommon::end_data_table_count();
   
     if (($allowed) || ($supplementalflag && $folder eq 'supplemental')) {      if (($allowed) || ($supplementalflag && $folder eq 'supplemental')) {
         my $toolslink = '<table><tr><td>'  
                        .&Apache::loncommon::help_open_menu('Navigation Screen',  
                                                            'Navigation_Screen',undef,'RAT')  
                        .'</td><td class="LC_middle">'.&mt('Tools:').'</td>'  
                        .'<td align="left"><ul id="LC_toolbar">'  
                        .'<li><a href="/adm/coursedocs?forcesupplement=1" '  
                        .'id="LC_content_toolbar_edittoplevel" '  
                        .'class="LC_toolbarItem" '  
                        .'title="'.&mt('Supplemental Content Editor').'">'  
                        .'</a></li></ul></td></tr></table><br />';  
         if ($shown) {          if ($shown) {
             if ($allowed) {              if ($allowed) {
                 $to_show = &Apache::loncommon::start_scrollbox('900px','880px','400px','contentscroll')                  $to_show = &Apache::loncommon::start_scrollbox('900px','880px','400px','contentscroll')
Line 1889  sub editor { Line 1879  sub editor {
                            .'<br style="line-height:2px;" />'                             .'<br style="line-height:2px;" />'
                            .&Apache::loncommon::end_scrollbox();                             .&Apache::loncommon::end_scrollbox();
             } else {              } else {
                 $to_show .= $toolslink                  $to_show = '<table><tr><td>'.&Apache::loncommon::help_open_menu('Navigation Screen','Navigation_Screen',undef,'RAT')
                              .'</td><td class="LC_middle">'.&mt('Tools:').'</td>'
                              .'<td align="left"><ul id="LC_toolbar">'
                              .'<li><a href="/adm/coursedocs?forcesupplement=1" '
                              .'id="LC_content_toolbar_edittoplevel" '
                              .'class="LC_toolbarItem" '
                              .'title="'.&mt('Supplemental Content Editor').'">'
                              .'</a></li></ul></td></tr></table><br />'
                            .&Apache::loncommon::start_data_table('LC_tableOfContent')                             .&Apache::loncommon::start_data_table('LC_tableOfContent')
                            .$output.' '                             .$output.' '
                            .&Apache::loncommon::end_data_table();                             .&Apache::loncommon::end_data_table();
             }              }
         } else {          } else {
             if (!$allowed) {  
                 $to_show .= $toolslink;  
             }  
             $to_show .= &Apache::loncommon::start_scrollbox('400px','380px','200px','contentscroll')              $to_show .= &Apache::loncommon::start_scrollbox('400px','380px','200px','contentscroll')
                        .'<div class="LC_info" id="contentlist">'                         .'<div class="LC_info" id="contentlist">'
                        .&mt('Currently no documents.')                         .&mt('Currently no documents.')
Line 2443  $form_common.' Line 2437  $form_common.'
                                                             $forceedit,                                                              $forceedit,
                                                             undef,$symb,                                                              undef,$symb,
                                                             &escape($env{'form.folderpath'}),                                                              &escape($env{'form.folderpath'}),
                                                             $renametitle,'','',1);                                                              $renametitle);
                 if ($jscall) {                  if ($jscall) {
                     $editlink = '<a class="LC_docs_ext_edit" href="javascript:'.                      $editlink = '<a class="LC_docs_ext_edit" href="javascript:'.
                                 $jscall.'" >'.&mt('Edit').'</a>&nbsp;'."\n";                                  $jscall.'" >'.&mt('Edit').'</a>&nbsp;'."\n";
Line 2627  sub checkonthis { Line 2621  sub checkonthis {
              $r->print('<span class="LC_error">'.&mt('connection down').'</span>');               $r->print('<span class="LC_error">'.&mt('connection down').'</span>');
           } elsif ($result eq 'not_found') {            } elsif ($result eq 'not_found') {
       unless ($url=~/\$/) {        unless ($url=~/\$/) {
   $r->print('<span class="LC_error">'.&mt('not found').'</span>');    $r->print('<span class="LC_error">'.&mt('not found').'</b></span>');
       } else {        } else {
   $r->print('<span class="LC_error">'.&mt('unable to verify variable URL').'</span>');    $r->print('<span class="LC_error">'.&mt('unable to verify variable URL').'</span>');
       }        }
Line 2673  sub list_symbs { Line 2667  sub list_symbs {
             $r->print(&Apache::loncommon::start_data_table_row().              $r->print(&Apache::loncommon::start_data_table_row().
                       '<td>'.$res->compTitle().'</td>'.                        '<td>'.$res->compTitle().'</td>'.
                       '<td>'.$res->symb().'</td>'.                        '<td>'.$res->symb().'</td>'.
                       &Apache::loncommon::end_data_table_row());                        &Apache::loncommon::start_data_table_row());
             $count ++;              $count ++;
         }          }
         if (!$count) {          if (!$count) {
Line 2683  sub list_symbs { Line 2677  sub list_symbs {
         }          }
         $r->print(&Apache::loncommon::end_data_table());          $r->print(&Apache::loncommon::end_data_table());
     }      }
     $r->print(&endContentScreen());  
 }  }
   
   
Line 2714  sub verifycontent { Line 2707  sub verifycontent {
    }     }
    &untiehash();     &untiehash();
    $r->print('<p class="LC_success">'.&mt('Done').'</p>');     $r->print('<p class="LC_success">'.&mt('Done').'</p>');
     $r->print(&endContentScreen());  
 }  }
   
   
Line 2794  sub checkversions { Line 2786  sub checkversions {
     if ($env{'form.timerange'} eq 'all') {      if ($env{'form.timerange'} eq 'all') {
 # show all documents  # show all documents
  $header=&mt('All Documents in '.$crstype);   $header=&mt('All Documents in '.$crstype);
  $allsel=' selected="selected"';   $allsel=1;
  foreach my $key (keys(%hash)) {   foreach my $key (keys(%hash)) {
     if ($key=~/^ids\_(\/res\/.+)$/) {      if ($key=~/^ids\_(\/res\/.+)$/) {
  my $src=$1;   my $src=$1;
Line 2815  sub checkversions { Line 2807  sub checkversions {
  .&mt('seconds');   .&mt('seconds');
     if ($env{'form.timerange'}==-1) {      if ($env{'form.timerange'}==-1) {
  $seltext='since start of course';   $seltext='since start of course';
  $startsel=' selected="selected"';   $startsel='selected';
  $env{'form.timerange'}=time;   $env{'form.timerange'}=time;
     }      }
     $starttime=time-$env{'form.timerange'};      $starttime=time-$env{'form.timerange'};
     if ($env{'form.timerange'}==2592000) {      if ($env{'form.timerange'}==2592000) {
  $seltext=&mt('during the last month').' ('.&Apache::lonlocal::locallocaltime($starttime).')';   $seltext=&mt('during the last month').' ('.&Apache::lonlocal::locallocaltime($starttime).')';
  $monthsel=' selected="selected"';   $monthsel='selected';
     } elsif ($env{'form.timerange'}==604800) {      } elsif ($env{'form.timerange'}==604800) {
  $seltext=&mt('during the last week').' ('.&Apache::lonlocal::locallocaltime($starttime).')';   $seltext=&mt('during the last week').' ('.&Apache::lonlocal::locallocaltime($starttime).')';
  $weeksel=' selected="selected"';   $weeksel='selected';
     } elsif ($env{'form.timerange'}==86400) {      } elsif ($env{'form.timerange'}==86400) {
  $seltext=&mt('since yesterday').' ('.&Apache::lonlocal::locallocaltime($starttime).')';   $seltext=&mt('since yesterday').' ('.&Apache::lonlocal::locallocaltime($starttime).')';
  $daysel=' selected="selected"';   $daysel='selected';
     }      }
     $header=&mt('Content changed').' '.$seltext;      $header=&mt('Content changed').' '.$seltext;
  } else {   } else {
Line 2865  sub checkversions { Line 2857  sub checkversions {
 <fieldset>  <fieldset>
 <legend>$lt{'cd'}</legend>  <legend>$lt{'cd'}</legend>
 <select name="timerange">  <select name="timerange">
 <option value='all'$allsel>$lt{'al'}</option>  <option value='all' $allsel>$lt{'al'}</option>
 <option value="-1"$startsel>$lt{'st'}</option>  <option value="-1" $startsel>$lt{'st'}</option>
 <option value="2592000"$monthsel>$lt{'lm'}</option>  <option value="2592000" $monthsel>$lt{'lm'}</option>
 <option value="604800"$weeksel>$lt{'lw'}</option>  <option value="604800" $weeksel>$lt{'lw'}</option>
 <option value="86400"$daysel>$lt{'sy'}</option>  <option value="86400" $daysel>$lt{'sy'}</option>
 </select>  </select>
 <input type="submit" name="display" value="$lt{'sd'}" />  <input type="submit" name="display" value="$lt{'sd'}" />
 </fieldset>  </fieldset>
Line 2885  $lt{'sc'}: <input type="submit" name="se Line 2877  $lt{'sc'}: <input type="submit" name="se
 <hr />  <hr />
 <h4>$lt{'vers'}</h4>  <h4>$lt{'vers'}</h4>
 <input type="submit" name="setversions" value="$lt{'save'}" />  <input type="submit" name="setversions" value="$lt{'save'}" />
   <table border="0">
 ENDHEADERS  ENDHEADERS
     #number of columns for version history      #number of columns for version history
       my $num_ver_col = 1;
     $r->print(      $r->print(
         &Apache::loncommon::start_data_table().      &Apache::loncommon::start_data_table().
         &Apache::loncommon::start_data_table_header_row().      &Apache::loncommon::start_data_table_header_row().
         '<th>'.&mt('Resources').'</th>'.      '<th>'.&mt('Resources').'</th>'.
         "<th>$lt{'mr'}</th>".      "<th>$lt{'mr'}</th>".
         "<th>$lt{'ve'}</th>".      "<th>$lt{'ve'}</th>".
         "<th>$lt{'vu'}</th>".      "<th>$lt{'vu'}</th>".
         '<th>'.&mt('History').'</th>'.      '<th colspan="'.$num_ver_col.'">'.&mt('History').'</th>'.
         &Apache::loncommon::end_data_table_header_row()      '</b>');
     );  
     foreach my $key (sort(keys(%changes))) {      foreach my $key (sort(keys(%changes))) {
         #excludes not versionable problems from resource version history:          #excludes not versionable problems from resource version history:
         next unless ($changes{$key}>$starttime && $key !~ /^\/res\/lib\/templates/);          if ($changes{$key}>$starttime && $key !~ /^\/res\/lib\/templates/) {
         my ($root,$extension)=($key=~/^(.*)\.(\w+)$/);      my ($root,$extension)=($key=~/^(.*)\.(\w+)$/);
         my $currentversion=&Apache::lonnet::getversion($key);      my $currentversion=&Apache::lonnet::getversion($key);
         if ($currentversion<0) {      if ($currentversion<0) {
             $currentversion='<span class="LC_error">'.&mt('Could not be determined.').'</span>';                  $currentversion='<span class="LC_error">'.&mt('Could not be determined.').'</span>';
         }      }
         my $linkurl=&Apache::lonnet::clutter($key);      my $linkurl=&Apache::lonnet::clutter($key);
         $r->print(          $r->print(
               &Apache::loncommon::end_data_table_header_row().
             &Apache::loncommon::start_data_table_row().              &Apache::loncommon::start_data_table_row().
             '<td><b>'.&Apache::lonnet::gettitle($linkurl).'</b><br />'.              '<td><b>'.&Apache::lonnet::gettitle($linkurl).'</b><br>'.
             '<a href="'.$linkurl.'" target="cat">'.$linkurl.'</a></td>'.              '<a href="'.$linkurl.'" target="cat">'.$linkurl.'</a></td>'.
             '<td align="right">'.$currentversion.'<span class="LC_fontsize_medium"><br />('.              '<td align="right">'.$currentversion.'<span class="LC_fontsize_medium"><br>('.
             &Apache::lonlocal::locallocaltime(&Apache::lonnet::metadata($root.'.'.$extension,'lastrevisiondate')).')</span></td>'.              &Apache::lonlocal::locallocaltime(&Apache::lonnet::metadata($root.'.'.$extension,'lastrevisiondate')).')</span></td>'.
             '<td align="right">'              '<td align="right">');
         );  # Used in course
         # Used in course      my $usedversion=$hash{'version_'.$linkurl};
         my $usedversion=$hash{'version_'.$linkurl};      if (($usedversion) && ($usedversion ne 'mostrecent')) {
         if (($usedversion) && ($usedversion ne 'mostrecent')) {                  if($usedversion != $currentversion){
                 if ($usedversion != $currentversion) {  
                     $r->print('<span class="LC_warning">'.$usedversion.'</span>');                      $r->print('<span class="LC_warning">'.$usedversion.'</span>');
                 } else {                  }else{
                     $r->print($usedversion);                      $r->print($usedversion);
                 }                  }
       } else {
    $r->print($currentversion);
       }
       $r->print('</td><td title="'.$lt{'vu'}.'">');
   # Set version
       $r->print(&Apache::loncommon::select_form($setversions{$linkurl},
         'set_version_'.$linkurl,
         {'select_form_order' =>
          ['',1..$currentversion,'mostrecent'],
          '' => '',
          'mostrecent' => &mt('most recent'),
          map {$_,$_} (1..$currentversion)}));
       my $lastold=1;
       for (my $prevvers=1;$prevvers<$currentversion;$prevvers++) {
    my $url=$root.'.'.$prevvers.'.'.$extension;
    if (&Apache::lonnet::metadata($url,'lastrevisiondate')<
       $starttime) {
       $lastold=$prevvers;
    }
       }
               #
               # Code to figure out how many version entries should go in
               # each of the four columns
               my $entries_per_col = 0;
               my $num_entries = ($currentversion-$lastold);
               if ($num_entries % $num_ver_col == 0) {
                   $entries_per_col = $num_entries/$num_ver_col;
             } else {              } else {
                 $r->print($currentversion);                  $entries_per_col = $num_entries/$num_ver_col + 1;
             }              }
         $r->print('</td><td title="'.$lt{'vu'}.'">');              my $entries_count = 0;
         # Set version              $r->print('<td valign="top"><span class="LC_fontsize_medium">');
         $r->print(&Apache::loncommon::select_form(              my $cols_output = 1;
             $setversions{$linkurl},              for (my $prevvers=$lastold;$prevvers<$currentversion;$prevvers++) {
             'set_version_'.$linkurl,   my $url=$root.'.'.$prevvers.'.'.$extension;
             {'select_form_order' => ['',1..$currentversion,'mostrecent'],   $r->print('<span class="LC_nobreak"><a href="'.&Apache::lonnet::clutter($url).
              '' => '',    '">'.&mt('Version').' '.$prevvers.'</a> ('.
              'mostrecent' => &mt('most recent'),    &Apache::lonlocal::locallocaltime(
              map {$_,$_} (1..$currentversion)}));                                  &Apache::lonnet::metadata($url,
         my $lastold=1;                                                            'lastrevisiondate')
         for (my $prevvers=1;$prevvers<$currentversion;$prevvers++) {                                                              ).
             my $url=$root.'.'.$prevvers.'.'.$extension;    ')');
             if (&Apache::lonnet::metadata($url,'lastrevisiondate')<$starttime) {   if (&Apache::loncommon::fileembstyle($extension) eq 'ssi') {
                 $lastold=$prevvers;                      $r->print(' <a href="/adm/diff?filename='.
             }        &Apache::lonnet::clutter($root.'.'.$extension).
         }        '&versionone='.$prevvers.
         $r->print('</td>');        '" target="diffs">'.&mt('Diffs').'</a>');
         # List all available versions   }
         $r->print('<td valign="top"><span class="LC_fontsize_medium">');   $r->print('</span><br />');
         for (my $prevvers=$lastold;$prevvers<$currentversion;$prevvers++) {                  if (++$entries_count % $entries_per_col == 0) {
             my $url=$root.'.'.$prevvers.'.'.$extension;                      $r->print('</span></td>');
             $r->print(                      if ($cols_output != $num_ver_col) {
                 '<span class="LC_nobreak">'                          $r->print('<td valign="top"><span class="LC_fontsize_medium">');
                .'<a href="'.&Apache::lonnet::clutter($url).'">'                          $cols_output++;
                .&mt('Version [_1]',$prevvers).'</a>'                      }
                .' ('.&Apache::lonlocal::locallocaltime(                  }
                          &Apache::lonnet::metadata($url,'lastrevisiondate'))      }
                .')');              while($cols_output++ < $num_ver_col) {
             if (&Apache::loncommon::fileembstyle($extension) eq 'ssi') {                  $r->print('</span></td><td>');
                 $r->print(  
                     ' <a href="/adm/diff?filename='.  
                     &Apache::lonnet::clutter($root.'.'.$extension).  
                     &HTML::Entities::encode('&versionone='.$prevvers,'"<>&').  
                     '" target="diffs">'.&mt('Diffs').'</a>');  
             }              }
             $r->print('</span><br />');   }
         }  
         $r->print('</span></td>'.&Apache::loncommon::end_data_table_row());  
     }      }
     $r->print(      $r->print('</td>'.&Apache::loncommon::end_data_table_row().
         &Apache::loncommon::end_data_table().              &Apache::loncommon::end_data_table().
         '<input type="submit" name="setversions" value="'.$lt{'save'}.'" />'.              '<input type="submit" name="setversions" value="'.$lt{'save'}.'" />');
         '</form>'  
     );  
   
     &untiehash();      &untiehash();
     $r->print(&endContentScreen());  
 }  }
   
 sub mark_hash_old {  sub mark_hash_old {
Line 3068  sub startContentScreen { Line 3078  sub startContentScreen {
     if (($mode eq 'navmaps') || ($mode eq 'supplemental')) {      if (($mode eq 'navmaps') || ($mode eq 'supplemental')) {
         $output .= '<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>'."\n";          $output .= '<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>'."\n";
         $output .= '<li'.(($mode eq 'coursesearch')?' class="active"':'').'><a href="/adm/searchcourse"><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'.&mt('Content Search').'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b></a></li>'."\n";          $output .= '<li'.(($mode eq 'coursesearch')?' class="active"':'').'><a href="/adm/searchcourse"><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'.&mt('Content Search').'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b></a></li>'."\n";
           $output .= '<li'.(($mode eq 'courseindex')?' class="active"':'').'><a href="/adm/indexcourse"><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'.&mt('Content Index').'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b></a></li>'."\n";
         $output .= '<li '.(($mode eq 'suppdocs')?' class="active"':'').'><a href="/adm/supplemental"><b>'.&mt('Supplemental Content').'</b></a></li>';          $output .= '<li '.(($mode eq 'suppdocs')?' class="active"':'').'><a href="/adm/supplemental"><b>'.&mt('Supplemental Content').'</b></a></li>';
     } else {      } else {
         $output .= '<li '.(($mode eq 'docs')?' class="active"':'').' id="tabbededitor"><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>'."\n";          $output .= '<li '.(($mode eq 'docs')?' class="active"':'').' id="tabbededitor"><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>'."\n";
Line 3213  sub handler { Line 3224  sub handler {
    if ($env{'form.command'} eq 'direct') {     if ($env{'form.command'} eq 'direct') {
        my ($mapurl,$id,$resurl);         my ($mapurl,$id,$resurl);
        if ($env{'form.symb'} ne '') {         if ($env{'form.symb'} ne '') {
            $env{'form.folderpath'}=             ($mapurl,$id,$resurl) = &Apache::lonnet::decode_symb($env{'form.symb'});
                &Apache::loncommon::symb_to_docspath($env{'form.symb'});             if ($resurl=~/\.(sequence|page)$/) {
                  $mapurl=$resurl;
              } elsif ($resurl eq 'adm/navmaps') {
                  $mapurl=$env{'course.'.$env{'request.course.id'}.'.url'};
              }
              my $mapresobj;
              my $navmap = Apache::lonnavmaps::navmap->new();
              if (ref($navmap)) {
                  $mapresobj = $navmap->getResourceByUrl($mapurl);
              }
              $mapurl=~s{^.*/([^/]+)\.(\w+)$}{$1};
              my $type=$2;
              my $path;
              if (ref($mapresobj)) {
                  my $pcslist = $mapresobj->map_hierarchy();
                  if ($pcslist ne '') {
                      foreach my $pc (split(/,/,$pcslist)) {
                          next if ($pc <= 1);
                          my $res = $navmap->getByMapPc($pc);
                          if (ref($res)) {
                              my $thisurl = $res->src();
                              $thisurl=~s{^.*/([^/]+)\.\w+$}{$1}; 
                              my $thistitle = $res->title();
                              $path .= '&'.
                                       &Apache::lonhtmlcommon::entity_encode($thisurl).'&'.
                                       &Apache::lonhtmlcommon::entity_encode($thistitle).
                                       ':'.$res->randompick().
                                       ':'.$res->randomout().
                                       ':'.$res->encrypted().
                                       ':'.$res->randomorder().
                                       ':'.$res->is_page();
                          }
                      }
                  }
                  $path =~ s/^\&//;
                  my $maptitle = $mapresobj->title();
                  if ($mapurl eq 'default') {
                      $maptitle = 'Main Course Documents';
                  }
                  $path .= (($path ne '')? '&' : '').
                       &Apache::lonhtmlcommon::entity_encode($mapurl).'&'.
                       &Apache::lonhtmlcommon::entity_encode($maptitle).
                       ':'.$mapresobj->randompick().
                       ':'.$mapresobj->randomout().
                       ':'.$mapresobj->encrypted().
                       ':'.$mapresobj->randomorder().
                       ':'.$mapresobj->is_page(); 
              } else {
                  my $maptitle = &Apache::lonnet::gettitle($mapurl);
                  my $ispage = (($type eq 'page')? 1 : '');
                  if ($mapurl eq 'default') {
                      $maptitle = 'Main Course Documents';
                  }
                  $path = &Apache::lonhtmlcommon::entity_encode($mapurl).'&'.
                          &Apache::lonhtmlcommon::entity_encode($maptitle).':::::'.$ispage;
              }
              unless ($mapurl eq 'default') {
                  $path = 'default&'.
                          &Apache::lonhtmlcommon::entity_encode('Main Course Documents').
                          ':::::&'.$path;
              }
              $env{'form.folderpath'}=$path;
        } elsif ($env{'form.supppath'} ne '') {         } elsif ($env{'form.supppath'} ne '') {
            $env{'form.folderpath'}=$env{'form.supppath'};             $env{'form.folderpath'}=$env{'form.supppath'};
        }         }
Line 3237  sub handler { Line 3309  sub handler {
     if ((!$env{'form.folderpath'}) && $allowed) {      if ((!$env{'form.folderpath'}) && $allowed) {
         &Apache::loncommon::restore_course_settings($stored_folderpath,          &Apache::loncommon::restore_course_settings($stored_folderpath,
                                           {'folderpath' => 'scalar'});                                            {'folderpath' => 'scalar'});
         unless (&unescape($env{'form.folderpath'}) =~ m{^(default|supplemental)&}) {  
             undef($env{'form.folderpath'});  
         }  
     }      }
         
 # If we are not allowed to make changes, all we can see are supplemental docs  # If we are not allowed to make changes, all we can see are supplemental docs
Line 4219  sub generate_edit_table { Line 4288  sub generate_edit_table {
     my $form;      my $form;
     my $activetab;      my $activetab;
     my $active;      my $active;
     if (($env{'form.active'} ne '') && ($env{'form.active'} ne 'aa')) {      if($env{'form.active'} ne ''){
         $activetab = $env{'form.active'};          $activetab = $env{'form.active'};
     }      }
     my $backicon = $iconpath.'clickhere.gif';      my $backicon = $iconpath.'clickhere.gif';

Removed from v.1.484.2.20  
changed lines
  Added in v.1.519


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