Konstrukt

 view release on metacpan or  search on metacpan

lib/Konstrukt/Doc/PluginList.pod  view on Meta::CPAN

			var result = '';
			for(i = 0; i < text.length; i++)
				result += String.fromCharCode(key.charCodeAt(i % key.length) ^ text.charCodeAt(i));
			return result;
		}
		document.write(xor_enc(unescape(enctext), key));
	</script>
	
	<noscript>
		<label>Antispam:</label>
		<div>
		<p>Please type the text '1tjbw' into this field:</p>
		<input name="captcha_answer" />
		</div>
	</noscript>
	
	<input name="captcha_hash" type="hidden" value="3452c4fb13505c5ffa256f2352851ed2b9286af70c3f9ed65e3e888690e1ee69" />

The captcha tag will usually be embedded in an existing C<<form>>. It will
only generate the question (using a template) and two C<<input>> HTML-tags that
will accept the answer and pass a hash of the correct answer to the server.

=head3 Perl interface

It's very easy to add a captcha-check to your plugins:

	my $template = use_plugin 'template';
	
	if ((use_plugin 'captcha')->check()) {
		#captcha solved!
		#your code...
	} else {
		#captcha not solved!
		#e.g. put error message and ask again:
		$self->add_node($template->node('error_message.template'));
		$self->add_node($template->node('template_with_input_form_and_captcha_tag.template'));
	}

Complete documentation: L<Konstrukt::Plugin::captcha>.
=head2 date



Displays the current date


	
B<Usage:>

	<& date / &>

B<Result:>

	April 23, 2006 - 10:45:16

Complete documentation: L<Konstrukt::Plugin::date>.
=head2 diff



Print out an XHTML table with the difference between two texts



B<Usage:>

 	<& diff &>
		<$ left $>
		1
		2
		3
		<$ / $>
		<$ right $>
		1
		3
		<$ / $>
	<& / &>

or

	<!-- set another amount of "context" lines -->
	<& diff context="2" &>
		...
	<& / &>

or

	<!-- define a header for the columns -->
	<& diff left_header="text a" right_header="text b" &>
		...
	<& / &>
	
B<Result:>

A table showing the difference between the two texts.

Complete documentation: L<Konstrukt::Plugin::diff>.
=head2 env



Access to the environment variables



B<Usage:>
	
	<!-- set value -->
	<& env var="var_name" set="value" / &>

	<!-- print out value -->
	<& env var="var_name" / &>

B<Result:>

	<!-- set value -->

	<!-- print out value -->
	value

Complete documentation: L<Konstrukt::Plugin::env>.



( run in 0.541 second using v1.01-cache-2.11-cpan-39bf76dae61 )