[LON-CAPA-cvs] cvs: loncom(version_2_11_X) /interface lonmenu.pm
raeburn
raeburn at source.lon-capa.org
Fri May 25 19:47:16 EDT 2012
raeburn Fri May 25 23:47:16 2012 EDT
Modified files: (Branch: version_2_11_X)
/loncom/interface lonmenu.pm
Log:
- For 2.11.
- Reverse changes in 1.369.2.2. Stored Links ("Wishlist") included in 2.11 in
place of Bookmarks.
- Backport 1.370.
Index: loncom/interface/lonmenu.pm
diff -u loncom/interface/lonmenu.pm:1.369.2.7 loncom/interface/lonmenu.pm:1.369.2.8
--- loncom/interface/lonmenu.pm:1.369.2.7 Fri May 25 03:23:36 2012
+++ loncom/interface/lonmenu.pm Fri May 25 23:47:16 2012
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Routines to control the menu
#
-# $Id: lonmenu.pm,v 1.369.2.7 2012/05/25 03:23:36 raeburn Exp $
+# $Id: lonmenu.pm,v 1.369.2.8 2012/05/25 23:47:16 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -179,6 +179,7 @@
use Apache::lonmsg();
use LONCAPA qw(:DEFAULT :match);
use HTML::Entities();
+use Apache::lonwishlist();
use vars qw(@desklines %category_names %category_members %category_positions
$readdesk @primary_menu %primary_submenu @secondary_menu %secondary_submenu);
@@ -736,9 +737,14 @@
c&8&1
c&8&2
s&8&3&prt.png&Print&printout[_1]&gopost('/adm/printout',currentURL)&Prepare a printable document
-s&9&1&sbkm.png&Bookmark&set[_1]bookmark[_2]&set_bookmark()&Set a bookmark for this resource&&1
-
ENDMENUITEMS
+ if (&Apache::lonnet::allowed('bre', $env{'request.course.id'}) eq 'F' && $env{'request.uri'} =~ /^\/res/) {
+ # wishlist is only available for users with access to resource-pool
+ # and links can only be set for resources within the resource-pool
+ $menuitems .= (<<ENDMENUITEMS);
+s&9&1&wishlist-link.png&Stored Links&wishlistlink[_2]&set_wishlistlink()&Save a link for this resource in your personal Stored Links repository&&1
+ENDMENUITEMS
+ }
my $currentURL = &Apache::loncommon::get_symb();
my ($symb_old,$symb_old_enc) = &Apache::loncommon::clean_symb($currentURL);
@@ -768,6 +774,12 @@
$menuitems .= (<<ENDMENUITEMS);
s&8&3&prt.png&Print&printout[_1]&gopost('/adm/printout',currentURL)&Prepare a printable document
ENDMENUITEMS
+ if (&Apache::lonnet::allowed('bre', $env{'request.course.id'}) eq 'F') {
+ # wishlist is only available for users with access to resource-pool
+ $menuitems .= (<<ENDMENUITEMS);
+s&9&1&wishlist-link.png&Stored Links&wishlistlink[_2]&set_wishlistlink()&Save a link for this resource in your personal Stored Links repository&&1
+ENDMENUITEMS
+ }
}
my $buttons='';
foreach (split(/\n/,$menuitems)) {
@@ -1406,15 +1418,6 @@
my $end_page_annotate =
&Apache::loncommon::end_page({'js_ready' => 1});
- my $start_page_bookmark =
- &Apache::loncommon::start_page('Bookmarks',undef,
- {'only_body' => 1,
- 'js_ready' => 1,
- 'bgcolor' => '#BBBBBB',});
-
- my $end_page_bookmark =
- &Apache::loncommon::end_page({'js_ready' => 1});
-
my $confirm_switch = &mt("Editing requires switching to the resource's home server.").'\n'.
&mt('Switch server?');
@@ -1531,13 +1534,6 @@
grpchat=window.open(url,winName,'height=320,width=280,resizable=yes,location=no,menubar=no,toolbar=no');
}
-function edit_bookmarks() {
- go('');
- w_BookmarkPal_flag=1;
- bookmarkpal=window.open("/adm/bookmarks",
- "BookmarkPal", "width=500,height=505,scrollbars=0");
-}
-
function annotate() {
w_Annotator_flag=1;
annotator=window.open('','Annotator','width=365,height=265,scrollbars=0');
@@ -1551,6 +1547,19 @@
annotator.document.close();
}
+function open_StoredLinks_Import(rat) {
+ var newWin;
+ if (rat) {
+ newWin = window.open('/adm/wishlist?inhibitmenu=yes&mode=import&rat='+rat,
+ 'wishlistImport','scrollbars=1,resizable=1,menubar=0');
+ }
+ else {
+ newWin = window.open('/adm/wishlist?inhibitmenu=yes&mode=import',
+ 'wishlistImport','scrollbars=1,resizable=1,menubar=0');
+ }
+ newWin.focus();
+}
+
(function (\$) {
\$(document).ready(function () {
\$.single=function(a){return function(b){a[0]=b;return a}}(\$([1]));
@@ -1565,28 +1574,6 @@
});
}(jQuery));
-function set_bookmark() {
- go('');
- clienttitle=document.title;
- clienthref=location.pathname;
- w_bmquery_flag=1;
- bmquery=window.open('','bmquery','width=365,height=165,scrollbars=0');
- bmquery.document.write(
- '$start_page_bookmark'
- +'<center><form method="post"'
- +' name="newlink" action="/adm/bookmarks" target="bmquery" '
- +'> <table width="340" height="150" '
- +'bgcolor="#FFFFFF" align="center"><tr><td>Link Name:<br /><input '
- +'type="text" name="title" size="45" value="'+clienttitle+'" />'
- +'<br />Address:<br /><input type="text" name="address" size="45" '
- +'value="'+clienthref+'" /><br /><center><input type="submit" '
- +'value="Save" /> <input type="button" value="Close" '
- +'onclick="javascript:window.close();" /></center></td>'
- +'</tr></table></form></center>'
- +'$end_page_bookmark' );
- bmquery.document.close();
-}
-
ENDUTILITY
}
More information about the LON-CAPA-cvs
mailing list