Mastering Joomla! 1.5 Extension and Framework Development


There is a newer version of this book available - Mastering Joomla! 1.5 Extension and Framework Development Second Edition
Mastering Joomla! 1.5 Extension and Framework Development
eBook: $26.99
Formats: PDF, PacktLib, ePub and Mobi formats
$14.84
save 45%!
Print + free eBook + free PacktLib access to the book: $76.98    Print cover: $49.99
$49.99
save 35%!
Free Shipping!
UK, US, Europe and selected countries in Asia.
Also available on:
Overview
Table of Contents
Author
Support
Sample Chapters

 

  • In-depth guide to programming Joomla!
  • Design and build secure and robust components, modules and plugins
  • Includes a comprehensive reference to the major areas of the Joomla! framework

 

Book Details

Language : English
Paperback : 488 pages [ 235mm x 191mm ]
Release Date : November 2007
ISBN : 1847192823
ISBN 13 : 9781847192820
Author(s) : James Kennard
Topics and Technologies : All Books, CMS and eCommerce, Joomla!, Open Source, Web Development

Back to BOOK PAGE

Table of Contents

Preface
Chapter 1: Introduction to Joomla!
Chapter 2: Getting Started
Chapter 3: The Database
Chapter 4: Component Design
Chapter 5: Module Design
Chapter 6: Plugin Design
Chapter 7: Extension Design
Chapter 8: Rendering Output
Chapter 9: Customizing the Page
Chapter 10: APIs and Web Services
Chapter 11: Error Handling and Security
Chapter 12: Utilities and Useful Classes
Appendix
Index
  • Chapter 1: Introduction to Joomla!
    • Overview
    • History
    • Requirements
    • Extension Types and Their Uses
      • Components
      • Modules
      • Plugins
      • Languages
      • Templates
      • Tools
    • Extension Manager
    • JED and JoomlaCode.org
    • Development Tools
      • J!Code
      • J!Dump
    • Summary
  • Chapter 2: Getting Started
    • The Application and Document
    • Request to Response
      • The Process
    • URI Structure
    • Directory Structure
    • Libraries
    • A Quick Lesson in Classes
      • Inheriting from JObject
    • Working with the Request
    • The Factory
    • The Session
    • Predefined Constants
    • Multilingual Support
      • UTF-8 String Handling
    • Coding Standards
      • phpDocumentor
    • Summary
  • Chapter 3: The Database
    • The Core Database
    • Extending the Database
      • Table Prefix
      • Schema Conventions
        • Common Fields
        • Schema Example
      • Dealing with Multilingual Requirements
    • Querying the Database
      • Writing Queries
      • Getting Results
        • loadResult( ) : string
        • loadResultArray( numinarray : int=0 ) : array
        • loadAssoc( ) : array
        • loadAssocList( key : string='' ) : array
        • loadObject( ) : stdClass
        • loadObjectList( key : string='' ) : array
        • loadRow( ) : array
        • loadRowList( key : int ) : array
      • Using ADOdb
    • JTable
      • CRUD
      • Manipulating Common Fields
        • Publishing
        • Hits
        • Checking Out
        • Ordering
        • Parameter Fields
        • Date Fields
    • Summary
  • Chapter 4: Component Design
    • Setting up a Sandbox
    • The Structure
    • The MVC
      • Building a Model
      • Building a View
      • Building a Controller
      • Building an MVC Component
    • Rendering Other Document Types
      • Feed
      • PDF
      • Raw
    • Dealing with Component Configuration
    • Elements and Parameters
      • Extending JElement
      • Using Custom JElement Classes
    • Help Files
    • Routing
    • Packaging
      • XML Manifest File
      • SQL Install and Uninstall Files and Queries
      • Install and Uninstall Files
    • Summary
  • Chapter 5: Module Design
    • Setting Up a Sandbox
    • First Steps
      • Standalone Modules
      • Modules and Components Working Together
      • Frontend and Backend Module Display Positions
    • Module Settings (Parameters)
    • Helpers
    • Layouts (Templates)
      • Media
    • Translating
    • Packaging
      • XML Manifest File
    • Summary
  • Chapter 6: Plugin Design
    • Setting Up a Sandbox
    • Events
    • Listeners
      • Registering Listeners
      • Handling Events
    • Plugin Groups
      • Authentication
      • Content
      • Editors
      • Editors-xtd
      • Search
      • System
      • User
      • XML-RPC
    • Loading Plugins
    • Using Plugins as Libraries (in Lieu of Library Extensions)
    • Translating Plugins
    • Dealing with Plugin Settings (Parameters)
    • Packaging
      • XML Manifest File
      • File Naming Conflicts
    • Summary
  • Chapter 7: Extension Design
    • Supporting Classes
    • Helpers
    • Using and Building getInstance() Methods
    • Using the Registry
      • Saving and Loading Registry Values
  • The User
    • User Parameters
  • The Session
  • The Browser
  • Assets
  • Summary
  • Chapter 8: Rendering Output
    • The joomla.html Library
      • Behavior
      • Email
      • Grid
      • Image
      • List
      • Menu
      • Select
    • Building Component HTML Layouts (Templates)
      • Iterative Templates
    • Component Backend
      • Admin Form
      • Toolbar
      • Sub-Menu
    • Itemized Data
      • Pagination
      • Ordering
      • Filtering and Searching
    • Summary
  • Chapter 9: Customizing the Page
    • Application Message Queue
    • Redirects
      • Component XML Metadata Files and Menu Parameters
    • Using Menu Item Parameters
    • Modifying the Document
      • Page Title
      • Pathway/Breadcrumb
      • JavaScript
      • CSS
      • Metadata
      • Custom Header Tags
    • Translating
      • Translating Text
      • Defining Translations
      • Debugging Translations
    • Using JavaScript Effects
      • JPane
      • Tooltips
      • Fx.Slide
    • Summary
  • Chapter 10: APIs and Web Services
    • XML
      • Parsing
      • Editing
      • Saving
    • AJAX
      • Response
      • Request
    • LDAP
    • Email
    • File Transfer Protocol
    • Web Services
    • Building a Web Service (XML-RPC Plugin)
    • Summary
  • Chapter 11: Error Handling and Security
    • Errors, Warnings, and Notices
      • Return Values
      • Customizing Error Handling
    • Dealing with CGI Request Data
      • Preprocessing CGI Data
      • Escaping and Encoding Data
        • Escaping and Quoting Database Data
        • Encode XHTML Data
      • Regular Expressions
        • Patterns
        • Matching
        • Replacing
    • Access Control
      • Menu Item Access Control
      • Extension Access Control
    • Attacks
      • How to Avoid Common Attacks
        • Using the Session Token
        • Code Injection
        • XSS (Cross Site Scripting)
        • File System Snooping
      • Dealing with Attacks
        • Log Out and Block
        • Attack Logging
        • Notify the Site Administrator
    • Summary
  • Appendix
    • Classes
      • JObject
        • Properties
        • Constructors
        • Methods
      • JUser
        • Properties
        • Constructors
        • Methods
      • JModel
        • Properties
        • Constructors
        • Methods
      • JView
        • Properties
        • Constructors
        • Methods
      • JController
        • Properties
        • Constructors
        • Methods
      • JTable
        • Properties
        • Constructors
        • Methods
      • JError
        • Methods
      • JDocument
        • Properties
        • Constructors
        • Methods
      • JApplication
        • Properties
        • Constructors
        • Methods
      • JURI
        • Properties
        • Constructors
        • Methods
      • JLanguage
        • Properties
        • Constructors
        • Methods
      • JLanguageHelper
        • Methods
      • JText
        • Methods
      • JElement
        • Properties
        • Constructors
        • Methods
      • JParameter
        • Properties
        • Constructors
        • Methods
      • JCache
        • Properties
        • Constructors
        • Methods
      • JMail
        • Constructors
        • Methods
      • JMailHelper
        • Methods
      • JFactory
        • Methods
      • JRegistry
        • Properties
        • Constructors
        • Methods
      • JSession
        • Properties
        • Constructors
        • Methods
      • JRoute
        • Methods
      • JMenu
        • Properties
        • Constructors
        • Methods
      • JPathway
        • Properties
        • Methods
      • JDatabase
        • Properties
        • Constructors
        • Methods
    • Parameters (Core JElements)
    • Configuration
