joomla/joomla-cms — pull request #2211 by Bakual (2013-10-10 18:31:27+00:00)
Title: New module to show post install messages in extension manager (or any extension)

After some discussions in https://github.com/joomla/joomla-cms/pull/2143 about moving the advertisment message to the new postinstall message component, I wrote a small module which could do that.

It will automatically take the current `option` parameter and search for active messages for this component. So it will be very easy to use also in other extensions if a developer chooses to use com_postinstall.

In case of `com_cpanel` it uses the extension id `700` so it would show the messages for Joomla like the current popup does. So in theory we could just put that module to the `cpanel` position and remove the current code in cpanel layouts and it would show the message in the module position (instead of the current modal window).

I have added the code to load the module in the extension manager layout. It's basically only two lines:

$mod_postinstall = JModuleHelper::getModule('mod_postinstall');
echo JModuleHelper::renderModule($mod_postinstall, array('style' => 'well'));

I think we could even expand it so developers could add some properties or set some params to the module, like a different text or something like that.

I didn't add a message yet to the #__postinstall_messages table. I would have to try out first how that works, but looking at it, it should be possible for sure. Maybe Nicholas would be able to help here.
The notification message currently shows even when no message is available, I believe that this is a bug in com_postinstall. Looks to me like `FOFModel::getTmpInstance('Messages', 'PostinstallModel', array('input' => array('eid' => 700)));` doesn't take into account the passed `eid` parameter and always looks up the default `700` (joomla_files). But I would have to look closer into this first.

What do you think? Would that approach work?