--- loncom/xml/lonxml.pm 2025/01/15 18:09:02 1.531.2.24.2.7 +++ loncom/xml/lonxml.pm 2024/12/28 22:47:34 1.531.2.28 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # XML Parser Module # -# $Id: lonxml.pm,v 1.531.2.24.2.7 2025/01/15 18:09:02 raeburn Exp $ +# $Id: lonxml.pm,v 1.531.2.28 2024/12/28 22:47:34 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1634,6 +1634,21 @@ sub renderingoptions { return $output; } +sub setmode_javascript { + return <<"ENDSCRIPT"; + +ENDSCRIPT +} + sub inserteditinfo { my ($filecontents,$filetype,$filename,$symb,$itemtitle,$folderpath,$uri,$action) = @_; $filecontents = &HTML::Entities::encode($filecontents,'<>&"'); @@ -1710,8 +1725,7 @@ FULLPAGE 'vi' => 'Save and View', 'dv' => 'Discard Edits and View', 'un' => 'Undo', - 'ed' => 'Edit', - 'ew' => 'Edit with Daxe'); + 'ed' => 'Edit'); my $spelllink = &Apache::lonhtmlcommon::spelllink('xmledit','filecont'); my $textarea_events = &Apache::edit::element_change_detection(); my $form_events = &Apache::edit::form_change_detection(); @@ -1727,8 +1741,8 @@ FULLPAGE } } } - my ($undo,$daxebutton,%onclick); - foreach my $item ('discard','undo','daxe') { + my ($undo,%onclick); + foreach my $item ('discard','undo') { $onclick{$item} = 'onclick="still_ask=true;setmode(this.form,'."'$item'".')"'; } foreach my $item ('saveedit','saveview') { @@ -1736,16 +1750,9 @@ FULLPAGE } unless ($uri =~ m{^/uploaded/}) { $undo = ''."\n"; + $onclick{'undo'}.' />'."\n"; } $initialize .= &setmode_javascript(); - if ($filetype eq 'html') { - my %editors = &Apache::loncommon::permitted_editors($uri); - if ($editors{'daxe'}) { - $daxebutton = ''."\n"; - } - } my $editfooter=(< @@ -1764,7 +1771,7 @@ $initialize
- $undo $deps_button $daxebutton $dragmath_button $htmlerror + $undo $deps_button $dragmath_button $htmlerror

$spelllink @@ -1777,96 +1784,6 @@ ENDFOOTER return ($editfooter,$add_to_onload,$add_to_onresize); } -sub setmode_javascript { - return <<"ENDSCRIPT"; - -ENDSCRIPT -} - -sub seteditor_javascript { - my ($is_course_doc,$is_supp,$supp_path,$supp_title) = @_; - my $symb; - if ($is_course_doc) { - if (!$is_supp) { - ($symb) = &Apache::lonnet::whichuser(); - if ($symb) { - $symb = &escape($symb); - } - } - } - return <<"ENDSCRIPT"; - -ENDSCRIPT -} - sub get_target { my $viewgrades=&Apache::lonnet::allowed('vgr',$env{'request.course.id'}); if ( $env{'request.state'} eq 'published') { @@ -2016,7 +1933,7 @@ ENDNOTFOUND &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, ['editmode']); } - if ((!$env{'form.editmode'}) || + if ((!$env{'form.editmode'}) || ($env{'form.problemmode'} eq 'saveview') || ($env{'form.problemmode'} eq 'discard')) { if ($filetype eq 'html' || $filetype eq 'sty') { @@ -2086,22 +2003,16 @@ ENDNOTFOUND # Edit action? Insert editing commands # unless (($env{'request.state'} eq 'published') || ($inhibit_menu)) { - if (($env{'form.editmode'}) && + if (($env{'form.editmode'}) && (!($env{'form.problemmode'} eq 'saveview')) && (!($env{'form.problemmode'} eq 'discard'))) { my ($displayfile,$url,$symb,$itemtitle,$action); $displayfile=$request->uri; if ($request->uri =~ m{^/uploaded/}) { if ($env{'request.course.id'}) { - if ($request->uri =~ m{^\Q/uploaded/$cdom/$cnum/\E(docs|supplemental)/}) { - if ($1 eq 'supplemental') { - &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, - ['folderpath','title']); - } - if (($env{'request.state'} eq 'edit') && ($env{'form.editmode'} eq 'edit') && - ($filetype eq 'html')) { - &Apache::lonhtmlcommon::clear_breadcrumbs(); - } + if ($request->uri =~ m{^\Q/uploaded/$cdom/$cnum/supplemental/\E}) { + &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, + ['folderpath','title']); } elsif ($request->uri =~ m{^\Q/uploaded/$cdom/$cnum/portfolio/syllabus/\E(.+)$}) { my $filename = $1; if ($1 eq 'loncapa.html') {