Diff for /loncom/xml/lonxml.pm between versions 1.174 and 1.179

version 1.174, 2002/05/24 20:51:55 version 1.179, 2002/07/01 15:29:23
Line 331  sub registerurl { Line 331  sub registerurl {
     my $forcereg=shift;      my $forcereg=shift;
     my $target = shift;      my $target = shift;
     my $result = '';      my $result = '';
     if (($ENV{'request.publicaccess'}) ||       if ($target eq 'edit') {
        (!&Apache::lonnet::is_on_map($ENV{'REQUEST_URI'}))) {          $result .="<script>\n    menu.currentURL=null;\n".
  return               &Apache::loncommon::browser_and_searcher_javascript().
                   "\n</script>\n";
       }
       if ((($ENV{'request.publicaccess'}) || 
            (!&Apache::lonnet::is_on_map($ENV{'REQUEST_URI'}))) &&
           (!$forcereg)) {
    return $result.
          '<script>function LONCAPAreg(){} function LONCAPAstale(){}</script>';           '<script>function LONCAPAreg(){} function LONCAPAstale(){}</script>';
     }      }
     if ($Apache::lonxml::registered && !$forcereg) { return ''; }      if ($Apache::lonxml::registered && !$forcereg) { return ''; }
Line 370  ENDPARM Line 376  ENDPARM
           menu.clearTimeout(menu.menucltim);            menu.clearTimeout(menu.menucltim);
           $timesync            $timesync
   menu.currentURL=window.location.pathname;    menu.currentURL=window.location.pathname;
             menu.reloadURL=window.location.pathname;
           menu.currentStale=0;            menu.currentStale=0;
           menu.clearbut(3,1);            menu.clearbut(3,1);
           menu.switchbutton            menu.switchbutton
Line 396  ENDPARM Line 403  ENDPARM
     function LONCAPAstale() {      function LONCAPAstale() {
   menu=window.open("$nothing","LONCAPAmenu","",false);    menu=window.open("$nothing","LONCAPAmenu","",false);
           menu.currentStale=1;            menu.currentStale=1;
           menu.switchbutton            if (menu.reloadURL!='' && menu.reloadURL!= null) { 
              (3,1,'reload.gif','return','location','go(currentURL)');               menu.switchbutton
                (3,1,'reload.gif','return','location','go(reloadURL)');
     }
           menu.clearbut(7,1);            menu.clearbut(7,1);
           menu.clearbut(7,2);            menu.clearbut(7,2);
           menu.clearbut(7,3);            menu.clearbut(7,3);
Line 442  ENDREGTHIS Line 451  ENDREGTHIS
 </script>  </script>
 ENDDONOTREGTHIS  ENDDONOTREGTHIS
     }      }
     if ($target eq 'edit') {  
  # Javascript routines for construction space:  
  # openbrowser and opensearcher will start the file browser  
  # (lonindexer) and searcher (lonsearchcat) respectively.  
  # Inputs are the name of the html form being used  
  # and the name of the element the selected URL should  
  # be placed in.  
         # openbrowser also takes arguments only and omit, which are  
         # comma deliminated lists of file extensions to (only) show   
         # or omit.  
         # Here we also set currentURL=null.  
         $result .=<<"ENDBROWSERSCRIPT";  
 <script>  
     menu.currentURL=null;  
     var editbrowser;  
     function openbrowser(formname,elementname,only,omit) {  
         var url = '/res/?';  
         if (editbrowser == null) {  
             url += 'launch=1&';  
         }  
         url += 'catalogmode=interactive&';  
         url += 'mode=edit&';  
         url += 'form=' + formname + '&';  
         if (only != null) {  
             url += 'only=' + only + '&';  
         }   
         if (omit != null) {  
             url += 'omit=' + omit + '&';  
         }  
         url += 'element=' + elementname + '';  
         var title = 'Browser';  
         var options = 'scrollbars=1,resizable=1,menubar=0';  
         options += ',width=700,height=600';  
         editbrowser = open(url,title,options,'1');  
         editbrowser.focus();  
     }  
     var editsearcher;  
     function opensearcher(formname,elementname) {  
         var url = '/adm/searchcat?';  
         if (editsearcher == null) {  
             url += 'launch=1&';  
         }  
         url += 'catalogmode=interactive&';  
         url += 'mode=edit&';  
         url += 'form=' + formname + '&';  
         url += 'element=' + elementname + '';  
         var title = 'Search';  
         var options = 'scrollbars=1,resizable=1,menubar=0';  
         options += ',width=700,height=600';  
         editsearcher = open(url,title,options,'1');  
         editsearcher.focus();  
     }  
 </script>  
 ENDBROWSERSCRIPT  
     }  
     return $result;      return $result;
 }  }
   
Line 520  sub xmlparse { Line 474  sub xmlparse {
  my ($request,$target,$content_file_string,$safeinit,%style_for_target) = @_;   my ($request,$target,$content_file_string,$safeinit,%style_for_target) = @_;
   
  &setup_globals($request,$target);   &setup_globals($request,$target);
   #
   # do we have a course style file?
   #
   
    if ($ENV{'request.course.id'}) {
        my $bodytext=
    $ENV{'course.'.$ENV{'request.course.id'}.'.default_xml_style'};
        if ($bodytext) {
          my $location=&Apache::lonnet::filelocation('',$bodytext);
          my $styletext=&Apache::lonnet::getfile($location);
          if ($styletext ne '-1') {
             %style_for_target = (%style_for_target,
                             &Apache::style::styleparser($target,$styletext));
          }
       }
    }
   
  #&printalltags();   #&printalltags();
  my @pars = ();   my @pars = ();
  my $pwd=$ENV{'request.filename'};   my $pwd=$ENV{'request.filename'};
Line 1236  ENDNOTFOUND Line 1207  ENDNOTFOUND
 #  #
   unless ($ENV{'request.state'} eq 'published') {    unless ($ENV{'request.state'} eq 'published') {
     if ($ENV{'form.editmode'} && (!($ENV{'form.viewmode'}))) {      if ($ENV{'form.editmode'} && (!($ENV{'form.viewmode'}))) {
       $result='<html><body bgcolor="#FFFFFF"></body></html>';   my $displayfile=$request->uri;
           $displayfile=~s/^\/[^\/]*//;
         $result='<html><body bgcolor="#FFFFFF"><h3>'.$displayfile.
                 '</h3></body></html>';
       $result=&inserteditinfo($result,$filecontents);        $result=&inserteditinfo($result,$filecontents);
     }      }
   }    }

Removed from v.1.174  
changed lines
  Added in v.1.179


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.