Konstrukt
view release on metacpan or search on metacpan
lib/Konstrukt/Doc/FunctionPlugins.pod view on Meta::CPAN
If the existing plugins don't offer the funktionality you need, you usually
would L<implement|Konstrukt::Doc::CreatingPlugins> your own application logic
as a plugin.
=head1 "LOW LEVEL" PLUGINS: FUNCTIONS
=head2 captcha
L<captcha|Konstrukt::Plugin::captcha>: Put captchas in your forms easily.
You can then easily check the answer in your perl code.
B<Usage:>
<!-- the easy way -->
<& captcha / &>
or
<!-- defining your own settings that may differ from the defaults -->
<& captcha type="text" template="/templates/captcha/text.template" / &>
B<Result:> (Something like this)
<script type="text/javascript">
var enctext = "%50%0A%3A%21%44%38%4C%0C%0D%0E%31%6C%13%2F%0D%12%18%00%3C%30%6E%2D%02%11%1B%06%26%73%11%38%15%12%09%5E%76%39%58%28%08%07%02%41%74%32%5D%2D%1F%11%51%41%2C%29%5D%6E%4C%14%0D%0F%21%34%0C%6E%5D%16%06%01%23%73%11%63%52%68";
var key = "lcTQ1Llb";
function xor_enc(text, key) {
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" />
=head2 date
L<date|Konstrukt::Plugin::date>: Displays the current date.
Mainly a simple demonstration plugin.
B<Usage:>
<& date / &>
B<Result:>
April 23, 2006 - 10:45:16
=head2 diff
L<diff|Konstrukt::Plugin::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.
=head2 env
L<env|Konstrukt::Plugin::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
=head2 formvalidator
L<formvalidator|Konstrukt::Plugin::formvalidator>: HTML form validator.
You can then easily check the correctness of the input in your perl code.
B<Usage:>
( run in 0.471 second using v1.01-cache-2.11-cpan-39bf76dae61 )