From: Arden W. <ar...@li...> - 2003-07-22 14:32:37
|
On Tue, 2003-07-22 at 07:50, Luc...@cs... wrote: > > We are studying how to develop a new module for our project, and are trying > to understand how to code it correctly. > Looking to various modules for inspiration carried a few questions since > many developers used different methods and API calls for same things. > Whether this depends on the evolution of the code (from php-nuke to envo) > or the skill or style of the programmer, we have difficulty in determining > the correct way of doing and why. > > These are the first doubts we have: > 1) When I want set the $MODULE_URL constant, is much convenient use the API > function or use static code as seen in various modules? The daily_archive module is done this way with pnGetModURL. This function is slow sometimes in updating from one site to the next. See www.sudbury.linuxguru.ca and test how the function behaves by then visiting www.sherbrooke.linuxguru.ca and watching how the function reports the URL. It does not adjust to a new site name. I have had to alter some of the code to directly place people at the index. > 2) In the permission's instance, what is the difference between :: and .* ? > Are they synonyms? Where can we find some mode on developing the permission > part of a module and what is the meaning of the first parameter passed to > the function pnSecAuthAction? It's always set at 0 is it useful in the > multisite option? > 3) In a modules, if we choose to separate the business logic in different > files (index.php + indexfunctions.php for example), is it advisable to put > the security check (if (pnSecAuthAction...)) in all the files or only in > the index.php? > 6) When I want load the module's name in the constant $MODULE_NAME is > better use: $globals['name'], > $globals['ModName'] or basename(dirname(__FILE__)) ? > > > There are many others things like these. Can we speak about it? > > Luca and Marco |