| @@ -1,52 +1,52 @@ | ||
| 1 | -<?php | |
| 2 | -class View_Horizontal extends View { | |
| 3 | - protected $labelPaddingTop; | |
| 4 | - | |
| 5 | - public function jQueryDocumentReady() { | |
| 6 | - $id = $this->form->getId(); | |
| 7 | - echo 'jQuery("#', $id, ' .pfbc-element:last").css("margin-right", "0");'; | |
| 8 | - } | |
| 9 | - | |
| 10 | - public function render() { | |
| 11 | - echo '<form', $this->form->getAttributes(), '>'; | |
| 12 | - $this->form->getError()->render(); | |
| 13 | - | |
| 14 | - $elements = $this->form->getElements(); | |
| 15 | - $elementSize = sizeof($elements); | |
| 16 | - for($e = 0; $e < $elementSize; ++$e) { | |
| 17 | - $element = $elements[$e]; | |
| 18 | - | |
| 19 | - if($element instanceof Element_Hidden || $element instanceof Element_HTMLExternal) | |
| 20 | - $element->render(); | |
| 21 | - else { | |
| 22 | - echo '<div class="pfbc-element">', $element->getPreHTML(); | |
| 23 | - if(!$element instanceof Element_Button) | |
| 24 | - $this->renderLabel($element); | |
| 25 | - $element->render(); | |
| 26 | - echo $element->getPostHTML(), '</div>'; | |
| 27 | - } | |
| 28 | - } | |
| 29 | - | |
| 30 | - echo '<div style="clear: both;"></div></form>'; | |
| 31 | - } | |
| 32 | - | |
| 33 | - public function renderCSS() { | |
| 34 | - $id = $this->form->getId(); | |
| 35 | - | |
| 36 | - parent::renderCSS(); | |
| 37 | - echo <<<CSS | |
| 38 | -#$id .pfbc-element { float: left; margin-right: .5em; } | |
| 39 | -#$id .pfbc-label strong { color: #990000; } | |
| 40 | -#$id .pfbc-label { float: left; margin-right: .25em; } | |
| 41 | -CSS; | |
| 42 | - | |
| 43 | - if(empty($this->labelPaddingTop) && !in_array("style", $this->form->getPrevent())) | |
| 44 | - $this->labelPaddingTop = ".75em"; | |
| 45 | - | |
| 46 | - if(!empty($this->labelPaddingTop)) { | |
| 47 | - if(is_numeric($this->labelPaddingTop)) | |
| 48 | - $this->labelPaddingTop .= "px"; | |
| 49 | - echo '#', $id, ' .pfbc-label { padding-top: ', $this->labelPaddingTop, '; }'; | |
| 50 | - } | |
| 51 | - } | |
| 52 | -} | |
| 1 | +<?php | |
| 2 | +class View_Horizontal extends View { | |
| 3 | + protected $labelPaddingTop; | |
| 4 | + | |
| 5 | + public function jQueryDocumentReady() { | |
| 6 | + $id = $this->form->getId(); | |
| 7 | + echo 'jQuery("#', $id, ' .pfbc-element:last").css("margin-right", "0");'; | |
| 8 | + } | |
| 9 | + | |
| 10 | + public function render() { | |
| 11 | + echo '<form', $this->form->getAttributes(), '>'; | |
| 12 | + $this->form->getError()->render(); | |
| 13 | + | |
| 14 | + $elements = $this->form->getElements(); | |
| 15 | + $elementSize = sizeof($elements); | |
| 16 | + for($e = 0; $e < $elementSize; ++$e) { | |
| 17 | + $element = $elements[$e]; | |
| 18 | + | |
| 19 | + if($element instanceof Element_Hidden || $element instanceof Element_HTMLExternal) | |
| 20 | + $element->render(); | |
| 21 | + else { | |
| 22 | + echo '<div class="pfbc-element">', $element->getPreHTML(); | |
| 23 | + if(!$element instanceof Element_Button) | |
| 24 | + $this->renderLabel($element); | |
| 25 | + $element->render(); | |
| 26 | + echo $element->getPostHTML(), '</div>'; | |
| 27 | + } | |
| 28 | + } | |
| 29 | + | |
| 30 | + echo '<div style="clear: both;"></div></form>'; | |
| 31 | + } | |
| 32 | + | |
| 33 | + public function renderCSS() { | |
| 34 | + $id = $this->form->getId(); | |
| 35 | + | |
| 36 | + parent::renderCSS(); | |
| 37 | + echo <<<CSS | |
| 38 | +#$id .pfbc-element { float: left; margin-right: .5em; } | |
| 39 | +#$id .pfbc-label strong { color: #990000; } | |
| 40 | +#$id .pfbc-label { float: left; margin-right: .25em; } | |
| 41 | +CSS; | |
| 42 | + | |
| 43 | + if(empty($this->labelPaddingTop) && !in_array("style", $this->form->getPrevent())) | |
| 44 | + $this->labelPaddingTop = ".75em"; | |
| 45 | + | |
| 46 | + if(!empty($this->labelPaddingTop)) { | |
| 47 | + if(is_numeric($this->labelPaddingTop)) | |
| 48 | + $this->labelPaddingTop .= "px"; | |
| 49 | + echo '#', $id, ' .pfbc-label { padding-top: ', $this->labelPaddingTop, '; }'; | |
| 50 | + } | |
| 51 | + } | |
| 52 | +} | |