|
Dec 18
2009
|
|
|
Unlike modules that are all stored in the modules folder or components that all exist in the components folder, plug-ins are categorized and grouped within folders that define their categories. For example, plug-ins that provide search functionality are stored in the pluginssearch folder, while content plug-ins exist in the pluginscontent folder.
In the Plugin Manager, the category of plug-in is generally displayed in two places: as a prefix to the plug-in name and in the Type column. The name of each plug-in is preceded by the type. For example, the LDAP plug-in displays a name of “Authentication - LDAP.” The type of plug-in defines how the extension will be treated by the system.
The eight different types of plug-ins include the following:
❑ Authentication — Provides user authentication functionality so that additional methods may be added. Some of the authentication plug-ins included with Joomla are LDAP, OpenID, GMail, and Joomla.
❑ Content — Allows content to be modified after it is retrieved from the database and before it is sent to the user. This allows content to be modified (for applications such as email address cloaking to prevent spam) or supplemented with additional information (such as item rating, user comments, and page navigation features).
❑ Editor — For content editors such as TinyMCE and XStandard Lite.
❑ Editor button — These plug-ins extend the capabilities of the content editor with buttons that add functions such as the ability to insert an image or a page break. In previous versions of Joomla, this type of plug-in was called an editor-xtd.
❑ Search — Used to add search capabilities for a particular item type such as content, sections, contacts, Web links, newsfeeds, or categories.
❑ System — Interfaces with the core Joomla system functions and allows control and modification over foundation tasks such as publishing, unpublishing, and even installation.
❑ User — Used to synchronize a user database with another user privilege system such as Gallery2, Simple Machines Forum, and so on.
❑ XML-RPC — Receives events directed through the XML Remote Procedure Call (RPC) communication protocol.
The creation of a plug-in entails creating a class that extends the JPlugin master class. Within the new class, functions are defined that match the names of the Joomla events. The code within these methods accepts the call of a trigger when that event occurs. For example, if you included a method called onAfterInitialise() in your plug-in definition, the code in the method would be executed every time a page was requested from the Joomla system, before the Joomla system started and began any processing.
Grouping the plug-ins into these type categories is more than just a semantic designation. The definition of the plug-in type determines the primary events that are available to that plug-in. However, some events (especially system events) can cross plug-in type boundaries. For that reason, the events themselves are divided into the following four generalized categories:
❑ Content
❑ Editor
❑ System and search
❑ User
These event categories limit the events that may be used by a given plug-in type, although most system events can be registered with any plug-in type.
