--- loncom/interface/loncommon.pm 2007/07/02 03:36:28 1.541 +++ loncom/interface/loncommon.pm 2007/07/11 20:37:52 1.549 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common routines # -# $Id: loncommon.pm,v 1.541 2007/07/02 03:36:28 raeburn Exp $ +# $Id: loncommon.pm,v 1.549 2007/07/11 20:37:52 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -240,7 +240,7 @@ Inputs: formname, elementname formname and elementname specify the name of the html form and the name of the element the selection from the search results will be placed in. -=back + =cut sub browser_and_searcher_javascript { @@ -524,7 +524,8 @@ function uncheckAll(field) { if (field.length > 0) { for (i = 0; i < field.length; i++) { field[i].checked = false ; - } } else { + } + } else { field.checked = false ; } } @@ -1078,7 +1079,7 @@ sub changable_area { =pod =back - + =head1 Excel and CSV file utility routines =over 4 @@ -1212,7 +1213,7 @@ sub create_workbook { =item * create_text_file -Create a file to write to and eventually make available to the usre. +Create a file to write to and eventually make available to the user. If file creation fails, outputs an error message on the request object and return undefs. @@ -2119,6 +2120,19 @@ sub getnames { } } +# -------------------------------------------------------------------- getemails +=pod + +=item * getemails($uname,$udom) + +Gets a user's email information and returns it as a hash with keys: +notification, critnotification, permanentemail + +For notification and critnotification, values are comma-separated lists +of e-mail address(es); for permanentemail, value is a single e-mail address. + +=cut + sub getemails { my ($uname,$udom)=@_; if ($udom eq 'public' && $uname eq 'public') { @@ -3324,7 +3338,7 @@ sub designparm { =back -=head1 HTTP Helpers +=head1 HTML Helpers =over 4 @@ -3618,20 +3632,12 @@ sub make_attr_string { =pod -=back - -=head1 HTML Helpers - -=over 4 - =item * &endbodytag() Returns a uniform footer for LON-CAPA web pages. Inputs: none -=back - =cut sub endbodytag { @@ -3648,8 +3654,6 @@ sub endbodytag { =pod -=over 4 - =item * &standard_css() Returns a style sheet @@ -3660,8 +3664,6 @@ Inputs: (all optional) function -> force usage of a specific rolish color scheme bgcolor -> override the default page bgcolor -=back - =cut sub standard_css { @@ -3733,6 +3735,10 @@ form, .inline { display: inline; } .LC_diff_added { color: green; } +.LC_unknown { + color: yellow; +} + .LC_icon { border: 0px; } @@ -3740,6 +3746,11 @@ form, .inline { display: inline; } border: 0px; height: 22px; } +.LC_docs_spacer { + width: 25px; + height: 1px; + border: 0px; +} .LC_internal_info { color: #999; @@ -4409,7 +4420,74 @@ table.LC_prior_match tr td { } span.LC_nobreak { - white-space: nowrap; + white-space: nowrap; +} + +table.LC_docs_documents { + background: #BBBBBB; + border-width: 0px; + border-collapse: collapse; +} + +table.LC_docs_documents td.LC_docs_document { + border: 2px solid black; + padding: 4px; +} + +.LC_docs_course_commands div { + float: left; + border: 4px solid #AAAAAA; + padding: 4px; + background: #DDDDCC; +} + +.LC_docs_entry_move { + border: 0px; + border-collapse: collapse; +} + +.LC_docs_entry_move td { + border: 2px solid #BBBBBB; + background: #DDDDDD; +} + +.LC_docs_editor td.LC_docs_entry_commands { + background: #DDDDDD; + font-size: x-small; +} +.LC_docs_copy { + color: #000099; +} +.LC_docs_cut { + color: #550044; +} +.LC_docs_rename { + color: #009900; +} +.LC_docs_remove { + color: #990000; +} + +.LC_docs_reinit_warn, +.LC_docs_ext_edit { + font-size: x-small; +} + +.LC_docs_editor td.LC_docs_entry_title, +.LC_docs_editor td.LC_docs_entry_icon { + background: #FFFFBB; +} +.LC_docs_editor td.LC_docs_entry_parameter { + background: #BBBBFF; + font-size: x-small; + white-space: nowrap; +} + +table.LC_docs_adddocs td, +table.LC_docs_adddocs th { + border: 1px solid #BBBBBB; + padding: 4px; + background: #DDDDDD; } END @@ -4417,8 +4495,6 @@ END =pod -=over 4 - =item * &headtag() Returns a uniform footer for LON-CAPA web pages. @@ -4442,8 +4518,6 @@ Inputs: $title - optional title for the no_auto_mt_title -> prevent &mt()ing the title arg -=back - =cut sub headtag { @@ -4499,16 +4573,12 @@ ADDMETA =pod -=over 4 - =item * &font_settings() Returns neccessary to set the proper encoding Inputs: none -=back - =cut sub font_settings { @@ -4525,16 +4595,12 @@ sub font_settings { =pod -=over 4 - =item * &xml_begin() Returns the needed doctype and Inputs: none -=back - =cut sub xml_begin { @@ -4559,16 +4625,12 @@ sub xml_begin { =pod -=over 4 - =item * &endheadtag() Returns a uniform for LON-CAPA web pages. Inputs: none -=back - =cut sub endheadtag { @@ -4577,8 +4639,6 @@ sub endheadtag { =pod -=over 4 - =item * &head() Returns a uniform complete
.. section for LON-CAPA web pages. @@ -4586,8 +4646,6 @@ Returns a uniform complete .. -=back - =cut sub head { @@ -4597,8 +4655,6 @@ sub head { =pod -=over 4 - =item * &start_page() Returns a complete .. section for LON-CAPA web pages. @@ -4637,8 +4693,6 @@ Inputs: $title - optional title for the no_auto_mt_title -> prevent &mt()ing the title arg -=back - =cut sub start_page { @@ -4690,8 +4744,6 @@ sub start_page { =pod -=over 4 - =item * &head() Returns a complete section for LON-CAPA web pages. @@ -4849,10 +4901,61 @@ sub simple_error_page { } } +=pod + +=item * &inhibit_menu_check($arg) + +Checks for a inhibitmenu state and generates output to preserve it + +Inputs: $arg - can be any of + - undef - in which case the return value is a string + to add into arguments list of a uri + - 'input' - in which case the return value is a HTML +