[LON-CAPA-cvs] cvs: loncom(version_2_11_X) /interface loncommon.pm lonmenu.pm
raeburn
raeburn at source.lon-capa.org
Tue Aug 7 09:15:29 EDT 2012
raeburn Tue Aug 7 13:15:29 2012 EDT
Modified files: (Branch: version_2_11_X)
/loncom/interface loncommon.pm lonmenu.pm
Log:
- For 2.11.
- Access to Publish, Directory, Delete, & Print functions if Remote Control
is up when viewing resource in Construction Space.
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.1075.2.12 loncom/interface/loncommon.pm:1.1075.2.13
--- loncom/interface/loncommon.pm:1.1075.2.12 Fri Aug 3 17:35:32 2012
+++ loncom/interface/loncommon.pm Tue Aug 7 13:15:28 2012
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# a pile of common routines
#
-# $Id: loncommon.pm,v 1.1075.2.12 2012/08/03 17:35:32 raeburn Exp $
+# $Id: loncommon.pm,v 1.1075.2.13 2012/08/07 13:15:28 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -5052,12 +5052,13 @@
$role = '<span class="LC_nobreak">('.$role.')</span>' if $role;
&get_unprocessed_cgi($ENV{'QUERY_STRING'}, ['inhibitmenu']);
- unless ($env{'environment.remote'} eq 'on') {
- if ($no_nav_bar || $env{'form.inhibitmenu'} eq 'yes') {
- return $bodytag;
- }
+ if ($no_nav_bar || $env{'form.inhibitmenu'} eq 'yes') {
+ return $bodytag;
+ }
- if ($env{'request.state'} eq 'construct') { $forcereg=1; }
+ if ($env{'request.state'} eq 'construct') { $forcereg=1; }
+
+ unless ($env{'environment.remote'} eq 'on') {
# if ($env{'request.state'} eq 'construct') {
# $titleinfo = &CSTR_pageheader(); #FIXME: Will be removed once all scripts have their own calls
@@ -5135,6 +5136,18 @@
<li>$menu</li>
</ol><div id="LC_realm"> $realm $dc_info</div>|;
}
+ my $funclist;
+ if ($env{'request.state'} eq 'construct') {
+ if (!$public){
+ if ($env{'request.state'} eq 'construct') {
+ $funclist = &Apache::lonhtmlcommon::scripttag(
+ &Apache::lonmenu::utilityfunctions(), 'start').
+ &Apache::lonhtmlcommon::scripttag('','end').
+ &Apache::lonmenu::innerregister($forcereg,
+ $args->{'bread_crumbs'});
+ }
+ }
+ }
return(<<ENDBODY);
$bodytag
<table id="LC_title_bar" class="LC_with_remote">
@@ -5144,6 +5157,7 @@
<tr><td>$titleinfo $dc_info $menu</td>
</tr>
</table>
+$funclist
ENDBODY
}
Index: loncom/interface/lonmenu.pm
diff -u loncom/interface/lonmenu.pm:1.369.2.20 loncom/interface/lonmenu.pm:1.369.2.21
--- loncom/interface/lonmenu.pm:1.369.2.20 Tue Aug 7 01:35:47 2012
+++ loncom/interface/lonmenu.pm Tue Aug 7 13:15:29 2012
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Routines to control the menu
#
-# $Id: lonmenu.pm,v 1.369.2.20 2012/08/07 01:35:47 raeburn Exp $
+# $Id: lonmenu.pm,v 1.369.2.21 2012/08/07 13:15:29 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -758,7 +758,7 @@
###
###
# Prepare the rest of the buttons
- my ($menuitems,$got_prt,$got_wishlist);
+ my ($menuitems,$got_prt,$got_wishlist,$cstritems);
if ($const_space) {
#
# We are in construction space
@@ -778,12 +778,16 @@
# Probably should be in mydesk.tab
#
$menuitems=(<<ENDMENUITEMS);
-s&6&1&list.png&$swtext{'list'}&dir[_1]&golist('$esc_currdir')&List current directory
-s&6&2&rtrv.png&$swtext{'rtrv'}&version[_1]&gocstr('/adm/retrieve','/priv/$udom/$uname/$cleandisfn')&Retrieve old version
-s&6&3&pub.png&$swtext{'pub'}&resource[_3]&gocstr('/adm/publish','/priv/$udom/$uname/$cleandisfn')&Publish this resource
-s&7&1&del.png&$swtext{'del'}&resource[_2]&gocstr('/adm/cfile?action=delete','/priv/$udom/$uname/$cleandisfn')&Delete this resource
-s&7&2&prt.png&$swtext{'prt'}&printout[_1]&gocstr('/adm/printout','/priv/$udom/$uname/$cleandisfn')&Prepare a printable document
+s&6&1&list.png&Directory&dir[_1]&golist('$esc_currdir')&List current directory
+s&6&2&rtrv.png&Retrieve&version[_1]&gocstr('/adm/retrieve','/priv/$udom/$uname/$cleandisfn')&Retrieve old version
+s&6&3&pub.png&Publish&resource[_3]&gocstr('/adm/publish','/priv/$udom/$uname/$cleandisfn')&Publish this resource
+s&7&1&del.png&Delete&resource[_2]&gocstr('/adm/cfile?action=delete','/priv/$udom/$uname/$cleandisfn')&Delete this resource
+s&7&2&prt.png&Print&printout[_1]&gocstr('/adm/printout','/priv/$udom/$uname/$cleandisfn')&Prepare a printable document
ENDMENUITEMS
+ unless ($noremote) {
+ $cstritems = $menuitems;
+ undef($menuitems);
+ }
}
if (ref($bread_crumbs) eq 'ARRAY') {
&Apache::lonhtmlcommon::clear_breadcrumbs();
@@ -933,6 +937,20 @@
. &Apache::lonhtmlcommon::scripttag('', 'end');
} else {
+ my $cstrcrumbs;
+ if ($const_space) {
+ foreach (split(/\n/,$cstritems)) {
+ my ($command, at rest)=split(/\&/,$_);
+ my $idx=10*$rest[0]+$rest[1];
+ &switch('','', at rest);
+ }
+ &Apache::lonhtmlcommon::add_breadcrumb_tool('advtools',
+ @inlineremote[63,61,71,72]);
+
+ $cstrcrumbs = &Apache::lonhtmlcommon::scripttag('', 'start')
+ .&Apache::lonhtmlcommon::breadcrumbs(undef,undef,0)
+ .&Apache::lonhtmlcommon::scripttag('', 'end');
+ }
my $requri=&Apache::lonnet::clutter(&Apache::lonnet::fixversion((split(/\?/,$env{'request.noversionuri'}))[0]));
$requri=&Apache::lonenc::check_encrypt(&unescape($requri));
my $cursymb=&Apache::lonenc::check_encrypt($env{'request.symb'});
@@ -981,6 +999,8 @@
// END LON-CAPA Internal
// ]]>
</script>
+
+$cstrcrumbs
ENDREGTHIS
}
} else {
@@ -1031,10 +1051,6 @@
pparm => 'Content Settings',
docs => 'Folder/Page Content',
pcstr => 'Edit',
- list => 'Directory',
- rtrv => 'Retrieve',
- pub => 'Publish',
- del => 'Delete',
prt => 'Print',
alnk => 'Stored Links',
anot => 'Notes',
@@ -1051,10 +1067,6 @@
subm => 'view sub-[_1]',
pparm => 'problem[_2]',
pcstr => 'edit[_1]',
- list => 'list[_1]',
- rtrv => 'retrieve[_1]',
- pub => 'publish[_1]',
- del => 'delete[_1]',
prt => 'prepare[_1]',
back => 'backward[_1]',
forw => 'forward[_1]',
@@ -1302,6 +1314,16 @@
if ($env{'environment.remote'} eq 'on') {
if (($row<1) || ($row>13)) { return ''; }
+ if ($env{'request.state'} eq 'construct') {
+ my $text = $top.' '.$bot;
+ $text=~s/\s*\-\s*//gs;
+ my $pic = '<img alt="'.$text.'" src="'.
+ &Apache::loncommon::lonhttpdurl('/res/adm/pages/'.$img).
+ '" align="'.($nobreak==3?'right':'left').'" class="LC_icon" />';
+ $inlineremote[$idx] =
+ '<a title="'.$desc.'" class="LC_menubuttons_link" href="javascript:'.$act.';">'.
+ $pic.'<span class="LC_menubuttons_inline_text">'.$top.' </span></a>';
+ }
# Remote
$img=~s/\.png$/\.gif/;
return "\n".
More information about the LON-CAPA-cvs
mailing list