You are previewing Mastering Joomla! 1.5 Extension and Framework Development: The Professional’s Guide to Programming Joomla!.
O'Reilly logo
Mastering Joomla! 1.5 Extension and Framework Development: The Professional’s Guide to Programming Joomla!

Book Description

The Professional Guide to Programming Joomla!

  • 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

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. 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

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 written 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.

Table of Contents

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