package HTML::Mason::Commands; use strict; use vars qw($m $r); my $_escape = \&HTML::Mason::Parser::_escape_perl_expression; HTML::Mason::Component::FileBased->new ( 'code'=>sub { my %ARGS; if (@_ % 2 == 0) { %ARGS = @_ } else { die "Odd number of parameters passed to component expecting name/value pairs" } my $widget = (!exists $ARGS{'widget'} ? die "no value sent for required parameter 'widget'" : $ARGS{'widget'}); my $object = (!exists $ARGS{'object'} ? die "no value sent for required parameter 'object'" : $ARGS{'object'}); my $disp_field = (!exists $ARGS{'disp_field'} ? die "no value sent for required parameter 'disp_field'" : $ARGS{'disp_field'}); my $use_form_tag = (!exists $ARGS{'use_form_tag'} ? die "no value sent for required parameter 'use_form_tag'" : $ARGS{'use_form_tag'}); my $_out = $m->current_sink; $m->debug_hook($m->current_comp->path) if (%DB::); my $agent = $m->comp("/widgets/util/detectAgent.mc"); my $spacerRow = ($agent->{browser} eq "Internet Explorer") ? '' : ""; my $advanced_search = get_state_data($widget, 'advanced_search') || 0; #--- Arguments ---# $_out->(' '); $_out->(' '); #--- Initialization ---# $_out->(' '); if ($use_form_tag) { $_out->('
'); } $_out->(' '); unless ($advanced_search) { $_out->(' '); } else { $_out->(' '); } $_out->('
SEARCH [ Advanced Search ]ADVANCED SEARCH [ Simple Search ]
'); $_out->( $spacerRow ); $_out->(' '); unless ($advanced_search) { $_out->(' '); } else { $_out->(' '); my @cur = localtime; $cur[5] += 1900; $cur[4]++; my $today = sprintf('%04d-%02d-%02d %02d:%02d:%02d', @cur[5,4,3,2,1,0]); $_out->(' '); } $_out->('
'); $m->comp('/widgets/profile/text.mc', name => $widget.'|simple', value => get_state_data($widget, 'simple') || '', useTable => 0); $_out->('
Name: '); $m->comp('/widgets/profile/text.mc', name => $widget.'|name', value => get_state_data($widget, 'name') || '', useTable => 0); $_out->('
File Name: '); $m->comp('/widgets/profile/text.mc', name => $widget.'|file_name', value => get_state_data($widget, 'file_name') || '', useTable => 0); $_out->('
Cover Date
From: '); $m->comp('/widgets/select_time/select_time.mc', base_name => "$widget|cover_date_start", indent => 1, no_hour => 1, no_min => 1, repopulate => 0, def_date => get_state_data($widget, 'cover_date_start')||'',, compact => 1, style => 'inline',); $_out->(' To: '); $m->comp('/widgets/select_time/select_time.mc', base_name => "$widget|cover_date_end", indent => 1, no_hour => 1, no_min => 1, repopulate => 0, def_date => get_state_data($widget, 'cover_date_end')||'',, compact => 1, style => 'inline',); $_out->('
Publish Date
From: '); $m->comp('/widgets/select_time/select_time.mc', base_name => "$widget|publish_date_start", indent => 1, no_hour => 1, no_min => 1, repopulate => 0, def_date => get_state_data($widget, 'publish_date_start')||'',, compact => 1, style => 'inline',); $_out->(' To: '); $m->comp('/widgets/select_time/select_time.mc', base_name => "$widget|publish_date_end", indent => 1, no_hour => 1, no_min => 1, repopulate => 0, def_date => get_state_data($widget, 'publish_date_end')||'',, compact => 1, style => 'inline',); $_out->('
Expire Date
From: '); $m->comp('/widgets/select_time/select_time.mc', base_name => "$widget|expire_date_start", indent => 1, no_hour => 1, no_min => 1, repopulate => 0, def_date => get_state_data($widget, 'expire_date_start')||'',, compact => 1, style => 'inline',); $_out->(' To: '); $m->comp('/widgets/select_time/select_time.mc', base_name => "$widget|expire_date_end", indent => 1, no_hour => 1, no_min => 1, repopulate => 0, def_date => get_state_data($widget, 'expire_date_end')||'',, compact => 1, style => 'inline',); $_out->('
'); if ($advanced_search) { $_out->('

'); } #--- Log History ---# if ($use_form_tag) { $_out->('
'); } return undef; }, 'create_time'=>1001670174, 'declared_args'=> { '$use_form_tag' => { 'default' => undef }, '$widget' => { 'default' => undef }, '$disp_field' => { 'default' => undef }, '$object' => { 'default' => undef } }, 'object_size'=>7032, 'parser_version'=>0.8 ) ;