root/trunk/examples/patExampleGen/sections_attributefilter.php
| Revision 349, 2.4 kB (checked in by gerd, 3 years ago) | |
|---|---|
| |
| Line | |
|---|---|
| 1 | <?php |
| 2 | /** |
| 3 | * Definitions for the examples on the patForms Filters |
| 4 | * |
| 5 | * $Id: sections_filter.php 186 2004-11-30 12:33:36Z schst $ |
| 6 | * |
| 7 | * @package patForms |
| 8 | * @subpackage Examples |
| 9 | * @author Sebastian Mordziol <argh@php-tools.net> |
| 10 | */ |
| 11 | |
| 12 | $sections['AttributeFilter'] = array( |
| 13 | 'descr' => 'Attribute filter are capable to alter attribute values. |
| 14 | Once a filter is applied to an element, it will be executed on events. |
| 15 | The first event usually is "apply" that happens when a new filter is applied |
| 16 | The second event is "set", triggered whenever an attribute is set', |
| 17 | 'basename' => 'example_attributefilter_', |
| 18 | 'pages' => array( |
| 19 | 'test' => array( |
| 20 | 'title' => 'Test', |
| 21 | 'descr' => 'This is just a stupid test. Still it shows the what happens if attribute filters are used. |
| 22 | THe Test filter does nothing special, it just surrounds the values of the attributes "title", |
| 23 | "label" and "description" with "[TEST:event]" and "[/TEST:event]". |
| 24 | Also the same filter is applied to the element twice! Hence each attribute is surrounded twice.- |
| 25 | which looks really funny. |
| 26 | ' |
| 27 | ), |
| 28 | 'gettext' => array( |
| 29 | 'title' => 'Gettext', |
| 30 | 'descr' => 'The Gettext filter uses GNU Gettext to translate attributes in your native language. |
| 31 | Well, this example does not really make any sense because gettext() could be called directly. |
| 32 | On the other hand, I love to create forms with templates (see parser examples). Hence it you cannot |
| 33 | just add gettext() into your template and this is where this attribute filter does a good job.' |
| 34 | ), |
| 35 | 'applyform' => array( |
| 36 | 'title' => 'Apply to form', |
| 37 | 'descr' => 'In the previuos examples, the attribute\'s filter were applied to a single element. |
| 38 | This can be quite annoying when you need to apply a filter to all elements of a form. |
| 39 | For this reason, patForms implements a wrapper function to apply attribute filter to all |
| 40 | elements.' |
| 41 | ) |
| 42 | ) |
| 43 | ); |
| 44 | ?> |
Note: See TracBrowser for help on using the browser.
