diff --git a/src/DebugBar/DataCollector/DataCollector.php b/src/DebugBar/DataCollector/DataCollector.php index a816b1e..db7c9b6 100644 --- a/src/DebugBar/DataCollector/DataCollector.php +++ b/src/DebugBar/DataCollector/DataCollector.php @@ -72,6 +72,18 @@ abstract class DataCollector implements DataCollectorInterface } /** + * Get an Xdebug Link to a file + * + * @return string|null + */ + public function getXdebugLink($file, $line = 1) + { + if (ini_get('xdebug.file_link_format') || extension_loaded('xdebug')) { + return e(str_replace(array('%f', '%l'), array($file, $line), ini_get('xdebug.file_link_format'))); + } + } + + /** * Sets the default variable dumper used by all collectors subclassing this class * * @param DebugBarVarDumper $varDumper diff --git a/src/DebugBar/Resources/widgets/templates/widget.css b/src/DebugBar/Resources/widgets/templates/widget.css index 7986069..29f6ab9 100644 --- a/src/DebugBar/Resources/widgets/templates/widget.css +++ b/src/DebugBar/Resources/widgets/templates/widget.css @@ -25,7 +25,9 @@ div.phpdebugbar-widgets-templates div.phpdebugbar-widgets-status span.phpdebugba div.phpdebugbar-widgets-templates span.phpdebugbar-widgets-render-time:before, div.phpdebugbar-widgets-templates span.phpdebugbar-widgets-memory:before, div.phpdebugbar-widgets-templates span.phpdebugbar-widgets-param-count:before, -div.phpdebugbar-widgets-templates span.phpdebugbar-widgets-type:before { +div.phpdebugbar-widgets-templates span.phpdebugbar-widgets-type:before, +div.phpdebugbar-widgets-templates a.phpdebugbar-widgets-editor-link:before +{ font-family: PhpDebugbarFontAwesome; margin-right: 4px; font-size: 12px; @@ -42,6 +44,10 @@ div.phpdebugbar-widgets-templates span.phpdebugbar-widgets-param-count:before { div.phpdebugbar-widgets-templates span.phpdebugbar-widgets-type:before { content: "\f121"; } +div.phpdebugbar-widgets-templates a.phpdebugbar-widgets-editor-link:before { + content: "\f08e"; + margin-left: 4px; +} div.phpdebugbar-widgets-templates table.phpdebugbar-widgets-params { display: none; width: 70%; diff --git a/src/DebugBar/Resources/widgets/templates/widget.js b/src/DebugBar/Resources/widgets/templates/widget.js index 362d4a4..2b120a7 100644 --- a/src/DebugBar/Resources/widgets/templates/widget.js +++ b/src/DebugBar/Resources/widgets/templates/widget.js @@ -17,6 +17,10 @@ this.$list = new PhpDebugBar.Widgets.ListWidget({ itemRenderer: function(li, tpl) { $('').addClass(csscls('name')).text(tpl.name).appendTo(li); + + if (typeof tpl.xdebug_link != 'undefined') { + $('').addClass(csscls('editor-link')).appendTo(li); + } if (tpl.render_time_str) { $('').addClass(csscls('render-time')).text(tpl.render_time_str).appendTo(li); }