开发者

How to add new form field in moodle database module?

Moodle's Database module has some predefined field types (text, date, URL, picture, etc), but I want to customize this to create new field types.

For example, I might like to create a new field type name IMB and tells what can be 开发者_开发知识库done when the user select IMB in the form.

How to go about doing this?


The db field types live in mod/data/field. You could copy one of the existing types and rename the folder to imb then rename the class to data_field_imb and start modifying away to get what you want.

There are only 2 files in their to worry about modifying (and an image if you want to get fancy). If you need to modify any onscreen text use the get_string('stringkey', 'data') or print_string('stringkey', 'data') then just make sure you put the stringkey and value into the file lang/en_utf8/data.php.

Good luck.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