Diff for /loncom/homework/lonhomework.pm between versions 1.328 and 1.329

version 1.328, 2011/09/09 16:56:35 version 1.329, 2011/10/31 19:35:03
Line 1099  sub get_template_list { Line 1099  sub get_template_list {
     my $count = 0;      my $count = 0;
     my $currentcategory='';      my $currentcategory='';
     my $first = 1;      my $first = 1;
       my $londocroot = $Apache::lonnet::perlvar{'lonDocRoot'};
     foreach my $file (@files) {      foreach my $file (@files) {
  next if ($file->[1] !~ /\S/);   next if ($file->[1] !~ /\S/);
         if ($file->[2] ne $currentcategory) {          if ($file->[2] ne $currentcategory) {
Line 1122  sub get_template_list { Line 1123  sub get_template_list {
            $result.=&Apache::loncommon::help_open_topic($file->[3]);             $result.=&Apache::loncommon::help_open_topic($file->[3]);
         }          }
         my $filename=$file->[0];          my $filename=$file->[0];
         $filename=~s/^\/home\/httpd\/html//;          $filename=~s{^\Q$londocroot\E}{};
         $result.=' <span class="LC_fontsize_small">'          $result.=' <span class="LC_fontsize_small">'
                 .'<a href="'.$filename.'?inhibitmenu=yes" target="sample">'.&mt('Example').'</a>'                  .'<a href="'.$filename.'?inhibitmenu=yes" target="sample">'.&mt('Example').'</a>'
                 .'</span><br />'."\n";                  .'</span><br />'."\n";
Line 1158  sub newproblem { Line 1159  sub newproblem {
  &renderpage($request,$dest);   &renderpage($request,$dest);
     } else {      } else {
  my $url=&HTML::Entities::encode($request->uri,'<>&"');   my $url=&HTML::Entities::encode($request->uri,'<>&"');
  my $shownurl=$url;  
  $shownurl=~s-^/~-/priv/-;  
  my $dest = &Apache::lonnet::filelocation("",$request->uri);   my $dest = &Apache::lonnet::filelocation("",$request->uri);
  my $errormsg;   my $errormsg;
  my $instructions;   my $instructions;
Line 1178  sub newproblem { Line 1177  sub newproblem {
        .'<h1>'.&mt("Creating a new $extension resource.")."</h1>         .'<h1>'.&mt("Creating a new $extension resource.")."</h1>
 $errormsg  $errormsg
 ".&mt("The requested file [_1] currently does not exist.",  ".&mt("The requested file [_1] currently does not exist.",
       '<span class="LC_filename">'.$shownurl.'</span>').'        '<span class="LC_filename">'.$url.'</span>').'
 <p class="LC_info">  <p class="LC_info">
 '.&mt("To create a new $extension, select a template from the".  '.&mt("To create a new $extension, select a template from the".
       " list below. Then click on the \"Create $extension\" button.").'        " list below. Then click on the \"Create $extension\" button.").'

Removed from v.1.328  
changed lines
  Added in v.1.329


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