| @@ -1,38 +1,38 @@ | ||
| 1 | -<?php | |
| 2 | -class Element_Button extends Element { | |
| 3 | - protected $attributes = array("type" => "submit", "value" => "Submit"); | |
| 4 | - protected $icon; | |
| 5 | - | |
| 6 | - public function __construct($label = "Submit", $type = "", array $properties = null) { | |
| 7 | - if(!is_array($properties)) | |
| 8 | - $properties = array(); | |
| 9 | - | |
| 10 | - if(!empty($type)) | |
| 11 | - $properties["type"] = $type; | |
| 12 | - | |
| 13 | - if(empty($properties["value"])) | |
| 14 | - $properties["value"] = $label; | |
| 15 | - | |
| 16 | - parent::__construct($label, "", $properties); | |
| 17 | - } | |
| 18 | - | |
| 19 | - public function jQueryDocumentReady() { | |
| 20 | - /*Unless explicitly prevented, jQueryUI's button widget functionality is applied to | |
| 21 | - the each Button element.*/ | |
| 22 | - if(!in_array("jQueryUIButtons", $this->form->getPrevent())) { | |
| 23 | - echo 'jQuery("#', $this->attributes["id"], '").button('; | |
| 24 | - /*Any of the jQueryUI framework icons can be added to your buttons via the icon | |
| 25 | - property. See http://jqueryui.com/themeroller/ for a complete list of available | |
| 26 | - icons.*/ | |
| 27 | - if(!empty($this->icon)) | |
| 28 | - echo '{ icons: { primary: "ui-icon-', $this->icon, '" } }'; | |
| 29 | - echo ');'; | |
| 30 | - } | |
| 31 | - } | |
| 32 | - | |
| 33 | - public function render() { | |
| 34 | - /*The button tag is used instead of input b/c it functions better with jQueryUI's | |
| 35 | - button widget - specifically the icon option.*/ | |
| 36 | - echo '<button', $this->getAttributes(), '>', $this->label, '</button>'; | |
| 37 | - } | |
| 38 | -} | |
| 1 | +<?php | |
| 2 | +class Element_Button extends Element { | |
| 3 | + protected $attributes = array("type" => "submit", "value" => "Submit"); | |
| 4 | + protected $icon; | |
| 5 | + | |
| 6 | + public function __construct($label = "Submit", $type = "", array $properties = null) { | |
| 7 | + if(!is_array($properties)) | |
| 8 | + $properties = array(); | |
| 9 | + | |
| 10 | + if(!empty($type)) | |
| 11 | + $properties["type"] = $type; | |
| 12 | + | |
| 13 | + if(empty($properties["value"])) | |
| 14 | + $properties["value"] = $label; | |
| 15 | + | |
| 16 | + parent::__construct($label, "", $properties); | |
| 17 | + } | |
| 18 | + | |
| 19 | + public function jQueryDocumentReady() { | |
| 20 | + /*Unless explicitly prevented, jQueryUI's button widget functionality is applied to | |
| 21 | + the each Button element.*/ | |
| 22 | + if(!in_array("jQueryUIButtons", $this->form->getPrevent())) { | |
| 23 | + echo 'jQuery("#', $this->attributes["id"], '").button('; | |
| 24 | + /*Any of the jQueryUI framework icons can be added to your buttons via the icon | |
| 25 | + property. See http://jqueryui.com/themeroller/ for a complete list of available | |
| 26 | + icons.*/ | |
| 27 | + if(!empty($this->icon)) | |
| 28 | + echo '{ icons: { primary: "ui-icon-', $this->icon, '" } }'; | |
| 29 | + echo ');'; | |
| 30 | + } | |
| 31 | + } | |
| 32 | + | |
| 33 | + public function render() { | |
| 34 | + /*The button tag is used instead of input b/c it functions better with jQueryUI's | |
| 35 | + button widget - specifically the icon option.*/ | |
| 36 | + echo '<button', $this->getAttributes(), '>', $this->label, '</button>'; | |
| 37 | + } | |
| 38 | +} | |