\n";
+ }
+ ##
+ ## Editing code
+ $result .=&hiddenfield('cell','').
+ &hiddenfield('newformula','');
+ ##
+ ## Create the save and load dialogs
+ my $filename = $spreadsheet->filename();
+ $filename = '' if ($filename =~ /^default\.$sheettype/i);
+ $filename =~ s/_$sheettype$//;
+ my $save_dialog = ''.
+ ' '.
+ ''.
+ '';
+ my $makedefault_dialog = '';
+ #
+ my $link = 'Browse";
+ my $load_dialog = <
+
+
+
+ $link
+
+
+
\n\n";
+ #
+ $result .=<
+
+
+
$load_dialog
+
+
+
$save_dialog
+
$makedefault_dialog
+
+
+
+
+END
+ return $result;
+}
+
sub handler {
my $r=shift;
#
@@ -155,6 +244,7 @@ sub handler {
$ENV{'request.course.id'});
my $allowed_to_view = &Apache::lonnet::allowed('vgr',
$ENV{'request.course.id'});
+
#
# Only those able to view others grades will be allowed to continue
# if they are not requesting their own.
@@ -175,10 +265,14 @@ sub handler {
##
## Spit out the javascript required for editing
##
- if (&Apache::lonnet::allowed('mgr',$ENV{'request.course.id'})) {
+ if ($allowed_to_edit) {
+ my $extra_javascript =
+ &Apache::loncommon::browser_and_searcher_javascript();
$r->print(<
+ $extra_javascript
+
var editwin;
function celledit(cellname,cellformula) {
@@ -219,7 +313,8 @@ ENDSCRIPT
'