Browse Source

Fixed debugger with the new bootstrap.

tags/2.0.0-beta
Qiang Xue 12 years ago
parent
commit
0e013c4f46
  1. 1
      apps/basic/controllers/SiteController.php
  2. 29
      framework/yii/bootstrap/ButtonDropdown.php
  3. 7
      framework/yii/bootstrap/ButtonGroup.php
  4. 882
      framework/yii/bootstrap/assets/css/bootstrap.css
  5. 2
      framework/yii/bootstrap/assets/css/bootstrap.min.css
  6. 160
      framework/yii/bootstrap/assets/js/bootstrap.js
  7. 2
      framework/yii/bootstrap/assets/js/bootstrap.min.js
  8. 17
      framework/yii/debug/assets/main.css
  9. 6
      framework/yii/debug/panels/LogPanel.php
  10. 59
      framework/yii/debug/views/default/view.php

1
apps/basic/controllers/SiteController.php

@ -21,6 +21,7 @@ class SiteController extends Controller
public function actionIndex() public function actionIndex()
{ {
Yii::warning('test');
return $this->render('index'); return $this->render('index');
} }

29
framework/yii/bootstrap/ButtonDropdown.php

@ -46,7 +46,7 @@ class ButtonDropdown extends Widget
/** /**
* @var array the HTML attributes of the button. * @var array the HTML attributes of the button.
*/ */
public $buttonOptions = array(); public $options = array();
/** /**
* @var array the configuration array for [[Dropdown]]. * @var array the configuration array for [[Dropdown]].
*/ */
@ -58,24 +58,11 @@ class ButtonDropdown extends Widget
/** /**
* Initializes the widget.
* If you override this method, make sure you call the parent implementation first.
*/
public function init()
{
parent::init();
Html::addCssClass($this->options, 'btn-group');
}
/**
* Renders the widget. * Renders the widget.
*/ */
public function run() public function run()
{ {
echo Html::beginTag('div', $this->options) . "\n"; echo $this->renderButton() . "\n" . $this->renderDropdown();
echo $this->renderButton() . "\n";
echo $this->renderDropdown() . "\n";
echo Html::endTag('div') . "\n";
$this->registerPlugin('button'); $this->registerPlugin('button');
} }
@ -85,21 +72,21 @@ class ButtonDropdown extends Widget
*/ */
protected function renderButton() protected function renderButton()
{ {
Html::addCssClass($this->buttonOptions, 'btn'); Html::addCssClass($this->options, 'btn');
if ($this->split) { if ($this->split) {
$tag = 'button'; $tag = 'button';
$options = $this->buttonOptions; $options = $this->options;
$this->buttonOptions['data-toggle'] = 'dropdown'; $this->options['data-toggle'] = 'dropdown';
Html::addCssClass($this->buttonOptions, 'dropdown-toggle'); Html::addCssClass($this->options, 'dropdown-toggle');
$splitButton = Button::widget(array( $splitButton = Button::widget(array(
'label' => '<span class="caret"></span>', 'label' => '<span class="caret"></span>',
'encodeLabel' => false, 'encodeLabel' => false,
'options' => $this->buttonOptions, 'options' => $this->options,
)); ));
} else { } else {
$tag = 'a'; $tag = 'a';
$this->label .= ' <span class="caret"></span>'; $this->label .= ' <span class="caret"></span>';
$options = $this->buttonOptions; $options = $this->options;
if (!isset($options['href'])) { if (!isset($options['href'])) {
$options['href'] = '#'; $options['href'] = '#';
} }

7
framework/yii/bootstrap/ButtonGroup.php

@ -18,7 +18,7 @@ use yii\helpers\Html;
* ```php * ```php
* // a button group with items configuration * // a button group with items configuration
* echo ButtonGroup::::widget(array( * echo ButtonGroup::::widget(array(
* 'items' => array( * 'buttons' => array(
* array('label' => 'A'), * array('label' => 'A'),
* array('label' => 'B'), * array('label' => 'B'),
* ) * )
@ -26,7 +26,7 @@ use yii\helpers\Html;
* *
* // button group with an item as a string * // button group with an item as a string
* echo ButtonGroup::::widget(array( * echo ButtonGroup::::widget(array(
* 'items' => array( * 'buttons' => array(
* Button::widget(array('label' => 'A')), * Button::widget(array('label' => 'A')),
* array('label' => 'B'), * array('label' => 'B'),
* ) * )
@ -60,7 +60,6 @@ class ButtonGroup extends Widget
public function init() public function init()
{ {
parent::init(); parent::init();
$this->clientOptions = false;
Html::addCssClass($this->options, 'btn-group'); Html::addCssClass($this->options, 'btn-group');
} }
@ -70,7 +69,7 @@ class ButtonGroup extends Widget
public function run() public function run()
{ {
echo Html::tag('div', $this->renderButtons(), $this->options); echo Html::tag('div', $this->renderButtons(), $this->options);
$this->registerPlugin('button'); BootstrapAsset::register($this->getView());
} }
/** /**

882
framework/yii/bootstrap/assets/css/bootstrap.css vendored

File diff suppressed because it is too large Load Diff

2
framework/yii/bootstrap/assets/css/bootstrap.min.css vendored

File diff suppressed because one or more lines are too long

160
framework/yii/bootstrap/assets/js/bootstrap.js vendored

@ -50,9 +50,10 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") }
// http://blog.alexmaccaw.com/css-transitions // http://blog.alexmaccaw.com/css-transitions
$.fn.emulateTransitionEnd = function (duration) { $.fn.emulateTransitionEnd = function (duration) {
var called = false, $el = this var called = false, $el = this
$(this).one('webkitTransitionEnd', function () { called = true }) $(this).one($.support.transition.end, function () { called = true })
var callback = function () { if (!called) $($el).trigger('webkitTransitionEnd') } var callback = function () { if (!called) $($el).trigger($.support.transition.end) }
setTimeout(callback, duration) setTimeout(callback, duration)
return this
} }
$(function () { $(function () {
@ -218,7 +219,9 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") }
var $parent = this.$element.closest('[data-toggle="buttons"]') var $parent = this.$element.closest('[data-toggle="buttons"]')
if ($parent.length) { if ($parent.length) {
var $input = this.$element.find('input').prop('checked', !this.$element.hasClass('active')) var $input = this.$element.find('input')
.prop('checked', !this.$element.hasClass('active'))
.trigger('change')
if ($input.prop('type') === 'radio') $parent.find('.active').removeClass('active') if ($input.prop('type') === 'radio') $parent.find('.active').removeClass('active')
} }
@ -234,7 +237,7 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") }
$.fn.button = function (option) { $.fn.button = function (option) {
return this.each(function () { return this.each(function () {
var $this = $(this) var $this = $(this)
var data = $this.data('button') var data = $this.data('bs.button')
var options = typeof option == 'object' && option var options = typeof option == 'object' && option
if (!data) $this.data('bs.button', (data = new Button(this, options))) if (!data) $this.data('bs.button', (data = new Button(this, options)))
@ -532,9 +535,7 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") }
this.$element.trigger(startEvent) this.$element.trigger(startEvent)
if (startEvent.isDefaultPrevented()) return if (startEvent.isDefaultPrevented()) return
var dimension = this.dimension() var actives = this.$parent && this.$parent.find('> .accordion-group > .in')
var scroll = $.camelCase(['scroll', dimension].join('-'))
var actives = this.$parent && this.$parent.find('> .accordion-group > .in')
if (actives && actives.length) { if (actives && actives.length) {
var hasData = actives.data('bs.collapse') var hasData = actives.data('bs.collapse')
@ -543,10 +544,32 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") }
hasData || actives.data('bs.collapse', null) hasData || actives.data('bs.collapse', null)
} }
this.$element[dimension](0) var dimension = this.dimension()
this.transition('addClass', 'shown.bs.collapse')
this.$element
.removeClass('collapse')
.addClass('collapsing')
[dimension](0)
this.transitioning = 1
var complete = function () {
this.$element
.removeClass('collapsing')
.addClass('in')
[dimension]('auto')
this.transitioning = 0
this.$element.trigger('shown.bs.collapse')
}
if (!$.support.transition) return complete.call(this)
var scrollSize = $.camelCase(['scroll', dimension].join('-'))
if ($.support.transition) this.$element[dimension](this.$element[0][scroll]) this.$element
.one($.support.transition.end, $.proxy(complete, this))
.emulateTransitionEnd(350)
[dimension](this.$element[0][scrollSize])
} }
Collapse.prototype.hide = function () { Collapse.prototype.hide = function () {
@ -557,41 +580,32 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") }
if (startEvent.isDefaultPrevented()) return if (startEvent.isDefaultPrevented()) return
var dimension = this.dimension() var dimension = this.dimension()
this.reset(this.$element[dimension]())
this.transition('removeClass', 'hidden.bs.collapse')
this.$element[dimension](0)
}
Collapse.prototype.reset = function (size) { this.$element
var dimension = this.dimension() [dimension](this.$element[dimension]())
[0].offsetHeight
this.$element this.$element
.addClass('collapsing')
.removeClass('collapse') .removeClass('collapse')
[dimension](size || 'auto') .removeClass('in')
[0].offsetWidth
this.$element[size != null ? 'addClass' : 'removeClass']('collapse')
return this this.transitioning = 1
}
Collapse.prototype.transition = function (method, completeEvent) {
var that = this
var complete = function () { var complete = function () {
if (completeEvent == 'shown.bs.collapse') that.reset() this.transitioning = 0
that.transitioning = 0 this.$element
that.$element.trigger(completeEvent) .trigger('hidden.bs.collapse')
.removeClass('collapsing')
.addClass('collapse')
} }
this.transitioning = 1 if (!$.support.transition) return complete.call(this)
this.$element[method]('in')
$.support.transition && this.$element.hasClass('collapse') ? this.$element
this.$element [dimension](0)
.one($.support.transition.end, complete) .one($.support.transition.end, $.proxy(complete, this))
.emulateTransitionEnd(350) : .emulateTransitionEnd(350)
complete()
} }
Collapse.prototype.toggle = function () { Collapse.prototype.toggle = function () {
@ -1042,9 +1056,11 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") }
}) })
}) })
var $body = $(document.body) $(function () {
.on('shown.bs.modal', '.modal', function () { $body.addClass('modal-open') }) var $body = $(document.body)
.on('hidden.bs.modal', '.modal', function () { $body.removeClass('modal-open') }) .on('shown.bs.modal', '.modal', function () { $body.addClass('modal-open') })
.on('hidden.bs.modal', '.modal', function () { $body.removeClass('modal-open') })
})
}(window.jQuery); }(window.jQuery);
@ -1229,12 +1245,9 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") }
.addClass(placement) .addClass(placement)
} }
var tp = placement == 'bottom' ? { top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2 } : var calculatedOffset = this.getCalcuatedOffset(placement, pos, actualWidth, actualHeight)
placement == 'top' ? { top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2 } :
placement == 'left' ? { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth } :
/* placement == 'right' */ { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width }
this.applyPlacement(tp, placement) this.applyPlacement(calculatedOffset, placement)
this.$element.trigger('shown.bs.' + this.type) this.$element.trigger('shown.bs.' + this.type)
} }
} }
@ -1246,25 +1259,33 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") }
var height = $tip[0].offsetHeight var height = $tip[0].offsetHeight
// manually read margins because getBoundingClientRect includes difference // manually read margins because getBoundingClientRect includes difference
offset.top = offset.top + parseInt($tip.css('margin-top'), 10) var marginTop = parseInt($tip.css('margin-top'), 10)
offset.left = offset.left + parseInt($tip.css('margin-left'), 10) var marginLeft = parseInt($tip.css('margin-left'), 10)
// we must check for NaN for ie 8/9
if (isNaN(marginTop)) marginTop = 0
if (isNaN(marginLeft)) marginLeft = 0
offset.top = offset.top + marginTop
offset.left = offset.left + marginLeft
$tip $tip
.offset(offset) .offset(offset)
.addClass('in') .addClass('in')
// check to see if placing tip in new offset caused the tip to resize itself
var actualWidth = $tip[0].offsetWidth var actualWidth = $tip[0].offsetWidth
var actualHeight = $tip[0].offsetHeight var actualHeight = $tip[0].offsetHeight
if (placement == 'top' && actualHeight != height) { if (placement == 'top' && actualHeight != height) {
replace = true replace = true
offset.top = offset.top + height - actualHeight offset.top = offset.top + height - actualHeight
} }
if (placement == 'bottom' || placement == 'top') { if (/bottom|top/.test(placement)) {
var delta = 0 var delta = 0
if (offset.left < 0){ if (offset.left < 0) {
delta = offset.left * -2 delta = offset.left * -2
offset.left = 0 offset.left = 0
@ -1299,6 +1320,8 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") }
var $tip = this.tip() var $tip = this.tip()
var e = $.Event('hide.bs.' + this.type) var e = $.Event('hide.bs.' + this.type)
function complete() { $tip.detach() }
this.$element.trigger(e) this.$element.trigger(e)
if (e.isDefaultPrevented()) return if (e.isDefaultPrevented()) return
@ -1307,9 +1330,9 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") }
$.support.transition && this.$tip.hasClass('fade') ? $.support.transition && this.$tip.hasClass('fade') ?
$tip $tip
.one($.support.transition.end, $tip.detach) .one($.support.transition.end, complete)
.emulateTransitionEnd(150) : .emulateTransitionEnd(150) :
$tip.detach() complete()
this.$element.trigger('hidden.bs.' + this.type) this.$element.trigger('hidden.bs.' + this.type)
@ -1335,6 +1358,13 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") }
}, this.$element.offset()) }, this.$element.offset())
} }
Tooltip.prototype.getCalcuatedOffset = function (placement, pos, actualWidth, actualHeight) {
return placement == 'bottom' ? { top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2 } :
placement == 'top' ? { top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2 } :
placement == 'left' ? { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth } :
/* placement == 'right' */ { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width }
}
Tooltip.prototype.getTitle = function () { Tooltip.prototype.getTitle = function () {
var title var title
var $e = this.$element var $e = this.$element
@ -1350,8 +1380,8 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") }
return this.$tip = this.$tip || $(this.options.template) return this.$tip = this.$tip || $(this.options.template)
} }
Tooltip.prototype.arrow =function(){ Tooltip.prototype.arrow = function () {
return this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow") return this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow')
} }
Tooltip.prototype.validate = function () { Tooltip.prototype.validate = function () {
@ -1442,6 +1472,8 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") }
this.init('popover', element, options) this.init('popover', element, options)
} }
if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js')
Popover.DEFAULTS = $.extend({} , $.fn.tooltip.Constructor.DEFAULTS, { Popover.DEFAULTS = $.extend({} , $.fn.tooltip.Constructor.DEFAULTS, {
placement: 'right' placement: 'right'
, trigger: 'click' , trigger: 'click'
@ -1471,7 +1503,13 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") }
$tip.removeClass('fade top bottom left right in') $tip.removeClass('fade top bottom left right in')
$tip.find('.popover-title:empty').hide() // Hide empty titles
//
// IE8 doesn't accept hiding via the `:empty` pseudo selector, we have to do
// this manually by checking the contents.
if ($tip.find('.popover-title').html() === '') {
$tip.find('.popover-title').hide();
}
} }
Popover.prototype.hasContent = function () { Popover.prototype.hasContent = function () {
@ -1488,15 +1526,15 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") }
o.content) o.content)
} }
Popover.prototype.arrow =function () {
return this.$arrow = this.$arrow || this.tip().find('.arrow')
}
Popover.prototype.tip = function () { Popover.prototype.tip = function () {
if (!this.$tip) this.$tip = $(this.options.template) if (!this.$tip) this.$tip = $(this.options.template)
return this.$tip return this.$tip
} }
Popover.prototype.destroy = function () {
this.hide().$element.off('.' + this.type).removeData(this.type)
}
// POPOVER PLUGIN DEFINITION // POPOVER PLUGIN DEFINITION
// ========================= // =========================
@ -1555,10 +1593,10 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") }
function ScrollSpy(element, options) { function ScrollSpy(element, options) {
var href var href
var process = $.proxy(this.process, this) var process = $.proxy(this.process, this)
var $element = $(element).is('body') ? $(window) : $(element)
this.$element = $(element).is('body') ? $(window) : $(element)
this.$body = $('body') this.$body = $('body')
this.$scrollElement = $element.on('scroll.bs.scroll-spy.data-api', process) this.$scrollElement = this.$element.on('scroll.bs.scroll-spy.data-api', process)
this.options = $.extend({}, ScrollSpy.DEFAULTS, options) this.options = $.extend({}, ScrollSpy.DEFAULTS, options)
this.selector = (this.options.target this.selector = (this.options.target
|| ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7 || ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
@ -1576,6 +1614,8 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") }
} }
ScrollSpy.prototype.refresh = function () { ScrollSpy.prototype.refresh = function () {
var offsetMethod = this.$element[0] == window ? 'offset' : 'position'
this.offsets = $([]) this.offsets = $([])
this.targets = $([]) this.targets = $([])
@ -1589,7 +1629,7 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") }
return ($href return ($href
&& $href.length && $href.length
&& [[ $href.offset().top + (!$.isWindow(self.$scrollElement.get(0)) && self.$scrollElement.scrollTop()), href ]]) || null && [[ $href[offsetMethod]().top + (!$.isWindow(self.$scrollElement.get(0)) && self.$scrollElement.scrollTop()), href ]]) || null
}) })
.sort(function (a, b) { return a[0] - b[0] }) .sort(function (a, b) { return a[0] - b[0] })
.each(function () { .each(function () {

2
framework/yii/bootstrap/assets/js/bootstrap.min.js vendored

File diff suppressed because one or more lines are too long

17
framework/yii/debug/assets/main.css

@ -5,7 +5,7 @@
font: 11px Verdana, Arial, sans-serif; font: 11px Verdana, Arial, sans-serif;
text-align: left; text-align: left;
height: 40px; height: 40px;
border-bottom: 1px solid #ccc; border-bottom: 1px solid #e4e4e4;
background: rgb(237,237,237); background: rgb(237,237,237);
background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2VkZWRlZCIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjUzJSIgc3RvcC1jb2xvcj0iI2Y2ZjZmNiIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiNmZmZmZmYiIHN0b3Atb3BhY2l0eT0iMSIvPgogIDwvbGluZWFyR3JhZGllbnQ+CiAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+); background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2VkZWRlZCIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjUzJSIgc3RvcC1jb2xvcj0iI2Y2ZjZmNiIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiNmZmZmZmYiIHN0b3Atb3BhY2l0eT0iMSIvPgogIDwvbGluZWFyR3JhZGllbnQ+CiAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+);
background: -moz-linear-gradient(top, rgba(237,237,237,1) 0%, rgba(246,246,246,1) 53%, rgba(255,255,255,1) 100%); background: -moz-linear-gradient(top, rgba(237,237,237,1) 0%, rgba(246,246,246,1) 53%, rgba(255,255,255,1) 100%);
@ -119,11 +119,22 @@ span.indent {
ul.trace { ul.trace {
font-size: 12px; font-size: 12px;
color: #666; color: #999;
margin: 2px 0 0 20px; margin: 2px 0 0 0;
padding: 0;
list-style: none;
} }
.default-index .container, .default-index .container,
.default-view .container { .default-view .container {
margin-top: 10px; margin-top: 10px;
} }
.callout-danger {
background-color: #fcf2f2;
border-color: #dFb5b4;
}
.callout {
margin: 0 0 10px 0;
padding: 5px 10px;
}

6
framework/yii/debug/panels/LogPanel.php

@ -65,11 +65,11 @@ EOD;
)); ));
} }
if ($level == Logger::LEVEL_ERROR) { if ($level == Logger::LEVEL_ERROR) {
$class = ' class="error"'; $class = ' class="danger"';
} elseif ($level == Logger::LEVEL_WARNING) { } elseif ($level == Logger::LEVEL_WARNING) {
$class = ' class="warning"'; $class = ' class="warning"';
} elseif ($level == Logger::LEVEL_INFO) { } elseif ($level == Logger::LEVEL_INFO) {
$class = ' class="info"'; $class = ' class="success"';
} else { } else {
$class = ''; $class = '';
} }
@ -84,7 +84,7 @@ EOD;
<thead> <thead>
<tr> <tr>
<th style="width: 100px;">Time</th> <th style="width: 100px;">Time</th>
<th style="width: 100px;">Level</th> <th style="width: 65px;">Level</th>
<th style="width: 250px;">Category</th> <th style="width: 250px;">Category</th>
<th>Message</th> <th>Message</th>
</tr> </tr>

59
framework/yii/debug/views/default/view.php

@ -1,5 +1,7 @@
<?php <?php
use yii\bootstrap\ButtonDropdown;
use yii\bootstrap\ButtonGroup;
use yii\helpers\Html; use yii\helpers\Html;
/** /**
@ -36,35 +38,36 @@ $this->title = 'Yii Debugger';
</ul> </ul>
</div><!--/span--> </div><!--/span-->
<div class="col-lg-10"> <div class="col-lg-10">
<div class="meta alert alert-info"> <div class="callout callout-danger">
<div class="btn-group"> <?php
<?php echo Html::a('All', array('index'), array('class' => 'btn')); ?> $count = 0;
<button class="btn dropdown-toggle" data-toggle="dropdown"> $items = array();
Last 10 foreach ($manifest as $meta) {
<span class="caret"></span> $label = $meta['tag'] . ': ' . $meta['method'] . ' ' . $meta['url'] . ($meta['ajax'] ? ' (AJAX)' : '')
</button> . ', ' . date('Y-m-d h:i:s a', $meta['time'])
<ul class="dropdown-menu"> . ', ' . $meta['ip'];
<?php $url = array('view', 'tag' => $meta['tag'], 'panel' => $activePanel->id);
$count = 0; $items[] = array(
foreach ($manifest as $meta) { 'label' => $label,
$label = $meta['tag'] . ': ' . $meta['method'] . ' ' . $meta['url'] . ($meta['ajax'] ? ' (AJAX)' : '') 'url' => $url,
. ', ' . date('Y-m-d h:i:s a', $meta['time']) );
. ', ' . $meta['ip']; if (++$count >= 10) {
$url = array('view', 'tag' => $meta['tag'], 'panel' => $activePanel->id); break;
echo '<li>' . Html::a(Html::encode($label), $url) . '</li>';
if (++$count >= 10) {
break;
}
} }
?> }
</ul> echo ButtonGroup::widget(array(
</div> 'buttons' => array(
<?php echo $summary['tag']; ?>: Html::a('All', array('index'), array('class' => 'btn btn-default')),
<?php echo $summary['method']; ?> ButtonDropdown::widget(array(
<?php echo Html::a(Html::encode($summary['url']), $summary['url']); ?> 'label' => 'Last 10',
<?php echo $summary['ajax'] ? ' (AJAX)' : ''; ?> 'options' => array('class' => 'btn-default'),
at <?php echo date('Y-m-d h:i:s a', $summary['time']); ?> 'dropdown' => array('items' => $items),
by <?php echo $summary['ip']; ?> )),
),
));
echo "\n" . $summary['tag'] . ': ' . $summary['method'] . ' ' . Html::a(Html::encode($summary['url']), $summary['url']);
echo ' at ' . date('Y-m-d h:i:s a', $summary['time']) . ' by ' . $summary['ip'];
?>
</div> </div>
<?php echo $activePanel->getDetail(); ?> <?php echo $activePanel->getDetail(); ?>
</div> </div>

Loading…
Cancel
Save