View Full Version : Trying to understand modules
RayYates
02-14-07, 07:49 PM
I'm trying to understand certain aspects of modules. (Old hat to you guys)
In another thread http://extranet.miva.com/forums/forumdisplay.php?f=30 I asked about a UIModules function. I now realize only one UI module can be active and since I'm using OpenUI, none of these functions are available for use in my modules.
Is that about correct?
I guess that also means (since there is no Error_Module type) that to effect the error messages they must be encoded directly onto each screen or template as needed or OpenUI Hookpoint would have to be utilized.
Is that also correct?
Ray, you may not be asking the right question. I'm not quite sure what you're asking. The only thing I can think of is that you want to validate input in particular screen when the "continue" button is pressed. Is that the question?
Regards,
Scott
RayYates
02-16-07, 04:36 PM
Sorry if my question is unclear. I've finally gotten comfortable with the module API and I've been experimenting.
When looking at the functions required for the different module type, http://smallbusiness.miva.com/support/docs/api/ModFuncs-html2/MM_ModFunctions4x.html, I wondered why there were so few UI modules (only one actually; OpenUI). I tried creating one and it seems to install correctly but none of the functions would fire. Looking at the databases it seems it did not install completely.
So is my assumption correct? i.e. Unlike other modules, only one UI module can be active at a time and that is why my UI module functions don't fire.
If true, then Merchant events/functions, defined in the spec for UI modules, are not available to other module types. That seems unfortunate because of the power those functions seem to hold.
It also means I already know the answer to the second question.
That bring up another point? If a UI module is coded correctly and installed before OpenUI, will the functions fire?
The one UI module used in the store is, by default, MMUI. If you go to admin:store:layout, you have the option of changing that to another installed UI module, eg OpenUI. That would uninstall the MMUI (removing all of its backend databases) and install the OpenUI (creating all the required backend databases). MMUI will always be there before your UI module and the only way to beat that would be to switch the layout to your UI module. If you do not have the backend databases created for fonts, colors, headers, footers, messages, etc in your module, your store would surely crash.
RayYates
02-17-07, 05:39 AM
I originally thought the UI functions would pass through to every installed module unless the module returned a 0 or null value. I can find nothing in the documentation that says only one UI module can be active at a time, but I understand your explanation. ...creating all the required backend databases etc... Unlike other module types, the OpenUI module completely replace the original functionality of MMUI.
That would explain why there are no UI modules other than OpenUI.
hmmmmm... thinking out loud... I suppose one write a UI module where all of the required functions called the OpenUI (if detected) or MMUI functions? The new module could add features then "pass through" retaining all of the original functionality of the main UI without having to re-create it.
vBulletin® v3.7.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.