|
Revision 362, 1.8 kB
(checked in by schst, 2 years ago)
|
Removed trailing whitespace
|
- Property svn:eol-style set to
native
- Property svn:keywords set to
Author Date Id Revision
|
| Line | |
|---|
| 1 |
<?php |
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 |
|
|---|
| 20 |
|
|---|
| 21 |
|
|---|
| 22 |
|
|---|
| 23 |
|
|---|
| 24 |
|
|---|
| 25 |
class patForms_Renderer_Array extends patForms_Renderer |
|---|
| 26 |
{ |
|---|
| 27 |
|
|---|
| 28 |
* gathers serialized data from all elements, and returns it along with all |
|---|
| 29 |
* attributes in a handy array that can directly be added to a template to |
|---|
| 30 |
* display the form. |
|---|
| 31 |
* |
|---|
| 32 |
* @access public |
|---|
| 33 |
* @param object &$patForms Reference to the patForms object |
|---|
| 34 |
* @return string $serializedElements The list with elements. |
|---|
| 35 |
*/ |
|---|
| 36 |
function render( &$patForms ) |
|---|
| 37 |
{ |
|---|
| 38 |
$serializedElements = array(); |
|---|
| 39 |
$elements =& $patForms->getElements(); |
|---|
| 40 |
|
|---|
| 41 |
$cnt = count( $elements ); |
|---|
| 42 |
for( $i=0; $i < $cnt; $i++ ) { |
|---|
| 43 |
|
|---|
| 44 |
// if an error occurrs here, we just ignore it - we don't want the whole serialization |
|---|
| 45 |
// process to fail because of a warning, for ex. |
|---|
| 46 |
$serialized = $elements[$i]->serialize(); |
|---|
| 47 |
if( patErrorManager::isError( $serialized ) ) { |
|---|
| 48 |
continue; |
|---|
| 49 |
} |
|---|
| 50 |
|
|---|
| 51 |
|
|---|
| 52 |
$meta = $elements[$i]->getAttributes(); |
|---|
| 53 |
$meta['element'] = $serialized; |
|---|
| 54 |
$meta['elementName'] = $elements[$i]->getElementName(); |
|---|
| 55 |
|
|---|
| 56 |
|
|---|
| 57 |
if (isset($meta['datasource'])) { |
|---|
| 58 |
unset($meta['datasource']); |
|---|
| 59 |
} |
|---|
| 60 |
|
|---|
| 61 |
array_push( $serializedElements, $meta ); |
|---|
| 62 |
} |
|---|
| 63 |
|
|---|
| 64 |
return $serializedElements; |
|---|
| 65 |
} |
|---|
| 66 |
} |
|---|
| 67 |
?> |
|---|