Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

06.

06
PHPMagazine International

PHPMagazine
International

Cutting-Edge Technologies for Web Professionals

Joomla! 1.5
Knocking at Your Door
Getting a Grip on the Next Release
Joomla! 1.5 Knocking At Your Door Cover Story

Joomla! 1.5 Knocking At Your Door


Getting a Grip on the Next Release
by Mitchell Pirtle

Let Joomla! core developer Mitch Pirtle take you through a quick
tour of the advancements in the latest update to the award winning
content management system. You will see the new front end editing
interface, as well as the much-needed changes to the back end
administrator interface.

Introduction Joomla!, please remember that this is the same award winning
team that made Mambo so special. Joomla! 1.0.0 was essentially
Last time I wrote for the International PHP Magazine (IPM),
the next maintenance release of the Mambo 4.5.2 series, with
we (IPM) were still in print, and we (Joomla!) were still called
some goodies added for measure.
Mambo. How things have changed! Even more change is afoot,
with the impending release of Joomla! 1.5, and several new I am not familiar with the team that presently works on Mambo,
and exciting initiatives set to come from the IPM stable. This and do not track their progress. But it is safe to say that you
article will outline and demonstrate some of the most important have two completely independent projects, run by completely
improvements in Joomla!, from a developer perspective. independent teams, and with decidedly different roadmaps and
philosophies. With the 1.5 release, all compatibility attempts
with Joomla! and Mambo come to an end, as not only have we
First, an Update made significant changes in our evolution, but the new Mambo
Back in August there were some events that triggered “the team has also progressed on their own path.
split”, which of course we like to refer to as the rebranding
If you were wondering when it was no longer possible to mix
of Mambo to Joomla!. It is beyond the scope of this article to
and match components written for Mambo/Joomla!, wonder no
outline the events that lead to this happening, but it is important
more – now is that time.
for everyone to know who Joomla! is, and what happened to
Mambo.
The International Community Speaks
The entire Mambo teams – developers, documentation writers, Back at the Joomla! Core Developer Summit in October, it
forum moderators, system administrators, PR and advocacy was brought to our attention, in a rather painful fashion, that
teams, and language translators – decided in unison that this international support in Joomla! was a critical shortcoming;
switch was required to protect the relationship between the and if we wanted our software to be internationally viable
developers and the community, and ensure that there would we needed to focus all our efforts to supporting a more multi-
be no more commercial attempts to manipulate the project. So lingual audience. We shelved our grand plans (more on that later)
most folks are not aware of the totality of that agreement, or for the next release, and focused instead on meeting the
that it was in complete unanimity that we decided to rebrand. community’s needs.

It was the most peaceful option for us, and the entire crew agreed The first step was to implement UTF-8 characterset support
with the plan. So when you look at the low version numbers of throughout the core. UTF-8 is also known as unicode, and

International PHP Magazine 06.2006 2


Cover Story Joomla! 1.5 Knocking At Your Door

supports multibyte charactersets, right-to-left languages, and developers had the flexibility to do just what they wanted, instead
others. With an aggressive schedule, we set out to implement of banging on a bunch of procedural code to make one site behave
UTF-8 support as quickly as possible. Our expected delivery the way they wanted, in a very manual and error-prone fashion that
date was within a few weeks, in November. made upgrades nearly impossible.

This effort was frustrating when we learned that not only was It is completely true that you could say the Joomla! content
the UTF-8 support going to require a lot of refactoring of the management system was created with the Joomla! Framework. But
existing core, but that there were two major issues: supporting enough history lessons already! Let’s get to the new Joomla!
both PHP4 and PHP5 required totally different approaches, and
the reliance on third-party libraries that Joomla! depended on First Impressions
were also unable to support UTF-8. Some libraries had to be
The new template is called rhuk_milkyway, and is brought to you
completely removed, and we recreated them from scratch, just
by the same developer that produced the default for the 1.0.x series
so we could support this requirement; and other libraries were
as well as the 4.5.x series when we were Mambo, Andy Miller. See
replaced with still other libraries as well.
Figure 1.
Once the groundwork for this effort was underway, there was
a period where the localization teams were winding through
the different translations to make sure that new API calls were
supported with their language files. While this was happening,
the developers decided to refactor some areas that badly needed
it – as the UTF-8 requirement forced them to refactor the
core anyway, it was logical to take care of some architectural
shortcomings of the existing core.

