Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Remove more deprecated Form code.
  • Loading branch information
perlDreamer committed Nov 24, 2011
1 parent 01a1558 commit bcc81e9
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
9 changes: 6 additions & 3 deletions lib/WebGUI/Asset/Wobject/WikiMaster.pm
Expand Up @@ -344,11 +344,14 @@ sub appendSearchBoxVars {
my $var = shift;
my $queryText = shift;
my $submitText = WebGUI::International->new($self->session, 'Asset_WikiMaster')->get('searchLabel');
use WebGUI::Form::Hidden;
use WebGUI::Form::Text;
use WebGUI::Form::Submit;
$var->{'searchFormHeader'} = join '',
(WebGUI::Form::formHeader($self->session, { action => $self->getUrl, method => 'GET', }),
WebGUI::Form::hidden($self->session, { name => 'func', value => 'search' }));
$var->{'searchQuery'} = WebGUI::Form::text($self->session, { name => 'query', value => $queryText });
$var->{'searchSubmit'} = WebGUI::Form::submit($self->session, { value => $submitText });
WebGUI::Form::Hidden->new($self->session, { name => 'func', value => 'search' })->toHtml);
$var->{'searchQuery'} = WebGUI::Form::Text($self->session, { name => 'query', value => $queryText })->toHtml;
$var->{'searchSubmit'} = WebGUI::Form::Submit($self->session, { value => $submitText }->toHtml);
$var->{'searchFormFooter'} = WebGUI::Form::formFooter($self->session);
$var->{'canAddPages'} = $self->canEditPages();
return $self;
Expand Down
3 changes: 2 additions & 1 deletion lib/WebGUI/Form.pm
Expand Up @@ -144,7 +144,8 @@ sub formHeader {
my $enctype = (exists $params->{enctype} && $params->{enctype} ne "") ? $params->{enctype} : "multipart/form-data";

# Fix a query string in the action URL
my $hidden = csrfToken($session);
use WebGUI::Form::CsrfToken;
my $hidden = WebGUI::Form::CsrfToken->new($session)->toHtml;
if ($action =~ /\?/) {
($action, my $query) = split /\?/, $action, 2;
my @params = split /[&;]/, $query;
Expand Down
12 changes: 8 additions & 4 deletions lib/WebGUI/Role/Asset/Comments.pm
Expand Up @@ -219,12 +219,16 @@ sub getFormattedComments {
$out .= q{<b>}.$comment->{alias}.q{:</b> "}.WebGUI::HTML::format($comment->{comment},'text').q{"</div>};
}
if ($self->canComment) {
use WebGUI::Form::Hidden;
use WebGUI::Form::Textarea;
use WebGUI::Form::CommentRating;
use WebGUI::Form::Submit;
$out .= '<div class="assetAspectCommentForm">';
$out .= WebGUI::Form::formHeader($session, {action=>$self->getUrl});
$out .= WebGUI::Form::hidden($session, {name=>"func",value=>"addComment"});
$out .= WebGUI::Form::textarea($session, {name=>"comment"});
$out .= WebGUI::Form::commentRating($session, {name=>"rating"});
$out .= WebGUI::Form::submit($session);
$out .= WebGUI::Form::Hidden->new($session, {name=>"func",value=>"addComment"})->toHtml;
$out .= WebGUI::Form::Textarea->new($session, {name=>"comment"})->toHtml;
$out .= WebGUI::Form::CommentRating->new($session, {name=>"rating"})->toHtml;
$out .= WebGUI::Form::Submit->new($session)->toHtml;
$out .= WebGUI::Form::formFooter($session);
$out .= '</div>';
}
Expand Down

0 comments on commit bcc81e9

Please sign in to comment.