Commit fbcae8c3 by Crisu83

changed BootButton to create buttons instead of inputs (fixes #22)

parent ed699265
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
<w>navbar</w> <w>navbar</w>
<w>scrollspy</w> <w>scrollspy</w>
<w>tabbable</w> <w>tabbable</w>
<w>typeahead</w>
<w>uneditable</w> <w>uneditable</w>
<w>unstyled</w> <w>unstyled</w>
</words> </words>
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
*/ */
class Bootstrap extends CApplicationComponent class Bootstrap extends CApplicationComponent
{ {
// The Bootstrap core plugins. // Bootstrap plugins.
const PLUGIN_ALERT = 'alert'; const PLUGIN_ALERT = 'alert';
const PLUGIN_BUTTON = 'button'; const PLUGIN_BUTTON = 'button';
const PLUGIN_CAROUSEL = 'carousel'; const PLUGIN_CAROUSEL = 'carousel';
...@@ -39,6 +39,7 @@ class Bootstrap extends CApplicationComponent ...@@ -39,6 +39,7 @@ class Bootstrap extends CApplicationComponent
public $responsiveCss = false; public $responsiveCss = false;
/** /**
* @var boolean whether to register jQuery and the Bootstrap JavaScript. * @var boolean whether to register jQuery and the Bootstrap JavaScript.
* @since 0.9.10
*/ */
public $enableJS = true; public $enableJS = true;
/** /**
......
...@@ -192,10 +192,12 @@ class BootButton extends BootWidget ...@@ -192,10 +192,12 @@ class BootButton extends BootWidget
return CHtml::htmlButton($this->label, $this->htmlOptions); return CHtml::htmlButton($this->label, $this->htmlOptions);
case self::FN_SUBMIT: case self::FN_SUBMIT:
return CHtml::submitButton($this->label, $this->htmlOptions); $this->htmlOptions['type'] = 'submit';
return CHtml::htmlButton($this->label, $this->htmlOptions);
case self::FN_RESET: case self::FN_RESET:
return CHtml::resetButton($this->label, $this->htmlOptions); $this->htmlOptions['type'] = 'reset';
return CHtml::htmlButton($this->label, $this->htmlOptions);
case self::FN_SUBMITLINK: case self::FN_SUBMITLINK:
return CHtml::linkButton($this->label, $this->htmlOptions); return CHtml::linkButton($this->label, $this->htmlOptions);
...@@ -204,10 +206,16 @@ class BootButton extends BootWidget ...@@ -204,10 +206,16 @@ class BootButton extends BootWidget
return CHtml::ajaxLink($this->label, $this->url, $this->ajaxOptions, $this->htmlOptions); return CHtml::ajaxLink($this->label, $this->url, $this->ajaxOptions, $this->htmlOptions);
case self::FN_AJAXBUTTON: case self::FN_AJAXBUTTON:
return CHtml::ajaxButton($this->label, $this->url, $this->ajaxOptions, $this->htmlOptions); $this->ajaxOptions['url'] = $this->url;
$this->htmlOptions['ajax'] = $this->ajaxOptions;
return CHtml::htmlButton($this->label, $this->htmlOptions);
case self::FN_AJAXSUBMIT: case self::FN_AJAXSUBMIT:
return CHtml::ajaxSubmitButton($this->label, $this->ajaxOptions, $this->htmlOptions); $this->ajaxOptions['type'] = 'POST';
$this->ajaxOptions['url'] = $this->url;
$this->htmlOptions['type'] = 'submit';
$this->htmlOptions['ajax'] = $this->ajaxOptions;
return CHtml::htmlButton($this->label, $this->htmlOptions);
default: default:
case self::FN_LINK: case self::FN_LINK:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment