[AppWrap-cvs] AppWrap/Apache/AppWrap Doorknob.pm,1.15,1.16 GetPage.pm,1.9,1.10 POST2GET.pm,1.3,1.4 S
Status: Beta
Brought to you by:
planetman
From: <pla...@us...> - 2003-08-26 05:24:54
|
Update of /cvsroot/appwrap/AppWrap/Apache/AppWrap In directory sc8-pr-cvs1:/tmp/cvs-serv20689 Modified Files: Doorknob.pm GetPage.pm POST2GET.pm Subs.pm Log Message: many minor bug fixes and documentation updates. Welcome back. Index: Doorknob.pm =================================================================== RCS file: /cvsroot/appwrap/AppWrap/Apache/AppWrap/Doorknob.pm,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** Doorknob.pm 19 Jan 2003 23:29:24 -0000 1.15 --- Doorknob.pm 25 Aug 2003 14:00:35 -0000 1.16 *************** *** 61,64 **** --- 61,68 ---- my %opts; + # load my_defaults before my_tables so that we have default + # values when required. + $opts{my_defaults} = Apache::AppWrap::Subs::get_my_defaults(); + # get the contents of table:my_tables. Its OK that %opts is # currently empty, my_tables stores a ref in it *************** *** 79,83 **** $opts{my_columns} = Apache::AppWrap::Subs::get_my_columns(\%opts); # $opts{my_exceptions}= Apache::AppWrap::Subs::get_my_exceptions(); - $opts{my_defaults} = Apache::AppWrap::Subs::get_my_defaults(); # enforce some rules for tables. These are directives --- 83,86 ---- Index: GetPage.pm =================================================================== RCS file: /cvsroot/appwrap/AppWrap/Apache/AppWrap/GetPage.pm,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** GetPage.pm 10 Dec 2002 12:04:53 -0000 1.9 --- GetPage.pm 25 Aug 2003 14:00:35 -0000 1.10 *************** *** 703,707 **** my @book; my $chpt_guide = $args->{chpt_guide}; ! if ($chpt_guide eq 'pod') { # here get the list of PODs using Pod::Find::find_pod my $pod_list = $args->{pod_list} || pod_list($opts); --- 703,707 ---- my @book; my $chpt_guide = $args->{chpt_guide}; ! if ($chpt_guide && $chpt_guide eq 'pod') { # here get the list of PODs using Pod::Find::find_pod my $pod_list = $args->{pod_list} || pod_list($opts); Index: POST2GET.pm =================================================================== RCS file: /cvsroot/appwrap/AppWrap/Apache/AppWrap/POST2GET.pm,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** POST2GET.pm 1 Dec 2002 01:08:28 -0000 1.3 --- POST2GET.pm 25 Aug 2003 14:00:35 -0000 1.4 *************** *** 29,37 **** and put this line in the mod_perl startup file: ! use Apache::AppWrap::POST2GET; =head1 DESCRIPTION ! Apache::AppWrap::POST2GET converts all POST parameters into GET style query string arguments. It declines to handle all non-POST requests. Afterconverting the arguments and setting the METHOD to C<POST> it then returns OK, thus passing control to the next phase in the Apache request lifecycle. =head1 EXPORT --- 29,37 ---- and put this line in the mod_perl startup file: ! use Apache::AppWrap::POST2GET (); =head1 DESCRIPTION ! Apache::AppWrap::POST2GET converts all POST parameters into GET style query string arguments. It declines to handle all non-POST requests. After converting the arguments and setting the METHOD to C<POST> it then returns OK, thus passing control to the next phase in the Apache request lifecycle. =head1 EXPORT Index: Subs.pm =================================================================== RCS file: /cvsroot/appwrap/AppWrap/Apache/AppWrap/Subs.pm,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** Subs.pm 19 Jan 2003 23:29:24 -0000 1.37 --- Subs.pm 25 Aug 2003 14:00:35 -0000 1.38 *************** *** 1558,1565 **** $img = $img_dir if $img_dir; $img .= '/' . $config{images} . '/favicon.ico"'; - #$log->debug("\nWebify: img=$img"); $icon = '<link rel="shortcut icon" href="' . $img; $icon .= ' type="' . $my_defaults->{favicontype}; ! $icon .= '" />' . $HNL; } # print the opening html --- 1558,1564 ---- $img = $img_dir if $img_dir; $img .= '/' . $config{images} . '/favicon.ico"'; $icon = '<link rel="shortcut icon" href="' . $img; $icon .= ' type="' . $my_defaults->{favicontype}; ! $icon = '" title="Favorite" />' . $HNL; } # print the opening html *************** *** 2061,2067 **** ############################### sub get_my_tables { ! my $opts = shift; ! my %my_tables; ! my $ref = sqlSelectArrayRef('*', 'my_tables'); foreach my $row (@$ref) { --- 2060,2070 ---- ############################### sub get_my_tables { ! my $opts = shift; ! my %my_tables; ! my $ref = sqlSelectArrayRef('*', 'my_tables'); ! my $log = Apache->request->log; ! my $test; ! # my $test = join (", ", map {$_ . '=' . $args->{$_} } %$args); ! #$log->debug("\nget_my_tqbles: args=$test"); foreach my $row (@$ref) { *************** *** 2069,2072 **** --- 2072,2091 ---- $my_tables{$tablename}{$admin_name} = $admin_value; } + + ############################## + # here we will fudge just a bit. Want to get all text labels + # from table:my_text. Formerly thay have been sourced from + # table:my_tables. By poking the labels from my_text into the + # my_tables data structure, we avoid having to recode the whole + # AppWrap lot. This is good. + ############################## + my $my_text = $opts->{my_text}; + $my_text ||= get_my_text($opts); + $opts->{my_text} = $my_text; + # foreach my $tablename (%$my_text) { + # foreach my $tablename (%$my_text) { + # } + + # while we are here, lets store a list of all valid tables my @valid_tables; *************** *** 2120,2123 **** --- 2139,2143 ---- my ($opts, $args) = @_; my $text; + my $test; # get the language for this request. Precedence is %args, then *************** *** 2131,2140 **** my $r = Apache->request; my $log = $r->log; ! # my $test = join (", ", map {$_ . '=' . $args->{$_} } %$args); #$log->debug("\nget_my_text: args=$test"); my $user = $r->pnotes('authed_email'); unless ($lang) { $text = $r->as_string; ! $r->log_error("get_my_text: request: $text"); return SERVER_ERROR; } --- 2151,2160 ---- my $r = Apache->request; my $log = $r->log; ! $test = join (", ", map {$_ . '=' . $args->{$_} } %$args); #$log->debug("\nget_my_text: args=$test"); my $user = $r->pnotes('authed_email'); unless ($lang) { $text = $r->as_string; ! # $r->log_error("get_my_text: request: $text"); return SERVER_ERROR; } *************** *** 2147,2151 **** s/^lang_// } keys %{ $config{column_meta}{my_text} }; ! #my $test = join(", ", @lang_cols); #$log->debug("\nget_my_text: langs=$test"); unless (grep(/$lang/, @languages)) { --- 2167,2171 ---- s/^lang_// } keys %{ $config{column_meta}{my_text} }; ! #$test = join(", ", @languages); #$log->debug("\nget_my_text: langs=$test"); unless (grep(/$lang/, @languages)) { *************** *** 4458,4468 **** $my_text ||= get_my_text ($opts, \%my_text_args); $opts->{my_text} ||= $my_text; ! unless ($my_text && scalar(keys %$my_text)) { ! my $text = 'get_display_text: did not load row data from'; ! $text .= ' table my_text'; ! $r->log_error($text); ! return SERVER_ERROR; ! } my %msgs; --- 4478,4489 ---- $my_text ||= get_my_text ($opts, \%my_text_args); $opts->{my_text} ||= $my_text; + #$log->debug("\nget_display_text: my_text=$my_text"); ! # unless ($my_text && scalar(keys %$my_text)) { ! # my $text = 'get_display_text: did not load row data from'; ! # $text .= ' table my_text'; ! # $r->log_error($text); ! # return SERVER_ERROR; ! # } my %msgs; *************** *** 4513,4516 **** --- 4534,4538 ---- my $log = Apache->request->log; + my $test; # this bit probably belongs in an initialization handler # primary importance is the requested URI. If it includes *************** *** 4525,4532 **** --- 4547,4557 ---- # a preferred language, consult my_tables for a language $language ||= $opts->{my_tables}{language}; + #$test = scalar(keys %{ $opts->{my_tables} }); + #$log->debug("\nget_language: my_tables=$test"); # lastly, if all the above have still not yielded a language, # use my_defaults $language ||= $opts->{my_defaults}{language}; + #$test = scalar(keys %{ $opts->{my_defaults} }); #$log->debug("\nget_language: language=$language"); return $language |