Diff for /rat/lonratedt.pm between versions 1.85 and 1.90

version 1.85, 2006/11/02 21:27:58 version 1.90, 2008/10/13 11:54:54
Line 173  use Apache::lonlocal; Line 173  use Apache::lonlocal;
 use LONCAPA::map();  use LONCAPA::map();
 use File::Copy;  use File::Copy;
 use LONCAPA;  use LONCAPA;
   use HTML::Entities();
   
 # --------------------------------------------------------- Build up RAT screen  # --------------------------------------------------------- Build up RAT screen
 sub ratedt {  sub ratedt {
Line 274  function idxopen(mode) { Line 274  function idxopen(mode) {
    var options="scrollbars=1,resizable=1,menubar=0,location=1,toolbar=1";     var options="scrollbars=1,resizable=1,menubar=0,location=1,toolbar=1";
    idxmode=mode;     idxmode=mode;
    idxflag=1;     idxflag=1;
    idx=open('$resurl/?launch=1&mode=$mode&catalogmode='+mode,'idxout',options);     idx=open('$resurl/?inhibitmenu=yes&launch=1&mode=$mode&catalogmode='+mode,'idxout',options);
    idx.focus();     idx.focus();
 }  }
   
Line 282  function idxopen(mode) { Line 282  function idxopen(mode) {
 function groupopen(url,recover,bookmarks) {  function groupopen(url,recover,bookmarks) {
    var options="scrollbars=1,resizable=1,menubar=0";     var options="scrollbars=1,resizable=1,menubar=0";
    idxflag=1;     idxflag=1;
    idx=open("/adm/groupsort?mode=$mode&recover="+recover+"&readfile="+url+"&bookmarks="+bookmarks,"idxout",options);     idx=open("/adm/groupsort?inhibitmenu=yes&mode=$mode&recover="+recover+"&readfile="+url+"&bookmarks="+bookmarks,"idxout",options);
    idx.focus();     idx.focus();
 }  }
   
Line 291  function srchopen(mode) { Line 291  function srchopen(mode) {
    var options="scrollbars=1,resizable=1,menubar=0";     var options="scrollbars=1,resizable=1,menubar=0";
    srchmode=mode;     srchmode=mode;
    srchflag=1;     srchflag=1;
    srch=open("/adm/searchcat?launch=1&mode=$mode&catalogmode="+mode,"srchout",options);     srch=open("/adm/searchcat?inhibitmenu=yes&launch=1&mode=$mode&catalogmode="+mode,"srchout",options);
    srch.focus();     srch.focus();
 }  }
 // ----------------------------------------------------- launch indexer browser  // ----------------------------------------------------- launch indexer browser
Line 326  function idxcheck(mode) { Line 326  function idxcheck(mode) {
         if (editbrowser == null) {          if (editbrowser == null) {
             url += 'launch=1&';              url += 'launch=1&';
         }          }
           url += 'inhibitmenu=yes&';
         url += 'catalogmode=interactive&';          url += 'catalogmode=interactive&';
         url += 'mode=edit&';          url += 'mode=edit&';
         url += 'form=' + formname + '&';          url += 'form=' + formname + '&';
Line 359  sub smpedt { Line 360  sub smpedt {
        unless ($fatal) {         unless ($fatal) {
    $targetmsg='<b>'.&mt('Saved.').'</b><br />';     $targetmsg='<b>'.&mt('Saved.').'</b><br />';
        } else {         } else {
    $targetmsg='<b>'.&mt('An error occured while saving.').'</b><br />';     $targetmsg='<b>'.&mt('An error occurred while saving.').'</b><br />';
        }         }
    }     }
    if ($env{'form.revert'}) {     if ($env{'form.revert'}) {
Line 602  sub smpedt { Line 603  sub smpedt {
        my ($name,$url)=split(/\:/,$LONCAPA::map::resources[$_]);         my ($name,$url)=split(/\:/,$LONCAPA::map::resources[$_]);
        unless ($name) {  $name=(split(/\//,$url))[-1]; }         unless ($name) {  $name=(split(/\//,$url))[-1]; }
        unless ($name) { $name='EMPTY'; }         unless ($name) { $name='EMPTY'; }
          $name = &LONCAPA::map::qtescape($name);
          $url  = &LONCAPA::map::qtescape($url);
        $targetdetail.='&'.&escape($name).'='.         $targetdetail.='&'.&escape($name).'='.
                   &escape($url);                    &escape($url);
        $idx++;         $idx++;
        $name=~s/\&colon;/\:/g;         $name = &HTML::Entities::encode($name,'\'"<>&');
        '<option value="'.$idx.'">'.$name.'</option>';         '<option value="'.$idx.'">'.$name.'</option>';
    } @LONCAPA::map::order);     } @LONCAPA::map::order);
   
Line 642  sub smpedt { Line 645  sub smpedt {
    function openview(entry) {     function openview(entry) {
        var url=unescape((entry.split('='))[1]);         var url=unescape((entry.split('='))[1]);
        var parts=new Array;         var parts=new Array;
        parts=url.split('&colon;');  
        url=parts.join(':');  
        if (url) { open(url,'cat'); }         if (url) { open(url,'cat'); }
    }     }
   
Line 662  sub smpedt { Line 663  sub smpedt {
        var entry=(document.forms.simpleedit.targetdetail.value.split('&'))         var entry=(document.forms.simpleedit.targetdetail.value.split('&'))
                 [selidx];                  [selidx];
        var oldname=unescape((entry.split('='))[0]);         var oldname=unescape((entry.split('='))[0]);
        var nameparts=oldname.split('&colon;');  
        oldname=unescape(nameparts.join(':'));  
        nameparts=oldname.split('&#34;');  
        oldname=unescape(nameparts.join('"'));  
        nameparts=oldname.split('&#39;');  
        oldname=unescape(nameparts.join("'"));  
        newtitle=prompt('$lt{'nt'}',oldname);         newtitle=prompt('$lt{'nt'}',oldname);
        if (newtitle) {         if (newtitle) {
            document.forms.simpleedit.renameres.value=1;             document.forms.simpleedit.renameres.value=1;
Line 763  ENDSMPHEAD Line 758  ENDSMPHEAD
 # ----------------------------------------------------------------- No such dir  # ----------------------------------------------------------------- No such dir
 sub nodir {  sub nodir {
    my ($r,$dir)=@_;     my ($r,$dir)=@_;
    $dir=~s{^/home/\w+/public_html}{};     $dir=~s{^/home/$LONCAPA::username_re/public_html}{};
    $r->print(&Apache::loncommon::start_page(undef,undef,     $r->print(&Apache::loncommon::start_page(undef,undef,
     {'only_body' => 1,      {'only_body' => 1,
      'bgcolor'   => '#FFFFFF',}).       'bgcolor'   => '#FFFFFF',}).
Line 780  sub viewmap { Line 775  sub viewmap {
       &Apache::loncommon::help_open_menu('','',6,'RAT').        &Apache::loncommon::help_open_menu('','',6,'RAT').
       &buttons($adv));        &buttons($adv));
     if ($errtext) {      if ($errtext) {
  $r->print($errtext.'<hr />');   $r->print('<div class="LC_error">'
                    .$errtext
                    .'</div>'
                    .'<hr />'
           );
     }      }
     my $idx=0;      my $idx=0;
     $r->print('<h1>'.$url.'</h1>');      $r->print('<h1>'.$url.'</h1>');
     if ($adv) {      if ($adv) {
  $r->print('<p><b><font color="red">'.&mt('Map contents are not shown in order.').'</font></b></p><br />');   $r->print('<p class="LC_warning">'
                    .&mt('Map contents are not shown in order.')
                    .'</p><br />'
           );
     }      }
     $r->print( '<table border="0" cellspacing="2" cellpadding="4">'.      $r->print(&Apache::loncommon::start_data_table()
                '<tr bgcolor="#DDDDDD"><th>'.&mt('Type').'</th>'.               .&Apache::loncommon::start_data_table_header_row()
                '<th>'.&mt('Title in map').'</th>'.               .'<th>'.&mt('Type').'</th>'
                '<th>'.&mt('Filename of resource').'</th>'.               .'<th>'.&mt('Title in map').'</th>'
                '<th>'.&mt('Link to published resource').'</th>'.               .'<th>'.&mt('Filename of resource').'</th>'
                '<th>'.&mt('Link to resource in Construction Space').'</th>'.               .'<th>'.&mt('Link to published resource').'</th>'
                '</tr>');               .'<th>'.&mt('Link to resource in Construction Space').'</th>'
     my @backgroundColors = ("#FFFFFF", "#F6F6F6");               .&Apache::loncommon::end_data_table_header_row()
       );
     foreach (&LONCAPA::map::attemptread(&Apache::lonnet::filelocation('',$url))) {      foreach (&LONCAPA::map::attemptread(&Apache::lonnet::filelocation('',$url))) {
  if (defined($_)) {   if (defined($_)) {
             $idx++;              $idx++;
     my ($title,$url,$cond)=split(/\:/,$_);      my ($title,$url,$cond)=split(/\:/,$_);
     if ($cond eq 'cond') { next; }      if ($cond eq 'cond') { next; }
             $title=~s/\&colon\;/\:/g;              $title= &LONCAPA::map::qtescape($title);
             $url=~s/\&colon\;/\:/g;              $url  = &LONCAPA::map::qtescape($url);
             unless ($title) { $title=(split(/\//,$url))[-1] };              unless ($title) { $title=(split(/\//,$url))[-1] };
             unless ($title) { $title='<i>'.&mt('Empty').'</i>'; }              unless ($title) { $title='<i>'.&mt('Empty').'</i>'; }
             my $resurl = &LONCAPA::map::qtescape($url);              my $resurl = $url;
             my $resfilepath = $Apache::lonnet::perlvar{'lonDocRoot'}.$resurl;              my $resfilepath = $Apache::lonnet::perlvar{'lonDocRoot'}.$resurl;
             my $filename;               my $filename; 
             if ($resurl =~ m#/([^/]+)$#) {              if ($resurl =~ m#/([^/]+)$#) {
Line 812  sub viewmap { Line 815  sub viewmap {
             }              }
             my $cstrurl = $resurl;              my $cstrurl = $resurl;
             $cstrurl =~ s#^/res/[^/]+/([^/]+)/#/priv/$1/#;              $cstrurl =~ s#^/res/[^/]+/([^/]+)/#/priv/$1/#;
             my $bgcol = $idx%2;               $r->print(&Apache::loncommon::start_data_table_row()
             $r->print('<tr bgcolor='.$backgroundColors[$bgcol].'><td>'.                       .'<td>'
                       '<img src="'.&Apache::loncommon::icon($resfilepath).                       .'<img src="'.&Apache::loncommon::icon($resfilepath).'" />'
                       '" /></td><td>'.&LONCAPA::map::qtescape($title).                       .'</td>'
                       '</td><td>'.$filename.'</td><td>');                       .'<td>'
                        .&HTML::Entities::encode(&LONCAPA::map::qtescape($title))
                        .'</td>'
                        .'<td>'.$filename.'</td>'
                        .'<td>'
               );
             if ($url) {              if ($url) {
  $r->print('<a href="'.$resurl.'">'.&mt('Resource space').'</a>');   $r->print('<a href="'.$resurl.'">'.&mt('Resource space').'</a>');
               } else {
                   $r->print('&nbsp;');
             }              }
             $r->print('</td><td>');              $r->print('</td><td>');
             if ($url) {              if ($url) {
                $r->print('<a href="'.$cstrurl.'">'.                 $r->print('<a href="'.$cstrurl.'">'.
                          &mt('Construction space').'</a>');                           &mt('Construction space').'</a>');
               } else {
                   $r->print('&nbsp;');
             }              }
             $r->print('</td></tr>'."\n");              $r->print('</td>'
                        .&Apache::loncommon::end_data_table_row()
               );
         }          }
     }      }
     $r->print('</table>');      $r->print(&Apache::loncommon::end_data_table());
     $r->print(&Apache::loncommon::end_page());      $r->print(&Apache::loncommon::end_page());
 }  }
   

Removed from v.1.85  
changed lines
  Added in v.1.90


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>
500 Internal Server Error

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at root@localhost to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.