User tests: Successful: Unsuccessful:
Allow extensions to register a callable function to be triggered when the debug console is rendered. This gives a hook to allow extensions to add data to the console.
Somewhere after the debug plugin is instantiated, add the following code:
// Only register when in debug mode and the debug plugin is enabled
if (JDEBUG && JPluginHelper::isEnabled('system', 'debug'))
{
PlgSystemDebug::addDisplayCallback('test', function () { return 'Testing new debug console feature!' });
}
Now when viewing the page and you have debug mode and the debug plugin enabled, you should have a new section on the console with a title PLG_DEBUG_TEST
(this is a translatable key) and opening the section should have the text from our anonymous function used for testing here.
Document the new API methods:
PlgSystemDebug::addDisplayCallback()
which takes two parameters:
$name
is the name of the callable function, it's used as an identifier for the various markup elements and to create the language key to translate the title$callable
is a valid callable function (anything which passes PHP 5.4's callable
typehint or the is_callable()
method will suffice here)PlgSystemDebug::removeDisplayCallback()
which takes one parameter:
$name
is the name of the callable function to be removedDocument the callable's functionality:
Document how to translate the title:
JText::_('PLG_DEBUG_' . strtoupper($name))
, so the name you give your callable should be in a format allowed with the language parserPLG_DEBUG_TEST="Testing New Feature"
key somewhereCategory | ⇒ | Plugins Front End |
Status | New | ⇒ | Pending |
Labels |
Added:
?
|
Labels |
Added:
?
?
|
Labels |
Removed:
?
|
I have tested this item
Status | Pending | ⇒ | Ready to Commit |
Labels |
Added:
?
|
Status | Ready to Commit | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2016-09-03 11:09:28 |
Closed_By | ⇒ | wilsonge |
Labels |
Removed:
?
|
I have tested this item✅ successfully on f942e74
works as described. nice feature!
This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/11700.