--- loncom/interface/lonhtmlcommon.pm 2012/04/05 15:56:13 1.308 +++ loncom/interface/lonhtmlcommon.pm 2012/04/16 19:24:59 1.309 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common html routines # -# $Id: lonhtmlcommon.pm,v 1.308 2012/04/05 15:56:13 raeburn Exp $ +# $Id: lonhtmlcommon.pm,v 1.309 2012/04/16 19:24:59 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. @@ -926,7 +971,7 @@ Inputs 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 +991,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 +1013,7 @@ Inputs: Returns: none -=item Close_PrgWin +=item &Close_PrgWin() Closes the progress window. @@ -1494,7 +1539,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 +1557,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 +1720,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 +1763,7 @@ returns: nothing push @{$tools{$category}}, @html; } -=item clear_breadcrumb_tools() +=item &clear_breadcrumb_tools() Clears the breadcrumb toolbar container. @@ -1730,7 +1775,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 +1784,7 @@ input: \$breadcrumbs - a reference to th breadcrumbs. returns: nothing + =cut #TODO might split this in separate functions for each category @@ -1754,7 +1800,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 +1811,7 @@ input: \$breadcrumbs - a reference to th breadcrumbs (after render_tools call). returns: nothing + =cut sub render_advtools { @@ -2763,8 +2812,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. @@ -2890,7 +2940,7 @@ sub generate_menu { =pod -=item &start_funclist +=item &start_funclist() Start list of available functions @@ -2930,7 +2980,7 @@ sub start_funclist { =pod -=item &add_item_funclist +=item &add_item_funclist() Adds an item to the list of available functions @@ -2956,7 +3006,7 @@ sub add_item_funclist { =pod -=item &end_funclist +=item &end_funclist() End list of available functions @@ -2977,7 +3027,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