Introduction to Chamilo 2 structure

  • Work in progress *

The general directories structure of Chamilo is split into the core modules (directly available as directories in the root directory) and additional applications (defined as directories in the "applications" directory).

Each module (or "application") has components which define actions (like a CRUD) on the application. Components can have additional features defined in sub-managers.

The data structure is defined in XML files in MDB2 format, which is then used for the dataclass definition (getters and setters, defined manually).

The data definition (table class) defines a data provider which (uses the datamanager and) defines
  • group actions ("delete all selected", etc) through a data provider
  • column models, which define which columns are usable
  • cell renderers, which define how tables appear

Many applications still define the dataclass another way, but they should tend to this (preferrably using Doctrine instead of DBM2).

There are two types of components (or actions):

  • view components
  • action components (do something and move you out and to a table, viewer, etc)

Simple content

Simple content can be created by extending the 3 (or 5) simple dataclasses: content_object, form, display, difference and difference_display (the last two are optional).
For example, create a directory inside the repository/content_object/ directory (use a lowercase name separated by underscores of the class you will create), let's say "user_note" then create the class itself as
  • user_note.class.php (class UserNote), then
  • user_note_form.class.php,
  • user_note_display.class.php
  • user_note_difference.class.php
  • user_note_diff_display.class.php

Complex objects use wrappers (to be continued...)


Libraries are defined in common/libraries/php/.
The most useful library is probably the "html" library.
Other libraries of direct interest:
  • security
  • tab (static tabs redirect instead of loading another part of the page, and dynamic form tabs allow you to use AJAX tabs within a form)

Creating a new course tool

Currently (2.1 stable) the easiest way to do so is probably to copy the announcement tool inside application/weblcms/tool/ into something else and change the name of that something else.

Updated by Yannick Warnier over 10 years ago ยท 5 revisions