Back to BOOK PAGE

James Kennard

James Kennard is a computer programmer. He has worked with various PHP and MySQL applications, since 2002. He quickly discovered Mambo/Joomla! because of its flexible extension manager. James currently maintains one open-source Joomla! component, which has been translated into over fifteen languages. Moreover, he has plans to build two more open-source components. Examples of his work can be found on his personal website www.webamoeba.co.uk.

Sorry, we don't have any reviews for this title yet.

Code Downloads

Download the code and support files for this book.


Submit Errata

Please let us know if you have found any errors not listed on this list by completing our errata submission form. Our editors will check them and add them to this list. Thank you.


Errata

- 55 submitted: last submission 29 Feb 2012

Errata type: Others | Page number: 27 | Errata date: 02 Apr 09

Bottom of page just above code example: 'use the &= assignment operator' should read '=&'

 

Errata type: Typo | Page number: 37 | Errata date: 18 Dec 08

Second last paragraph: Misspelled word: togther should be together.

 

Errata type: Typo | Page number: 37 | Errata date: 02 Apr 09

@return int Resultant vaue should read.. @return int Resultant value

 

Errata type: Typo | Page number: 38 | Errata date: 15 may 09

Second bulleted item: * class varaibles should be * class variables

 

Errata type: code | Page number: 46 | Errata date: 08 May 09

