Diff for /loncom/interface/londocs.pm between versions 1.163 and 1.164

version 1.163, 2005/01/08 06:34:30 version 1.164, 2005/01/08 06:42:15
Line 132  sub dumpbutton { Line 132  sub dumpbutton {
     }      }
 }  }
   
   sub clean {
       my ($title)=@_;
       $title=~s/[^\w\/\!\$\%\^\*\-\_\=\+\;\:\,\\\|\`\~]+/\_/gs;
       return $title;
   }
 # -------------------------------------------------------- Actually dump course  # -------------------------------------------------------- Actually dump course
   
 sub dumpcourse {  sub dumpcourse {
Line 149  sub dumpcourse { Line 154  sub dumpcourse {
  my ($ca,$cd)=split(/\@/,$ENV{'form.authorspace'});   my ($ca,$cd)=split(/\@/,$ENV{'form.authorspace'});
  $r->print('<h3>'.&mt('Copying Files').'</h3>');   $r->print('<h3>'.&mt('Copying Files').'</h3>');
  my $title=$ENV{'form.authorfolder'};   my $title=$ENV{'form.authorfolder'};
  $title=~s/[^\w\/]+/\_/g;   $title=&clean($title);
  my %replacehash=();   my %replacehash=();
  foreach (keys %ENV) {   foreach (keys %ENV) {
     if ($_=~/^form\.namefor\_(.+)/) {      if ($_=~/^form\.namefor\_(.+)/) {
Line 160  sub dumpcourse { Line 165  sub dumpcourse {
  $crs=~s/\_/\//g;   $crs=~s/\_/\//g;
  foreach (keys %replacehash) {   foreach (keys %replacehash) {
     my $newfilename=$title.'/'.$replacehash{$_};      my $newfilename=$title.'/'.$replacehash{$_};
     $newfilename=~s/[^\w\/\.\/]+/\_/g;      $newfilename=&clean($newfilename);
     my @dirs=split(/\//,$newfilename);      my @dirs=split(/\//,$newfilename);
     my $path='/home/'.$ca.'/public_html';      my $path='/home/'.$ca.'/public_html';
     my $makepath=$path;      my $makepath=$path;
Line 214  sub dumpcourse { Line 219  sub dumpcourse {
  }   }
  my $title=$origcrsdata{'description'};   my $title=$origcrsdata{'description'};
  $title=~s/\s+/\_/gs;   $title=~s/\s+/\_/gs;
  $title=~s/[^\w\/\!\$\%\^\*\-\_\=\+\;\:\,\\\|\`\~]+/\_/gs;   $title=&clean($title);
  $r->print('<h3>'.&mt('Folder in Construction Space').'</h3><input type="text" size="50" name="authorfolder" value="'.$title.'" /><br />');   $r->print('<h3>'.&mt('Folder in Construction Space').'</h3><input type="text" size="50" name="authorfolder" value="'.$title.'" /><br />');
  &tiehash();   &tiehash();
  $r->print('<h3>'.&mt('Filenames in Construction Space').'</h3><table border="2"><tr><th>'.&mt('Internal Filename').'</th><th>'.&mt('Title').'</th><th>'.&mt('Save as ...').'</th></tr>');   $r->print('<h3>'.&mt('Filenames in Construction Space').'</h3><table border="2"><tr><th>'.&mt('Internal Filename').'</th><th>'.&mt('Title').'</th><th>'.&mt('Save as ...').'</th></tr>');
Line 229  sub dumpcourse { Line 234  sub dumpcourse {
  $title=$_;   $title=$_;
     }      }
     $title=~s/\.(\w+)$//;      $title=~s/\.(\w+)$//;
     $title=~s/[^\w\/\!\$\%\^\*\-\_\=\+\;\:\,\\\|\`\~]+/\_/gs;      $title=&clean($title);
     $title.='.'.$ext;      $title.='.'.$ext;
     $r->print("\n<td><input type='text' size='60' name='namefor_".$_."' value='".$title."' /></td></tr>\n");      $r->print("\n<td><input type='text' size='60' name='namefor_".$_."' value='".$title."' /></td></tr>\n");
  }   }

Removed from v.1.163  
changed lines
  Added in v.1.164


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