The Tipping Point


It was at this moment that some very important decisions were
made that ultimately affected the delivery of 1.5 – which back then
was just called 1.1, as it was not considered a major effort. The first
big decision was to refactor the colossal and bloated joomla.php.
This bloated file was one monolithic pile of procedural PHP that
was parsed for each and every single page that was delivered to the Fig 1: Screenshot of Default Front End Interface
browser. This exercise started out innocently enough, with significant
time spent just breaking out the code into separate classes, and using Gone is the venerable SolarFlare II template, replaced with a much
more manageable layout that has more flexibility with module
many OO patterns to simplify the rendering process of content. The
positions. There are other changes, but the most interesting I will
intent was to make it easier on developers, but the added bonus was
save for the last.
performance enhancements. The effect was due to Joomla! no longer
parsing all that code for each request, and only loading classes that
were needed for that particular view. Life on the Backside
The second big decision was to rationalize the API, as there were clear So how does the administrator interface look? This is one of the
issues with the existing one that had evolved over time. By coming most visible changes to the end user, as the entire administrator
up with a solid, common philosophy we were able to refactor the interface has been completely revamped. Immediately apparent is
API with a much more logical approach, further simplifying efforts the new template colorscheme, as evidenced by the login screen.
for developers. See Figure 2.

The third, and most significant decision was to approach Joomla! The new look is driven from a totally new admin template, which
as more than a content management system, and focus on bringing also showcases the ability of Joomla! to allow for distinctly
a more framework-oriented approach to the architecture. This had different looks on the administrator interface, not just the front end.
a really profound impact on Joomla! in general, and also further Perhaps most telling is the main page, also called the Control Panel.
necessitated core refactoring to break out the classes so that See Figure 3.

3 International PHP Magazine 06.2006


Joomla! 1.5 Knocking At Your Door Cover Story

Fig 3: Screenshot of the Login Screen

