Note:

If you want to create a new page for developers, you should create it on the Moodle Developer Resource site.

Core APIs: Difference between revisions

From MoodleDocs
No edit summary
No edit summary
Line 3: Line 3:
==APIs used by all Moodle scripts==
==APIs used by all Moodle scripts==


=== Access control API - "access" ===
=== access ===


=== Database access API - "database" ===
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.


=== File management API - "file" ===
=== database ===


=== Page construction API - "page" ===
The [[Database access API]] allows you to read/write databases in a consistent and safe way.


=== Page rendering API - "renderer" ===
=== file ===


=== Language strings API - "string" ===
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"===
=== 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 ===


===Backup API - "backup"===
The [[Comment API]] allows you to save and retrieve user comments, so that you can easily add commenting to any of your code.


===Comment API - "comment"===
=== conditional ===


===Conditional activities API - "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 API - "restore"===
=== - "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.

Portfolio API - "portfolio"

- "restore"

RSS API - "rss"

Role API - "role"

Tags API - "tag"

Time API - "time"

Web services API - "webservice"