there should be: if (!$result = $db->query($query)) instead of: if (!$result = $db->setQuery($query))

 

Errata type: typo | Page number: 53 | Errata date: 15 may 09

Second line in code example: * #_myextenstion_foobars table handler should be * #_myextension_foobars table handler

 

Errata type: other | Page number: 56 | Errata date: 08 May 09

In the example that starts at the bottom of the page there should be a !-operator before $table->load($id)

 

Errata type: typo | Page number: 59 | Errata date: 08 May 09

Under "Checking Out" (bottom of page): "We can use the isCheckoutMethod() to achieve this." should be "We can use the method isCheckedOut() to achieve this."

 

Errata type: Graphics | Page number: 67 | Errata date: 06 Mar 09

Diagram - Folder Models: Legend Is: MVC Controllers Legend Should be: MVC Models

 

Errata type: typo | Page number: 67 | Errata date: 08 May 09

Chapter 4 - The structure The diagram shows folders with the first letter capitalized. For example it says 'Assets', but to keep it according to the joomla file structure, it should say 'assets', all lower case.

 

Errata type: Typo | Page number: 69 | Errata date: 27 Feb 09

Typo in paragraph above picture: joomla.application.component (typo: applictaion)

 

Errata type: Technical | Page number: 72 | Errata date: 06 Mar 09

>nameQuote('#__myextension_foobar') should be >nameQuote('#__myextension_foobar').

 

Errata type: Typo | Page number: 72 | Errata date: 18 Dec 08

Text paragraph, first line: table #__myextensnion_ should be table #__myextension_

 

Errata type: Technical | Page number: 73 | Errata date: 06 Mar 09

(PHP + Layout) in the function _buildFoobar(): between $db->nameQuote('#__myextension_foobar') and " WHERE" needs to be a .

 

Errata type: Technical | Page number: 74 | Errata date: 06 Mar 09

$this->_id should be intval($this->_id)

 

