We introduce the course, state some expectations, check on your development environment and then install our plugin from a template.
We also add some notes about git, a very useful tool for developers and pretty much an essential for Moodle Developers.
The example plugin uses renderers to separate the output from the plugin logic as is good practice in any kind of development. We briefly re-visit the $PAGE and other output components and refactor our code to use simple permissions. We set up a couple of features: styles.css and a local class.
This week covers Moodle forms to an advanced level. We will briefly recap the material from the level 1 course before getting into the complexities associated with saving form data and upgrading a plugin by adding a new table. Finally we save some data to the table using a form, including dealing with an editor type form element.
We have some tidying up to do this week. We can now add one page but we need to be able to add more pages and navigate between them, edit pages and delete them. We will introduce a page management "console" similar to those you already see in Moodle for managing courses. All in all, another busy week.
We will be adding a button and a sliding panel to our multipage pages this week. In order to do this we will also use the upgrade.php script to perform a proper upgrade of our database tables.
We are nearing the end of the course, and you have done very well to make it this far. Its no mean feat covering the ground that we have in 5-6 weeks.
This weeks content covers three new programming APIs in Moodle that are built around automatic class loading and namespaces. They are:
Each of those does not involve writing a lot of code. But you should be familiar with namespaces and class loading. So we cover that first. Tasks are straightforward in code, but are really a bit tricky to debug. I suggest you stick pretty close to the code given, to avoid having to track down bugs.
Logging and events are sides of the same coin, and by now you have probably seen them in Moodle code. Hopefully after the material here they will become clearer.
Have we finished out plugin, is it ever finished? Code checking and the plugins database. Some additions we might make to increase interactivity.
An extended task for you to attempt: Adding a comments section to the plugin. This will involve researching the comments API, upgrading the database, adding new capabilities, updating mod_form and admin settings.
Haere rā (farewell) from all in New Zealand and Japan.