Diff for /loncom/xml/lonxml.pm between versions 1.547 and 1.549

version 1.547, 2014/06/21 20:56:40 version 1.549, 2014/07/27 11:20:13
Line 1521  sub inserteditinfo { Line 1521  sub inserteditinfo {
       my $xml_help = '';        my $xml_help = '';
       my $initialize='';        my $initialize='';
       my $textarea_id = 'filecont';        my $textarea_id = 'filecont';
       my ($dragmath_button,$deps_button);        my ($dragmath_button,$deps_button,$context,$cnum,$cdom,$add_to_onload,
       my ($add_to_onload, $add_to_onresize);            $add_to_onresize,$init_dragmath);
       $initialize=&Apache::lonhtmlcommon::spellheader();        $initialize=&Apache::lonhtmlcommon::spellheader();
       if (($filetype eq 'html') && (&Apache::lonhtmlcommon::htmlareabrowser())) {        if ($filetype eq 'html') {
   my $lang = &Apache::lonhtmlcommon::htmlarea_lang();            if ($env{'request.course.id'}) {
           my %textarea_args = (                $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'};
                                 fullpage => 'true',                $cnum = $env{'course.'.$env{'request.course.id'}.'.num'};
                                 dragmath => 'math',                if ($uri =~ m{^\Q/uploaded/$cdom/$cnum/portfolio/syllabus/\E}) {
                               );                    $context = 'syllabus';
           $initialize .= &Apache::lonhtmlcommon::htmlareaselectactive(\%textarea_args);                 }
             }
             if (&Apache::lonhtmlcommon::htmlareabrowser()) {
         my $lang = &Apache::lonhtmlcommon::htmlarea_lang();
                 my %textarea_args = (
                                       fullpage => 'true',
                                       dragmath => 'math',
                                     );
                 $initialize .= &Apache::lonhtmlcommon::htmlareaselectactive(\%textarea_args);
                 if ($context eq 'syllabus') {
                     $init_dragmath = "editmath_visibility('filecont','none')";
                 }
             }
       }        }
       $initialize .= (<<FULLPAGE);        $initialize .= (<<FULLPAGE);
 <script type="text/javascript">  <script type="text/javascript">
 // <![CDATA[  // <![CDATA[
     function initDocument() {      function initDocument() {
  resize_textarea('$textarea_id','LC_aftertextarea');   resize_textarea('$textarea_id','LC_aftertextarea');
           $init_dragmath
     }      }
 // ]]>  // ]]>
 </script>  </script>
 FULLPAGE  FULLPAGE
       my $textareaclass;        my $textareaclass;
       if ($filetype eq 'html') {        if ($filetype eq 'html') {
           my $context;            if ($context eq 'syllabus') {
           if ($env{'request.course.id'}) {                $deps_button = &Apache::lonhtmlcommon::dependencies_button()."\n";
               my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'};                $initialize .=
               my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'};                    &Apache::lonhtmlcommon::dependencycheck_js(undef,&mt('Syllabus'),
               if ($uri =~ m{^\Q/uploaded/$cdom/$cnum/portfolio/syllabus/\E}) {                                                               $uri,undef,
                   $context = 'syllabus';                                                               "/public/$cdom/$cnum/syllabus").
                   $deps_button = &Apache::lonhtmlcommon::dependencies_button()."\n";                    "\n";
                   $initialize .=                if (&Apache::lonhtmlcommon::htmlareabrowser()) {
                       &Apache::lonhtmlcommon::dependencycheck_js(undef,&mt('Syllabus'),                    $textareaclass = 'class="LC_richDefaultOn"';
                                                                  $uri,undef,  
                                                                  "/public/$cdom/$cnum/syllabus").  
                       "\n";  
                   if (&Apache::lonhtmlcommon::htmlareabrowser()) {  
                       $textareaclass = 'class="LC_richDefaultOn"';  
                   }  
               }  
           }  
           unless ($context eq 'syllabus') {  
               if ($symb || $folderpath) {  
                   $deps_button = &Apache::lonhtmlcommon::dependencies_button()."\n";  
                   $initialize .=   
                       &Apache::lonhtmlcommon::dependencycheck_js($symb,$itemtitle,  
                                                                  undef,$folderpath,$uri)."\n";  
               }                }
             } elsif ($symb || $folderpath) {
                 $deps_button = &Apache::lonhtmlcommon::dependencies_button()."\n";
                 $initialize .= 
                     &Apache::lonhtmlcommon::dependencycheck_js($symb,$itemtitle,
                                                                undef,$folderpath,$uri)."\n";
           }            }
           $dragmath_button = '<span id="math_filecont">'.&Apache::lonhtmlcommon::dragmath_button('filecont',1).'</span>';            $dragmath_button = '<span id="math_filecont">'.&Apache::lonhtmlcommon::dragmath_button('filecont',1).'</span>';
           $initialize .= "\n".&Apache::lonhtmlcommon::dragmath_js('EditMathPopup');            $initialize .= "\n".&Apache::lonhtmlcommon::dragmath_js('EditMathPopup');
Line 1747  sub handler { Line 1751  sub handler {
             }              }
  }   }
     }      }
       my $inhibit_menu;
     my %mystyle;      my %mystyle;
     my $result = '';      my $result = '';
     my $filecontents=&Apache::lonnet::getfile($file);      my $filecontents=&Apache::lonnet::getfile($file);
Line 1804  ENDNOTFOUND Line 1809  ENDNOTFOUND
     &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},      &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
     ['rawmode']);      ['rawmode']);
     if ($env{'form.rawmode'}) { $result = $filecontents; }      if ($env{'form.rawmode'}) { $result = $filecontents; }
               if (($env{'request.state'} eq 'construct') &&
                   (($filetype eq 'css') || ($filetype eq 'js')) && ($ENV{'HTTP_REFERER'})) {
                   if ($ENV{'HTTP_REFERER'} =~ m{^https?\://[^\/]+/priv/$LONCAPA::match_domain/$LONCAPA::match_username/[^\?]+\.(x?html?|swf)(|\?)[^\?]*$}) {
                       $inhibit_menu = 1;
                   }
               }
             if (($filetype ne 'html') &&               if (($filetype ne 'html') && 
                 (!$env{'form.return_only_error_and_warning_counts'})) {                  (!$env{'form.return_only_error_and_warning_counts'}) &&
                   (!$inhibit_menu)) {
                 my $nochgview = 1;                  my $nochgview = 1;
                 my $controls = '';                  my $controls = '';
                     if ($env{'request.state'} eq 'construct') {                      if ($env{'request.state'} eq 'construct') {
Line 1843  ENDNOTFOUND Line 1855  ENDNOTFOUND
 #  #
 # Edit action? Insert editing commands  # Edit action? Insert editing commands
 #  #
     unless ($env{'request.state'} eq 'published') {      unless (($env{'request.state'} eq 'published') || ($inhibit_menu)) {
  if ($env{'form.editmode'} && (!($env{'form.viewmode'})) && (!($env{'form.discardview'})))   if ($env{'form.editmode'} && (!($env{'form.viewmode'})) && (!($env{'form.discardview'})))
  {   {
             my ($displayfile,$url,$symb,$itemtitle,$action);              my ($displayfile,$url,$symb,$itemtitle,$action);

Removed from v.1.547  
changed lines
  Added in v.1.549


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