--- loncom/interface/loncommon.pm 2007/07/03 00:17:42 1.543 +++ 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.543 2007/07/03 00:17:42 albertel Exp $ +# $Id: loncommon.pm,v 1.549 2007/07/11 20:37:52 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -3338,7 +3338,7 @@ sub designparm { =back -=head1 HTTP Helpers +=head1 HTML Helpers =over 4 @@ -3632,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 { @@ -3662,8 +3654,6 @@ sub endbodytag { =pod -=over 4 - =item * &standard_css() Returns a style sheet @@ -3674,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 { @@ -4432,24 +4420,81 @@ 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_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 } =pod -=over 4 - =item * &headtag() Returns a uniform footer for LON-CAPA web pages. @@ -4473,8 +4518,6 @@ Inputs: $title - optional title for the no_auto_mt_title -> prevent &mt()ing the title arg -=back - =cut sub headtag { @@ -4530,16 +4573,12 @@ ADDMETA =pod -=over 4 - =item * &font_settings() Returns neccessary to set the proper encoding Inputs: none -=back - =cut sub font_settings { @@ -4556,16 +4595,12 @@ sub font_settings { =pod -=over 4 - =item * &xml_begin() Returns the needed doctype and Inputs: none -=back - =cut sub xml_begin { @@ -4590,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 { @@ -4608,8 +4639,6 @@ sub endheadtag { =pod -=over 4 - =item * &head() Returns a uniform complete .. section for LON-CAPA web pages. @@ -4617,8 +4646,6 @@ Returns a uniform complete .. -=back - =cut sub head { @@ -4628,8 +4655,6 @@ sub head { =pod -=over 4 - =item * &start_page() Returns a complete .. section for LON-CAPA web pages. @@ -4668,8 +4693,6 @@ Inputs: $title - optional title for the no_auto_mt_title -> prevent &mt()ing the title arg -=back - =cut sub start_page { @@ -4721,8 +4744,6 @@ sub start_page { =pod -=over 4 - =item * &head() Returns a complete section for LON-CAPA web pages. @@ -4880,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 +
field of type hidden to + preserve the value + - a url - in which case the return value is the url with + the neccesary cgi args added to preserve the + inhibitmenu state + - a ref to a url - no return value, but the string is + updated to include the neccessary cgi + args to preserve the inhibitmenu state + +=cut + +sub inhibit_menu_check { + my ($arg) = @_; + &get_unprocessed_cgi($ENV{'QUERY_STRING'}, ['inhibitmenu']); + if ($arg eq 'input') { + if ($env{'form.inhibitmenu'}) { + return ''; + } else { + return + } + } + if ($env{'form.inhibitmenu'}) { + if (ref($arg)) { + $$arg .= '?inhibitmenu='.$env{'form.inhibitmenu'}; + } elsif ($arg eq '') { + $arg .= 'inhibitmenu='.$env{'form.inhibitmenu'}; + } else { + $arg .= '?inhibitmenu='.$env{'form.inhibitmenu'}; + } + } + if (!ref($arg)) { + return $arg; + } +} + ############################################### =pod +=back + +=head1 User Information Routines + +=over 4 + =item * &get_users_function() Used by &bodytag to determine the current users primary role. @@ -5446,6 +5518,12 @@ sub get_secgrprole_info { =pod +=back + +=head1 HTTP Helpers + +=over 4 + =item * get_unprocessed_cgi($query,$possible_names) Modify the %env hash to contain unprocessed CGI form parameters held in