Browse Source

More cases for #4595

tags/2.0.0-rc
Alexander Makarov 11 years ago
parent
commit
f38dbf3027
  1. 4
      Alert.php
  2. 7
      CHANGELOG.md
  3. 14
      Modal.php

4
Alert.php

@ -55,7 +55,7 @@ class Alert extends Widget
/** /**
* @var array the options for rendering the close button tag. * @var array the options for rendering the close button tag.
* The close button is displayed in the header of the modal window. Clicking * The close button is displayed in the header of the modal window. Clicking
* on the button will hide the modal window. If this is null, no close button will be rendered. * on the button will hide the modal window. If this is false, no close button will be rendered.
* *
* The following special options are supported: * The following special options are supported:
* *
@ -117,7 +117,7 @@ class Alert extends Widget
*/ */
protected function renderCloseButton() protected function renderCloseButton()
{ {
if ($this->closeButton !== null) { if ($this->closeButton !== false) {
$tag = ArrayHelper::remove($this->closeButton, 'tag', 'button'); $tag = ArrayHelper::remove($this->closeButton, 'tag', 'button');
$label = ArrayHelper::remove($this->closeButton, 'label', '×'); $label = ArrayHelper::remove($this->closeButton, 'label', '×');
if ($tag === 'button' && !isset($this->closeButton['type'])) { if ($tag === 'button' && !isset($this->closeButton['type'])) {

7
CHANGELOG.md

@ -11,7 +11,12 @@ Yii Framework 2 bootstrap extension Change Log
- Enh #4120: Added ability for each item to choose it's encoding option in `Dropdown` and `Nav` (Alex-Code) - Enh #4120: Added ability for each item to choose it's encoding option in `Dropdown` and `Nav` (Alex-Code)
- Enh #4363: Added `showIndicators` property to make Carousel indicators optional (sdkiller) - Enh #4363: Added `showIndicators` property to make Carousel indicators optional (sdkiller)
- Chg #3036: Upgraded Twitter Bootstrap to 3.1.x (qiangxue) - Chg #3036: Upgraded Twitter Bootstrap to 3.1.x (qiangxue)
- Chg #4595: `yii\bootstrap\NavBar`'s `brandLabel` and `brandUrl` are taking `false` instead of `null` for "don't use" case (samdark) - Chg #4595: The following properties are now taking `false` instead of `null` for "don't use" case (samdark)
- `yii\bootstrap\NavBar::$brandLabel`.
- `yii\bootstrap\NavBar::$brandUrl`.
- `yii\bootstrap\Modal::$closeButton`.
- `yii\bootstrap\Modal::$toggleButton`.
- `yii\bootstrap\Alert::$closeButton`.
2.0.0-beta April 13, 2014 2.0.0-beta April 13, 2014
------------------------- -------------------------

14
Modal.php

@ -52,9 +52,9 @@ class Modal extends Widget
*/ */
public $size; public $size;
/** /**
* @var array the options for rendering the close button tag. * @var array|false the options for rendering the close button tag.
* The close button is displayed in the header of the modal window. Clicking * The close button is displayed in the header of the modal window. Clicking
* on the button will hide the modal window. If this is null, no close button will be rendered. * on the button will hide the modal window. If this is false, no close button will be rendered.
* *
* The following special options are supported: * The following special options are supported:
* *
@ -69,7 +69,7 @@ class Modal extends Widget
/** /**
* @var array the options for rendering the toggle button tag. * @var array the options for rendering the toggle button tag.
* The toggle button is used to toggle the visibility of the modal window. * The toggle button is used to toggle the visibility of the modal window.
* If this property is null, no toggle button will be rendered. * If this property is false, no toggle button will be rendered.
* *
* The following special options are supported: * The following special options are supported:
* *
@ -80,7 +80,7 @@ class Modal extends Widget
* Please refer to the [Modal plugin help](http://getbootstrap.com/javascript/#modals) * Please refer to the [Modal plugin help](http://getbootstrap.com/javascript/#modals)
* for the supported HTML attributes. * for the supported HTML attributes.
*/ */
public $toggleButton; public $toggleButton = false;
/** /**
@ -187,7 +187,7 @@ class Modal extends Widget
*/ */
protected function renderCloseButton() protected function renderCloseButton()
{ {
if ($this->closeButton !== null) { if ($this->closeButton !== false) {
$tag = ArrayHelper::remove($this->closeButton, 'tag', 'button'); $tag = ArrayHelper::remove($this->closeButton, 'tag', 'button');
$label = ArrayHelper::remove($this->closeButton, 'label', '×'); $label = ArrayHelper::remove($this->closeButton, 'label', '×');
if ($tag === 'button' && !isset($this->closeButton['type'])) { if ($tag === 'button' && !isset($this->closeButton['type'])) {
@ -217,7 +217,7 @@ class Modal extends Widget
$this->clientOptions = array_merge(['show' => false], $this->clientOptions); $this->clientOptions = array_merge(['show' => false], $this->clientOptions);
} }
if ($this->closeButton !== null) { if ($this->closeButton !== false) {
$this->closeButton = array_merge([ $this->closeButton = array_merge([
'data-dismiss' => 'modal', 'data-dismiss' => 'modal',
'aria-hidden' => 'true', 'aria-hidden' => 'true',
@ -225,7 +225,7 @@ class Modal extends Widget
], $this->closeButton); ], $this->closeButton);
} }
if ($this->toggleButton !== null) { if ($this->toggleButton !== false) {
$this->toggleButton = array_merge([ $this->toggleButton = array_merge([
'data-toggle' => 'modal', 'data-toggle' => 'modal',
], $this->toggleButton); ], $this->toggleButton);

Loading…
Cancel
Save