Skip to content

Commit bcc81e9

Browse files
committedNov 24, 2011
Remove more deprecated Form code.
1 parent 01a1558 commit bcc81e9

File tree

3 files changed

+16
-8
lines changed

3 files changed

+16
-8
lines changed
 

‎lib/WebGUI/Asset/Wobject/WikiMaster.pm

+6-3
Original file line numberDiff line numberDiff line change
@@ -344,11 +344,14 @@ sub appendSearchBoxVars {
344344
my $var = shift;
345345
my $queryText = shift;
346346
my $submitText = WebGUI::International->new($self->session, 'Asset_WikiMaster')->get('searchLabel');
347+
use WebGUI::Form::Hidden;
348+
use WebGUI::Form::Text;
349+
use WebGUI::Form::Submit;
347350
$var->{'searchFormHeader'} = join '',
348351
(WebGUI::Form::formHeader($self->session, { action => $self->getUrl, method => 'GET', }),
349-
WebGUI::Form::hidden($self->session, { name => 'func', value => 'search' }));
350-
$var->{'searchQuery'} = WebGUI::Form::text($self->session, { name => 'query', value => $queryText });
351-
$var->{'searchSubmit'} = WebGUI::Form::submit($self->session, { value => $submitText });
352+
WebGUI::Form::Hidden->new($self->session, { name => 'func', value => 'search' })->toHtml);
353+
$var->{'searchQuery'} = WebGUI::Form::Text($self->session, { name => 'query', value => $queryText })->toHtml;
354+
$var->{'searchSubmit'} = WebGUI::Form::Submit($self->session, { value => $submitText }->toHtml);
352355
$var->{'searchFormFooter'} = WebGUI::Form::formFooter($self->session);
353356
$var->{'canAddPages'} = $self->canEditPages();
354357
return $self;

‎lib/WebGUI/Form.pm

+2-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,8 @@ sub formHeader {
144144
my $enctype = (exists $params->{enctype} && $params->{enctype} ne "") ? $params->{enctype} : "multipart/form-data";
145145

146146
# Fix a query string in the action URL
147-
my $hidden = csrfToken($session);
147+
use WebGUI::Form::CsrfToken;
148+
my $hidden = WebGUI::Form::CsrfToken->new($session)->toHtml;
148149
if ($action =~ /\?/) {
149150
($action, my $query) = split /\?/, $action, 2;
150151
my @params = split /[&;]/, $query;

‎lib/WebGUI/Role/Asset/Comments.pm

+8-4
Original file line numberDiff line numberDiff line change
@@ -219,12 +219,16 @@ sub getFormattedComments {
219219
$out .= q{<b>}.$comment->{alias}.q{:</b> "}.WebGUI::HTML::format($comment->{comment},'text').q{"</div>};
220220
}
221221
if ($self->canComment) {
222+
use WebGUI::Form::Hidden;
223+
use WebGUI::Form::Textarea;
224+
use WebGUI::Form::CommentRating;
225+
use WebGUI::Form::Submit;
222226
$out .= '<div class="assetAspectCommentForm">';
223227
$out .= WebGUI::Form::formHeader($session, {action=>$self->getUrl});
224-
$out .= WebGUI::Form::hidden($session, {name=>"func",value=>"addComment"});
225-
$out .= WebGUI::Form::textarea($session, {name=>"comment"});
226-
$out .= WebGUI::Form::commentRating($session, {name=>"rating"});
227-
$out .= WebGUI::Form::submit($session);
228+
$out .= WebGUI::Form::Hidden->new($session, {name=>"func",value=>"addComment"})->toHtml;
229+
$out .= WebGUI::Form::Textarea->new($session, {name=>"comment"})->toHtml;
230+
$out .= WebGUI::Form::CommentRating->new($session, {name=>"rating"})->toHtml;
231+
$out .= WebGUI::Form::Submit->new($session)->toHtml;
228232
$out .= WebGUI::Form::formFooter($session);
229233
$out .= '</div>';
230234
}

0 commit comments

Comments
 (0)
Please sign in to comment.