Index: trunk/extensions/HtmlUi/classes/HtmlUiFormElementCollection.php |
— | — | @@ -44,4 +44,12 @@ |
45 | 45 | public function setOption( $option, $value ) { |
46 | 46 | return isset( $this->options[$option] ) ? $this->options[$option] = $value : null; |
47 | 47 | } |
| 48 | + |
| 49 | + public function renderElements() { |
| 50 | + $elements = array(); |
| 51 | + foreach ( $this->elements as $element ) { |
| 52 | + $elements[] = $element->render(); |
| 53 | + } |
| 54 | + return $elements; |
| 55 | + } |
48 | 56 | } |
Index: trunk/extensions/HtmlUi/classes/HtmlUiFieldset.php |
— | — | @@ -24,6 +24,9 @@ |
25 | 25 | |
26 | 26 | public function render() { |
27 | 27 | $template = new HtmlUiTemplate( 'extensions/HtmlUi/templates/HtmlUiFieldset.php' ); |
28 | | - return $template->render( array_merge( array( 'id' => $this->id ), $this->elements ) ); |
| 28 | + return $template->render( array( |
| 29 | + 'id' => $this->id, |
| 30 | + 'elements' => $this->renderElements() |
| 31 | + ) ); |
29 | 32 | } |
30 | 33 | } |
Index: trunk/extensions/HtmlUi/classes/HtmlUiForm.php |
— | — | @@ -15,12 +15,12 @@ |
16 | 16 | |
17 | 17 | public function render() { |
18 | 18 | $template = new HtmlUiTemplate( 'extensions/HtmlUi/templates/HtmlUiForm.php' ); |
19 | | - return $template->render( array_merge( |
20 | | - array( 'attributes' => array( |
| 19 | + return $template->render( array( |
| 20 | + 'attributes' => array( |
21 | 21 | 'action' => $this->options['action'], |
22 | 22 | 'method' => $this->options['method'], |
23 | 23 | ), |
24 | | - $this->elements |
| 24 | + 'elements' => $this->renderElements() |
25 | 25 | ) ); |
26 | 26 | } |
27 | 27 | |
Index: trunk/extensions/HtmlUi/templates/HtmlUiFieldset.php |
— | — | @@ -1,5 +1,3 @@ |
2 | 2 | <fieldset class="htmlUiFieldset" rel="<?php echo $id ?>"> |
3 | | - <?php foreach( $elements as $element ): ?> |
4 | | - <?php echo $element->render(); ?> |
5 | | - <?php endforeach; ?> |
| 3 | + <?php echo implode( self::unescape( $elements ) ) ?> |
6 | 4 | </fieldset> |
Index: trunk/extensions/HtmlUi/templates/HtmlUiForm.php |
— | — | @@ -1,5 +1,3 @@ |
2 | 2 | <form class="htmlUiForm"<?php echo self::attributes( $attributes ) ?>> |
3 | | - <?php foreach( $elements as $element ): ?> |
4 | | - <?php echo $element->render(); ?> |
5 | | - <?php endforeach; ?> |
| 3 | + <?php echo implode( self::unescape( $elements ) ) ?> |
6 | 4 | </form> |