Skip to content

Commit c8e6184

Browse files
committed
Upgrade to release v2.7.0
1 parent d20293b commit c8e6184

File tree

2 files changed

+26
-5
lines changed

2 files changed

+26
-5
lines changed

CHANGE.md

+15
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
1+
version 2.7.0
2+
=============
3+
**Date:** 18-Jul-2014
4+
5+
1. enh #96: Enhanced DatePicker, DateTimePicker, and TimePicker to work along with the new `autoWidgetSettings` for DateControl module .
6+
2. enh #98: Added `language` configuration property for DatePicker, DateTimePicker, and TimePicker.
7+
3. bug #99: Fix DateControl to work for date time formatting with DateTimePicker.
8+
4. enh #104: Add more information to documentation for Select2 widget and explain placeholder setting when `allowClear` is `true`.
9+
5. enh #106: Added Turkish translations for FileInput widget.
10+
6. bug #110: Allow use of Select2 with tags, when tags are empty.
11+
7. enh #111: Allow configuring of template for each item in SideNav.
12+
8. Added `iconPrefix` property in SideNav to easily configure with more icon frameworks (other than glyphicon).
13+
114
version 2.6.0
215
=============
16+
**Date:** 01-Jul-2014
17+
318
1. Issue Fixes from #73 to #95.
419
2. Added `language` property to `InputWidget` along with `initLanguage` method for automatic language setting in `pluginOptions`.
520
The `language` property will be auto defaulted to `Yii::$app->language` if not set.

widgets/SideNav.php

+11-5
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/**
44
* @copyright Copyright © Kartik Visweswaran, Krajee.com, 2013
55
* @package yii2-widgets
6-
* @version 1.0.0
6+
* @version 1.1.0
77
*/
88

99
namespace kartik\widgets;
@@ -62,6 +62,13 @@ class SideNav extends \yii\widgets\Menu
6262
*/
6363
public $type = self::TYPE_DEFAULT;
6464

65+
/**
66+
* @var string prefix for the icon in [[items]]. This string will be prepended
67+
* before the icon name to get the icon CSS class. This defaults to `glyphicon glyphicon-`
68+
* for usage with glyphicons available with Bootstrap.
69+
*/
70+
public $iconPrefix = 'glyphicon glyphicon-';
71+
6572
/**
6673
* @var array string/boolean the sidenav heading. This is not HTML encoded
6774
* When set to false or null, no heading container will be displayed.
@@ -101,7 +108,6 @@ class SideNav extends \yii\widgets\Menu
101108
* - icon: string, optional, specifies the glyphicon name to be placed before label.
102109
* - url: string or array, optional, specifies the URL of the menu item. It will be processed by [[Url::to]].
103110
* When this is set, the actual menu item content will be generated using [[linkTemplate]];
104-
* otherwise, [[labelTemplate]] will be used.
105111
* - visible: boolean, optional, whether this menu item is visible. Defaults to true.
106112
* - items: array, optional, specifies the sub-menu items. Its format is the same as the parent items.
107113
* - active: boolean, optional, whether this menu item is in active state (currently selected).
@@ -111,7 +117,7 @@ class SideNav extends \yii\widgets\Menu
111117
* - template: string, optional, the template used to render the content of this menu item.
112118
* The token `{url}` will be replaced by the URL associated with this menu item,
113119
* and the token `{label}` will be replaced by the label of the menu item.
114-
* If this option is not set, [[linkTemplate]] or [[labelTemplate]] will be used instead.
120+
* If this option is not set, [[linkTemplate]] will be used instead.
115121
* - options: array, optional, the HTML attributes for the menu item tag.
116122
*
117123
*/
@@ -201,8 +207,8 @@ protected function markTopItems()
201207
protected function renderItem($item)
202208
{
203209
$this->validateItems($item);
210+
$template = ArrayHelper::getValue($item, 'template', $this->linkTemplate);
204211
$url = Url::to(ArrayHelper::getValue($item, 'url', '#'));
205-
$template = $this->linkTemplate;
206212
if (empty($item['top'])) {
207213
if (empty($item['items'])) {
208214
$template = str_replace('{icon}', $this->indItem . '{icon}', $template);
@@ -214,7 +220,7 @@ protected function renderItem($item)
214220
$template = str_replace('{icon}', $indicator . '{icon}', $template);
215221
}
216222
}
217-
$icon = empty($item['icon']) ? '' : '<i class="glyphicon glyphicon-' . $item['icon'] . '"></i> &nbsp;';
223+
$icon = empty($item['icon']) ? '' : '<span class="' . $this->iconPrefix . $item['icon'] . '"></span> &nbsp;';
218224
unset($item['icon'], $item['top']);
219225
return strtr($template, [
220226
'{url}' => $url,

0 commit comments

Comments
 (0)