Diff for /rat/lonratedt.pm between versions 1.58 and 1.62

version 1.58, 2004/04/26 17:50:37 version 1.62, 2004/11/17 19:59:29
Line 706  sub smpedt { Line 706  sub smpedt {
    my $tmpfn=&Apache::lonnet::filelocation('',$url).'.tmp';     my $tmpfn=&Apache::lonnet::filelocation('',$url).'.tmp';
    my $targetmsg='';     my $targetmsg='';
    if ($ENV{'form.save'}) {     if ($ENV{'form.save'}) {
        $targetmsg='<b>Saving ...</b><br>';  
        copy($tmpfn,&Apache::lonnet::filelocation('',$url));         copy($tmpfn,&Apache::lonnet::filelocation('',$url));
        unlink($tmpfn);         unlink($tmpfn);
        my ($errtext,$fatal)=         my ($errtext,$fatal)=
                            &mapread(&Apache::lonnet::filelocation('',$url),'');                             &mapread(&Apache::lonnet::filelocation('',$url),'');
          unless ($fatal) {
      $targetmsg='<b>'.&mt('Saved.').'</b><br />';
          } else {
      $targetmsg='<b>'.&mt('An error occured while saving.').'</b><br />';
          }
    }     }
    if ($ENV{'form.revert'}) {     if ($ENV{'form.revert'}) {
        $targetmsg='<b>Reverting ...</b><br>';         $targetmsg='<b>'.&mt('Reverted.').'</b><br />';
        unlink($tmpfn);         unlink($tmpfn);
        my ($errtext,$fatal)=         my ($errtext,$fatal)=
                            &mapread(&Apache::lonnet::filelocation('',$url),'');                             &mapread(&Apache::lonnet::filelocation('',$url),'');
Line 973  sub smpedt { Line 977  sub smpedt {
   
 # ----------------------------------------------------- Start simple RAT screen  # ----------------------------------------------------- Start simple RAT screen
    my $editscript=&editscript('simple');     my $editscript=&editscript('simple');
    my $bodytag=&Apache::loncommon::bodytag(undef,undef,undef,1).     my $bodytag=&Apache::loncommon::bodytag(undef,undef,undef,
        &Apache::loncommon::help_open_topic('Sequence_Simple_Editor_Creation').   ($ENV{'environment.remote'} ne 'off')).
        &Apache::loncommon::help_open_faq(6).         &Apache::loncommon::help_open_menu('','Sequence_Simple_Editor_Creation','Sequence_Simple_Editor_Creation','',6,'RAT');
        &Apache::loncommon::help_open_bug('RAT');  
    my %lt=&Apache::lonlocal::texthash(     my %lt=&Apache::lonlocal::texthash(
       'sa' => 'Save',        'sa' => 'Save',
       'nt' => 'New Title',        'nt' => 'New Title',
Line 1132  sub viewmap { Line 1135  sub viewmap {
     my ($r,$url,$adv,$errtext)=@_;      my ($r,$url,$adv,$errtext)=@_;
     $r->print('<html>'.      $r->print('<html>'.
      &Apache::loncommon::bodytag('Edit Content of a Map').       &Apache::loncommon::bodytag('Edit Content of a Map').
       &Apache::loncommon::help_open_faq(6).        &Apache::loncommon::help_open_menu('','','','',6,'RAT').
       &Apache::loncommon::help_open_bug('RAT').  
       &buttons($adv));        &buttons($adv));
     if ($errtext) {      if ($errtext) {
  $r->print($errtext.'<hr />');   $r->print($errtext.'<hr />');
Line 1146  sub viewmap { Line 1148  sub viewmap {
     foreach (&attemptread(&Apache::lonnet::filelocation('',$url))) {      foreach (&attemptread(&Apache::lonnet::filelocation('',$url))) {
  if (defined($_)) {   if (defined($_)) {
             $idx++;              $idx++;
     my ($title,$url)=split(/\:/,$_);      my ($title,$url,$cond)=split(/\:/,$_);
       if ($cond eq 'cond') { next; }
             $title=~s/\&colon\;/\:/g;              $title=~s/\&colon\;/\:/g;
             $url=~s/\&colon\;/\:/g;              $url=~s/\&colon\;/\:/g;
             unless ($title) { $title=(split(/\//,$url))[-1] };              unless ($title) { $title=(split(/\//,$url))[-1] };
Line 1156  sub viewmap { Line 1159  sub viewmap {
             }              }
             $r->print(&Apache::lonratsrv::qtescape($title));              $r->print(&Apache::lonratsrv::qtescape($title));
             if ($url) { $r->print('</a>'); }              if ($url) { $r->print('</a>'); }
     $r->print('<br>');      $r->print("<br />\n");
         }          }
     }      }
     $r->print('</body></html>');      $r->print('</body></html>');

Removed from v.1.58  
changed lines
  Added in v.1.62


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