2011年1月24日 星期一

Build a Hello World new module

  1. Download the NEWMODULE.zip (HEAD) from http://docs.moodle.org/en/Development:NEWMODULE_Documentation (or download here) (Follow the README.txt from the zip file! (not the tutorial at moodle.org, it is not for 2.0))
  2. Rename all occurrences of "NEWMODULE" to "widget" (or your new module name) of the all files in the zip (161 replacements) (Also rename "newmodule" to "widget" for unix system)
  3. Rename "NEWMODULE" folder to "widget"
  4. Rename lang\en\NEWMODULE.php to widget.php
  5. In version.php, modify $module->version to current date (you need to change the XX for each update). Comment this line: $module->version = 0
  6. Optional: In view.php, just before the footer(), add -> echo 'Hello World';
  7. Copy the widget folder to moodle\mod\
  8. Site Administration -> Notifications, when you see the new module, -> Update
  9. Done.
Note: It seems there will be some problem if the last character of the module name is digital

    沒有留言:

    張貼留言