Errata type: Technical | Page number: 85 | Errata date: 06 Mar 09

(PHP) Code, Line 11: if (JFile::exists($path) should be if (JFile::exists($path))

 

Errata type: Typo | Page number: 85 | Errata date: 02 Apr 09

Missing semicolon after: $c = JRequest::getCmd('c', 'DefaultEntity')

 

Errata type: Typo | Page number: 87 | Errata date: 06 Mar 09

Table of Document Type / File Name: View.feed.php should be view.feed.php

 

Errata type: other | Page number: 94 | Errata date: 08 May 09

Throughout the book JMenubar is used, however this was only valid in the beta's. In all stable releases starting april 2007 JMenuBar was renamed to JToolBarHelper.

 

Errata type: typo | Page number: 95 | Errata date: 15 May 09

Last paragraph, third sentence: "Theses fields" should be "These fields"

 

Errata type: typo | Page number: 95 | Errata date: 15 May 09

Last predefined parameter type (last bulleted item): timzones should be timezones.

 

Errata type: Others | Page number: 103 | Errata date: 13 Mar 09

DTD location has changed since publication http://dev.joomla.org/xml/1.5/component-install.dtd is now http://www.joomla.org/xml/dtd/1.5/component-install.dtd

 

Errata type: typo | Page number: 104 | Errata date: 15 May 09

Last sentence at the bottom of the page is confusing. This is some information regarding this available from the official Joomla!Wiki: would be better if written as: Additional infomration regarding the manifest file can be found on the official Joomla!Wiki:

 

Errata type: Technical | Page number: 105| Errata date: 02 Apr 09

The example of copyright tag uses the description one despite the copyright correct one. Copy me as much as you like! should be: Copy me as much as you like!

 

Errata type: Technical | Page number: 115 | Errata date: 23 Mar 09

DTD location has changed since publication http://dev.joomla.org/xml/1.5/module-install.dtd is now http://www.joomla.org/xml/dtd/1.5/module-install.dtd

 

Errata type: Others | Page number: 134 | Errata date: 13 Mar 09

DTD location has changed since publication http://dev.joomla.org/xml/1.5/plugin-install.dtd is now http://www.joomla.org/xml/dtd/1.5/plugin-install.dtd

 

Errata type: typo | Page number: 136 | Errata date: 08 May 09

On the last line of this page the JEventDispatcher object is mentioned. It is in fact the JDispatcher object (without the Event) however this Is not the only occurrence of the class name. For example it is included in the diagram on the subsequent page.

 

Errata type: code | Page number: 157 | Errata date: 08 May 09

In the function myimport the author uses 'foo.bar.*' in an attempt to then use JLoader::import to import all files from a directory. However, JLoader does not resolve the wildcard character to list all of the files in the given directory, so it is necessary to individually import each file from the directory. It is possible to work around this problem by designing a separate function to iterate the directories contents and then use JLoader to import them. Agreed, this was deprecated, I don’t think this was ever actually used in the stable releases of 1.5. Here’s a suggested alternative: How do we use the myimport() function? This example demonstrates how we would import the file in mylibrary/foo/bar/baz: JPluginHelper::importPlugin('mylibrary', 'base'); myimport('foo.bar.baz');

 

Errata type: typo | Page number: 171 | Errata date: 08 May 09

There's a typo in the second "if" statement in function getInstance, line 48 in code example file Chapter07.extensionDesign/getinstance2.php . The function declares a static variable named "instances" (plural) and references it four times, but the line mentioned above references a variable named "instance" (singular). the second if statement should be: if (!$instances[$foo])

 

Errata type: typo | Page number: 175 | Errata date: 15 May 09

Second code block, line 2: jimport('joomla.filesyste.file'); should be jimport('joomla.filesystem.file');

 

Errata type: typo | Page number: 175 | Errata date: 15 May 09

Last sentence: ...the name of the class as which we wish to save... should be ...the name of the class to which we wish to save...

 

Errata type: typo | Page number: 178 | Errata date: 08 May 09

The first two paragraphs under User Parameters discuss default user parameters. The second sentence in the first paragraph states that "The users.xml file, located in the backendof the root of the user's component, contains the default attributes." This is true, but this file does not contain the user parameters: this should read user.xml instead of users.xml

 

Errata type: typo | Page number: 189 | Errata date: 15 May 09

Sentence following bullet list of file types contains a misspelling: We deal with asset files in two commom ways. "commom" should be "common"

 

Errata type: Others | Page number: 198 | Errata date: 02 Apr 09

The second sentence under Tooltip reads "To create tooltips we use the basic tooltip type, explain earlier in this chapter." The word "explain" should be "explained."

 

Errata type: typo | Page number: 200 | Errata date: 08 May 09

The second sentence under Grid reads "There are seven grid types, each of which represents handles a common field found used in the database." This sentence contains two extra verbs and probably should read "There are seven grid types, each of which handles a common field used in the database."

 

Errata type: typo | Page number: 207 | Errata date: 15 May 09

First line under Specificordering, second sentence: obect should be object.

 

Errata type: typo | Page number: 214 | Errata date: 15 May 09

Last line of second text paragraph: "loadTemnplate" should be "loadTemplate"

 

Errata type: typo | Page number: 215 | Errata date: 08 May 09

else if (question == "" && answer == "") should be else if (question == "" || answer == "")

 

Errata type: Code | Page number: 222 | Errata date: 13 Mar 09

2nd last code line: $selected); should be !$selected);

 

