By Freeform Solutions
Changelog:
Feb 8 2009 -- updated to include changes in iMenu 3...changes have not been fully tested...please report issues to info@freeformsolutions.ca
May 28 2006 -- updated in conjunction with release of new modules
April 5 2006 -- updated clone_imenu.pl with two bug fixes
We find it very useful to clone these modules. WF-Channel is not designed to handle lots and lots and lots of pages, and also, you can't have two WF-Channel areas in the main menu if you only have one WF-Channel module. By cloning the module you get the nice submenu functionality in the main menu, with all the benefits of the page management that it gives you for multiple sections of your site.
On the other hand, sometimes the main menu is just not right for the site you need to build. There are a lot of custom menu modules out there. We liked the simplicity of iMenu, and added a few features of our own, including sub menus. Now that you can clone iMenu, you can actually have lots of different menus in your site, all with sub menu functionality in them. Multi-menu and other modules do similar things, but we like this cloning approach best, so we're sharing our tools for it with the community.
If you are not sure about this, then you probably don't have Perl installed. Therefore, assuming you are using Windows, get a copy of ActiveState Perl here:
http://www.activestate.com/Products/ActivePerl/
Follow the install instructions and you're done.
perl clone.pl aboutus "About Us"
That's it. Upload the new module and install it and away you go.
If you're cloning WF-Channel, don't forget to CHMOD the permissions on the folders that require that, as per the wfchannel readme.
These scripts were written using ActivePerl for Windows. I think it will run okay on Linux, but I can't say for sure. If you have problems, it's probably related to the syntax for the paths to files, which should be easy enough to modify and fix.
This script is meant to be run from the new folder you make. I believe if you run it from another location, the paths will be screwed up, depending on your operating system, version of perl, etc. What this means is, make sure the new folder that you made is the active folder when you run the script, ie: if the folder you made is called c:\xoops\modules\aboutus then make sure the DOS prompt is c:\xoops\modules\aboutus> when you run the script.
Or to put it another way, this is good:
c:\xoops\modules\aboutus>perl clone.pl aboutus "About Us"
While this is bad:
c:\>perl c:\xoops\modules\aboutus\clone.pl aboutus "About Us"
Of course, make sure that your new folder name has no spaces!
The admin icon for the modules look exactly like the icon for the original modules, and have their names on them. Not much a perl script can do about that (without all kinds of extra work), but the module name does change to reflect the human readable name you pass in at the command line so that makes it a little easier to tell your different copies apart. Note that we have found that if you do not modify the icons in some way for each copy, then they don't all show up in the Administration Menu!
To make a new icon, get a copy of the Bit3 font that is used for the XOOPS module icon text (or if you don't care about it matching, use any old font), and open up the icon file and edit it.