Fig 2: Screenshot of the Login Screen You Get) areas. In 1.0.x there were two, one for the introductory
text and another for the main body.
We have brought out an entirely new set of icons as well, which
is a welcome change of pace after looking at the previous icons As this was quite confusing for a lot of newcomers to Joomla!, we
for several years. We have also consolidated both the Control Panel decided to simplify the whole content creation process by having
choices, as well as the menu items. Gone are the multiple-nested one editor area and providing a button to create the “Read More...”
menus, replaced with simple, logical menus that are typically only link that signifies a separate page for lengthy text.
one level deep. The lone exception is for components, which is
You can see in the screenshot the text {readmore} that tells Joomla!
necessary for complex components – otherwise you would have a
you want to make that separation between introductory text and
simple menu that required many clicks to get where you needed for
main text. For aggregate listings such as blog lists, this inserts a
more sophisticated applications.
“Read More...” link at the end of the introductory text.
We consolidated ‘Content Items’ and ‘Static Content Items’ to
We have also changed the code for insertion of images, from
just one, which in this article are referred to as Articles. This is a
{mosimage} to just {image} for clarity, as well as getting away
test for now, however the final release may include this change in
from the deprecated “mos” terminology which originally stood for
terminology. At the time of writing the debate was still in full swing,
Mambo Open Source.
but for clarity I will continue to refer to them as ‘Content Items’ in
this article, until the change is made permanent. See Figure 4. Also of note is the new styling of the images tab and related tabs,
which are not layered anymore as tabs but rendered much more
The biggest change to the content editor is the consolidation of the
cleanly with expanding divs. This is a lot easier on slower machines
content areas, also known as WYSIWYG (What You See Is What
and also is more cross platform to support a wider array of browsers
and browser versions. See Figure 5.

Fig 4: Screenshot of the Content Manager Fig 5: Screenshot of the Content Detail Page

International PHP Magazine 06.2006 4


Get your
International PHP Magazine
in just 4 Steps for as low as €3.50 per copy!

warm up... choose

Step 1: Login with your Username and Password Step 2: Choose a subscription type:
at http://www.entwickler.com/ssl/pdf/ Single Issue/Annual

content
confirm

Step 3: Confirm your payment details Step 4: Download your Issue

International PHP Magazine’s new download center facility ensures you have access to the
International PHP Magazine at all times. Please visit our subscription service to order your
copy of the magazine for as low as €3.50 per copy. What’s more, you can use your access
details to log into our download center any time, from anywhere, to access and download all
issues you have subscribed to.
Cover Story Joomla! 1.5 Knocking At Your Door

The Global Configuration screen also gets some revamping, with the
different configuration directives consolidated to just four tabs. This
makes things a lot easier – as well as quicker – as we learned that having
a configuration screen with ten or more tabs was just unmanageable.

Also the top-level tabs are much more logical and intuitive,
making it more likely for the newcomers to Joomla! to jump to the
intended screen to make the changes that they desire. See Figure 6.

The new Media Manager interface is a much-needed


improvement over the old one; and is also a source of pride and
joy of the happy parent (that would be developer Louis Landry).

The tree on the left makes it so much more convenient


to jump from folder to folder, which was a common
interface complaint from the 1.0.x userbase. See Figure 7.
Fig 6: Screenshot of the Global Configuration And now, for something completely different. Let’s go back to the
front end interface, login, and try to edit a content item. See Figure 8.

Finally, some AJAX magic makes its way to the Joomla!


Interface. Perhaps this is just a first step, but also paves the way
for the front end content editor interface to be a lot more useful.

Here is some dirty laundry from the old days: back in the Mambo
universe, we were constantly hearing about how much everyone
hated the front-end content editor interface. The problem is, none of
us ever used it. The pain we felt to fix that just wasn’t there. We never
understood why it was such a big deal, or why everyone wanted us
to spend so much time on the front-end when you had so much
more power and capability available from the back end interface.

Well, quite a few of us started taking jobs developing and


Fig 7: Screenshot of the Media Manager customizing sites that used Mambo. For every single one
of us, the very first project we worked on was an absolute
horror – from the front end content editor perspective, that is
– and we all vowed that the interface needed some serious work.

The 1.5 development team put that need into action, and provided
a fantastic interface to the front end that provides virtually the
same power and capability as the one provided by the back end,
but without giving back end access to your content writers. This
is significant, as it takes an early, critical step in the process of
us really rethinking how the front end interface should be used.

Finally, folks that are restricted to the front end can rejoice!

Developer Resources Everywhere


Speaking of developers, you can get a full reference of the new
API at http://api.joomla.org/, and there is a developer portal at
Fig 8: Screenshot of Front End Editor http://dev.joomla.org/. The portal is a great resource, as you can

6 International PHP Magazine 06.2006


Joomla! 1.5 Knocking At Your Door Cover Story

read developer blogs, articles about the technology from a developer Unlike the old forge (which I was the sole maintainer of for over a
perspective, and find links to other resources to help you be as year), the new JoomlaForge is a feature rich, robust environment
productive as you can be. that really facilitates collaborative development.

Additionally, you can have free hosting of your open source Joomla! But Wait, There’s More
extension at forge.joomla.org, where you have access to a tracker, There is one more screenshot that needs to be shown, which is the
subversion repository, file release system, and more. This topic administrator interface for managing plugins, formerly known as
deserves some more detail, which I hope explains how fantastic a mambots. See Figure 9.
resource this is to you.
Plugins have had a complete and dramatic redesign that
The JoomlaForge happens to be the biggest instance of SourceForge provides a real wealth of capabilities. You will see in this list of
Enterprise Edition (SFEE), in the world. We have over 25,000 default plugins a new type of plugin for authentication. We have
registered developers working on more than 1,000 projects, spanning provided three authentication plugins for reference: the standard
a huge variety of applications including document management, Joomla! authentication plugin that uses the stock Joomla! tables,
discussion forums, photo galleries, additional WYSIWYG editors, a native LDAP plugin to authenticate from remote directory
you name it! Not only is there a veritable cornucopia of applications sources such as OpenLDAP, Netware or Microsoft’s Active
to choose from, you can also set up your own project for free. Directory, and a little proof of concept authentication plugin
that lets you login with your Google Mail account’s credentials.
If you are itching to develop a Joomla! extension and release it
under an open source license, you can use all the formidable features We have also included a stub for use with the XStandard WYSIWYG
provided by SFEE. As well you will have your project hosted in editor, which has an interesting implementation. Basically you
a Joomla!-centric environment, where you will always have the install the editor locally on your machine (sorry, Windows is
community’s interest. required at this point, we’re working on it); and when you wish
to edit content, you don’t have to wait for all that JavaScript to
However, SFEE is not targeted at the non-technical end user
download to your browser locally before rendering the editor
that is looking for a photo gallery, it is targeted squarely at the
area. This makes editing content feel much more responsible, like
developer who needs tools to collaborate with other developers
a desktop application instead of a web-based content editor. Nice!
working on a software project. So what can the non-developers do?
Also you will see another new class of plugins, focused on
We created our new software directory at http://extensions.joomla. functionality provided by XML-RPC capabilities. There is
org, where you can find a categorized list of available applications one plugin that lets you use a fat client blogging application (in
– complete with reviews, links to the software’s home page, and this case, w.bloggar) to post content to your Joomla! web site.
more. This is where we like to send the users of the software
to find additional functionality, in a non-techie presentation. Not to leave it at that, we have also provided our own Joomla!
This means that the SFEE interface remains focused solely on XML-RPC interface, which will provide the means for fat client
the needs of the developer, which is what SFEE is so good at. applications to interact with your web site like a web service. There
is already a Java-based client called J!Explorer that is more than
just a working prototype, to be found at www.joomlatools.org.

The plugin installer has really gone through the upgrade


process, where you no longer have to use a component
installer, module installer and so on – you can now just use
the installer. Another much-needed addition is the capability
to install from a URL, instead of constantly downloading to
your client machine, and then uploading to the web server.

Speaking the International Language


One important topic not covered yet is the concept of language
packs. This allows third-party developers to provide different
language packs for their applications, not just at the Joomla! level
Fig 9: Screenshot of Plugin Manager Interface but also at an application level.

International PHP Magazine 06.2006 7


Cover Story Joomla! 1.5 Knocking At Your Door

For example, say you wrote a component that provided a calendar This code tells Joomla! to check and see if the language in use is a
for events, like GigCalendar at www.gigcalendar.net. What happens right-to-left language; and if so, to load an additional stylesheet for
if someone downloads your application and they are speaking the template.
Spanish? Your component is still rendering the language you
provided, which (in the case of GigCalendar) is English. There are also ways to test to see if there are modules published in a
particular position. So for example if you wanted to render HTML
By being able to provide a language pack for your component, it for the left module position, but only if there are published modules
is now possible for someone using Joomla! in Spanish to also have there, you can use the code shown in Listing 2.
GigCalendar, also in Spanish. It sounds much easier than it really is,
and it is a wonderful capability for the international, multilingual Listing 2
community.
Template Conditional Example 2
Sometimes Looks ARE Everything <jdoc:exists type=”modules” condition=”left” >
<jdoc:include type=”modules” name=”left” style=”-3” />
So what happens to templates, you ask? We have changed the way </jdoc:exists>
templates are done, with a strict focus on making the template
files as easy to edit as possible. One change is the move from PHP Most importantly, there are tutorials on templates on the developer
snippets in the HTML – which frustrated and confounded many portal and of course the default template provided with the 1.5
editors and proved a common source of syntax errors – with a more distribution has all of these examples and more. By studying this
XML-friendly format. template and how it is done, you can easily get started with the new
syntax.
For example, to include a module position in your template for the
1.0.x series, you would use:
It’s All in the Packaging
<?php mosLoadModules ( ‘user3’, -1 ); ?>
Another important point about the refactoring of Joomla! is that
With 1.5 you would instead use:
this has resulted in a much more framework-oriented package. It is
<jdoc:include type=”modules” name=”user3” style=”-1” /> actually correct to say that the Joomla! CMS was created with the
Joomla! Framework.
The first format makes great sense to a PHP developer, but is
problematic for HTML editors, to say the least. First off, your For example, the JApplication class allows you to create a
document will not validate and of course it is very difficult to standalone script that does not require the CMS, but has access to
know while you are working on your template if it validates or not, all the facilities as if the script was being rendered, and as if it was
without actually viewing (and validating) your output as rendered being delivered by the CMS.
by Joomla! There are many reasons that this is undesirable.
If you look in the distribution, you will see the libraries folder. This
Another template feature is conditional logic, without the need for is actually the framework, and what we used to create the CMS.
PHP. See the example in Listing 1. We are investigating what it would take to release the framework
as a standalone package, and hopefully under the LGPL license to
promote inclusion in other applications.
Listing 1
Template Conditional Example 1 Planning for the Future
I saved my favorite part for last. In the libraries folder, you will
<jdoc:tmpl name=”isRTL” varscope=”document”
see the joomla folder containing the database folder. Here you see
type=”condition” conditionvar=”LANG_ISRTL”>
the foundation for making Joomla! capable of using a variety of
<jdoc:sub condition=”1”>
different database platforms, allowing you to use not only MySQL
<link href=”templates/{TEMPLATE}/css/
but PostgreSQL, but some commercial database platforms as well.
template_rtl.css” rel=”stylesheet” type=”text/css” />
</jdoc:sub> The first step is already done, and you can create your own database
</jdoc:tmpl> driver by using the existing mysql and mysqli ones as a reference
point. But what about all that SQL littering the codebase?

8 International PHP Magazine 06.2006


Joomla! 1.5 Knocking At Your Door Cover Story

That is the next step. We are participating in the Google Summer of Conclusion
Code program, and hope that one of the projects will be researching
The 1.5 release of Joomla! includes some significant changes, as well
and implementing a layer for Joomla! to generate SQL based on
as some welcome additions to functionality to ease the lives of third
the driver, as opposed to hardcoding SQL statements everywhere party developers for product development and custom work. Not
in your code. only has the interface been simplified for the end user, the API has
There are already existing implementations for us to look at like been rationalized for the developer.
ADOdb and Propel, and there is also plenty to learn from other More importantly, this version is a lot more suited for complex
languages such as java and python. It is my hopes that this layer is applications and sophisticated requirements. This is an excellent
implemented in the next point release of Joomla!, so that you can platform for integrating systems, for example, and taking on other
choose the database platform that is right for you. enterprise-scale challenges.

With Joomla! 1.5 available, life as a web developer couldn’t be any


We All Could Use A Little Change better!
And now a little bit for those of you that have already written
applications to the 1.0.x API, and are worrying about the time you Mitch Pirtle is a core developer on the
are going to spend moving to the 1.5 API. Joomla! content management team and focuses
on database technologies and evangelism of the
This was a very hot topic, and the lead developer on the 1.5 effort, platform for application development, as well
Johan Janssens, has made a blog post [1] about migrating a very as being a champion of open source software.
popular application called FacileForms that makes it easy to create He is also a founder of JamboWorks, providing
forms and process the posted results. business and enterprise services and products
based on the Joomla! application platform. There he works on training
In a nutshell, Johan spent about an hour playing around with and client relationships, as well as business development. Mitch is
FacileForms to get what he wanted working in 1.5. That doesn’t also an active member of New York PHP, vocal booster of PHP and
mean that it was fully ported, nor does it mean that all applications PostgreSQL. He can be found with his wife and children loitering
will be as easy, but it should be a great reference to those of you that somewhere in the parks of Manhattan with his PowerBook and a cigar.
are preparing for the migration of existing applications.

Questions & Comments


• PHP Magazine Forum

www.phpmag.net

Dive into the World of PHP

Daily News Online Articles Opinion Polls Book Club Selections


International PHP Magazine 06.2006 9

You might also like