Errata type: Technical | Page number: 226 | Errata date: 13 Mar 09

Begin of Constructor-Code: global $mainframe; should be: global $mainframe, $option;

 

Errata type: typo | Page number: 229 | Errata date: 15 May 09

Fourth text paragraph, second line: ... fields to our temple. should be ... fields to our template.

 

Errata type: Typo | Page number: 231 | Errata date: 02 Apr 09

The second sentence under "Filtering and Searching" reads "We'll begin by talking a look at filtering." The word "talking" should be "taking."

 

Errata type: Typo | Page number: 255 | Errata date: 02 Apr 09

In the first sentence under the note, the word "thath" should be "that."

 

Errata type: Code | Page number: 259 | Errata date: 13 Mar 09

Code in the middle of the page: Trailing semicolon (;) missing.

 

Errata type: Typo | Page number: 265 | Errata date: 13 Mar 09

Table of languages: Pt-PT should be pt-PT

 

Errata type: Technic | Page number: 266 | Errata date: 13 Mar 09

In the translation example, last line POLITEHELLO=Guten tag %s should be: POLITEHELLO=Guten Tag, %s

 

Errata type: typo | Page number: 316 | Errata date: 15 May 09

CMD Cast Type Description (first line on page) syuitable should be suitable.

 

Errata type: Typo | Page number: 330 | Errata date: 27 Feb 09

"commas" is misspelled as "comas". Using the getEscaped() method escapes any special characters in the passed string. In our example the inverted comas will be escaped by prefixing them with a backslash. Should be: Using the getEscaped() method escapes any special characters in the passed string. In our example the inverted commas will be escaped by prefixing them with a backslash.

 

Errata type: Technical | Page number: 330 | Errata date: 27 Feb 09

Code example near the bottom omits a parenthesis for the Quote() function. $name = $db->QuotegetEscaped(JRequest('name')); Should be: $name = $db->Quote(getEscaped(JRequest('name')));

 

Errata type: typo | Page number: 330 | Errata date: 08 May 09

4th line in Code: negation and wrong variable name if ( $cmd !== false && !in_array($cmd, $allow) ) should be if ( $cmd !== false && in_array($cmd, $allowCmds) )

 

Errata type: Technical | Page number: 333 | Errata date: 20 Mar 09

