--- loncom/xml/lonxml.pm 2001/06/13 20:02:28 1.93
+++ loncom/xml/lonxml.pm 2001/06/16 18:34:31 1.96
@@ -11,6 +11,7 @@
# 5/27 H. K. Ng
# 6/2,6/3,6/8,6/9 Gerd Kortemeyer
# 6/12,6/13 H. K. Ng
+# 6/16 Gerd Kortemeyer
package Apache::lonxml;
use vars
@@ -147,6 +148,12 @@ ENDPARM
(2,1,'back.gif','backward','','gopost("/adm/flip","back:"+currentURL)');
menu.switchbutton
(2,3,'forw.gif','forward','','gopost("/adm/flip","forward:"+currentURL)');
+ menu.switchbutton
+ (9,1,'sbkm.gif','set','bookmark','set_bookmark()');
+ menu.switchbutton
+ (9,2,'vbkm.gif','view','bookmark','edit_bookmarks()');
+ menu.switchbutton
+ (9,3,'anot.gif','anno-','tations','annotate()');
$hwkadd
}
@@ -159,7 +166,8 @@ ENDPARM
menu.clearbut(7,2);
menu.clearbut(7,3);
menu.menucltim=menu.setTimeout(
- 'clearbut(2,1);clearbut(2,3);clearbut(8,1);clearbut(8,2);clearbut(8,3);',
+ 'clearbut(2,1);clearbut(2,3);clearbut(8,1);clearbut(8,2);clearbut(8,3);'+
+ 'clearbut(9,1);clearbut(9,2);clearbut(9,3);',
2000);
}
@@ -217,27 +225,8 @@ sub printalltags {
sub xmlparse {
my ($target,$content_file_string,$safeinit,%style_for_target) = @_;
- if ($target eq 'meta') {
- $Apache::lonxml::redirection = 0;
- $Apache::lonxml::metamode = 1;
- $Apache::lonxml::evaluate = 1;
- $Apache::lonxml::import = 0;
- } elsif ($target eq 'grade') {
- &startredirection;
- $Apache::lonxml::metamode = 0;
- $Apache::lonxml::evaluate = 1;
- $Apache::lonxml::import = 1;
- } elsif ($target eq 'modified') {
- $Apache::lonxml::redirection = 0;
- $Apache::lonxml::metamode = 0;
- $Apache::lonxml::evaluate = 0;
- $Apache::lonxml::import = 0;
- } else {
- $Apache::lonxml::redirection = 0;
- $Apache::lonxml::metamode = 0;
- $Apache::lonxml::evaluate = 1;
- $Apache::lonxml::import = 1;
- }
+
+ &setup_globals($target);
#&printalltags();
my @pars = ();
@Apache::lonxml::pwd=();
@@ -464,6 +453,36 @@ sub callsub {
return $currentstring;
}
+sub setup_globals {
+ my ($target)=@_;
+ if ($target eq 'meta') {
+ $Apache::lonxml::redirection = 0;
+ $Apache::lonxml::metamode = 1;
+ $Apache::lonxml::evaluate = 1;
+ $Apache::lonxml::import = 0;
+ } elsif ($target eq 'grade') {
+ &startredirection;
+ $Apache::lonxml::metamode = 0;
+ $Apache::lonxml::evaluate = 1;
+ $Apache::lonxml::import = 1;
+ } elsif ($target eq 'modified') {
+ $Apache::lonxml::redirection = 0;
+ $Apache::lonxml::metamode = 0;
+ $Apache::lonxml::evaluate = 0;
+ $Apache::lonxml::import = 0;
+ } elsif ($target eq 'edit') {
+ $Apache::lonxml::redirection = 0;
+ $Apache::lonxml::metamode = 0;
+ $Apache::lonxml::evaluate = 0;
+ $Apache::lonxml::import = 0;
+ } else {
+ $Apache::lonxml::redirection = 0;
+ $Apache::lonxml::metamode = 0;
+ $Apache::lonxml::evaluate = 1;
+ $Apache::lonxml::import = 1;
+ }
+}
+
sub init_safespace {
my ($target,$safeeval,$safehole,$safeinit) = @_;
$safeeval->permit("entereval");
@@ -801,7 +820,7 @@ ENDNOTFOUND
sub debug {
if ($Apache::lonxml::debug eq 1) {
- print "DEBUG:".$_[0]."
\n";
+ print("DEBUG:".$_[0]."
\n");
}
}