James.mitchell Posted October 19, 2015 Report Share Posted October 19, 2015 Can anyone advise what I need to do to get a (new) plugin to attach itself to an existing controller? I have a plugin that adds a new table, and I want to have the data included in the Admin statistics reports for Advertisers & Campaigns.So far I have a "demo" that works by changing stats.php and adding the plugin directly to OA_Admin_Statistics_Delivery_Controller_GlobalAdvertiser // Prepare the stats controller, and populate with the stats$oStatsController = &OA_Admin_Statistics_Factory::getController ( $entity . "-" . $breakdown, $aParams );require_once MAX_PATH . '/plugins/deliveryLog/oxLogDwellTime/DwellTime.php';$dwplugin = & new OA_StatisticsFieldsDelivery_DwellTime (); // my plugin$oStatsController->addPlugin ( 'oxDwellTime', $dwplugin ); // add the plugin to the controller$oStatsController->aColumnVisible += $dwplugin->getVisibleColumns (); // add my fields to the controllers lists$oStatsController->aColumns += $dwplugin->getFields ( $oStatsController );$oStatsController->aColumnLinks += $dwplugin->getColumnLinks ();$oStatsController->aEmptyRow += $dwplugin->getEmptyRow ();... which is duplicating the logic from the controller's constructor.But what I want to do is to have my plugin registered, or extend, all the report controllers without doing the manual hack. I assume this is possible by registering something at install time, in the XML? Can someone point me to either a github project that does this, or suggest what I need to modify? Thanks. Quote Link to comment Share on other sites More sharing options...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.