Apache-Wyrd

 view release on metacpan or  search on metacpan

Wyrd/Site/GDButton.pm  view on Meta::CPAN

		#Shrink it down to 1/5 the rendered size.
		my $final = GD::Image->new($self->{'width'}, $self->{'height'});
		$final->copyResampled($image, 0, 0, 0, 0, $self->{'width'}, $self->{'height'}, $self->{'width'} * 5, $self->{'height'} * 5);
		
		open FILE, "> " . $self->{'outfile'};
		binmode FILE;
		print FILE ($self->{'outfile'}=~/gif$/) ? $final->gif : $final->png;
		close FILE;
	}

	#attempt to preserve any normal IMG or INPUT attributes
	my @attrs =  qw(name id action method alt src align onmouseover onmouseout onclick border height width ismap longdesc usemap class style);
	my %attrs =  map {$_ => $self->{$_}} @attrs;
	$attrs{'src'} = Apache::Util::escape_uri($attrs{'src'});
	if ($self->{'type'} eq 'input') {
		$self->_data(q(<input type="image") . $self->_attribute_template(@attrs) . q(>));
	} else {#consider anything else as an image tag.
		$self->_data(q(<img) . $self->_attribute_template(@attrs) . q(>));
	}
	return $self->_set(\%attrs);
}

Wyrd/Site/SearchResults.pm  view on Meta::CPAN

=item relevance

The generic, unweighted relevance score, based on a function of word-incidents
to document size (wordcount).

=back

To allow the individual items of the "search results" block to be related to
each other.  Additionally, if a previous search result is given in the CGI
variable "previous" and the CGI variable "within" is a non-null value (as would
be returned by a hidden INPUT tag named "previous" and a checkbox named "within",
The searcstring will be limited to the previous results.

Additionally, the CGI variable "max" is used to limit the search results to
"max" number of items or less, and the "next" and "beginning" CGI variables are
used to define a window of "max" number of of search results within a search
set, which is to say that as the frame moves to the window defined by "next",
the C<Apache::Wyrd::Intefaces::Setter> elements will set C<$:next> in the list
template to the current value of the CGI variable "next" + the value of "max".
This allows the webmaster to easily construct a moving-window search result.



( run in 0.456 second using v1.01-cache-2.11-cpan-c6e0e5ac2a7 )