[LON-CAPA-cvs] cvs: loncom(version_2_11_X) /interface lonmenu.pm
raeburn
raeburn at source.lon-capa.org
Fri Aug 3 18:38:35 EDT 2012
raeburn Fri Aug 3 22:38:35 2012 EDT
Modified files: (Branch: version_2_11_X)
/loncom/interface lonmenu.pm
Log:
- For 2.11.
- Modify changes in 1.1075.2.12 so CSTR button is available for editing
a resource in course context, where uses has au/ca role for resource's
authorship.
- Prevent javascript error for Folder/Page Content item when remote control
is active.
Index: loncom/interface/lonmenu.pm
diff -u loncom/interface/lonmenu.pm:1.369.2.17 loncom/interface/lonmenu.pm:1.369.2.18
--- loncom/interface/lonmenu.pm:1.369.2.17 Fri Aug 3 17:35:32 2012
+++ loncom/interface/lonmenu.pm Fri Aug 3 22:38:35 2012
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Routines to control the menu
#
-# $Id: lonmenu.pm,v 1.369.2.17 2012/08/03 17:35:32 raeburn Exp $
+# $Id: lonmenu.pm,v 1.369.2.18 2012/08/03 22:38:35 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -569,46 +569,8 @@
my $timesync = ( $noremote ? '' : 'swmenu.syncclock(1000*'.time.');' );
# =============================================================================
# ============================ This is for URLs that actually can be registered
- unless ( ($env{'request.noversionuri'}!~m{^/(res/)*adm/})
+ if ( ($env{'request.noversionuri'}!~m{^/(res/)*adm/})
|| ($forcereg)) {
- unless ($noremote) {
-# Not registered, graphical
- return (<<ENDDONOTREGTHIS);
-
-<script type="text/javascript">
-// <![CDATA[
-// BEGIN LON-CAPA Internal
-var swmenu=null;
-
- function LONCAPAreg() {
- swmenu=$reopen
- $timesync
- swmenu.currentStale=1;
- swmenu.clearbut(2,1);
- swmenu.clearbut(2,3);
- swmenu.clearbut(8,1);
- swmenu.clearbut(8,2);
- swmenu.clearbut(8,3);
- if (swmenu.currentURL) {
- swmenu.switchbutton
- (3,1,'reload.gif','return','location','go(currentURL)');
- } else {
- swmenu.clearbut(3,1);
- }
- }
-
- function LONCAPAstale() {
- }
-
-// END LON-CAPA Internal
-// ]]>
-</script>
-ENDDONOTREGTHIS
-
- }
- return '';
- }
-
# -- This applies to homework problems for users with grading privileges
my $crs='/'.$env{'request.course.id'};
if ($env{'request.course.sec'}) {
@@ -635,11 +597,13 @@
"gocmd('/adm/parmset','set')",
'Content Settings');
}
- if ($env{'request.symb'}=~/^uploaded/ &&
- &Apache::lonnet::allowed('mdc',$crs)) {
- $hwkadd.=&switch('','',7,4,'docs.png','Folder/Page Content','parms[_2]',
- "gocmd('/adm/coursedocs','direct')",
- 'Folder/Page Content');
+ if ($noremote) {
+ if ($env{'request.symb'}=~/^uploaded/ &&
+ &Apache::lonnet::allowed('mdc',$crs)) {
+ $hwkadd.=&switch('','',7,4,'docs.png','Folder/Page Content','parms[_2]',
+ "gocmd('/adm/coursedocs','direct')",
+ 'Folder/Page Content');
+ }
}
# -- End Homework
###
@@ -947,6 +911,10 @@
}
}
}
+ return &Apache::lonhtmlcommon::scripttag('', 'start')
+ . &Apache::lonhtmlcommon::breadcrumbs(undef,undef,0)
+ . &Apache::lonhtmlcommon::scripttag('', 'end');
+
} else {
my $requri=&Apache::lonnet::clutter(&Apache::lonnet::fixversion((split(/\?/,$env{'request.noversionuri'}))[0]));
$requri=&Apache::lonenc::check_encrypt(&unescape($requri));
@@ -998,10 +966,44 @@
</script>
ENDREGTHIS
}
+ } else {
+ unless ($noremote) {
+# Not registered, graphical
+ return (<<ENDDONOTREGTHIS);
+
+<script type="text/javascript">
+// <![CDATA[
+// BEGIN LON-CAPA Internal
+var swmenu=null;
- return &Apache::lonhtmlcommon::scripttag('', 'start')
- . &Apache::lonhtmlcommon::breadcrumbs(undef,undef,0)
- . &Apache::lonhtmlcommon::scripttag('', 'end');
+ function LONCAPAreg() {
+ swmenu=$reopen
+ $timesync
+ swmenu.currentStale=1;
+ swmenu.clearbut(2,1);
+ swmenu.clearbut(2,3);
+ swmenu.clearbut(8,1);
+ swmenu.clearbut(8,2);
+ swmenu.clearbut(8,3);
+ if (swmenu.currentURL) {
+ swmenu.switchbutton
+ (3,1,'reload.gif','return','location','go(currentURL)');
+ } else {
+ swmenu.clearbut(3,1);
+ }
+ }
+
+ function LONCAPAstale() {
+ }
+
+// END LON-CAPA Internal
+// ]]>
+</script>
+ENDDONOTREGTHIS
+
+ }
+ return '';
+ }
}
sub is_course_upload {
More information about the LON-CAPA-cvs
mailing list