Attached the patches for the new events to the Jira (
http://svn.modxcms.com/jira/browse/MODX-867 ).
The new events are grouped with the manager events and I named them:
OnManagerWelcomePrerender -> before the content
OnManagerWelcomeHome -> in the home tab
OnManagerWelcomeRender -> after the content
I invoked the events at the end of the processing of the welcome page data to allow the use of existing placeholders (which can also allow you to overwrite existing placeholders).
Here is a simple plugin to use as a test (including an example of how to use data from existing placeholders):
// <?php
$e = &$modx->Event;
$output ='';
switch($e->name) {
case 'OnManagerWelcomePrerender':
$output = "<h1>OnManagerWelcomePrerender</h1>";
break;
case 'OnManagerWelcomeHome':
$output = "<h1>OnManagerWelcomeHome</h1>";
break;
case 'OnManagerWelcomeRender':
$output = "<h1>OnManagerWelcomeRender</h1>";
$ph = $modx->getPlaceholder('UserInfo');
$ph = '<strong>Hello World</strong>'.$ph;
$modx->setPlaceholder('UserInfo', $ph);
break;
default:
$output = '';
break;
}
$e->output($output);
return;
Here is the output of this plugin:
I can think of many cool uses for this...I have a simple comments dashboard setup. Can even do a dashboard with multiple ’widgets’
BTW - I used NetBeans to do the patches..easy to do