Many thanks for posting your new module template code for Moodle 1.7.

Please could you also post it in the Tracker - MDLSITE-75 - to ensure it gets reviewed and put in CVS.
i'm working locally, my pc is my server so is there any help for me because i should deliver this module within 3 days..
pleaseeeee ???
hello Chris:
Thank you for the template of module. I'm from China. And now I want to develop a new module.And I don't use moodle before.I've some questions about it.
When I put the folder in the ".../Moodle/Mod/" and edit the files of the template, it still can't work .Which should I do except changing the name "newmodule" ? Is it necessary to finish the file "Lib.php" or other files?
Thank you for your help.
I am going to check it out and test it, I need the template to integrate a project that a coworker has been working on for several months. I'll let you know my results and how well your template worked for us.
Juan
Hello,
in this new template model (New Module Template Code for Moodle 1.7)there is a mod.html file like the older new module template. But in the latest Moodle distribution (Moodle 1.8) there isn't the mod.html file in the mods folders, instead of mod.html theres is a mod_form.php.
What's the reason?The old mod.html is still usable in Moodle 1.8? or only can be used the mod_form.php? And another question about this, what difference is between this two files?
Thank you for your attention!!
Re: New Module Template Code for Moodle 1.7
I'm asking the same as you, Joan!
I developed a module with this model:
http://download.moodle.org/download.php/plugins/mod/NEWMODULE.zip
I'm working with Moodle 1.8 and I don't have any problems. But when I try to install the module on Moodle 1.7.1, I get this error:
This module cannot be added to this course yet!
(No file found at: ../mod/amcontent/mod.html)
Of course, I don't have any mod.html file... Because mod_html.php works perfectly.
Do I have to rewrite the form for version 1.7, in mod.html?
Thanks for any help!
Adrien
Hi chris.
I tried to add this module onto latest version moodle1.8.2 without changing.(it means that I moved this skelton folder to mod/ along README.txt).
But the moodle did not recognize this module at all.
I don't know the reason why the system could not find module.
Following is the all what I did.
Please tell me what do I have to do so that I can work this module.
1. decompressed MODULE2.zip
2. copied to directory mod/
3. I logged in moodle 1.8.2 system as Administrator.
Then I clicked link labeled Notification(admin/index.php) but nothing was displayed.
4. I checked module page(admin/module.php) but the system didn't find newmodule.
thank you.
Hi All.
this trouble was caused by the conflict of module's ID on the databese.
I checked the module table of database.
Then I found that the last module ID was 17.
So I edited lib.php and set 18 to the variable named $newmodule_CONSTANT.
Then I tried again.
the newmodule was recognized successfully.
I apologize that I bothered this forum with this tiny trouble.
Thanx
I've tried your template with moodle 1.6.5 but i'm having some problems..
I changed all 'newmodule' keywords to my module's name (let's call it 'xx') but two things happen:
1. i don't know what to do with file db/install.xml
2. Under the activity module column in the Modules configuration page, the module is listed as 'newmodule', not xx.
There were some database errors so i created two files under db:
mysql.sql
CREATE TABLE `prefix_xx` (
`id` int(10) unsigned NOT NULL auto_increment,
`name` varchar(255) NOT NULL default '',
PRIMARY KEY (`id`),
KEY `course` (`course`)
)
# --------------------------------------------------------
INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('xx', 'view', 'xx', 'name');
and mysql.php (copy paste from other file and deleted all lines
<?php // $Id: mysql.php,v 1.13 2006/04/24 08:43:29 vyshane Exp $
?>
any suggestion would be much appreciated
joao
The naming of your module comes from two places. First is the directory name containing the template files. ie. /mod/modulename. Many links refer to the directory. Second are the string files in the "lang" folder. There are a few strings that are used by Moodle to identify your module on the admin page and when adding a resource. Those are included and you can look for the get_string () functions in the code to see where they come from.
db/install.xml is from one of my beloved features of the latest versions which is the XMLDB editor. In the admin tools there is an option for XMLDB that loads all the install.xml files and allows you to edit the database structure for your module. That tool then will generate PHP code to be placed in install.php. Each time you visit the notifications page, it checks the version.php file and upgrades your module if needed. Included in this upgrade is the migration of database tables to a new format if needed. It takes a short time to get used to but is far better than having to figure it our by yourself.
Perhaps reviewing these two items will fix your sql problems but I am not sure.
Jason
Thks a lot for your reply. I was already diving into the implementation of get_string function cause i discovered it is used in modules.php to print the module name but i couldn't figure out where the 'identifiers' were coming from.
The name of my module is now displayed correctly.
Concerning the db/install.xml stuff, i'll look at it later and maybe bug you or someelse about it later on.
Again, many thks
Joao
I have a flash cs4 with AS3 file, can i integrate it in this template & use it as a new module ???
Thank in advance...
Sarah...