--- loncom/interface/lonhtmlcommon.pm 2013/01/03 20:02:12 1.340 +++ loncom/interface/lonhtmlcommon.pm 2013/04/30 15:10:22 1.343 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common html routines # -# $Id: lonhtmlcommon.pm,v 1.340 2013/01/03 20:02:12 raeburn Exp $ +# $Id: lonhtmlcommon.pm,v 1.343 2013/04/30 15:10:22 bisitz Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1280,6 +1280,14 @@ sub htmlareaselectactive { } } } + + my %lt = &Apache::lonlocal::texthash( + 'plain' => 'Plain text', + 'rich' => 'Rich formatting', + 'plain_title' => 'Disable rich text formatting and edit in plain text', + 'rich_title' => 'Enable rich text formatting (bold, italic, etc.)', + ); + $output.=' function containsBlockHtml(id) { @@ -1308,14 +1316,14 @@ sub htmlareaselectactive { var rt_enabled = $(this).hasClass("LC_enable_rt"); if (rt_enabled) { startRichEditor(id); - $("#LC_rt_"+id).html("« Plain text"); - $("#LC_rt_"+id).attr("title", "Disable rich text formatting and edit in plain text"); + $("#LC_rt_"+id).html("« '.$lt{'plain'}.'"); + $("#LC_rt_"+id).attr("title", "'.$lt{'plain_title'}.'"); $("#LC_rt_"+id).addClass("LC_disable_rt"); $("#LC_rt_"+id).removeClass("LC_enable_rt"); } else { destroyRichEditor(id); - $("#LC_rt_"+id).html("Rich formatting »"); - $("#LC_rt_"+id).attr("title", "Enable rich text formatting (bold, italic, etc.)"); + $("#LC_rt_"+id).html("'.$lt{'rich'}.' »"); + $("#LC_rt_"+id).attr("title", "'.$lt{'rich_title'}.'"); $("#LC_rt_"+id).addClass("LC_enable_rt"); $("#LC_rt_"+id).removeClass("LC_disable_rt"); }'; @@ -1336,12 +1344,12 @@ sub htmlareaselectactive { var id = $(this).attr("id"); var rt_enabled = containsBlockHtml(id); if(rt_enabled) { - $(this).before("
« Plain text
"); + $(this).before("
« '.$lt{'plain'}.'
"); startRichEditor(id); $("#LC_rt_"+id).click(editorHandler); } else { - $(this).before("
Rich formatting »
"); + $(this).before("
'.$lt{'rich'}.' »
"); $("#LC_rt_"+id).click(editorHandler); }'; if ($dragmath_prefix ne '') { @@ -1355,13 +1363,13 @@ sub htmlareaselectactive { }); $(".LC_richDefaultOn").each(function() { var id = $(this).attr("id"); - $(this).before("
« Plain text
"); + $(this).before("
« '.$lt{'plain'}.'
"); startRichEditor(id); $("#LC_rt_"+id).click(editorHandler); }); $(".LC_richDefaultOff").each(function() { var id = $(this).attr("id"); - $(this).before("
Rich formatting »
"); + $(this).before("
'.$lt{'rich'}.' »
"); $("#LC_rt_"+id).click(editorHandler); }); @@ -1908,8 +1916,11 @@ returns: nothing sub docs_breadcrumbs { my ($allowed,$crstype,$contenteditor,$title,$precleared)=@_; - my ($folderpath,@folders); + my ($folderpath,@folders,$supplementalflag); @folders = split('&',$env{'form.folderpath'}); + if ($env{'form.folderpath'} =~ /^supplemental/) { + $supplementalflag = 1; + } my $plain=''; my $container = 'sequence'; my ($randompick,$isencrypted,$ishidden,$is_random_order) = (-1,0,0,0); @@ -1930,16 +1941,18 @@ sub docs_breadcrumbs { # each of randompick number, hidden, encrypted, random order, is_page # are appended with ":"s to the foldername $name=~s/\:(\d*)\:(\w*)\:(\w*):(\d*)\:?(\d*)$//; - if ($contenteditor) { - if ($1 ne '') { - $randompick=$1; - } else { - $randompick=-1; + unless ($supplementalflag) { + if ($contenteditor) { + if ($1 ne '') { + $randompick=$1; + } else { + $randompick=-1; + } + if ($2) { $ishidden=1; } + if ($3) { $isencrypted=1; } + if ($4 ne '') { $is_random_order = 1; } + if ($5 == 1) {$container = 'page'; } } - if ($2) { $ishidden=1; } - if ($3) { $isencrypted=1; } - if ($4 ne '') { $is_random_order = 1; } - if ($5 == 1) {$container = 'page'; } } if ($folder eq 'supplemental') { $name = &mt('Supplemental '.$crstype.' Contents'); @@ -2209,11 +2222,11 @@ sub course_selection { my $courseform=''.&Apache::loncommon::selectcourse_link ($formname,'pickcourse','pickdomain','coursedesc','',1,$crstype).''; - $output .= ''.$allcrs.'
'; + $output .= '
'; if ($totcodes > 0) { my $numtitles = @$codetitles; if ($numtitles > 0) { - $output .= ''.&mt('Pick courses by category:').'
'; + $output .= '
'; $output .= '
'.$$codetitles[0].'
'."\n". '

'; } } - $output .= ''.$pickspec.' '.$courseform.'  selected.
'."\n"; + $output .= + '' + .' '.$courseform.'  ' + .&mt('[_1] selected.', + '' + .'') + .'
'."\n"; return $output; }