version 1.166, 2007/10/04 01:16:58
|
version 1.170, 2007/11/16 06:31:26
|
Line 486 sub build_url {
|
Line 486 sub build_url {
|
my ($base, $fields)=@_; |
my ($base, $fields)=@_; |
my $url; |
my $url; |
$url = $base.'?'; |
$url = $base.'?'; |
foreach my $key(keys(%$fields)) { |
foreach my $key (keys(%$fields)) { |
$url.=$key.'='.$$fields{$key}.'&'; |
$url.=&escape($key).'='.&escape($$fields{$key}).'&'; |
} |
} |
$url =~ s/&$//; |
$url =~ s/&$//; |
return $url; |
return $url; |
Line 868 sub Create_PrgWin {
|
Line 868 sub Create_PrgWin {
|
function openpopwin () { |
function openpopwin () { |
popwin=open(\'\',\'popwin\',\'width=400,height=100\');". |
popwin=open(\'\',\'popwin\',\'width=400,height=100\');". |
"popwin.document.writeln(\'".$start_page. |
"popwin.document.writeln(\'".$start_page. |
"<h4>$heading<\/h4>". |
"<h4>".&mt("$heading")."<\/h4>". |
"<form action= \"\" name=\"popremain\" method=\"post\">". |
"<form action= \"\" name=\"popremain\" method=\"post\">". |
'<input type="text" size="'.$width.'" name="remaining" value="'. |
'<input type="text" size="'.$width.'" name="remaining" value="'. |
&mt('Starting').'" /><\\/form>'.$end_page. |
&mt('Starting').'" /><\\/form>'.$end_page. |
Line 887 sub Create_PrgWin {
|
Line 887 sub Create_PrgWin {
|
} |
} |
if (!$inputname) { |
if (!$inputname) { |
$prog_state{'inputname'}=&get_uniq_name(); |
$prog_state{'inputname'}=&get_uniq_name(); |
&r_print($r,$heading.' <input type="text" name="'.$prog_state{'inputname'}. |
&r_print($r,&mt("$heading [_1]",' <input type="text" name="'.$prog_state{'inputname'}.'" size="'.$width.'" />')); |
'" size="'.$width.'" />'); |
|
} else { |
} else { |
$prog_state{'inputname'}=$inputname; |
$prog_state{'inputname'}=$inputname; |
|
|
Line 1101 ENDLINK
|
Line 1100 ENDLINK
|
} |
} |
|
|
sub htmlareaheaders { |
sub htmlareaheaders { |
if (&htmlareablocked()) { return ''; } |
return if (&htmlareablocked()); |
unless (&htmlareabrowser()) { return ''; } |
return if (!&htmlareabrowser()); |
my $lang='en'; |
|
if (&mt('htmlarea_lang') ne 'htmlarea_lang') { |
|
$lang=&mt('htmlarea_lang'); |
|
} |
|
return (<<ENDHEADERS); |
return (<<ENDHEADERS); |
<script type="text/javascript"> |
<script type="text/javascript" src="/fckeditor/fckeditor.js"></script> |
_editor_url='/htmlarea/'; |
|
_editor_lang='$lang'; |
|
</script> |
|
<script type="text/javascript" src="/htmlarea/htmlarea.js"></script> |
|
<link rel="stylesheet" type="text/css" href="/htmlarea/htmlarea.css" /> |
|
ENDHEADERS |
ENDHEADERS |
} |
} |
|
|
# ------------------------------------------------- Activate additional buttons |
|
|
|
sub htmlareaaddbuttons { |
|
if (&htmlareablocked()) { return ''; } |
|
unless (&htmlareabrowser()) { return ''; } |
|
return (<<ENDADDBUTTON); |
|
var config=new HTMLArea.Config(); |
|
config.registerButton('ed_math','LaTeX Inline', |
|
'/htmlarea/images/ed_math.gif',false, |
|
function(editor,id) { |
|
editor.surroundHTML(' <m>\$','\$</m> '); |
|
} |
|
); |
|
config.registerButton('ed_math_eqn','LaTeX Equation', |
|
'/htmlarea/images/ed_math_eqn.gif',false, |
|
function(editor,id) { |
|
editor.surroundHTML( |
|
' \\n<center><m>\\\\[','\\\\]</m></center>\\n '); |
|
} |
|
); |
|
config.toolbar.push(['ed_math','ed_math_eqn']); |
|
ENDADDBUTTON |
|
} |
|
|
|
# ----------------------------------------------------------------- Preferences |
# ----------------------------------------------------------------- Preferences |
|
|
sub disablelink { |
sub disablelink { |
Line 1159 sub enablelink {
|
Line 1125 sub enablelink {
|
return '<a href="'.&HTML::Entities::encode('/adm/preferences?action=set_wysiwyg&wysiwyg=on&returnurl=','<>&"').&escape($ENV{'REQUEST_URI'}).'">'.&mt('Enable WYSIWYG Editor').'</a>'; |
return '<a href="'.&HTML::Entities::encode('/adm/preferences?action=set_wysiwyg&wysiwyg=on&returnurl=','<>&"').&escape($ENV{'REQUEST_URI'}).'">'.&mt('Enable WYSIWYG Editor').'</a>'; |
} |
} |
|
|
|
# ------------------------------------------------- lang to use in html editor |
|
sub htmlarea_lang { |
|
my $lang='en'; |
|
if (&mt('htmlarea_lang') ne 'htmlarea_lang') { |
|
$lang=&mt('htmlarea_lang'); |
|
} |
|
return $lang; |
|
} |
|
|
# ----------------------------------------- Script to activate only some fields |
# ----------------------------------------- Script to activate only some fields |
|
|
sub htmlareaselectactive { |
sub htmlareaselectactive { |
my @fields=@_; |
my @fields=@_; |
unless (&htmlareabrowser()) { return ''; } |
unless (&htmlareabrowser()) { return ''; } |
if (&htmlareablocked()) { return '<br />'.&enablelink(@fields); } |
if (&htmlareablocked()) { return '<br />'.&enablelink(@fields); } |
my $output='<script type="text/javascript" defer="1">'. |
my $output='<script type="text/javascript" defer="1">'; |
&htmlareaaddbuttons(); |
my $lang = &htmlarea_lang(); |
foreach(@fields) { |
foreach my $field (@fields) { |
$output.="\nHTMLArea.replace('$_',config);"; |
$output.=" |
|
{ |
|
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</script><br />". |
$output.="\nwindow.status='Activated Editfields';\n</script><br />". |
&disablelink(@fields); |
&disablelink(@fields); |
Line 1489 sub course_select_row {
|
Line 1472 sub course_select_row {
|
my ($title,$formname,$totcodes,$codetitles,$idlist,$idlist_titles, |
my ($title,$formname,$totcodes,$codetitles,$idlist,$idlist_titles, |
$css_class) = @_; |
$css_class) = @_; |
my $output = &row_title($title,$css_class); |
my $output = &row_title($title,$css_class); |
$output .= qq| |
$output .= &course_selection($formname,$totcodes,$codetitles,$idlist,$idlist_titles); |
|
$output .= &row_closure(); |
|
return $output; |
|
} |
|
|
|
sub course_selection { |
|
my ($formname,$totcodes,$codetitles,$idlist,$idlist_titles) = @_; |
|
my $output = qq| |
<script type="text/javascript"> |
<script type="text/javascript"> |
function coursePick (formname) { |
function coursePick (formname) { |
for (var i=0; i<formname.coursepick.length; i++) { |
for (var i=0; i<formname.coursepick.length; i++) { |
Line 1562 sub course_select_row {
|
Line 1552 sub course_select_row {
|
$output .= '</tr></table><br />'; |
$output .= '</tr></table><br />'; |
} |
} |
} |
} |
$output .= '<input type="radio" name="coursepick" value="specific" onclick="coursePick(this.form);opencrsbrowser('."'".$formname."'".','."'".'dccourse'."'".','."'".'dcdomain'."'".','."'".'coursedesc'."','','1'".')" />'.&mt('Pick specific course(s):').' '.$courseform.' <input type="text" value="0" size="4" name="coursetotal" /><input type="hidden" name="courselist" value="" />selected.<br />'."\n"; |
$output .= '<input type="radio" name="coursepick" value="specific" onclick="coursePick(this.form);opencrsbrowser('."'".$formname."','dccourse','dcdomain','coursedesc','','1'".')" />'.&mt('Pick specific course(s):').' '.$courseform.' <input type="text" value="0" size="4" name="coursetotal" /><input type="hidden" name="courselist" value="" />selected.<br />'."\n"; |
$output .= &row_closure(); |
|
return $output; |
return $output; |
} |
} |
|
|