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

version 1.163, 2005/01/08 06:34:30 version 1.165, 2005/01/30 12:51:21
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");
  }   }
Line 1298  END Line 1303  END
  $folderpath.=$folderarg.'&'.$foldername;   $folderpath.=$folderarg.'&'.$foldername;
  $url.='folderpath='.&Apache::lonnet::escape($folderpath);   $url.='folderpath='.&Apache::lonnet::escape($folderpath);
  $parameterset='<label>'.&mt('Randomly Pick: ').   $parameterset='<label>'.&mt('Randomly Pick: ').
     '<input type="text" size="4" name="randpick_'.$orderidx.'" value="'.      '<input type="text" size="4" onChange="this.form.submit()" name="randpick_'.$orderidx.'" value="'.
     (&Apache::lonratedt::getparameter($orderidx,      (&Apache::lonratedt::getparameter($orderidx,
                                               'parameter_randompick'))[0].                                                'parameter_randompick'))[0].
                                               '" />'.'</label>';                                                '" />'.
   '<font size="-2"><a href="javascript:void(0)">'.&mt('Store').'</a></font></label>';
                 
     }      }
     if ($ispage) {      if ($ispage) {
Line 1328  END Line 1334  END
     if (($allowed) && ($folder!~/^supplemental/)) {      if (($allowed) && ($folder!~/^supplemental/)) {
   my %lt=&Apache::lonlocal::texthash(    my %lt=&Apache::lonlocal::texthash(
        'hd' => 'Hidden',         'hd' => 'Hidden',
        'ec' => 'URL hidden',         'ec' => 'URL hidden');
        'sp' => 'Store Parameters');  
  my $enctext=   my $enctext=
     ((&Apache::lonratedt::getparameter($orderidx,'parameter_encrypturl'))[0]=~/^yes$/i?' checked="1"':'');      ((&Apache::lonratedt::getparameter($orderidx,'parameter_encrypturl'))[0]=~/^yes$/i?' checked="1"':'');
  my $hidtext=   my $hidtext=
     ((&Apache::lonratedt::getparameter($orderidx,'parameter_hiddenresource'))[0]=~/^yes$/i?' checked="1"':'');      ((&Apache::lonratedt::getparameter($orderidx,'parameter_hiddenresource'))[0]=~/^yes$/i?' checked="1"':'');
  $line.=(<<ENDPARMS);   $line.=(<<ENDPARMS);
 <td bgcolor="#BBBBFF"><font size='-2'>  <td bgcolor="#BBBBFF"><font size='-2'>
 <nobr><label><input type="checkbox" name="hidprs_$orderidx" $hidtext/> $lt{'hd'}</label></nobr></td>  <nobr><label><input type="checkbox" name="hidprs_$orderidx" onClick="this.form.submit()" $hidtext /> $lt{'hd'}</label></nobr></td>
 <td bgcolor="#BBBBFF"><font size='-2'>  <td bgcolor="#BBBBFF"><font size='-2'>
 <nobr><label><input type="checkbox" name="encprs_$orderidx" $enctext/> $lt{'ec'}</label></nobr></td>  <nobr><label><input type="checkbox" name="encprs_$orderidx" onClick="this.form.submit()" $enctext /> $lt{'ec'}</label></nobr></td>
 <td bgcolor="#BBBBFF"><font size="-2">$parameterset</font></td>  <td bgcolor="#BBBBFF"><font size="-2">$parameterset</font></td>
 <td bgcolor="#BBBBFF"><font size='-2'>  
 <input type="submit" value="$lt{'sp'}" />  
 </font></td>  
 ENDPARMS  ENDPARMS
     }      }
     $line.="</form></tr>";      $line.="</form></tr>";
Line 1955  function makeabout() { Line 1957  function makeabout() {
        this.document.forms.newaboutsomeone.importdetail.value=         this.document.forms.newaboutsomeone.importdetail.value=
    'About '+user+'=/adm/'+comp[1]+'/'+comp[0]+'/aboutme';     'About '+user+'=/adm/'+comp[1]+'/'+comp[0]+'/aboutme';
        this.document.forms.newaboutsomeone.submit();         this.document.forms.newaboutsomeone.submit();
    }     } else {
                  alert("Not a valid user\@domain");
              }
          } else {
              alert("Please enter both user and domain in the format user\@domain"); 
        }         }
    }     }
 }  }
   
 function makeims() {  function makeims() {
     var caller = document.forms.ims.folder.value      var caller = document.forms.ims.folder.value;
     var newlocation = "/adm/imsimportdocs?folder="+caller+"&phase=one"      var newlocation = "/adm/imsimportdocs?folder="+caller+"&phase=one";
     newWindow = window.open("","IMSimport","HEIGHT=700,WIDTH=750,scrollbars=yes")      newWindow = window.open("","IMSimport","HEIGHT=700,WIDTH=750,scrollbars=yes");
     newWindow.location.href = newlocation      newWindow.location.href = newlocation;
 }  }
   
   

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


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