[LON-CAPA-cvs] cvs: loncom /html/res/adm/pages reload.png /interface lonhtmlcommon.pm lonmenu.pm mydesk.tab doc/loncapafiles loncapafiles.lpml

www www@source.lon-capa.org
Sun, 16 Jan 2011 22:45:05 -0000


This is a MIME encoded message

--www1295217905
Content-Type: text/plain

www		Sun Jan 16 22:45:05 2011 EDT

  Added files:                 
    /loncom/html/res/adm/pages	reload.png 

  Modified files:              
    /doc/loncapafiles	loncapafiles.lpml 
    /loncom/interface	lonhtmlcommon.pm lonmenu.pm mydesk.tab 
  Log:
  Move "return" button to where the other navigation arrows are (also, it's
  not a function that is available in courses at all times, so it should
  not have been in the line where it was)
  
  
--www1295217905
Content-Type: text/plain
Content-Disposition: attachment; filename="www-20110116224505.txt"

Index: doc/loncapafiles/loncapafiles.lpml
diff -u doc/loncapafiles/loncapafiles.lpml:1.722 doc/loncapafiles/loncapafiles.lpml:1.723
--- doc/loncapafiles/loncapafiles.lpml:1.722	Sat Jan 15 15:14:42 2011
+++ doc/loncapafiles/loncapafiles.lpml	Sun Jan 16 22:44:59 2011
@@ -2,7 +2,7 @@
  "http://lpml.sourceforge.net/DTD/lpml.dtd">
 <!-- loncapafiles.lpml -->
 
-<!-- $Id: loncapafiles.lpml,v 1.722 2011/01/15 15:14:42 www Exp $ -->
+<!-- $Id: loncapafiles.lpml,v 1.723 2011/01/16 22:44:59 www Exp $ -->
 
 <!--
 
@@ -6956,6 +6956,7 @@
 mngcu.png;
 prob_ana.png;
 role_hotlist.png;
+reload.png;
 self_enroll.png;
 survey_rep.png;
 subdocs.png;
Index: loncom/interface/lonhtmlcommon.pm
diff -u loncom/interface/lonhtmlcommon.pm:1.286 loncom/interface/lonhtmlcommon.pm:1.287
--- loncom/interface/lonhtmlcommon.pm:1.286	Thu Jan 13 17:44:30 2011
+++ loncom/interface/lonhtmlcommon.pm	Sun Jan 16 22:45:05 2011
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common html routines
 #
-# $Id: lonhtmlcommon.pm,v 1.286 2011/01/13 17:44:30 www Exp $
+# $Id: lonhtmlcommon.pm,v 1.287 2011/01/16 22:45:05 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1424,6 +1424,29 @@
     return 1;
 }
 
+#
+# Should the "return to content" link be shown?
+#
+
+sub show_return_link {
+    if (($env{'request.noversionuri'} =~ m{^/adm/(viewclasslist|navmaps)($|\?)})
+        || ($env{'request.noversionuri'} =~ m{^/adm/.*/aboutme($|\?)})) {
+
+        return if ($env{'form.register'});
+    }
+    return (($env{'request.noversionuri'}=~m{^/(res|public)/} &&
+             $env{'request.symb'} eq '')
+            ||
+            ($env{'request.noversionuri'}=~ m{^/cgi-bin/printout.pl})
+            ||
+            (($env{'request.noversionuri'}=~/^\/adm\//) &&
+             ($env{'request.noversionuri'}!~/^\/adm\/wrapper\//) &&
+             ($env{'request.noversionuri'}!~
+              m{^/adm/.*/(smppg|bulletinboard)($|\?)})
+           ));
+}
+
+
 ############################################################
 ############################################################
 
@@ -1509,22 +1532,28 @@
                 $last = $menulink;
             }
         }
