version 1.22, 2003/09/04 15:17:41
|
version 1.26, 2003/09/30 15:40:09
|
Line 54 built-in functions.
|
Line 54 built-in functions.
|
package Apache::lonspreadsheet; |
package Apache::lonspreadsheet; |
|
|
use strict; |
use strict; |
|
use warnings FATAL=>'all'; |
|
no warnings 'uninitialized'; |
use Apache::classcalc(); |
use Apache::classcalc(); |
use Apache::studentcalc(); |
use Apache::studentcalc(); |
use Apache::assesscalc(); |
use Apache::assesscalc(); |
use Apache::Constants qw(:common :http); |
use Apache::Constants qw(:common :http); |
use Apache::lonnet; |
use Apache::lonnet; |
use Apache::lonhtmlcommon; |
use Apache::lonhtmlcommon; |
|
use Apache::lonlocal; |
|
use Apache::loncoursedata(); |
use HTML::Entities(); |
use HTML::Entities(); |
|
|
## |
## |
Line 103 sub file_dialogs {
|
Line 107 sub file_dialogs {
|
if ($save_status ne 'ok') { |
if ($save_status ne 'ok') { |
$message .= "An error occurred while saving the spreadsheet". |
$message .= "An error occurred while saving the spreadsheet". |
"There error is:".$save_status; |
"There error is:".$save_status; |
return $result; |
|
} else { |
} else { |
$message .= "Spreadsheet saved as ".$ENV{'form.savefilename'}; |
$message .= "Spreadsheet saved as ".$spreadsheet->filename(); |
} |
} |
} elsif (exists($ENV{'form.newformula'}) && |
} elsif (exists($ENV{'form.newformula'}) && |
exists($ENV{'form.cell'}) && |
exists($ENV{'form.cell'}) && |
Line 168 END
|
Line 171 END
|
$load_dialog .= "</select>\n</td><td> </td></tr>\n</table>\n"; |
$load_dialog .= "</select>\n</td><td> </td></tr>\n</table>\n"; |
# |
# |
$result .=<<END; |
$result .=<<END; |
|
<!-- |
|
<fieldset title="File Dialogs" > |
|
<legend>File Dialogs</legend> |
|
--> |
<!-- load / save dialogs --> |
<!-- load / save dialogs --> |
<table cellspacing="2"> |
<table cellspacing="2"> |
<tr> |
<tr> |
Line 180 END
|
Line 187 END
|
</td> |
</td> |
</tr> |
</tr> |
</table> |
</table> |
|
<!-- |
|
</fieldset> |
|
--> |
END |
END |
return ($result,$message); |
return ($result,$message); |
} |
} |
Line 200 sub handler {
|
Line 210 sub handler {
|
# HTML Header |
# HTML Header |
# |
# |
if ($r->header_only) { |
if ($r->header_only) { |
$r->content_type('text/html'); |
&Apache::loncommon::content_type($r,'text/html'); |
$r->send_http_header; |
$r->send_http_header; |
return OK; |
return OK; |
} |
} |
Line 289 sub handler {
|
Line 299 sub handler {
|
# |
# |
# Open page, try to prevent browser cache. |
# Open page, try to prevent browser cache. |
# |
# |
$r->content_type('text/html'); |
&Apache::loncommon::content_type($r,'text/html'); |
&Apache::loncommon::no_cache($r); |
&Apache::loncommon::no_cache($r); |
$r->send_http_header; |
$r->send_http_header; |
|
|
Line 365 ENDSCRIPT
|
Line 375 ENDSCRIPT
|
## |
## |
## Take care of "backdoor" spreadsheet expiration / recalc stuff |
## Take care of "backdoor" spreadsheet expiration / recalc stuff |
if ($allowed_to_edit && exists($ENV{'form.recalc'})) { |
if ($allowed_to_edit && exists($ENV{'form.recalc'})) { |
|
if (exists($ENV{'form.recalc'})) { |
|
&Apache::loncoursedata::delete_caches($ENV{'requres.course.id'}); |
|
} |
if ($ENV{'form.recalc'} eq 'ilovewastingtime') { |
if ($ENV{'form.recalc'} eq 'ilovewastingtime') { |
&Apache::lonnet::logthis('ilovewastingtime'); |
&Apache::lonnet::logthis('ilovewastingtime'); |
# expire ALL spreadsheets |
# expire ALL spreadsheets |
Line 448 END
|
Line 461 END
|
# |
# |
$r->print("<table><tr>"); |
$r->print("<table><tr>"); |
if ($sheettype eq 'classcalc') { |
if ($sheettype eq 'classcalc') { |
$r->print('<td><input type="submit" value="Generate Spreadsheet" />'. |
$r->print('<td><input type="submit" value="'. |
|
&mt('Generate Spreadsheet').'" />'. |
'</td>'); |
'</td>'); |
} |
} |
if ($allowed_to_view) { |
if ($allowed_to_view) { |