Skip to content
Permalink
Browse files

Remove more deprecated Form code.

  • Loading branch information...
perlDreamer committed Nov 24, 2011
1 parent 01a1558 commit bcc81e906c6d17d1b79504c8eacfd1ffcec6902b
Showing with 16 additions and 8 deletions.
  1. +6 −3 lib/WebGUI/Asset/Wobject/WikiMaster.pm
  2. +2 −1 lib/WebGUI/Form.pm
  3. +8 −4 lib/WebGUI/Role/Asset/Comments.pm
@@ -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;
@@ -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;
@@ -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>';
}

0 comments on commit bcc81e9

Please sign in to comment.
You can’t perform that action at this time.