PluginProbe
Contact Forms by Cimatti / 1.9.2
Contact Forms by Cimatti v1.9.2
2.3.6 2.3.5 2.3.0 2.2.32 2.2.4 2.2.0 2.1.2 2.1.1 trunk 1.0 1.1 1.2 1.2.1 1.3 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.3.8 1.3.9 1.4.0 1.4.1 All 62 releases
← All changes | PFBC/Element/Radio.php +53 -53 1.21.9.2 View file →
@@ -1,53 +1,53 @@
1 -<?php
2 -class Element_Radio extends OptionElement {
3 - protected $attributes = array("type" => "radio");
4 - protected $inline;
5 - protected $maxheight;
6 -
7 - public function jQueryDocumentReady() {
8 - if(!empty($this->inline))
9 - echo 'jQuery("#', $this->attributes["id"], ' .pfbc-radio:last").css("margin-right", "0");';
10 - else
11 - echo 'jQuery("#', $this->attributes["id"], ' .pfbc-radio:last").css({ "padding-bottom": "0", "border-bottom": "none" });';
12 -
13 - if(!empty($this->maxheight) && is_numeric($this->maxheight)) {
14 - echo <<<JS
15 -var radiobuttons = jQuery("#{$this->attributes["id"]} .pfbc-radio-buttons");
16 -if(radiobuttons.outerHeight() > {$this->maxheight}) {
17 - radiobuttons.css({
18 - "height": "{$this->maxheight}px",
19 - "overflow": "auto",
20 - "overflow-x": "hidden"
21 - });
22 -}
23 -JS;
24 - }
25 - }
26 -
27 - public function render() {
28 - $count = 0;
29 - $checked = false;
30 - echo '<div id="', $this->attributes["id"], '"><div class="pfbc-radio-buttons">';
31 - foreach($this->options as $value => $text) {
32 - $value = $this->getOptionValue($value);
33 - echo '<div class="pfbc-radio"><table cellpadding="0" cellspacing="0"><tr><td valign="top"><input id="', $this->attributes["id"], "-", $count, '"', $this->getAttributes(array("id", "value", "checked")), ' value="', $this->filter($value), '"';
34 - if(isset($this->attributes["value"]) && $this->attributes["value"] == $value)
35 - echo ' checked="checked"';
36 - echo '/></td><td><label for="', $this->attributes["id"], "-", $count, '">', $text, '</label></td></tr></table></div>';
37 - ++$count;
38 - }
39 - echo '</div>';
40 -
41 - if(!empty($this->inline))
42 - echo '<div style="clear: both;"></div>';
43 -
44 - echo '</div>';
45 - }
46 -
47 - public function renderCSS() {
48 - if(!empty($this->inline))
49 - echo '#', $this->attributes["id"], ' .pfbc-radio { float: left; margin-right: 0.5em; }';
50 - else
51 - echo '#', $this->attributes["id"], ' .pfbc-radio { padding: 0.5em 0; border-bottom: 1px solid #f4f4f4; }';
52 - }
53 -}
1 +<?php
2 +class Element_Radio extends OptionElement {
3 + protected $attributes = array("type" => "radio");
4 + protected $inline;
5 + protected $maxheight;
6 +
7 + public function jQueryDocumentReady() {
8 + if(!empty($this->inline))
9 + echo 'jQuery("#', $this->attributes["id"], ' .pfbc-radio:last").css("margin-right", "0");';
10 + else
11 + echo 'jQuery("#', $this->attributes["id"], ' .pfbc-radio:last").css({ "padding-bottom": "0", "border-bottom": "none" });';
12 +
13 + if(!empty($this->maxheight) && is_numeric($this->maxheight)) {
14 + echo <<<JS
15 +var radiobuttons = jQuery("#{$this->attributes["id"]} .pfbc-radio-buttons");
16 +if(radiobuttons.outerHeight() > {$this->maxheight}) {
17 + radiobuttons.css({
18 + "height": "{$this->maxheight}px",
19 + "overflow": "auto",
20 + "overflow-x": "hidden"
21 + });
22 +}
23 +JS;
24 + }
25 + }
26 +
27 + public function render() {
28 + $count = 0;
29 + $checked = false;
30 + echo '<div id="', $this->attributes["id"], '"><div class="pfbc-radio-buttons">';
31 + foreach($this->options as $value => $text) {
32 + $value = $this->getOptionValue($value);
33 + echo '<div class="pfbc-radio"><table cellpadding="0" cellspacing="0"><tr><td valign="top"><input id="', $this->attributes["id"], "-", $count, '"', $this->getAttributes(array("id", "value", "checked")), ' value="', $this->filter($value), '"';
34 + if(isset($this->attributes["value"]) && $this->attributes["value"] == $value)
35 + echo ' checked="checked"';
36 + echo '/></td><td><label for="', $this->attributes["id"], "-", $count, '">', $text, '</label></td></tr></table></div>';
37 + ++$count;
38 + }
39 + echo '</div>';
40 +
41 + if(!empty($this->inline))
42 + echo '<div style="clear: both;"></div>';
43 +
44 + echo '</div>';
45 + }
46 +
47 + public function renderCSS() {
48 + if(!empty($this->inline))
49 + echo '#', $this->attributes["id"], ' .pfbc-radio { float: left; margin-right: 0.5em; }';
50 + else
51 + echo '#', $this->attributes["id"], ' .pfbc-radio { padding: 0.5em 0; border-bottom: 1px solid #f4f4f4; }';
52 + }
53 +}