-        my $links = join "", 
+        my $links;
+        if ((&show_return_link) && (!$CourseBreadcrumbs)) {
+           $links=&htmltag( 'a',"<img src='/res/adm/pages/reload.png' border='0' style='vertical-align:middle;' />",
+                            { href => '/adm/flip?postdata=return:',
+                              title => &mt("Back to most recent content resource") });
+        }
+        $links.= join "", 
              map {
                  $faq  = $_->{'faq'}  if (exists($_->{'faq'}));
                  $bug  = $_->{'bug'}  if (exists($_->{'bug'}));
                  $help = $_->{'help'} if (exists($_->{'help'}));
 
-                 my $result = $_->{no_mt} ? $_->{text} : mt($_->{text});
+                 my $result = $_->{no_mt} ? $_->{text} : &mt($_->{text});
 
                  if ($_->{href}){
-                     $result = htmltag( 'a', $result, 
+                     $result = &htmltag( 'a', $result, 
                        { href   => $_->{href},
-                         title  => $_->{no_mt} ? $_->{title} : mt($_->{title}),
+                         title  => $_->{no_mt} ? $_->{title} : &mt($_->{title}),
                          target => $_->{target}, });
                  }
 
-                 $result = htmltag( 'li', "$result $crumbsymbol");
+                 $result = &htmltag( 'li', "$result $crumbsymbol");
              } @Crumbs;
 
         #should the last Element be translated?
@@ -1534,7 +1563,7 @@
 
         # last breadcrumb is the first order heading of a page
         # for course breadcrumbs it's just bold
-        $links .= htmltag( 'li', htmltag($CourseBreadcrumbs ? 'b' : 'h1',
+        $links .= &htmltag( 'li', htmltag($CourseBreadcrumbs ? 'b' : 'h1',
                 $lasttext), {title => $lasttext});
 
         my $icons = '';
@@ -1557,23 +1586,23 @@
 		
 
         unless ($CourseBreadcrumbs) {
-            $links = htmltag('ol',  $links, { id => "LC_MenuBreadcrumbs"   });
+            $links = &htmltag('ol',  $links, { id => "LC_MenuBreadcrumbs"   });
         } else {
-            $links = htmltag('ul',  $links, { class => "LC_CourseBreadcrumbs" });
+            $links = &htmltag('ul',  $links, { class => "LC_CourseBreadcrumbs" });
         }
 
         if ($component) {
-            $links = htmltag('span', 
+            $links = &htmltag('span', 
                              ( $no_mt ? $component : mt($component) ).
                              ( $icons ? $icons : '' ),
                              { class => 'LC_breadcrumbs_component' } )
                              .$links;
         }
         
-        render_tools(\$links);
-        $links = htmltag('div', $links, 
+        &render_tools(\$links);
+        $links = &htmltag('div', $links, 
                         { id => "LC_breadcrumbs" }) unless ($CourseBreadcrumbs) ;
-        render_advtools(\$links);
+        &render_advtools(\$links);
 
         # Return the @Crumbs stack to what we started with
         push(@Crumbs,$last);
Index: loncom/interface/lonmenu.pm
diff -u loncom/interface/lonmenu.pm:1.341 loncom/interface/lonmenu.pm:1.342
--- loncom/interface/lonmenu.pm:1.341	Thu Jan 13 19:43:12 2011
+++ loncom/interface/lonmenu.pm	Sun Jan 16 22:45:05 2011
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines to control the menu
 #
-# $Id: lonmenu.pm,v 1.341 2011/01/13 19:43:12 www Exp $
+# $Id: lonmenu.pm,v 1.342 2011/01/16 22:45:05 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -107,8 +107,6 @@
 
 Same as primary_menu() but operates on @secondary_menu.
 
-=item show_return_link()
-
 =item innerregister()
 
 This gets called in order to register a URL in the body of the document
@@ -276,7 +274,6 @@
     my $canvgr        = &Apache::lonnet::allowed('vgr', $crs_sec); 
     my $author        = getauthor();
 
-    my $showlink = &show_return_link();
     my %groups = &Apache::lonnet::get_active_groups(
                      $env{'user.domain'}, $env{'user.name'},
                      $env{'course.' . $env{'request.course.id'} . '.domain'},
@@ -288,9 +285,6 @@
         next if    $$menuitem[4]   ne 'always'
                 && $$menuitem[4]   ne 'author'
                 && !$env{'request.course.id'};
-        next if    $$menuitem[4]   eq 'showreturn'
-                && !$showlink
-                && !($env{'request.state'} eq 'construct');
         next if    $$menuitem[4]   =~ /^mdc/
                 && !$canedit;
         next if    $$menuitem[4]  eq 'nvgr'
@@ -346,24 +340,6 @@
     return "<ul id=\"LC_secondary_menu\">$menu</ul>";
 }
 
-sub show_return_link {
-    if (($env{'request.noversionuri'} =~ m{^/adm/(viewclasslist|navmaps)($|\?)})
-        || ($env{'request.noversionuri'} =~ m{^/adm/.*/aboutme($|\?)})) {
-
-        return if ($env{'form.register'});
-    }
-    return (($env{'request.noversionuri'}=~m{^/(res|public)/} &&
-	     $env{'request.symb'} eq '')
-	    ||
-	    ($env{'request.noversionuri'}=~ m{^/cgi-bin/printout.pl})
-	    ||
-	    (($env{'request.noversionuri'}=~/^\/adm\//) &&
-	     ($env{'request.noversionuri'}!~/^\/adm\/wrapper\//) &&
-	     ($env{'request.noversionuri'}!~
-	      m{^/adm/.*/(smppg|bulletinboard)($|\?)})
-           ));
-}
-
 sub innerregister {
     my ($forcereg,$bread_crumbs) = @_;
     my $const_space = ($env{'request.state'} eq 'construct');
@@ -613,8 +589,8 @@
 #
 	    $menuitems=(<<ENDMENUITEMS);
 c&3&1
-s&2&1&back.png&backward[_1]&&gopost('/adm/flip','back:'+currentURL)&Go to the previous resource in the course sequence&&1
-s&2&3&forw.png&forward[_1]&&gopost('/adm/flip','forward:'+currentURL)&Go to the next resource in the course sequence&&3
+s&2&1&back.png&backward[_1]&&gopost('/adm/flip','back:'+currentURL)&Previous content resource&&1
+s&2&3&forw.png&forward[_1]&&gopost('/adm/flip','forward:'+currentURL)&Next content resource&&3
 c&6&3
 c&8&1
 c&8&2
@@ -686,34 +662,34 @@
 	    foreach (@inlineremote) { if ($_ ne '') { $addremote=1; last;} }
     if ($addremote) {
 
-        Apache::lonhtmlcommon::clear_breadcrumb_tools();
+        &Apache::lonhtmlcommon::clear_breadcrumb_tools();
 
-            Apache::lonhtmlcommon::add_breadcrumb_tool(
+            &Apache::lonhtmlcommon::add_breadcrumb_tool(
                 'navigation', @inlineremote[21,23]);
 
         if(hidden_button_check() ne 'yes') {
-            Apache::lonhtmlcommon::add_breadcrumb_tool(
+            &Apache::lonhtmlcommon::add_breadcrumb_tool(
                 'tools', @inlineremote[93,91,81,82,83]);
 
             #publish button in construction space
             if ($env{'request.state'} eq 'construct'){
-                Apache::lonhtmlcommon::add_breadcrumb_tool(
+                &Apache::lonhtmlcommon::add_breadcrumb_tool(
                      'advtools', @inlineremote[63]);
-            }else{
-                Apache::lonhtmlcommon::add_breadcrumb_tool(
+            } else {
+                &Apache::lonhtmlcommon::add_breadcrumb_tool(
                      'tools', @inlineremote[63]);
             }
             
             unless ($env{'request.noversionuri'}=~ m{^/adm/(navmaps|viewclasslist)(\?|$)}) {
-                Apache::lonhtmlcommon::add_breadcrumb_tool(
+                &Apache::lonhtmlcommon::add_breadcrumb_tool(
                     'advtools', @inlineremote[61,71,72,73,92]);
             }
         }
     }
 
-    return   Apache::lonhtmlcommon::scripttag('', 'start')
-           . Apache::lonhtmlcommon::breadcrumbs(undef,undef,0)
-           . Apache::lonhtmlcommon::scripttag('', 'end');
+    return   &Apache::lonhtmlcommon::scripttag('', 'start')
+           . &Apache::lonhtmlcommon::breadcrumbs(undef,undef,0)
+           . &Apache::lonhtmlcommon::scripttag('', 'end');
 }
 
 sub is_course_upload {
Index: loncom/interface/mydesk.tab
diff -u loncom/interface/mydesk.tab:1.143 loncom/interface/mydesk.tab:1.144
--- loncom/interface/mydesk.tab:1.143	Thu Jan 13 22:49:47 2011
+++ loncom/interface/mydesk.tab	Sun Jan 16 22:45:05 2011
@@ -39,7 +39,6 @@
 # condition: when to show link, secondary_menu will act upon this
 #   possible conditions:
 #   - empty: 
-#   - showreturn: link is displayed if return link is wanted
 #   - showgroups: user is member of a group
 #   - always: show this link even if user hasn't selected a role
 #   - whn: access what's new
@@ -56,7 +55,6 @@
 scnd:/adm/grades:::Grades:vgr
 scnd:/adm/parmset:::Settings:opa
 scnd:/adm/roles:::Roles:
-scnd:/adm/flip?postdata=return%3a:::Return to Last Location:showreturn
 scnd:/priv/[uname]/:::Construction Space:author
 scnd:/res/[udom]/[uname]/?launch=1:::Browse:author
 

--www1295217905--