User Overrides

From Habari Project

Jump to: navigation, search

Classes

The core files used by Habari reside in /system/classes. In general, each file represents a single class: post.php defined the Post object, posts.php defines the Posts object, etc. In order to make Habari as flexible as possible, the developers have made it possible to easily override the default classes. Any file placed in /user/classes will override the system file of the same name.

So, if you wanted to redesign the way the Post object operates internally, while still preserving the external interfaces, you could create your own Post class in /user/classes/post.php. Habari will detect the presence of your file, and will load it in place of the system file.

This is a terrific way to test changes to the core Habari code without trouncing the system: you can copy the file(s) you want to modify from /system/classes to /user/classes and make whatever changes you need. When you're finished, you can delete your local files and Habari will automatically use the system classes!

Themes

Habari will look in each of these directories for themes that can be activated:

  • /user/sites/{sitename}/themes
  • /user/themes
  • /3rdparty/themes
  • /system/themes

The first theme with a given name found from these directories (in order from top to bottom) will be available to Habari for selection. Other themes with the same name but in later directories will not be available for activation. This allows a theme in the user directory (one modified by the user) to override one of the same name in subsequent directories.

Plugins

Habari will look in each of these directories for plugins that can be activated:

  • /user/sites/{sitename}/plugins
  • /user/plugins
  • /3rdparty/plugins
  • /system/plugins

The first plugin with a given name found from these directories (in order from top to bottom) will be available to Habari for selection. Other plugins with the same name but in later directories will not be available for activation. This allows a plugin in the user directory (one modified by the user) to override one of the same name in subsequent directories.

As with the theme directories, the user directory is for user-created content. The system directory is for content supplied by the core software. The 3rdparty directory is for contributed content that is external to the core software, such as that which can be updated by subversion checkout from a non-Habari repository.

Other Development Pages · Developer Introduction
Personal tools
This is a cached copy of the requested page, and may not be up to date.

Sorry! This site is experiencing technical difficulties.
Try waiting a few minutes and reloading.

(Cannot contact the database server: Access denied for user 'habari'@'localhost' to database 'habari_wiki' (localhost))


You can try searching via Google in the meantime.
Note that their indexes of our content may be out of date.