version 1.262, 2010/01/24 03:56:09
|
version 1.273, 2010/05/30 18:30:52
|
Line 74 sub coursepreflink {
|
Line 74 sub coursepreflink {
|
|
|
sub raw_href_to_link { |
sub raw_href_to_link { |
my ($message)=@_; |
my ($message)=@_; |
$message=~s/(https?\:\/\/[^\s\'\"]+)(\s|$)/<a href="$1"><tt>$1<\/tt><\/a>$2/gi; |
$message=~s/(https?\:\/\/[^\s\'\"\<]+)([\s\<]|$)/<a href="$1"><tt>$1<\/tt><\/a>$2/gi; |
return $message; |
return $message; |
} |
} |
|
|
Line 90 Successful completion of an operation me
|
Line 90 Successful completion of an operation me
|
sub confirm_success { |
sub confirm_success { |
my ($message,$failure)=@_; |
my ($message,$failure)=@_; |
if ($failure) { |
if ($failure) { |
return '<span class="LC_error">'."\n" |
return '<span class="LC_error" style="font-size: inherit;">'."\n" |
.'<img src="/adm/lonIcons/navmap.wrong.gif" alt="'.&mt('Error').'" /> '."\n" |
.'<img src="/adm/lonIcons/navmap.wrong.gif" alt="'.&mt('Error').'" /> '."\n" |
.$message."\n" |
.$message."\n" |
.'</span>'."\n"; |
.'</span>'."\n"; |
Line 1061 sub Increment_PrgWin {
|
Line 1061 sub Increment_PrgWin {
|
# |
# |
my $str; |
my $str; |
if ($min == 0 && $sec > 1) { |
if ($min == 0 && $sec > 1) { |
$str = '[_2] seconds'; |
$str = '[_1] seconds'; |
} elsif ($min == 1 && $sec > 1) { |
} elsif ($min == 1 && $sec > 1) { |
$str = '1 minute [_2] seconds'; |
$str = '1 minute [_2] seconds'; |
} elsif ($min == 1 && $sec < 2) { |
} elsif ($min == 1 && $sec < 2) { |
Line 1240 sub htmlareaheaders {
|
Line 1240 sub htmlareaheaders {
|
my $s=""; |
my $s=""; |
if (&htmlareabrowser()) { |
if (&htmlareabrowser()) { |
$s.=(<<ENDEDITOR); |
$s.=(<<ENDEDITOR); |
<script type="text/javascript" src="/fckeditor/fckeditor.js"></script> |
|
<script type="text/javascript" src="/ckeditor/ckeditor.js"></script> |
<script type="text/javascript" src="/ckeditor/ckeditor.js"></script> |
ENDEDITOR |
ENDEDITOR |
} |
} |
Line 1284 sub htmlarea_lang {
|
Line 1283 sub htmlarea_lang {
|
sub htmlareaselectactive { |
sub htmlareaselectactive { |
my @fields=@_; |
my @fields=@_; |
unless (&htmlareabrowser()) { return ''; } |
unless (&htmlareabrowser()) { return ''; } |
#if (&htmlareablocked()) { return '<br />'.&enablelink(@fields); } |
|
my $output='<script type="text/javascript" defer="defer">'."\n" |
my $output='<script type="text/javascript" defer="defer">'."\n" |
.'// <![CDATA['."\n"; |
.'// <![CDATA['."\n"; |
my $lang = &htmlarea_lang(); |
my $lang = &htmlarea_lang(); |
Line 1355 sub htmlareaselectactive {
|
Line 1353 sub htmlareaselectactive {
|
}); |
}); |
|
|
}); |
}); |
'; |
'; |
|
|
foreach my $field (@fields) { |
|
$output.=' |
|
|
|
{ |
|
$(document).ready(function() { |
|
if (!($("#'.$field.'").hasClass("LC_richAlwaysOn"))) { |
|
if (!($("#'.$field.'").hasClass("LC_richAlwaysOff"))) { |
|
if (!($("#'.$field.'").hasClass("LC_richDetectHtml"))) { |
|
if (!($("#'.$field.'").hasClass("LC_richDefaultOn"))) { |
|
if (!($("#'.$field.'").hasClass("LC_richDefaultOff"))) { |
|
var oFCKeditor = new FCKeditor("'.$field.'"); |
|
oFCKeditor.Config["CustomConfigurationsPath"] = |
|
"/fckeditor/loncapaconfig.js"; |
|
oFCKeditor.ReplaceTextarea(); |
|
oFCKeditor.Config["AutoDetectLanguage"] = false; |
|
oFCKeditor.Config["DefaultLanguage"] = "'.$lang.'"; |
|
} |
|
} |
|
} |
|
} |
|
} |
|
}); |
|
}'; |
|
} |
|
$output.="\nwindow.status='Activated Editfields';\n" |
$output.="\nwindow.status='Activated Editfields';\n" |
.'// ]]>'."\n" |
.'// ]]>'."\n" |
.'</script><br />'. |
.'</script><br />'; |
&disablelink(@fields); |
|
return $output; |
return $output; |
} |
} |
|
|
Line 1466 returns: nothing
|
Line 1438 returns: nothing
|
if ($menulink) { |
if ($menulink) { |
my $description = 'Menu'; |
my $description = 'Menu'; |
my $no_mt_descr = 0; |
my $no_mt_descr = 0; |
if (exists($env{'request.course.id'}) && |
if ((exists($env{'request.course.id'})) && |
$env{'request.course.id'} ne '') { |
($env{'request.course.id'} ne '') && |
|
($env{'course.'.$env{'request.course.id'}.'.description'} ne '')) { |
$description = |
$description = |
$env{'course.'.$env{'request.course.id'}.'.description'}; |
$env{'course.'.$env{'request.course.id'}.'.description'}; |
$no_mt_descr = 1; |
$no_mt_descr = 1; |
Line 1508 returns: nothing
|
Line 1481 returns: nothing
|
my $lasttext = $last->{'no_mt'} ? $last->{'text'} |
my $lasttext = $last->{'no_mt'} ? $last->{'text'} |
: mt( $last->{'text'} ); |
: mt( $last->{'text'} ); |
|
|
$links .= htmltag( 'li', htmltag('b', $lasttext), {title => $lasttext}); |
$links .= htmltag( 'li', htmltag('h1', $lasttext), {title => $lasttext}); |
|
|
my $icons = ''; |
my $icons = ''; |
$faq = $last->{'faq'} if (exists($last->{'faq'})); |
$faq = $last->{'faq'} if (exists($last->{'faq'})); |
Line 1794 ENDTWO
|
Line 1767 ENDTWO
|
|
|
} # End: row_count block for pick_box |
} # End: row_count block for pick_box |
|
|
|
|
sub role_select_row { |
sub role_select_row { |
my ($roles,$title,$css_class,$show_separate_custom,$cdom,$cnum) = @_; |
my ($roles,$title,$css_class,$show_separate_custom,$cdom,$cnum) = @_; |
my $crstype = 'Course'; |
my $crstype = 'Course'; |
Line 2017 sub course_custom_roles {
|
Line 1989 sub course_custom_roles {
|
} |
} |
|
|
|
|
|
sub resource_info_box { |
|
my ($symb,$onlyfolderflag)=@_; |
|
my $return=''; |
|
if ($symb) { |
|
$return=&Apache::loncommon::start_data_table(); |
|
my ($map,$id,$resource)=&Apache::lonnet::decode_symb($symb); |
|
my $folder=&Apache::lonnet::gettitle($map); |
|
$return.=&Apache::loncommon::start_data_table_row(). |
|
'<th>'.&mt('Folder:').'</th><td>'.$folder.'</td>'. |
|
&Apache::loncommon::end_data_table_row(); |
|
unless ($onlyfolderflag) { |
|
$return.=&Apache::loncommon::start_data_table_row(). |
|
'<th>'.&mt('Resource:').'</th><td>'.&Apache::lonnet::gettitle($symb).'</td>'. |
|
&Apache::loncommon::end_data_table_row(); |
|
} |
|
$return.=&Apache::loncommon::end_data_table(); |
|
} else { |
|
$return='<p><span class="LC_error">'.&mt('No context provided.').'</span></p>'; |
|
} |
|
return $return; |
|
|
|
} |
|
|
############################################## |
############################################## |
############################################## |
############################################## |
|
|
Line 2397 returns: XHTML list as String.
|
Line 2392 returns: XHTML list as String.
|
# \@items, {listattr => { class => 'abc', id => 'xyx' }, itemattr => {class => 'abc', id => 'xyx'}} |
# \@items, {listattr => { class => 'abc', id => 'xyx' }, itemattr => {class => 'abc', id => 'xyx'}} |
sub list_from_array { |
sub list_from_array { |
my ($items, $args) = @_; |
my ($items, $args) = @_; |
|
return unless scalar @$items; |
my ($ul, $li) = inittags( qw(ul li) ); |
my ($ul, $li) = inittags( qw(ul li) ); |
my $listitems = join '', map { $li->($_, $args->{itemattr}) } @$items; |
my $listitems = join '', map { $li->($_, $args->{itemattr}) } @$items; |
return $ul->( $listitems, $args->{listattr} ); |
return $ul->( $listitems, $args->{listattr} ); |