--- rat/lonratedt.pm 2009/12/04 11:13:58 1.98 +++ rat/lonratedt.pm 2012/05/01 23:00:29 1.105.2.1 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Edit Handler for RAT Maps # -# $Id: lonratedt.pm,v 1.98 2009/12/04 11:13:58 bisitz Exp $ +# $Id: lonratedt.pm,v 1.105.2.1 2012/05/01 23:00:29 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -44,7 +44,7 @@ use HTML::Entities(); sub ratedt { my ($r,$url)=@_; my %layout = ('border' => "0"); - if ($env{'environment.remote'} eq 'off') { + if ($env{'environment.remote'} eq 'off') { $layout{'rows'} = "1,250,*"; } else { $layout{'rows'} = "1,70,*"; @@ -158,7 +158,7 @@ function idxopen(mode) { function groupopen(url,recover,bookmarks) { var options="scrollbars=1,resizable=1,menubar=0"; idxflag=1; - idx=open("/adm/groupsort?inhibitmenu=yes&mode=$mode&recover="+recover+"&readfile="+url+"&bookmarks="+bookmarks,"idxout",options); +idx=open("/adm/groupsort?inhibitmenu=yes&mode=$mode&recover="+recover+"&readfile="+url+"&bookmarks="+bookmarks,"idxout",options); idx.focus(); } @@ -553,7 +553,7 @@ ENDJS &Apache::lonhtmlcommon::clear_breadcrumbs(); &Apache::lonhtmlcommon::add_breadcrumb({ text => 'Construction Space', - href => &Apache::loncommon::authorspace(), + href => &Apache::loncommon::authorspace($url), faq => 6, bug => 'RAT', help => 'Sequence_Simple_Editor_Creation',}); @@ -649,8 +649,10 @@ ENDSMPHEAD # ----------------------------------------------------------------- No such dir sub nodir { my ($r,$dir)=@_; - $dir=~s{^/home/$LONCAPA::username_re/public_html}{}; - my $brcrum = [{'href' => &Apache::loncommon::authorspace(), + my $londocroot = $r->dir_config('lonDocRoot'); + my ($path) = ($dir =~ m{^\Q$londocroot\E?(/priv/[^/]+/[^/]+/)}); + $dir=~s{^\Q$londocroot/priv/\E[^/]+/[^/]+}{}; + my $brcrum = [{'href' => &Apache::loncommon::authorspace($path), 'text' => 'Construction Space'}]; # {'href' => '', # 'text' => 'No such directory'}]; @@ -674,7 +676,7 @@ sub viewmap { &Apache::lonhtmlcommon::clear_breadcrumbs(); &Apache::lonhtmlcommon::add_breadcrumb({ text => 'Construction Space', - href => &Apache::loncommon::authorspace(), + href => &Apache::loncommon::authorspace($url), faq => 6, bug => 'RAT', help => 'Sequence_Simple_Editor_Creation',}); @@ -729,7 +731,7 @@ sub viewmap { $filename = $1; } my $cstrurl = $resurl; - $cstrurl =~ s#^/res/[^/]+/([^/]+)/#/priv/$1/#; + $cstrurl =~ s{^/res/}{/priv/}; $r->print(&Apache::loncommon::start_data_table_row() .'' .''