Core APIs: Difference between revisions
No edit summary |
No edit summary |
||
Line 3: | Line 3: | ||
==APIs used by all Moodle scripts== | ==APIs used by all Moodle scripts== | ||
=== | === access === | ||
The [[Access control API]] gives you functions so you can determine what the current user is allow to do, and it allows modules to extend Moodle with new capabilities. | |||
=== | === database === | ||
The [[Database access API]] allows you to read/write databases in a consistent and safe way. | |||
=== | === file === | ||
=== | The [[File management API]] controls file storage. | ||
=== page === | |||
The [[Page definition API]] is how you contruct web pages from data. | |||
=== renderer === | |||
The [[Page rendering API]] is what you use to turn the current page into HTML and send it to the user. | |||
=== string === | |||
The [[Language strings API]] is how you get text strings to use in the user interface. It handles any language translations that might be available. | |||
==Other APIs== | ==Other APIs== | ||
===Activity completion API | === activity_completion === | ||
The [[Activity completion API]] is only used by activity modules, to indicate to the system how activities are completed. | |||
=== backup / restore === | |||
The [[Backup API]] defines exactly how to convert course data into XML for backup purposes, and the [[Restore API]] describes how to convert it back the other way. | |||
=== calendar === | |||
The [[Calendar API]] allows you to add and modify events in the calendar for user, groups, courses, or the whole site. | |||
=== comment === | |||
The [[Comment API]] allows you to save and retrieve user comments, so that you can easily add commenting to any of your code. | |||
=== | === conditional === | ||
The [[Conditional activities API]] is for | |||
===Events API - "event"=== | ===Events API - "event"=== | ||
Line 35: | Line 60: | ||
===Message API - "message"=== | ===Message API - "message"=== | ||
=== preferences === | |||
The [[User preferences API]] is a simple way to store and retrieve preferences for any user. | |||
===Portfolio API - "portfolio"=== | ===Portfolio API - "portfolio"=== | ||
=== | === - "restore"=== | ||
===RSS API - "rss"=== | ===RSS API - "rss"=== | ||
Line 47: | Line 76: | ||
===Time API - "time"=== | ===Time API - "time"=== | ||
===Web services API - "webservice" === |
Revision as of 08:21, 3 January 2012
Moodle has a number of core APIs that provide tools for Moodle scripts.
APIs used by all Moodle scripts
access
The Access control API gives you functions so you can determine what the current user is allow to do, and it allows modules to extend Moodle with new capabilities.
database
The Database access API allows you to read/write databases in a consistent and safe way.
file
The File management API controls file storage.
page
The Page definition API is how you contruct web pages from data.
renderer
The Page rendering API is what you use to turn the current page into HTML and send it to the user.
string
The Language strings API is how you get text strings to use in the user interface. It handles any language translations that might be available.
Other APIs
activity_completion
The Activity completion API is only used by activity modules, to indicate to the system how activities are completed.
backup / restore
The Backup API defines exactly how to convert course data into XML for backup purposes, and the Restore API describes how to convert it back the other way.
calendar
The Calendar API allows you to add and modify events in the calendar for user, groups, courses, or the whole site.
comment
The Comment API allows you to save and retrieve user comments, so that you can easily add commenting to any of your code.
conditional
The Conditional activities API is for
Events API - "event"
External functions API - "external"
Groups API - "group"
Gradebook API - "grade"
Message API - "message"
preferences
The User preferences API is a simple way to store and retrieve preferences for any user.