From f38dbf3027393a62ad7d30841900ea73340fd31e Mon Sep 17 00:00:00 2001 From: Alexander Makarov Date: Thu, 7 Aug 2014 16:37:48 +0400 Subject: [PATCH] More cases for #4595 --- Alert.php | 4 ++-- CHANGELOG.md | 7 ++++++- Modal.php | 14 +++++++------- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/Alert.php b/Alert.php index 91e8d9b..ce85f4a 100644 --- a/Alert.php +++ b/Alert.php @@ -55,7 +55,7 @@ class Alert extends Widget /** * @var array the options for rendering the close button tag. * 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: * @@ -117,7 +117,7 @@ class Alert extends Widget */ protected function renderCloseButton() { - if ($this->closeButton !== null) { + if ($this->closeButton !== false) { $tag = ArrayHelper::remove($this->closeButton, 'tag', 'button'); $label = ArrayHelper::remove($this->closeButton, 'label', '×'); if ($tag === 'button' && !isset($this->closeButton['type'])) { diff --git a/CHANGELOG.md b/CHANGELOG.md index 13a9564..82b040a 100644 --- a/CHANGELOG.md +++ b/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 #4363: Added `showIndicators` property to make Carousel indicators optional (sdkiller) - 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 ------------------------- diff --git a/Modal.php b/Modal.php index 62e8221..b7b04c1 100644 --- a/Modal.php +++ b/Modal.php @@ -52,9 +52,9 @@ class Modal extends Widget */ 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 - * 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: * @@ -69,7 +69,7 @@ class Modal extends Widget /** * @var array the options for rendering the toggle button tag. * 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: * @@ -80,7 +80,7 @@ class Modal extends Widget * Please refer to the [Modal plugin help](http://getbootstrap.com/javascript/#modals) * for the supported HTML attributes. */ - public $toggleButton; + public $toggleButton = false; /** @@ -187,7 +187,7 @@ class Modal extends Widget */ protected function renderCloseButton() { - if ($this->closeButton !== null) { + if ($this->closeButton !== false) { $tag = ArrayHelper::remove($this->closeButton, 'tag', 'button'); $label = ArrayHelper::remove($this->closeButton, 'label', '×'); if ($tag === 'button' && !isset($this->closeButton['type'])) { @@ -217,7 +217,7 @@ class Modal extends Widget $this->clientOptions = array_merge(['show' => false], $this->clientOptions); } - if ($this->closeButton !== null) { + if ($this->closeButton !== false) { $this->closeButton = array_merge([ 'data-dismiss' => 'modal', 'aria-hidden' => 'true', @@ -225,7 +225,7 @@ class Modal extends Widget ], $this->closeButton); } - if ($this->toggleButton !== null) { + if ($this->toggleButton !== false) { $this->toggleButton = array_merge([ 'data-toggle' => 'modal', ], $this->toggleButton);