O'Reilly logo

Moodle 3.x Developer's Guide by Ian Wild

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating an admin settings page

Let us start by creating a new instance of the admin_settingpage class. We will call this new instance $settings. Add the following code to the if ($hassiteconfig) clause:

$settings = new admin_settingpage('local_duallang', get_string('local_duallang', 'local_duallang')); 

We should note at this stage that I am not intending to delve too deeply into function parameters as they are very well described in Moodle's source code. For example, in Eclipse highlight the text admin_settingpage, right-click with the mouse, and from the pop-up context menu, click on Open Declaration. Eclipse navigates you to the class constructor--which is preceded by a detailed DocBlock:

/** * see admin_settingpage for details of this ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required