[LON-CAPA-cvs] cvs: loncom(version_2_11_X) /interface lonmenu.pm

raeburn raeburn at source.lon-capa.org
Mon May 14 09:58:04 EDT 2012


raeburn		Mon May 14 13:58:04 2012 EDT

  Modified files:              (Branch: version_2_11_X)
    /loncom/interface	lonmenu.pm 
  Log:
  - For 2.11
    - Reverse changes in 1.332, 1.335, 1.337, 1.346.
    - Wishlist not included in 2.11.0; Bookmarks retained.
  
  
Index: loncom/interface/lonmenu.pm
diff -u loncom/interface/lonmenu.pm:1.369.2.1 loncom/interface/lonmenu.pm:1.369.2.2
--- loncom/interface/lonmenu.pm:1.369.2.1	Sun May 13 23:45:07 2012
+++ loncom/interface/lonmenu.pm	Mon May 14 13:58:04 2012
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines to control the menu
 #
-# $Id: lonmenu.pm,v 1.369.2.1 2012/05/13 23:45:07 raeburn Exp $
+# $Id: lonmenu.pm,v 1.369.2.2 2012/05/14 13:58:04 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -156,7 +156,6 @@
 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 @secondary_menu);
@@ -628,14 +627,9 @@
 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&Wishlist&wishlistlink[_2]&set_wishlistlink()&Set a link for this resource to wishlist&&1
-ENDMENUITEMS
-            }
 
 my $currentURL = &Apache::loncommon::get_symb();
 my ($symb_old,$symb_old_enc) = &Apache::loncommon::clean_symb($currentURL);
@@ -665,12 +659,6 @@
 	    $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&Wishlist&wishlistlink[_2]&set_wishlistlink()&Set a link for this resource to wishlist&&1
-ENDMENUITEMS
-            }
 	}
         my $buttons='';
         foreach (split(/\n/,$menuitems)) {
@@ -1309,6 +1297,15 @@
     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?');
 
@@ -1425,6 +1422,13 @@
    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');
@@ -1438,17 +1442,26 @@
    annotator.document.close();
 }
 
-function open_Wishlist_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 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