[LON-CAPA-cvs] cvs: loncom /xml londefdef.pm
raeburn
raeburn@source.lon-capa.org
Sun, 28 Nov 2010 02:46:24 -0000
raeburn Sun Nov 28 02:46:24 2010 EDT
Modified files:
/loncom/xml londefdef.pm
Log:
- Add "use" for loncommon
- xhtml - missing form action
- Course vs. Community
Index: loncom/xml/londefdef.pm
diff -u loncom/xml/londefdef.pm:1.426 loncom/xml/londefdef.pm:1.427
--- loncom/xml/londefdef.pm:1.426 Thu Nov 18 17:42:15 2010
+++ loncom/xml/londefdef.pm Sun Nov 28 02:46:23 2010
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Tags Default Definition Module
#
-# $Id: londefdef.pm,v 1.426 2010/11/18 17:42:15 raeburn Exp $
+# $Id: londefdef.pm,v 1.427 2010/11/28 02:46:23 raeburn Exp $
#
#
# Copyright Michigan State University Board of Trustees
@@ -47,6 +47,7 @@
use Apache::lonmenu();
use Apache::lonmeta();
use Apache::lonlocal;
+use Apache::loncommon();
use Apache::Constants qw(:common);
use File::Basename;
use LONCAPA();
@@ -588,7 +589,7 @@
sub edit_controls {
my ($nochgview) = @_;
my $result .= '
-<form method="post">
+<form method="post" action="">
<div class="LC_edit_problem_header">';
unless ($nochgview) {
$result .= '
@@ -600,7 +601,12 @@
$result .= '
<div><input type="submit" name="editmode" accesskey="e" value="'.&mt('Edit').'" />';
if (($env{'request.course.id'}) && ($env{'form.forceedit'})) {
- $result .= (' ' x 3).'<input type="button" value="'.&mt('Course View').'" onclick="javascript:location.href=currentURL" />';
+ my $viewtext = &mt('Course View');
+ if (&Apache::loncommon::course_type() eq 'Community') {
+ $viewtext = &mt('Community View');
+ }
+ $result .= (' ' x 3).'<input type="button" value="'.
+ $viewtext.'" onclick="javascript:location.href=currentURL" />';
}
$result .= '</div>
</div>