--- loncom/interface/lonhtmlcommon.pm 2012/04/04 10:47:29 1.307
+++ loncom/interface/lonhtmlcommon.pm 2012/05/02 18:01:53 1.311
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# a pile of common html routines
#
-# $Id: lonhtmlcommon.pm,v 1.307 2012/04/04 10:47:29 foxr Exp $
+# $Id: lonhtmlcommon.pm,v 1.311 2012/05/02 18:01:53 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -103,7 +103,7 @@ sub direct_parm_link {
##############################################
##############################################
-=item confirm_success
+=item &confirm_success()
Successful completion of an operation message
@@ -129,7 +129,7 @@ sub confirm_success {
=pod
-=item dragmath_button
+=item &dragmath_button()
Creates a button that launches a dragmath popup-window, in which an
expression can be edited and pasted as LaTeX into a specified textarea.
@@ -155,10 +155,11 @@ ENDDRAGMATH
=pod
-=item dragmath_js
+=item &dragmath_js()
Javascript used to open pop-up window containing dragmath applet which
can be used to paste LaTeX into a textarea.
+
=cut
sub dragmath_js {
@@ -177,13 +178,57 @@ sub dragmath_js {
ENDDRAGMATHJS
}
+##############################################
+##############################################
+
+=pod
+
+=item &dependencies_button()
+
+Creates a button that launches a popup-window, in which dependencies
+for the web page in the main window can be added to, replaced or deleted.
+
+=cut
+
+sub dependencies_button {
+ my $buttontext=&mt('Manage Dependencies');
+ return <<"END";
+
+END
+}
+
+##############################################
+
+=pod
+
+=item &dependencycheck_js()
+
+Javascript used to open pop-up window containing interface to manage
+dependencies for a web page uploaded diretcly to a course.
+
+=cut
+
+sub dependencycheck_js {
+ my ($symb,$title) = @_;
+ my $link = '/adm/dependencies?symb='.&HTML::Entities::encode($symb,'<>&"').
+ '&title='.&HTML::Entities::encode($title,'<>&"');
+ return <
+ //
+
+ENDJS
+}
##############################################
##############################################
=pod
-=item authorbombs
+=item &authorbombs()
=cut
@@ -317,7 +362,7 @@ sub get_recent_frozen {
=pod
-=item textbox
+=item &textbox()
=cut
@@ -337,7 +382,7 @@ sub textbox {
=pod
-=item checkbox
+=item &checkbox()
=cut
@@ -359,7 +404,7 @@ sub checkbox {
=pod
-=item radiobutton
+=item &radiobutton()
=cut
@@ -383,10 +428,10 @@ sub radio {
=pod
-=item &date_setter
+=item &date_setter()
&date_setter returns html and javascript for a compact date-setting form.
-To retrieve values from it, use &get_date_from_form().
+To retrieve values from it, use &get_date_from_form.
Inputs
@@ -636,7 +681,7 @@ sub build_url {
=pod
-=item &get_date_from_form
+=item &get_date_from_form()
get_date_from_form retrieves the date specified in an &date_setter form.
@@ -895,7 +940,7 @@ of items completed and an estimate of th
=over 4
-=item &Create_PrgWin
+=item &Create_PrgWin()
Writes javascript to the client to open a progress window and returns a
data structure used for bookkeeping.
@@ -906,27 +951,14 @@ Inputs
=item $r Apache request
-=item $title The title of the progress window
-
-=item $heading A description (usually 1 line) of the process being initiated.
-
=item $number_to_do The total number of items being processed.
-=item $type Either 'popup' or 'inline' (popup is assumed if nothing is
- specified)
-
-=item $width Specify the width in charaters of the input field.
-
-=item $formname Only useful in the inline case, if a form already exists, this needs to be used and specfiy the name of the form, otherwise the Progress line will be created in a new form of it's own
-
-=item $inputname Only useful in the inline case, if a form and an input of type text exists, use this to specify the name of the input field
-
=back
Returns a hash containing the progress state data structure.
-=item &Update_PrgWin
+=item &Update_PrgWin()
Updates the text in the progress indicator. Does not increment the count.
See &Increment_PrgWin.
@@ -946,7 +978,7 @@ Inputs:
Returns: none
-=item Increment_PrgWin
+=item Increment_PrgWin()
Increment the count of items completed for the progress window by $step or 1 if no step is provided.
@@ -968,7 +1000,7 @@ Inputs:
Returns: none
-=item Close_PrgWin
+=item &Close_PrgWin()
Closes the progress window.
@@ -1176,8 +1208,8 @@ ENDEDITOR
-
-
+
+
ENDJQUERY
return $s;
}
@@ -1494,7 +1526,7 @@ clientTime = (new Date()).getTime();
=pod
-=item breadcrumbs
+=item &breadcrumbs()
Compiles the previously registered breadcrumbs into an series of links.
Additionally supports a 'component', which will be displayed on the
@@ -1512,11 +1544,11 @@ Inputs: $component (the text on the righ
when including the text on the right.
Returns a string containing breadcrumbs for the current page.
-=item clear_breadcrumbs
+=item &clear_breadcrumbs()
Clears the previously stored breadcrumbs.
-=item add_breadcrumb
+=item &add_breadcrumb()
Pushes a breadcrumb on the stack of crumbs.
@@ -1675,7 +1707,7 @@ returns: nothing
push(@Crumbs,@_);
}
-=item add_breadcrumb_tool($category, $html)
+=item &add_breadcrumb_tool($category, $html)
Adds $html to $category of the breadcrumb toolbar container.
@@ -1718,7 +1750,7 @@ returns: nothing
push @{$tools{$category}}, @html;
}
-=item clear_breadcrumb_tools()
+=item &clear_breadcrumb_tools()
Clears the breadcrumb toolbar container.
@@ -1730,7 +1762,7 @@ returns: nothing
undef(%tools);
}
-=item render_tools(\$breadcrumbs)
+=item &render_tools(\$breadcrumbs)
Creates html for breadcrumb tools (categories navigation and tools) and inserts
\$breadcrumbs at the correct position.
@@ -1739,6 +1771,7 @@ input: \$breadcrumbs - a reference to th
breadcrumbs.
returns: nothing
+
=cut
#TODO might split this in separate functions for each category
@@ -1754,7 +1787,9 @@ returns: nothing
{ listattr => { class=>'LC_breadcrumb_tools_outerlist' } });
}
-=item render_advtools(\$breadcrumbs)
+=pod
+
+=item &render_advtools(\$breadcrumbs)
Creates html for advanced tools (category advtools) and inserts \$breadcrumbs
at the correct position.
@@ -1763,6 +1798,7 @@ input: \$breadcrumbs - a reference to th
breadcrumbs (after render_tools call).
returns: nothing
+
=cut
sub render_advtools {
@@ -2763,8 +2799,9 @@ sub scripttag {
return htmltag('script', $content, {type => 'text/javascript'});
};
+=pod
-=item list_from_array( \@array, { listattr =>{}, itemattr =>{} } )
+=item &list_from_array( \@array, { listattr =>{}, itemattr =>{} } )
Constructs a XHTML list from \@array.
@@ -2855,7 +2892,8 @@ sub generate_menu {
$$link{alttext} : $$link{linktext})
}), {
href => $$link{url},
- title => mt($$link{linktitle})
+ title => mt($$link{linktitle}),
+ class => 'LC_menubuttons_link'
}).
$a->(mt($$link{linktext}), {
href => $$link{url},
@@ -2889,7 +2927,7 @@ sub generate_menu {
=pod
-=item &start_funclist
+=item &start_funclist()
Start list of available functions
@@ -2929,7 +2967,7 @@ sub start_funclist {
=pod
-=item &add_item_funclist
+=item &add_item_funclist()
Adds an item to the list of available functions
@@ -2955,7 +2993,7 @@ sub add_item_funclist {
=pod
-=item &end_funclist
+=item &end_funclist()
End list of available functions
@@ -2976,7 +3014,7 @@ sub end_funclist {
=pod
-=item funclist_from_array( \@array, {legend => 'text for legend'} )
+=item &funclist_from_array( \@array, {legend => 'text for legend'} )
Constructs a XHTML list from \@array with the first item being visually
highlighted and set to the value of legend or 'Functions' if legend is