--- loncom/interface/lonhtmlcommon.pm 2012/11/08 18:37:44 1.330 +++ loncom/interface/lonhtmlcommon.pm 2012/11/29 20:37:07 1.334 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common html routines # -# $Id: lonhtmlcommon.pm,v 1.330 2012/11/08 18:37:44 raeburn Exp $ +# $Id: lonhtmlcommon.pm,v 1.334 2012/11/29 20:37:07 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -209,10 +209,19 @@ dependencies for a web page uploaded dir =cut sub dependencycheck_js { - my ($symb,$title,$url) = @_; - my $link = '/adm/dependencies?symb='.&HTML::Entities::encode($symb,'<>&"'). - '&title='.&HTML::Entities::encode($title,'<>&"'). - '&url='.&HTML::Entities::encode($url,'<>&"'); + my ($symb,$title,$url,$folderpath,$uri) = @_; + my $link; + if ($symb) { + $link = '/adm/dependencies?symb='.&HTML::Entities::encode($symb,'<>&"'); + } elsif ($folderpath) { + $link = '/adm/dependencies?folderpath='.&HTML::Entities::encode($folderpath,'<>&"'); + $url = $uri; + } + $link .= (($link=~/\?/)?'&':'?').'title='. + &HTML::Entities::encode($title,'<>&"'); + if ($url) { + $link .= '&url='.&HTML::Entities::encode($url,'<>&"'); + } return < // $url, + 'title' => $name, + 'text' => $name, + 'no_mt' => 1, + }); + } + if ($title) { + push(@docs_crumbs, + {'title' => $title, + 'text' => $title, + 'no_mt' => 1,} + ); + } + if (wantarray) { + unless ($precleared) { + &clear_breadcrumbs(); + } + &add_breadcrumb(@docs_crumbs); + if ($contenteditor) { + $plain=~s/\>\;\s*$//; + } + my $menulink = 0; + if (!$allowed && !$contenteditor) { + $menulink = 1; + } + return (&breadcrumbs(undef,undef,$menulink,'nohelp',undef,undef, + $contenteditor), + $randompick,$ishidden,$isencrypted,$plain, + $is_random_order); + } else { + return \@docs_crumbs; + } +} + ############################################################ ############################################################ @@ -3029,13 +3117,18 @@ ENDUTILITY } sub jump_to_editres { - my ($cfile,$home,$switchserver,$forceedit,$forcereg,$symb) = @_; + my ($cfile,$home,$switchserver,$forceedit,$forcereg,$symb,$folderpath, + $title,$idx,$suppurl) = @_; my $jscall; if ($switchserver) { - if ($symb && $home) { + if ($home) { $cfile = '/adm/switchserver?otherserver='.$home.'&role='. - &HTML::Entities::encode($env{'request.role'},'"<>&'). - '&symb='.&HTML::Entities::encode($symb,'"<>&'); + &HTML::Entities::encode($env{'request.role'},'"<>&'); + if ($symb) { + $cfile .= '&symb='.&HTML::Entities::encode($symb,'"<>&'); + } elsif ($folderpath) { + $cfile .= '&folderpath='.&HTML::Entities::encode($folderpath,'"<>&'); + } if ($forceedit) { $cfile .= '&forceedit=1'; } @@ -3047,7 +3140,21 @@ sub jump_to_editres { } else { unless ($cfile =~ m{^/priv/}) { if ($symb) { - $cfile .= (($cfile=~/\?/)?'&':'?')."symb=$symb"; + $cfile .= (($cfile=~/\?/)?'&':'?')."symb=$symb"; + } elsif ($folderpath) { + $cfile .= (($cfile=~/\?/)?'&':'?'). + 'folderpath='.&HTML::Entities::encode(&escape($folderpath),'"<>&'); + if ($title) { + $cfile .= (($cfile=~/\?/)?'&':'?'). + 'title='.&HTML::Entities::encode(&escape($title),'"<>&'); + } + if ($idx) { + $cfile .= (($cfile=~/\?/)?'&':'?').'idx='.$idx; + } + if ($suppurl) { + $cfile .= (($cfile=~/\?/)?'&':'?'). + 'suppurl='.&HTML::Entities::encode(&escape($suppurl)); + } } if ($forceedit) { $cfile .= (($cfile=~/\?/)?'&':'?').'forceedit=1';