--- loncom/interface/lonhtmlcommon.pm 2016/09/15 17:31:00 1.358.2.7 +++ loncom/interface/lonhtmlcommon.pm 2017/03/15 15:17:43 1.358.2.11 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common html routines # -# $Id: lonhtmlcommon.pm,v 1.358.2.7 2016/09/15 17:31:00 raeburn Exp $ +# $Id: lonhtmlcommon.pm,v 1.358.2.11 2017/03/15 15:17:43 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -407,7 +407,7 @@ sub textbox { ############################################## ############################################## sub checkbox { - my ($name,$checked,$value) = @_; + my ($name,$checked,$value,$special) = @_; my $Str = ''; return $Str; } @@ -534,6 +534,8 @@ sub date_setter { if (! defined($state) || $state ne 'disabled') { $state = ''; + } else { + $state = 'disabled="disabled"'; } if (! defined($no_hh_mm_ss)) { $no_hh_mm_ss = 0; @@ -1160,7 +1162,7 @@ sub Close_PrgWin { sub crumbs { my ($uri,$target,$prefix,$form,$skiplast,$onclick)=@_; # You cannot crumbnify uploaded or adm resources - if ($uri=~/^\/*(uploaded|adm)\//) { return &mt('(Internal Course/Group Content)'); } + if ($uri=~/^\/*(uploaded|adm)\//) { return &mt('(Internal Course/Community Content)'); } if ($target) { $target = ' target="'. &Apache::loncommon::escape_single($target).'"'; @@ -1180,6 +1182,12 @@ sub crumbs { } else { $path.='/'; } + if ($path eq '/res/') { + unless (&Apache::lonnet::allowed('bre',$path)) { + $output.="$dir/"; + next; + } + } my $href_path = &HTML::Entities::encode($path,'<>&"'); &Apache::loncommon::inhibit_menu_check(\$href_path); if ($form) { @@ -1822,7 +1830,7 @@ returns: nothing $env{'course.'.$env{'request.course.id'}.'.description'}; $no_mt_descr = 1; if ($env{'request.noversionuri'} =~ - m{^/public/($match_domain)/($match_courseid)/syllabus$}) { + m{^/?public/($match_domain)/($match_courseid)/syllabus$}) { unless (($env{'course.'.$env{'request.course.id'}.'.domain'} eq $1) && ($env{'course.'.$env{'request.course.id'}.'.num'} eq $2)) { $description = 'Menu'; @@ -3394,8 +3402,8 @@ ENDUTILITY sub jump_to_editres { my ($cfile,$home,$switchserver,$forceedit,$forcereg,$symb,$folderpath, - $title,$idx,$suppurl,$todocs) = @_; - my $jscall; + $title,$idx,$suppurl,$todocs,$suppanchor) = @_; + my ($jscall,$anchor); if ($switchserver) { if ($home) { $cfile = '/adm/switchserver?otherserver='.$home.'&role='. @@ -3415,7 +3423,16 @@ sub jump_to_editres { } } else { unless ($cfile =~ m{^/priv/}) { + if ($cfile =~ m{^(/adm/wrapper/ext/[^#]+)#([^#]+)$}) { + $cfile = $1; + $anchor = $2; + } if ($symb) { + if ($anchor ne '') { + if ($symb =~ m{^([^#]+)\Q#$anchor\E$}) { + $symb = $1.&escape(&escape('#')).$anchor; + } + } $cfile .= (($cfile=~/\?/)?'&':'?')."symb=$symb"; } elsif ($folderpath) { $cfile .= (($cfile=~/\?/)?'&':'?'). @@ -3439,8 +3456,15 @@ sub jump_to_editres { $cfile .= (($cfile=~/\?/)?'&':'?').'register=1'; } if ($todocs) { - $cfile .= (($cfile=~/\?/)?'&':'?').'todocs=1'; + $cfile .= (($cfile=~/\?/)?'&':'?').'todocs=1'; } + if ($suppanchor ne '') { + $cfile .= (($cfile=~/\?/)?'&':'?').'anchor='. + &HTML::Entities::encode($suppanchor,'"<>&'); + } + } + if ($anchor ne '') { + $cfile .= '#'.$anchor; } $jscall = "go('".&Apache::loncommon::escape_single($cfile)."')"; }