|
|
cool hack
|
|
|
|
|
|
sent
in the following cool & radical hack...
The PSFV Chameleon
Purpose... you want to have a custom PSFV, that uses the same field names,
and in the same order, but you can now change the current textarea's to
textbox's or radios or checkboxes to shorten the page length and or the
look, and you may want to eliminate one or more of the fields to prevent
users from searching on them or hitting the URL links, or etc., etc. (Search
works the Same). Simple, it takes just 5 minutes.
IN YOUR CGI: copy from your current fields, and then modify them.
my %PSFV_INPUT_WIDGET_DEFINITIONS =
category =>
-DISPLAY_NAME => 'Category',
-TYPE => 'popup_menu',........etc., etc.
my @PSFV_INPUT_WIDGET_DISPLAY_ORDER =
category
co_name
url...........etc., etc.
my @VIEW_DISPLAY_PARAMS =
-APPLICATION_LOGO => 'web_db_logo.gif',
-APPLICATION_LOGO_ALT => 'Search & Add Listings',
* -PSFV_INPUT_WIDGET_DEFINITIONS =>
\%PSFV_INPUT_WIDGET_DEFINITIONS,
* -PSFV_INPUT_WIDGET_DISPLAY_ORDER =>
\@PSFV_INPUT_WIDGET_DISPLAY_ORDER,
-INPUT_WIDGET_DEFINITIONS =>
\%INPUT_WIDGET_DEFINITIONS,
-INPUT_WIDGET_DISPLAY_ORDER =>
\@INPUT_WIDGET_DISPLAY_ORDER,
.......etc., etc.
IN YOUR PSFV.PM (PowerSearchFormView):
sub display
my $self = shift;
my @display_params = @_;
@_ =
arrange([
* -PSFV_INPUT_WIDGET_DEFINITIONS, (remove the -I_W_D)
* -PSFV_INPUT_WIDGET_DISPLAY_ORDER, (remove
the -I_W_D_O)
-SESSION_OBJECT,
],
[
* -PSFV_INPUT_WIDGET_DEFINITIONS, (remove the -I_W_D)
* -PSFV_INPUT_WIDGET_DISPLAY_ORDER, (remove
the -I_W_D_O)
-SCRIPT_NAME,
my $psfv_input_widget_definitions = shift; (remove
the -i_w_d)
my $psfv_input_widget_display_order = shift; (remove
the -i_w_d_o)
my $session = shift;
.......etc., etc.
my $widget;
foreach $widget (@$psfv_input_widget_display_order) {
if ($widget eq 'status') {
.......etc., etc.
else {
my $values_ref = $psfv_input_widget_definitions->{$widget};
my (@values) = _rearrange([
-DISPLAY_NAME,
.......etc., etc.
THAT IS ALL THERE IS TO IT.......
|
|