Diagramm, Class DefenceHandler: &_gerParams() : JParameter should be &_getParams() : JParameter

 

Errata type: Technical | Page number: 336 | Errata date: 20 Mar 09

JLog::getInstance($extension.'.Defences.log', $options); $extension was not set.

 

Errata type: Technical | Page number: 420 | Errata date: 20 Mar 09

first paragraph: addElemenrPath( path : mixed ) : void should be addElementPath( path : mixed ) : void

 

Errata type: Technical | Page number: 429 | Errata date: 20 Mar 09

2nd paragraph from bottom: static &getTemaplate() : JTemplate should be static &getTemplate() : JTemplate

 

Errata type: TYpo | Page number: 245

In the diagram, Old: "Rediect" Should be: "Redirect"

 

Sample chapters

You can view our sample chapters and prefaces of this title on PacktLib or download sample chapters in PDF format.

Frequently bought together

Mastering Joomla! 1.5 Extension and Framework Development +    OpenNebula 3 Cloud Computing =
50% Off
the second eBook
Price for both: £28.05

Buy both these recommended eBooks together and get 50% off the cheapest eBook.

What you will learn from this book

 

  • Joomla!'s directory and URI structure along with a brief overview of its libraries
  • Joomla's common classes, variables and constants crucial for creating Joomla! extensions
  • Extending the database, following conventions for database schema, and common fields
  • Storing common types of data in standard fields and dealing with multilingual requirements.
  • Getting data from the Joomla! database
  • Using the JTable class to display and edit tables of cells
  • Designing components using the MVC design pattern
  • Configuring the component and its various elements and parameters.
  • Packaging components with the required install and uninstall files
  • Getting modules and components to work together
  • Writing, loading, and translating plugins
  • Working with Joomla!'s registry
  • Working with the User, Session, and Browser classes
  • Render output and maintain consistency throughout the application
  • Controlling paging of lists
  • Using JavaScript effects from the mootools librarys included with Joomla!
  • Creating and using Web Services in Joomla!
  • Handling errors, warnings and notices
  • Building secure Joomla! extensions
  • Working with dates, arrays, tree structures and other Joomla! utility classes
  • An in-depth reference guide to the most significant parts of the Joomla! framework

 

In Detail

Joomla! is the world's hottest open-source content management system, and the winner of the 2006 Open Source CMS Prize. Out of the box, Joomla! does a great job of managing the content needed to make your website sing. But for many people, the true power of Joomla! lies in its application framework that makes it possible for thousands of developers around the world to create powerful add-ons and extensions. Many companies or organizations have requirements that go beyond what is available in the basic Joomla! package or in a freely available extension. Thankfully, Joomla! offers a powerful application framework that makes it easy for developers to create sophisticated add-ons that extend the power of Joomla! into virtually unlimited directions.

If you use PHP programming to extend or customize Joomla!, this book is essential reading. If you feel that you've mastered the basics of creating Joomla! extensions, then this book will take you to the next level. Packed with expert advice on all aspects of development with Joomla!, you will learn about best-practice design and coding for Joomla! components, modules, plugins and other extensions.

You will also learn about customizing the page output, using JavaScript effects, making use of Web Services from within Joomla! and ensuring that your code is secure and error-free.

A unique and comprehensive reference to the main areas of interest within the Joomla! framework is also included in the book.


Packed with expert advice on all aspects of programming with Joomla!, this book is an invaluable reference guide you will turn to again and again in your Joomla! development tasks.

Approach

Packed with expert advice and tips, this book is an invaluable reference guide that you will turn to again and again as you work with Joomla!

Who this book is for

PHP developers who want to understand how Joomla! works with a view to advanced customization or extension development, and want to learn how to work with the Joomla! framework.

Code Download and Errata
Packt Anytime, Anywhere
Register Books
Print Upgrades
eBook Downloads
Video Support
Contact Us
Awards Voting Nominations Previous Winners
Judges Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software
Resources
Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software