| | 1 | <?php |
|---|
| | 2 | /** |
|---|
| | 3 | * @package jelix |
|---|
| | 4 | * @subpackage jtpl_plugin |
|---|
| | 5 | * @author Julien Issler |
|---|
| | 6 | * @contributor |
|---|
| | 7 | * @copyright 2008 Julien Issler |
|---|
| | 8 | * @link http://www.jelix.org |
|---|
| | 9 | * @licence GNU Lesser General Public Licence see LICENCE file or http://www.gnu.org/licenses/lgpl.html |
|---|
| | 10 | */ |
|---|
| | 11 | |
|---|
| | 12 | /** |
|---|
| | 13 | * Display all data of a form without the use of other plugins. |
|---|
| | 14 | * |
|---|
| | 15 | * @param jTpl $tpl template engine |
|---|
| | 16 | * @param jFormsBase $form the form to display |
|---|
| | 17 | */ |
|---|
| | 18 | function jtpl_function_text_formdatafull($tpl, $form){ |
|---|
| | 19 | |
|---|
| | 20 | foreach($form->getControls() as $ctrlref=>$ctrl){ |
|---|
| | 21 | if($ctrl->type == 'submit' || $ctrl->type == 'reset' || $ctrl->type == 'hidden' || $ctrl->type == 'captcha') continue; |
|---|
| | 22 | if(!$form->isActivated($ctrlref)) continue; |
|---|
| | 23 | |
|---|
| | 24 | echo $ctrl->label,' : '; |
|---|
| | 25 | |
|---|
| | 26 | $value = $ctrl->getDisplayValue($form->getData($ctrlref)); |
|---|
| | 27 | if(is_array($value)) |
|---|
| | 28 | echo join(',',$value); |
|---|
| | 29 | else if($ctrl->datatype instanceof jDatatypeHtml) |
|---|
| | 30 | echo strip_tags($value); |
|---|
| | 31 | else |
|---|
| | 32 | echo $value; |
|---|
| | 33 | |
|---|
| | 34 | echo "\n\n"; |
|---|
| | 35 | } |
|---|
| | 36 | |
|---|
| | 37 | } |