--- loncom/interface/lonmenu.pm 2013/01/03 20:16:22 1.407 +++ loncom/interface/lonmenu.pm 2013/04/24 02:43:59 1.411 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Routines to control the menu # -# $Id: lonmenu.pm,v 1.407 2013/01/03 20:16:22 raeburn Exp $ +# $Id: lonmenu.pm,v 1.411 2013/04/24 02:43:59 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -847,23 +847,15 @@ sub prepare_functions { # This applies in course context # if (($resurl eq "/public/$cdom/$cnum/syllabus") && ($perms{'mdc'})) { - if ($env{'course.'.$env{'request.course.id'}.'.externalsyllabus'} =~ /\w/) { - &switch('','',6,1,'pcstr.png','Edit', - 'resource[_2]', - "go('/adm/courseprefs?phase=display&actions=courseinfo')", - 'Edit this resource'); - $editbutton = 1; + $cfile = $resurl; + $home = &Apache::lonnet::homeserver($cnum,$cdom); + if ($env{'form.forceedit'}) { + $forceview = 1; } else { - $cfile = $resurl; - $home = &Apache::lonnet::homeserver($cnum,$cdom); - if ($env{'form.forceedit'}) { - $forceview = 1; - } else { - $forceedit = 1; - } - $editbutton = &get_editbutton($cfile,$home,$switchserver, - $forceedit,$forceview,$forcereg); + $forceedit = 1; } + $editbutton = &get_editbutton($cfile,$home,$switchserver, + $forceedit,$forceview,$forcereg); } elsif (($resurl eq '/adm/extresedit') && (($env{'form.symb'}) || ($env{'form.folderpath'}))) { ($cfile,$home,$switchserver,$forceedit,$forceview) = @@ -1672,11 +1664,7 @@ sub roles_selector { } } } - if ($crstype eq 'Community') { - $switchtext = &mt('Switch community role') - } else { - $switchtext = &mt('Switch course role') - } + $switchtext = &mt('Switch role'); my @roles_order = ($ccrole,'in','ta','ep','ad','st'); my $numdiffsec; if (keys(%seccount) == 1) { @@ -1798,6 +1786,7 @@ sub get_all_courseroles { push(@{$courseroles->{'st'}},keys(%sections_count)); $seccount->{'st'} = scalar(keys(%sections_count)); } + $seccount->{'st'} ++; # Increment for a section-less student role. my $rolehash = { 'roles' => $courseroles, 'seccount' => $seccount, @@ -2002,7 +1991,6 @@ sub countdown_timer { } my $duedate = &Apache::lonnet::EXT("resource.0.duedate"); my @interval=&Apache::lonnet::EXT("resource.0.interval"); - my $hastimeleft; if (@interval > 1) { my $first_access=&Apache::lonnet::get_first_access($interval[1]); if ($first_access > 0) {