Book Image

Moodle 1.9 Extension Development

Book Image

Moodle 1.9 Extension Development

Overview of this book

Moodle gives you the power to create and customize feature-rich plug-ins. If you can write Moodle plug-ins, you can make it do just about anything. From making the site easier to administer, to new features, to completely changing the way it looks; plug-ins are the method Moodle offers to customize and extend its functionality. This book will show you how to build all sorts of Moodle plug-ins: admin plug-ins, Blocks, Activities, Grading components, Reports, Fliters that change the way your site works and looks. You will develop standard Moodle plug-ins such as Activities, Filters, and Blocks by creating functioning code that you can execute in your own Moodle installation. Writing modular plug-ins for Moodle will be a large focus of this book.This book will take you inside Moodle and provide you with the ability to develop code the “Moodle way”.This book will expose you to all of the core code functions in Moodle, in a progressive, understandable way. You will learn what libraries are available, what the API calls are, how it is structured and how it can be expanded beyond the plug-in system.You will begin by getting an understanding of the basic architecture that Moodle uses to operate in. Next you will build your first plug-in; a block. You will carry on building other Moodle plug-ins, gaining knowledge of the “Moodle way” of coding, before plunging deeper into the API and inner libraries. Lastly, you will learn how to integrate Moodle with other systems using a variety of methods.When you have completed, you will have a solid understanding of Moodle programming and knowledge of how to extend its functionality in whatever way you want.
Table of Contents (19 chapters)
Moodle 1.9 Extension Development
Credits
About the Authors
About the Reviewer
Preface

The scope of creating an activity module


As we start to make an activity module, it's important to note that activity modules are inherently more complex than both blocks and filters. An activity module has roughly ten required PHP files, over a dozen functions, three sub folders, and an icon graphic. This is in sharp contrast to the other module types that we created in earlier chapters. Following is a listing of the structure of an empty activity module. We will flesh out each component of the listing as we progress through the chapter:

  • ./README.txt

  • ./lib.php

  • ./restorelib.php

  • ./lang

  • ./lang/en_utf8

  • ./lang/en_utf8/foo.php

  • ./lang/en_utf8/help

  • ./lang/en_utf8/help/newmodule

  • ./lang/en_utf8/help/newmodule/index.html

  • ./lang/en_utf8/help/newmodule/mods.html

  • ./version.php

  • ./mod_form.php

  • ./backuplib.php

  • ./submit_form.php

  • ./view.php

  • ./icon.gif

  • ./index.php

  • ./db

  • ./db/access.php

  • ./db/upgrade.php

  • ./db/install.xml

See http://docs.moodle.org/en/Development:Modules for the official...