[LON-CAPA-cvs] cvs: loncom /xml lonxml.pm
albertel
lon-capa-cvs-allow@mail.lon-capa.org
Wed, 05 Dec 2007 14:52:19 -0000
albertel Wed Dec 5 09:52:19 2007 EDT
Modified files:
/loncom/xml lonxml.pm
Log:
- make editing html/sty have same look and feel as EditXML
- elminate bottom buttons
Index: loncom/xml/lonxml.pm
diff -u loncom/xml/lonxml.pm:1.469 loncom/xml/lonxml.pm:1.470
--- loncom/xml/lonxml.pm:1.469 Tue Nov 13 17:16:10 2007
+++ loncom/xml/lonxml.pm Wed Dec 5 09:52:15 2007
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# XML Parser Module
#
-# $Id: lonxml.pm,v 1.469 2007/11/13 22:16:10 albertel Exp $
+# $Id: lonxml.pm,v 1.470 2007/12/05 14:52:15 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1083,7 +1083,7 @@
# If the caller supplied the response_id parameter,
# Maintain its counter.. creating if necessary.
- if(defined($part_response)) {
+ if (defined($part_response)) {
if (!defined($Apache::lonxml::counters_per_part{$part_response})) {
$Apache::lonxml::counters_per_part{$part_response} = 0;
}
@@ -1164,7 +1164,6 @@
} else {
return $Apache::lonxml::counters_per_part{$part_response};
}
-
}
=pod
@@ -1477,7 +1476,7 @@
sub inserteditinfo {
- my ($filecontents,$filetype)=@_;
+ my ($filecontents, $filetype, $filename)=@_;
$filecontents = &HTML::Entities::encode($filecontents,'<>&"');
# my $editheader='<a href="#editsection">Edit below</a><hr />';
my $xml_help = '';
@@ -1529,38 +1528,41 @@
$xml_help=&Apache::loncommon::helpLatexCheatsheet();
}
- my $cleanbut = '';
-
my $titledisplay=&display_title();
my %lt=&Apache::lonlocal::texthash('st' => 'Save and Edit',
'vi' => 'Save and View',
'dv' => 'Discard Edits and View',
'un' => 'undo',
'ed' => 'Edit');
- my $buttons=(<<BUTTONS);
-$cleanbut
-<input type="submit" name="discardview" accesskey="d" value="$lt{'dv'}" />
-<input type="submit" name="Undo" accesskey="u" value="$lt{'un'}" /><hr />
-<input type="submit" name="savethisfile" accesskey="s" value="$lt{'st'}" />
-<input type="submit" name="viewmode" accesskey="v" value="$lt{'vi'}" />
-BUTTONS
- $buttons.=&Apache::lonhtmlcommon::spelllink('xmledit','filecont');
+ my $spelllink .=&Apache::lonhtmlcommon::spelllink('xmledit','filecont');
my $textarea_events = &Apache::edit::element_change_detection();
my $form_events = &Apache::edit::form_change_detection();
my $editfooter=(<<ENDFOOTER);
$initialize
-<hr />
<a name="editsection" />
<form $form_events method="post" name="xmledit">
-$xml_help
-<input type="hidden" name="editmode" value="$lt{'ed'}" />
-$buttons<br />
-<textarea $textarea_events style="width:100%" cols="80" rows="44" name="filecont" id="filecont">$filecontents</textarea>
-<div id="LC_aftertextarea">
-<br />$buttons
-<br />
-$titledisplay
-</div>
+ <div class="LC_edit_problem_editxml_header">
+ <table class="LC_edit_problem_header_title"><tr><td>
+ $filename
+ </td><td align="right">
+ $xml_help
+ </td></tr>
+ </table>
+ <div class="LC_edit_problem_discards">
+ <input type="submit" name="discardview" accesskey="d" value="$lt{'dv'}" />
+ <input type="submit" name="Undo" accesskey="u" value="$lt{'un'}" />
+ $spelllink
+ </div>
+ <div class="LC_edit_problem_saves">
+ <input type="submit" name="savethisfile" accesskey="s" value="$lt{'st'}" />
+ <input type="submit" name="viewmode" accesskey="v" value="$lt{'vi'}" />
+ </div>
+ </div>
+ <textarea $textarea_events style="width:100%" cols="80" rows="44" name="filecont" id="filecont">$filecontents</textarea>
+ <div id="LC_aftertextarea">
+ <br />
+ $titledisplay
+ </div>
</form>
</body>
ENDFOOTER
@@ -1690,11 +1692,12 @@
unless ($env{'request.state'} eq 'published') {
if ($env{'form.editmode'} && (!($env{'form.viewmode'})) && (!($env{'form.discardview'})))
{
- my ($edit_info, $add_to_onload, $add_to_onresize)=
- &inserteditinfo($filecontents,$filetype);
-
my $displayfile=$request->uri;
$displayfile=~s/^\/[^\/]*//;
+
+ my ($edit_info, $add_to_onload, $add_to_onresize)=
+ &inserteditinfo($filecontents,$filetype,$displayfile);
+
my %options =
('add_entries' =>
{'onresize' => $add_to_onresize,
@@ -1710,9 +1713,7 @@
my $start_page = &Apache::loncommon::start_page(undef,$js,
\%options);
$result=$start_page.
- &Apache::lonxml::message_location().'<h3>'.
- $displayfile.
- '</h3>'.
+ &Apache::lonxml::message_location().
$edit_info.
&Apache::loncommon::end_page();
}