mirror of
https://github.com/maximebf/php-debugbar.git
synced 2025-01-17 05:18:32 +01:00
Use xdebug_link in html variables (#609)
This commit is contained in:
parent
b6113ae0e5
commit
d420dd09d1
@ -59,7 +59,10 @@ class ObjectCountCollector extends DataCollector implements DataCollectorInterfa
|
|||||||
$reflector = class_exists($class) ? new \ReflectionClass($class) : null;
|
$reflector = class_exists($class) ? new \ReflectionClass($class) : null;
|
||||||
|
|
||||||
if ($reflector && $link = $this->getXdebugLink($reflector->getFileName())) {
|
if ($reflector && $link = $this->getXdebugLink($reflector->getFileName())) {
|
||||||
$data[$class . '<a href="' . $link['url'] . '" class="phpdebugbar-widgets-editor-link"></a>'] = $count;
|
$data[$class] = [
|
||||||
|
'value' => $count,
|
||||||
|
'xdebug_link' => $link,
|
||||||
|
];
|
||||||
} else {
|
} else {
|
||||||
$data[$class] = $count;
|
$data[$class] = $count;
|
||||||
}
|
}
|
||||||
|
@ -31,6 +31,7 @@ pre.phpdebugbar-widgets-code-block {
|
|||||||
text-align: right;
|
text-align: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.phpdebugbar-widgets-kvlist span.phpdebugbar-widgets-filename,
|
||||||
li.phpdebugbar-widgets-list-item span.phpdebugbar-widgets-filename {
|
li.phpdebugbar-widgets-list-item span.phpdebugbar-widgets-filename {
|
||||||
display: block;
|
display: block;
|
||||||
font-style: italic;
|
font-style: italic;
|
||||||
@ -39,7 +40,7 @@ pre.phpdebugbar-widgets-code-block {
|
|||||||
color: #888;
|
color: #888;
|
||||||
}
|
}
|
||||||
|
|
||||||
li.phpdebugbar-widgets-list-item a.phpdebugbar-widgets-editor-link:hover {
|
a.phpdebugbar-widgets-editor-link:hover {
|
||||||
color: #aaaaaa;
|
color: #aaaaaa;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -218,7 +218,7 @@ if (typeof(PhpDebugBar) == 'undefined') {
|
|||||||
itemRenderer: function(dt, dd, key, value) {
|
itemRenderer: function(dt, dd, key, value) {
|
||||||
$('<span />').attr('title', key).text(key).appendTo(dt);
|
$('<span />').attr('title', key).text(key).appendTo(dt);
|
||||||
|
|
||||||
var v = value;
|
var v = value && value.value || value;
|
||||||
if (v && v.length > 100) {
|
if (v && v.length > 100) {
|
||||||
v = v.substr(0, 100) + "...";
|
v = v.substr(0, 100) + "...";
|
||||||
}
|
}
|
||||||
@ -251,7 +251,21 @@ if (typeof(PhpDebugBar) == 'undefined') {
|
|||||||
|
|
||||||
itemRenderer: function(dt, dd, key, value) {
|
itemRenderer: function(dt, dd, key, value) {
|
||||||
$('<span />').attr('title', $('<i />').html(key || '').text()).html(key || '').appendTo(dt);
|
$('<span />').attr('title', $('<i />').html(key || '').text()).html(key || '').appendTo(dt);
|
||||||
dd.html(value);
|
dd.html(value && value.value || value);
|
||||||
|
|
||||||
|
if (value && value.xdebug_link) {
|
||||||
|
var header = $('<span />').addClass(csscls('filename')).text(value.xdebug_link.filename + ( value.xdebug_link.line ? "#" + value.xdebug_link.line : ''));
|
||||||
|
if (value.xdebug_link) {
|
||||||
|
if (value.xdebug_link.ajax) {
|
||||||
|
$('<a title="' + value.xdebug_link.url + '"></a>').on('click', function () {
|
||||||
|
$.ajax(value.xdebug_link.url);
|
||||||
|
}).addClass(csscls('editor-link')).appendTo(header);
|
||||||
|
} else {
|
||||||
|
$('<a href="' + value.xdebug_link.url + '"></a>').addClass(csscls('editor-link')).appendTo(header);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
header.appendTo(dd);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user