@@ -290,7 +318,7 @@ sub innerregister {
my $tableend=($noremote?'
':'').($textinter?'':'');
# =============================================================================
# ============================ This is for URLs that actually can be registered
- if (($ENV{'request.noversionuri'}!~/^\/(res\/)*adm\//) || ($forcereg)) {
+ if (($ENV{'request.noversionuri'}!~m|^/(res/)*adm/|) || ($forcereg)) {
# -- This applies to homework problems for users with grading privileges
my $crs='/'.$ENV{'request.course.id'};
if ($ENV{'request.course.sec'}) {
@@ -299,7 +327,8 @@ sub innerregister {
$crs=~s/\_/\//g;
my $hwkadd='';
- if ($ENV{'request.filename'}=~/\.(problem|exam|quiz|assess|survey|form)$/) {
+ if ($ENV{'request.symb'} ne '' &&
+ $ENV{'request.filename'}=~/\.(problem|exam|quiz|assess|survey|form)$/) {
if (&Apache::lonnet::allowed('vgr',$crs)) {
$hwkadd.=&switch('','',7,1,'subm.gif','view sub-[_1]','missions[_1]',
"gocmd('/adm/grades','submission')",
@@ -311,7 +340,8 @@ sub innerregister {
'Modify user grades for this assessment resource');
}
}
- if (&Apache::lonnet::allowed('opa',$crs)) {
+ if ($ENV{'request.symb'} ne '' &&
+ &Apache::lonnet::allowed('opa',$crs)) {
$hwkadd.=&switch('','',7,3,'pparm.gif','problem[_2]','parms[_2]',
"gocmd('/adm/parmset','set')",
'Modify deadlines, etc, for this resource');
@@ -393,10 +423,11 @@ s&6&1&list.gif&list[_1]&dir[_1]&golist('
s&6&2&rtrv.gif&retrieve[_1]&version[_1]&gocstr('/adm/retrieve','/~$uname/$thisdisfn')&Retrieve old version
s&6&3&pub.gif&publish[_1]&resource[_1]&gocstr('/adm/publish','/~$uname/$thisdisfn')&Publish this resource
s&7&1&del.gif&delete[_1]&resource[_2]&gocstr('/adm/cfile?action=delete','/~$uname/$thisdisfn')&Delete this resource
-s&7&2&prt.gif&prepare[_1]&printout[_1]&gopost('/adm/printout','/~$uname/$thisdisfn')&Prepare a printable document
+s&7&2&prt.gif&prepare[_1]&printout[_1]&gocstr('/adm/printout','/~$uname/$thisdisfn')&Prepare a printable document
ENDMENUITEMS
}
- } else {
+ } elsif (defined($ENV{'request.course.id'}) &&
+ $ENV{'request.symb'} ne '') {
$menuitems=(<
$inlineremote[21]
$inlineremote[23]
$inlineremote[61]
$inlineremote[62]
$inlineremote[63]
$inlineremote[71]
$inlineremote[72]
$inlineremote[73]
$inlineremote[81]
$inlineremote[82]
$inlineremote[83]
$inlineremote[91]
$inlineremote[92]
$inlineremote[93]
ENDINLINE
+ }
}
- if ($const_space && $is_const_dir) {
- $inlinebuttons = '';
- }
$result =(<
// BEGIN LON-CAPA Internal
@@ -460,14 +493,17 @@ $tableend
ENDREGTEXT
# Registered, graphical output
} else {
- my $requri=(split(/\?/,$ENV{'request.noversionuri'}))[0];
+ my $requri=&Apache::lonnet::clutter(&Apache::lonnet::fixversion((split(/\?/,$ENV{'request.noversionuri'}))[0]));
$requri=&Apache::lonenc::check_encrypt(&Apache::lonnet::unescape($requri));
my $cursymb=&Apache::lonenc::check_encrypt($ENV{'request.symb'});
my $navstatus=&get_nav_status();
+ my $clearcstr;
+
+ if ($ENV{'user.adv'}) { $clearcstr='clearbut(6,1)'; }
$result = (<
-// BEGIN LON-CAPA Internal
+//
ENDREGTHIS
}
@@ -551,12 +587,14 @@ ENDDONOTREGTHIS
}
sub loadevents() {
- if ($ENV{'request.noversionuri'} eq '/res/adm/pages/menu.html') { return ''; }
+ if ($ENV{'request.state'} eq 'construct' ||
+ $ENV{'request.noversionuri'} eq '/res/adm/pages/menu.html') { return ''; }
return 'LONCAPAreg();';
}
sub unloadevents() {
- if ($ENV{'request.noversionuri'} eq '/res/adm/pages/menu.html') { return ''; }
+ if ($ENV{'request.state'} eq 'construct' ||
+ $ENV{'request.noversionuri'} eq '/res/adm/pages/menu.html') { return ''; }
return 'LONCAPAstale();';
}
@@ -970,7 +1008,8 @@ sub utilityfunctions {
my $caller = shift;
unless (($ENV{'browser.interface'} eq 'textual') ||
($ENV{'environment.remote'} eq 'off') || ($caller eq '/adm/menu')) { return ''; }
- my $currenturl=&Apache::lonenc::check_encrypt($ENV{'request.noversionuri'});
+ my $currenturl=&Apache::lonnet::clutter(&Apache::lonnet::fixversion((split(/\?/,$ENV{'request.noversionuri'}))[0]));
+ $currenturl=&Apache::lonenc::check_encrypt(&Apache::lonnet::unescape($currenturl));
my $currentsymb=&Apache::lonenc::check_encrypt($ENV{'request.symb'});
my $nav_control=&nav_control_js();
@@ -1018,6 +1057,27 @@ function gocstr(url,filename) {
this.document.cstrdelete.submit();
return;
}
+ if (url == '/adm/printout') {
+ this.document.cstrprint.postdata.value = filename
+ this.document.cstrprint.curseed.value = 0;
+ this.document.cstrprint.problemtype.value = 0;
+ if (this.document.lonhomework) {
+ if ((this.document.lonhomework.rndseed) && (this.document.lonhomework.rndseed.value != null) && (this.document.lonhomework.rndseed.value != '')) {
+ this.document.cstrprint.curseed.value = this.document.lonhomework.rndseed.value
+ }
+ if (this.document.lonhomework.problemtype) {
+ for (var i=0; i
+
+
ENDCONSTSPACEFORM
}
@@ -1111,7 +1177,7 @@ sub handler {
$tabbg=&Apache::loncommon::designparm($function.'.tabbg',$domain);
$font=&Apache::loncommon::designparm($function.'.font',$domain);
my $script_tag;
- if ($ENV{'environment.remote'} eq 'on') {
+ if ($ENV{'environment.remote'} ne 'off') {
my $utility=&utilityfunctions('/adm/menu');
$script_tag=(<
@@ -1124,8 +1190,10 @@ ENDSCRIPT
$ENV{'browser.interface'}='faketextual';
$ENV{'environment.remote'}='off';
}
+ my $html=&Apache::lonxml::xmlbegin();
$r->print(<
+$html
+
LON-CAPA Main Menu
$script_tag