version 1.176, 2008/07/07 11:02:05
|
version 1.182.2.3, 2010/01/23 22:26:27
|
Line 68 use LONCAPA;
|
Line 68 use LONCAPA;
|
|
|
=pod |
=pod |
|
|
=item dragmath |
=item dragmath_button |
|
|
Creates a button that will allow dragmath to edit an equation into |
Creates a button that launches a dragmath popup-window, in which an |
a specified textbox. |
expression can be edited and pasted as LaTeX into a specified textarea. |
|
|
|
textarea - Name of the textarea to edit. |
|
helpicon - If true, show a help icon to the right of the button. |
|
|
textarea - Name of the text area to edit. |
|
=cut |
=cut |
|
|
############################################## |
sub dragmath_button { |
# TODO: Figure out a way to only emit the mathedit function once. |
my ($textarea,$helpicon) = @_; |
# per html output document. |
my $help_text; |
# |
if ($helpicon) { |
|
$help_text = &Apache::loncommon::help_open_topic('Authoring_Math_Editor'); |
|
} |
|
my $buttontext=&mt('Edit Math'); |
|
return <<ENDDRAGMATH; |
|
<input type="button" value="$buttontext", onclick="javascript:mathedit('$textarea',document)" />$help_text |
|
ENDDRAGMATH |
|
} |
|
|
############################################## |
############################################## |
|
|
sub dragmath { |
=pod |
my ($textarea) = @_; |
|
|
|
return <<ENDDRAGMATH; |
=item dragmath_js |
<script language="JavaScript"> |
|
|
Javascript used to open pop-up window containing dragmath applet which |
|
can be used to paste LaTeX into a textarea. |
|
|
|
=cut |
|
|
|
sub dragmath_js { |
|
my ($popup) = @_; |
|
return <<ENDDRAGMATHJS; |
|
<script type="text/javascript"> |
function mathedit(textarea, doc) { |
function mathedit(textarea, doc) { |
targetEntry = textarea; |
targetEntry = textarea; |
targetDoc = doc; |
targetDoc = doc; |
newwin = window.open("/adm/dragmath/applet/EditMathPopup.html","","width=565,height=500,resizable"); |
newwin = window.open("/adm/dragmath/applet/$popup.html","","width=565,height=500,resizable"); |
} |
} |
</script> |
</script> |
<input type="button" value="Edit Math", onclick="javascript:mathedit('$textarea',document)" /> |
|
ENDDRAGMATH |
ENDDRAGMATHJS |
} |
} |
|
|
|
|
############################################## |
############################################## |
############################################## |
############################################## |
|
|
Line 372 sub date_setter {
|
Line 391 sub date_setter {
|
($tzname,$sec,$min,$hour,$mday,$month,$year) = &get_timedates($currentvalue); |
($tzname,$sec,$min,$hour,$mday,$month,$year) = &get_timedates($currentvalue); |
} |
} |
unless ($wasdefined) { |
unless ($wasdefined) { |
($tzname,$sec,$min,$hour,$mday,$month,$year) = &get_timedates($now); |
|
if (($defhour) || ($defmin) || ($defsec)) { |
if (($defhour) || ($defmin) || ($defsec)) { |
|
($tzname,$sec,$min,$hour,$mday,$month,$year) = &get_timedates($now); |
$sec=($defsec?$defsec:0); |
$sec=($defsec?$defsec:0); |
$min=($defmin?$defmin:0); |
$min=($defmin?$defmin:0); |
$hour=($defhour?$defhour:0); |
$hour=($defhour?$defhour:0); |
Line 1073 sub crumbs {
|
Line 1092 sub crumbs {
|
my $output=''; |
my $output=''; |
unless ($noformat) { $output.='<br /><tt><b>'; } |
unless ($noformat) { $output.='<br /><tt><b>'; } |
$output.='<font size="'.$size.'">'.$prefix.'/'; |
$output.='<font size="'.$size.'">'.$prefix.'/'; |
if ($env{'user.adv'}) { |
if (($env{'user.adv'}) || ($env{'user.author'})) { |
my $path=$prefix.'/'; |
my $path=$prefix.'/'; |
foreach my $dir (split('/',$uri)) { |
foreach my $dir (split('/',$uri)) { |
if (! $dir) { next; } |
if (! $dir) { next; } |
Line 1259 Inputs: $component (the large text on th
|
Line 1278 Inputs: $component (the large text on th
|
$menulink (boolean, controls whether to include a link to /adm/menu) |
$menulink (boolean, controls whether to include a link to /adm/menu) |
$helplink (if 'nohelp' don't include the orange help link) |
$helplink (if 'nohelp' don't include the orange help link) |
$css_class (optional name for the class to apply to the table for CSS) |
$css_class (optional name for the class to apply to the table for CSS) |
|
$no_mt (optional flag, 1 if &mt() is _not_ to be applied to $component |
|
when including the text on the right. |
|
|
Returns a string containing breadcrumbs for the current page. |
Returns a string containing breadcrumbs for the current page. |
|
|
=item clear_breadcrumbs |
=item clear_breadcrumbs |
Line 1284 returns: nothing
|
Line 1306 returns: nothing
|
my @Crumbs; |
my @Crumbs; |
|
|
sub breadcrumbs { |
sub breadcrumbs { |
my ($component,$component_help,$menulink,$helplink,$css_class) = @_; |
my ($component,$component_help,$menulink,$helplink,$css_class,$no_mt) = @_; |
# |
# |
$css_class ||= 'LC_breadcrumbs'; |
$css_class ||= 'LC_breadcrumbs'; |
my $Str = "\n".'<table class="'.$css_class.'"><tr><td>'; |
my $Str = "\n".'<table class="'.$css_class.'"><tr><td>'; |
Line 1293 returns: nothing
|
Line 1315 returns: nothing
|
my $faq = ''; |
my $faq = ''; |
my $bug = ''; |
my $bug = ''; |
my $help=''; |
my $help=''; |
|
# Crumb Symbol |
|
my $crumbsymbol = ' ▶ '; |
# The last breadcrumb does not have a link, so handle it separately. |
# The last breadcrumb does not have a link, so handle it separately. |
my $last = pop(@Crumbs); |
my $last = pop(@Crumbs); |
# |
# |
Line 1316 returns: nothing
|
Line 1340 returns: nothing
|
}); |
}); |
} |
} |
my $links .= |
my $links .= |
join('->', |
join($crumbsymbol, |
map { |
map { |
$faq = $_->{'faq'} if (exists($_->{'faq'})); |
$faq = $_->{'faq'} if (exists($_->{'faq'})); |
$bug = $_->{'bug'} if (exists($_->{'bug'})); |
$bug = $_->{'bug'} if (exists($_->{'bug'})); |
Line 1335 returns: nothing
|
Line 1359 returns: nothing
|
$result; |
$result; |
} @Crumbs |
} @Crumbs |
); |
); |
$links .= '->' if ($links ne ''); |
$links .= $crumbsymbol if ($links ne ''); |
if ($last->{'no_mt'}) { |
if ($last->{'no_mt'}) { |
$links .= '<b>'.$last->{'text'}.'</b>'; |
$links .= '<b>'.$last->{'text'}.'</b>'; |
} else { |
} else { |
Line 1362 returns: nothing
|
Line 1386 returns: nothing
|
$Str .= $links.'</td>'; |
$Str .= $links.'</td>'; |
# |
# |
if (defined($component)) { |
if (defined($component)) { |
$Str .= '<td class="'.$css_class.'_component">'. |
$Str .= '<td class="'.$css_class.'_component">'; |
&mt($component); |
if ($no_mt) { |
|
$Str .= $component; |
|
} else { |
|
$Str .= &mt($component); |
|
} |
if ($icons ne '') { |
if ($icons ne '') { |
$Str .= ' '.$icons; |
$Str .= ' '.$icons; |
} |
} |
Line 1464 END
|
Line 1492 END
|
return $output; |
return $output; |
} |
} |
|
|
|
sub row_headline { |
|
my $output = <<"END"; |
|
<tr><td colspan="2"> |
|
END |
|
return $output; |
|
} |
|
|
sub row_title { |
sub row_title { |
my ($title,$css_title_class,$css_value_class) = @_; |
my ($title,$css_title_class,$css_value_class) = @_; |
$css_title_class ||= 'LC_pick_box_title'; |
$css_title_class ||= 'LC_pick_box_title'; |
Line 1710 sub course_custom_roles {
|
Line 1745 sub course_custom_roles {
|
|
|
############################################## |
############################################## |
############################################## |
############################################## |
|
|
|
# topic_bar |
|
# |
|
# Generates a div containing a numbered (static image) followed by a title |
|
# with a background color defined in the corresponding CSS: LC_topic_bar |
|
# |
|
sub topic_bar { |
|
my ($imgnum,$title) = @_; |
|
return ' |
|
<div class="LC_topic_bar"> |
|
<img alt="'.&mt('Step [_1]',$imgnum). |
|
'"src="/res/adm/pages/bl_step'.$imgnum.'.gif" /> |
|
<span>'.$title.'</span> |
|
</div> |
|
'; |
|
} |
|
|
|
############################################## |
|
############################################## |
|
|
# echo_form_input |
# echo_form_input |
# |
# |