User tests: Successful: Unsuccessful:
Similar to how the quickicons module triggers an event to add additional items to its output, this adds support for the mod_stats_admin
module to do the same.
A new onGetStats
event is published with a single parameter, a context (hardcoded to mod_stats_admin
) and any plugin responding to this event is expected to return an array matching this schema:
array(
'title' => 'Stats Item Title',
'data' => 'Data to be displayed',
'icon' => 'Optional IcoMoon font icon for the row, defaulting to "info" if not set',
);
The title and data attributes MUST be defined or a row is not added.
Similar to the quickicons implementation, items can NOT be removed via the plugin event.
Add the following method to a system plugin:
public function onGetStats($context)
{
return array(
array(
'title' => 'Plays Audio',
'data' => JText::_('JNO'),
'icon' => 'music',
),
);
}
With the admin stats module enabled, you should see a new row with this data.
Status | New | ⇒ | Pending |
Labels |
Added:
?
|
Category | ⇒ | Modules |
I have tested this item
Status | Pending | ⇒ | Ready to Commit |
RTC. Maybe with the New Feature label?
Labels |
Added:
?
|
can we allow multiple results then, as it in quickicon onGetIcons
?
public function onGetStats($context)
{
return array(
array(
'title' => 'Plays Audio',
'data' => JText::_('JNO'),
'icon' => 'music',
),
array(
'title' => 'Plays Video',
'data' => JText::_('JYES'),
'icon' => 'video',
),
);
}
This PR has received new commits.
CC: @brianteeman, @nikitadhiman
To me that's creating excessive complexity but whatever, it's done.
Milestone |
Added: |
Milestone |
Added: |
Status | Ready to Commit | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2016-09-04 12:57:47 |
Closed_By | ⇒ | wilsonge |
Labels |
Removed:
?
|
Category | Modules | ⇒ | Administration Modules |
I have tested this item✅ successfully on f321fe2
This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/10870.