This book will guide you through the complexities of implementing components, modules, and plugins in Joomla! 1.5. It provides useful reference material that explains many of the advanced design features and classes available in Joomla! 1.5.
Joomla! is one of the world’s top open-source content management systems. The main sources of the PHP MySQL application’s success are its comprehensive extension libraries, which extend Joomla! far beyond content management, and its very active forums where one can easily tap into the knowledge of other Joomla! users, administrators, and developers.
The architecture of the latest version of Joomla! differs in many ways from previous versions. Resultantly backward-compatibility with some extensions has been broken; the race is on for developers to update their skills in order to rectify the problems and start building new extensions. Perhaps the most important of the changes is the reorganization and classification of files and classes. This change encourages but does not force developers to use the Joomla! libraries consistently between extensions.
Chapter 1 deals with the history of Joomla! and gives an overview of the technology in general.
Chapter 2 covers the process from request to response and also talks about directory and URI structure along with a brief description of libraries. It also introduces a number of common classes, variables, and constants that are used frequently when creating Joomla! extensions.
Chapter 3 deals with the database. It talks about extending the database, conventions for the database schema, and common fields. Then the focus moves on to storing data common types of data in standard fields and dealing with multilingual requirements. We then cover querying the database and getting results.
Next, the chapter explores how to manipulate common field types. The chapter concludes with a brief description of the JTable. The JTable is used to display and edit regular two-dimensional tables of cells. The JTable has many facilities that make it possible to customize its rendering and editing but provides defaults for these features so that simple tables can be set up easily.
Chapter 4 is about designing components. It starts with the structure and a basic design of a component using the MVC design pattern. Then we learn configuring the component and its various elements and parameters. The chapter finishes by discussing component packaging and the various install and uninstall files.
Chapter 5 covers designing modules. It explains standalone modules, module settings, frontend and backend modules, and modules and components working together. Then we talk about using templates and packaging the modules.
Chapter 6 deals with designing plugins. It initially deals with listeners/observers and then the various plugin groups like authentication, content editors, search, and others. Then comes loading, translating, and using plugins as libraries. Finally it deals with, plugin settings and how to package plugins.
Chapter 7
is all about designing extensions. Here, we start with helper classes then cover building and using getInstance()
methods. Then we cover the registry along with saving and loading registry values. Towards the end of the chapter, we explain the User, Session, Browser and the assets.
Chapter 8
explains ways to render output and how to maintain consistency throughout. It starts with the joomla.html
library and then continues to describe how to build component HTML layouts. Then it discusses how to output the backend of a component. The chapter ends with the details of itemized data and pagination.
Chapter 9 deals with customizing the page. We cover things like modifying the document and translating, along with a brief explanation of using JavaScript effects from the mootools library, which is included in Joomla!.
Chapter 10 explores some of the Joomla! APIs, specifically in relation to web services. We also discuss some of the more common web services and take a more in-depth look at the Yahoo! Search API. The chapter finishes by describing how we can create our own web services using plugins.
Chapter 11 provides an introduction to handling and throwing errors, warnings, and notices. Further, it talks about building secure Joomla! extensions. It also describes a number of common mistakes made when coding with Joomla! and explains how to avoid them.
Chapter 12 explains various utilities and useful classes like dates, arrays, tree structures, and others.
The Appendix details the more common Joomla! classes. It also provides information on how to handle the ever-useful JParameter object. The appendix ends with a description of the Joomla! settings in relation to the registry/config.
To use this book effectively you need access to a Joomla! 1.5 installation. In order to run Joomla! 1.5 you need the following software: PHP 4.3 or higher (4.4.3 or greater is recommended), MySQL 3.23 or higher and Apache 1.3 or higher or an equivalent webserver.
In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.
There are two styles for code. Code words in text are shown as follows: “When we populate the $oldValue
variable using the getValue()
method we supply a second parameter.”
A block of code will be set as follows:
$user =& JFactory::getUser(); if ($user->guest) { // user is a guest (is not logged in) }
New terms and important words are introduced in a bold-type font. Words that you see on the screen, in menus or dialog boxes for example, appear in our text like this: “In the System tab we must set Debug Language to Yes”.
Feedback from our readers is always welcome. Let us know what you think about this book, what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.
To send us general feedback, simply drop an email to <[email protected]>
, making sure to mention the book title in the subject of your message.
If there is a book that you need and would like to see us publish, please send us a note in the SUGGEST A TITLE form on www.packtpub.com or email <[email protected]>
.
If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on www.packtpub.com/authors.
Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.
Visit http://www.packtpub.com/support, and select this book from the list of titles to download any example code or extra resources for this book. The files available for download will then be displayed.
Although we have taken every care to ensure the accuracy of our contents, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in text or code—we would be grateful if you would report this to us. By doing this you can save other readers from frustration, and help to improve subsequent versions of this book. If you find any errata, report them by visiting http://www.packtpub.com/support, selecting your book, clicking on the Submit Errata link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata added to the list of existing errata. The existing errata can be viewed by selecting your title from http://www.packtpub.com/support.
You can contact us at <[email protected]>
if you are having a problem with some aspect of the book, and we will do our best to address it.