Diff for /loncom/interface/londocs.pm between versions 1.378 and 1.382

version 1.378, 2009/07/10 19:48:51 version 1.382, 2009/07/27 20:35:40
Line 1049  sub breadcrumbs { Line 1049  sub breadcrumbs {
     }      }
     $plain=~s/\&gt\;\s*$//;      $plain=~s/\&gt\;\s*$//;
     return (&Apache::lonhtmlcommon::breadcrumbs(undef,undef,0,'nohelp',      return (&Apache::lonhtmlcommon::breadcrumbs(undef,undef,0,'nohelp',
        'LC_docs_path', undef, 1 ),$randompick,$ishidden,$isencrypted,$plain,$is_random_order);         undef, undef, 1 ),$randompick,$ishidden,$isencrypted,$plain,$is_random_order);
 }  }
   
 sub log_docs {  sub log_docs {
Line 1273  sub print_paste_buffer { Line 1273  sub print_paste_buffer {
     my ($r,$container) = @_;      my ($r,$container) = @_;
     return if (!defined($env{'docs.markedcopy_url'}));      return if (!defined($env{'docs.markedcopy_url'}));
   
     $r->print(<<ENDPASTE);      $r->print('<fieldset>'
 <form name="pasteform" action="/adm/coursedocs" method="post"><p>               .'<legend>'.&mt('Clipboard').'</legend>'
 ENDPASTE               .'<form name="pasteform" action="/adm/coursedocs" method="post">'
     $r->print('<input type="submit" name="pastemarked" value="'.&mt('Paste').'" /> ');               .'<input type="submit" name="pastemarked" value="'.&mt('Paste').'" /> '
       );
   
     my $type;      my $type;
     if ($env{'docs.markedcopy_url'} =~ m{^(?:/adm/wrapper/ext|(?:http|https)(?:&colon;|:))//} ) {      if ($env{'docs.markedcopy_url'} =~ m{^(?:/adm/wrapper/ext|(?:http|https)(?:&colon;|:))//} ) {
Line 1290  ENDPASTE Line 1291  ENDPASTE
  if ($extension eq 'sequence' &&   if ($extension eq 'sequence' &&
     $env{'docs.markedcopy_url'} =~ m{/default_\d+\.sequence$ }x) {      $env{'docs.markedcopy_url'} =~ m{/default_\d+\.sequence$ }x) {
     $icon = &Apache::loncommon::lonhttpdurl($r->dir_config('lonIconsURL'));      $icon = &Apache::loncommon::lonhttpdurl($r->dir_config('lonIconsURL'));
     $icon .= '/folder_closed.gif';      $icon .= '/navmap.folder.closed.gif';
  }   }
  $icon = '<img src="'.$icon.'" alt="" class="LC_icon" />';   $icon = '<img src="'.$icon.'" alt="" class="LC_icon" />';
  $r->print($icon.$type.': '.  &parse_supplemental_title(&LONCAPA::map::qtescape($env{'docs.markedcopy_title'})));   $r->print($icon.$type.': '.  &parse_supplemental_title(&LONCAPA::map::qtescape($env{'docs.markedcopy_title'})));
Line 1305  ENDPASTE Line 1306  ENDPASTE
         <input type="hidden" name="folderpath" value="'.&HTML::Entities::encode($env{'form.folderpath'},'<>&"').'" />          <input type="hidden" name="folderpath" value="'.&HTML::Entities::encode($env{'form.folderpath'},'<>&"').'" />
 ');  ');
     }      }
     $r->print('</p></form>');      $r->print('</form></fieldset>');
 }  }
   
 sub do_paste_from_buffer {  sub do_paste_from_buffer {
Line 1588  sub editor { Line 1589  sub editor {
     my $idx=0;      my $idx=0;
     my $shown=0;      my $shown=0;
     if (($ishidden) || ($isencrypted) || ($randompick>=0) || ($is_random_order)) {      if (($ishidden) || ($isencrypted) || ($randompick>=0) || ($is_random_order)) {
  $r->print('<p>'.&mt('Parameters').':<ul>'.   $r->print('<div class="LC_Box">'.
   ($randompick>=0?'<li>'.&mt('randomly pick [_1] resources',$randompick).'</li>':'').            '<p>'.&mt('Parameters:').
             '<ul>'.
     ($randompick>=0?'<li>'.&mt('randomly pick [quant,_1,resource]',$randompick).'</li>':'').
   ($ishidden?'<li>'.&mt('contents hidden').'</li>':'').    ($ishidden?'<li>'.&mt('contents hidden').'</li>':'').
   ($isencrypted?'<li>'.&mt('URLs hidden').'</li>':'').    ($isencrypted?'<li>'.&mt('URLs hidden').'</li>':'').
     ($is_random_order?'<li>'.&mt('random order').'</li>':'').
   '</ul></p>');    '</ul></p>');
           if ($randompick>=0) {
               $r->print('<p class="LC_warning">'
                    .&mt('Caution: this folder is set to randomly pick a subset'
                        .' of resources. Adding or removing resources from this'
                        .' folder will change the set of resources that the'
                        .' students see, resulting in spurious or missing credit'
                        .' for completed problems, not limited to ones you'
                        .' modify. Do not modify the contents of this folder if'
                        .' it is in active student use.')
                    .'</p>'
               );
           }
           if ($is_random_order) {
               $r->print('<p class="LC_warning">'
                    .&mt('Caution: this folder is set to randomly order its'
                        .' contents. Adding or removing resources from this folder'
                        .' will change the order of resources shown.')
                    .'</p>'
               );
           }
           $r->print('</div>');
     }      }
     if ($randompick>=0) {  
  $r->print('<p>'.&mt('Caution: this folder is set to randomly pick a subset of resources. Adding or removing resources from this folder will change the set of resources that the students see, resulting in spurious or missing credit for completed problems, not limited to ones you modify. Do not modify the contents of this folder if it is in active student use.').'</p>');      my $output;
     }  
     if ($is_random_order) {  
  $r->print('<p>'.&mt('Caution: this folder is set to randomly order its contents. Adding or removing resources from this folder will change the order of resources shown.').'</p>');  
     }  
     $r->print('<table class="LC_docs_editor">');  
     foreach my $res (@LONCAPA::map::order) {      foreach my $res (@LONCAPA::map::order) {
  my ($name,$url)=split(/\:/,$LONCAPA::map::resources[$res]);          my ($name,$url)=split(/\:/,$LONCAPA::map::resources[$res]);
  $name=&LONCAPA::map::qtescape($name);          $name=&LONCAPA::map::qtescape($name);
  $url=&LONCAPA::map::qtescape($url);          $url=&LONCAPA::map::qtescape($url);
  unless ($name) {  $name=(split(/\//,$url))[-1]; }          unless ($name) {  $name=(split(/\//,$url))[-1]; }
  unless ($name) { $idx++; next; }          unless ($name) { $idx++; next; }
  $r->print(&entryline($idx,$name,$url,$folder,$allowed,$res,          $output .= &entryline($idx,$name,$url,$folder,$allowed,$res,
      $coursenum));                                $coursenum);
  $idx++;          $idx++;
  $shown++;          $shown++;
     }      }
     unless ($shown) {      if ($shown) {
  $r->print('<tr><td>'.&mt('Currently no documents.').'</td></tr>');      $r->print(&Apache::loncommon::start_data_table()
                .&Apache::loncommon::start_data_table_header_row()
                .'<th colspan="2">'.&mt('Move').'</th>'
                .'<th>'.&mt('Actions').'</th>'
                .'<th colspan="2">'.&mt('Document').'</th>'
                .'<th colspan="4">'.&mt('Settings').'</th>'
                .&Apache::loncommon::end_data_table_header_row()
                .$output
                .&Apache::loncommon::end_data_table()
       )
       } else {
           $r->print('<p class="LC_info">'
                    .&mt('Currently no documents.')
                    .'</p>'
           );
     }      }
     $r->print("\n</table>\n");  
     if ($allowed) {      if ($allowed) {
         &print_paste_buffer($r,$container);          &print_paste_buffer($r,$container);
     }      }
Line 1778  sub entryline { Line 1811  sub entryline {
     $renametitle=~s/\\/\\\\/g;      $renametitle=~s/\\/\\\\/g;
     $renametitle=~s/\&quot\;/\\\"/g;      $renametitle=~s/\&quot\;/\\\"/g;
     $renametitle=~s/ /%20/g;      $renametitle=~s/ /%20/g;
     my $line='<tr>';      my $line=&Apache::loncommon::start_data_table_row();
     my ($form_start,$form_end);      my ($form_start,$form_end);
 # Edit commands  # Edit commands
     my ($container, $type, $esc_path, $path, $symb);      my ($container, $type, $esc_path, $path, $symb);
Line 1881  END Line 1914  END
         $form_end = '</form>';          $form_end = '</form>';
  $line.=(<<END);   $line.=(<<END);
 <td>  <td>
    <table class="LC_docs_entry_move">  <div class="LC_docs_entry_move">
       <tr>    <a href='/adm/coursedocs?cmd=up_$index&amp;${type}path=$esc_path&amp;${type}symb=$symb$cpinfo'>
          <td>      <img src="${iconpath}move_up.gif" alt='$lt{'up'}' class="LC_icon" />
             <a href='/adm/coursedocs?cmd=up_$index&amp;${type}path=$esc_path&amp;${type}symb=$symb$cpinfo'><img src="${iconpath}move_up.gif" alt='$lt{'up'}' class="LC_icon" /></a>    </a>
          </td>  </div>
       </tr>  <div class="LC_docs_entry_move">
       <tr>    <a href='/adm/coursedocs?cmd=down_$index&amp;${type}path=$esc_path&amp;${type}symb=$symb$cpinfo'>
         <td>      <img src="${iconpath}move_down.gif" alt='$lt{'dw'}' class="LC_icon" />
            <a href='/adm/coursedocs?cmd=down_$index&amp;${type}path=$esc_path&amp;${type}symb=$symb$cpinfo'><img src="${iconpath}move_down.gif" alt='$lt{'dw'}' class="LC_icon" /></a>    </a>
         </td>  </div>
       </tr>  
     </table>  
 </td>  </td>
 <td>  <td>
    $form_start     $form_start
Line 1919  END Line 1950  END
     my $pagefile;      my $pagefile;
     if ($uploaded) {      if ($uploaded) {
  if ($extension eq 'sequence') {   if ($extension eq 'sequence') {
     $icon=$iconpath.'/folder_closed.gif';      $icon=$iconpath.'/navmap.folder.closed.gif';
     $url=~/\Q$coursenum\E\/([\/\w]+)\.sequence$/;      $url=~/\Q$coursenum\E\/([\/\w]+)\.sequence$/;
     $url='/adm/coursedocs?';      $url='/adm/coursedocs?';
     $folderarg=$1;      $folderarg=$1;
Line 2026  END Line 2057  END
  undef($external);   undef($external);
     }      }
     $line.='      $line.='
   <td class="LC_docs_entry_icon">    <td>
     '.($url?'<a href="'.$url.'">':'').'<img src="'.$icon.'" alt="" class="LC_icon" />'.($url?'</a>':'').'      '.($url?'<a href="'.$url.'">':'').'<img src="'.$icon.'" alt="" class="LC_icon" />'.($url?'</a>':'').'
   </td>    </td>
   <td class="LC_docs_entry_title">    <td>
     '.($url?"<a href=\"$url\">":'').$title.($url?'</a>':' <span class="LC_docs_reinit_warn">'.&mt('(re-initialize course to access)').'</span>').$external."      '.($url?"<a href=\"$url\">":'').$title.($url?'</a>':' <span class="LC_docs_reinit_warn">'.&mt('(re-initialize course to access)').'</span>').$external."
   </td>";    </td>";
     if (($allowed) && ($folder!~/^supplemental/)) {      if (($allowed) && ($folder!~/^supplemental/)) {
Line 2055  END Line 2086  END
   <td class="LC_docs_entry_parameter">$form_start $parameterset $form_end</td>    <td class="LC_docs_entry_parameter">$form_start $parameterset $form_end</td>
 ENDPARMS  ENDPARMS
     }      }
     $line.="</tr>";      $line.=&Apache::loncommon::end_data_table_row();
     return $line;      return $line;
 }  }
   
Line 2942  HIDDENFORM Line 2973  HIDDENFORM
    $activeClass = 0;     $activeClass = 0;
  }   }
     }      }
     $r->print('<li '.$active.' onclick="javascript:showPage(this,\'mainCourseDocuments\',\'mainnav\',\'maincoursedoc\');">'.&mt('Main Course Documents').'</li>');      $r->print('<li '.$active.' onclick="javascript:showPage(this,\'mainCourseDocuments\',\'mainnav\',\'maincoursedoc\');"><a href="#"><b>'.&mt('Main Course Documents').'</b></a></li>');
     $active = '';      $active = '';
     if (!$forcestandard || ($env{'form.folderpath'}=~/^supplemental/)) {      if (!$forcestandard || ($env{'form.folderpath'}=~/^supplemental/)) {
         if($activeClass == 1){          if($activeClass == 1){
            $active = 'class="active"';             $active = 'class="active"';
         }          }
     }      }
     $r->print('<li '.$active.' onclick="javascript:showPage(this,\'supplCourseDocuments\',\'mainnav\',\'maincoursedoc\');">'.&mt('Supplemental Course Documents').'</li>');      $r->print('<li '.$active.' onclick="javascript:showPage(this,\'supplCourseDocuments\',\'mainnav\',\'maincoursedoc\');"><a href="#"><b>'.&mt('Supplemental Course Documents').'</b></a></li>');
     $r->print('</ul>'      $r->print('</ul>'
              .'<div class="LC_Box" style="clear:both;margin:0;">'               .'<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 3391  sub generate_edit_table { Line 3422  sub generate_edit_table {
     if($env{'form.active'} ne ''){      if($env{'form.active'} ne ''){
         $activetab = $env{'form.active'};          $activetab = $env{'form.active'};
     }      }
     $form = '<div class="LC_Box"><h4 class="LC_hcell">'.&mt($varcd).'</h4>';      $form = '<div class="LC_Box">';
     $form .= '<ul id="navigation'.$tid.'" class="LC_TabContent">';      $form .= '<ul id="navigation'.$tid.'" class="LC_TabContent">';
     foreach my $name (sort(keys(%orderhash))){      foreach my $name (sort(keys(%orderhash))){
         if($name eq 'zz'){          if($name eq 'zz'){

Removed from v.1.378  
changed lines
  Added in v.1.382


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