Tài liệu The Professional''''s Guide to Programming Joomla ppt

486 527 0
Tài liệu The Professional''''s Guide to Programming Joomla ppt

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

Mastering Joomla! 1.5 Extension and Framework Development The Professional's Guide to Programming Joomla! James Kennard BIRMINGHAM - MUMBAI Mastering Joomla! 1.5 Extension and Framework Development The Professional's Guide to Programming Joomla! Copyright © 2007 Packt Publishing All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews. Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, Packt Publishing, nor its dealers or distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book. Packt Publishing has endeavored to provide trademark information about all the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information. First published: November 2007 Production Reference: 1311007 Published by Packt Publishing Ltd. 32 Lincoln Road Olton Birmingham, B27 6PA, UK. ISBN 978-1-84719-282-0 www.packtpub.com Cover Image by Vinayak Chittar ( vinayak.chittar@gmail.com ) Credits Author James Kennard Reviewers Joseph L. LeBlanc Riccardo Tacconi Senior Acquisition Editor Douglas Paterson Development Editor Rashmi Phadnis Technical Editors Adil Rizwan Ahmed Ved Prakash Jha Editorial Manager Dipali Chittar Project Manager Abhijeet Deobhakta Indexer Hemangini Bari Proofreader Chris Smith Production Coordinator Manjiri Nadkarni Cover Designer Shantanu Zagade About the Author James Kennard is a computer programmer with a particular interest in web-based services. His interests in Joomla! started as a result of an internal assignment at work when he was tasked with identifying suitable web systems to host a number of intranet and Internet applications. James currently maintains one open-source Joomla! component, which has been translated into over fteen languages. Examples of his work can be found on his personal website: www.webamoeba.co.uk . About the Reviewers Joseph L. LeBlanc started with computers at a very young age. His independent education gave him the exibility to experiment and learn computer science. Joseph holds a bachelor's degree in Management Information Systems from the Oral Roberts University. Joseph is currently a freelance Joomla! extension developer. He released a popular component tutorial in May 2004, then later authored the book Learning Joomla! 1.5 Extension Development: Creating Modules, Components, and Plugins with PHP. Work samples and open-source extensions are available at www.jlleblanc.com . In addition to freelancing, he is a board member of the DC PHP Conference. He has also worked as a programmer for a web communications rm in Washington, DC. Riccardo Tacconi works for an Italian company as a system administrator and web developer using PHP, MySQL, and Oracle. He is an MCP and studies IT part-time at the British Open University. His main interests are web development, Windows and Linux administration, Robotics, and Java software development (JMF, motion detection, CV, and distributed systems). He loves Linux and he is a proud member of the local Linux User Group: GROLUG. He tries to innovate ways to substitute Windows-based technologies with Linux and open-source alternatives. Table of Contents Preface 1 Chapter 1: Introduction to Joomla! 7 Overview 7 History 8 Requirements 9 Extension Types and Their Uses 9 Components 10 Modules 10 Plugins 10 Languages 11 Templates 11 Tools 11 Extension Manager 12 JED and JoomlaCode.org 12 Development Tools 13 J!Code 14 J!Dump 14 Summary 16 Chapter 2: Getting Started 17 The Application and Document 17 Request to Response 18 The Process 18 URI Structure 22 Directory Structure 24 Libraries 26 A Quick Lesson in Classes 27 Inheriting from JObject 28 Table of Contents [ ii ] Working with the Request 29 The Factory 30 The Session 31 Predefined Constants 32 Multilingual Support 34 UTF-8 String Handling 34 Coding Standards 36 phpDocumentor 37 Summary 39 Chapter 3: The Database 41 The Core Database 41 Extending the Database 42 Table Prefix 42 Schema Conventions 42 Common Fields 42 Schema Example 44 Dealing with Multilingual Requirements 45 Querying the Database 46 Writing Queries 46 Getting Results 47 loadResult( ) : string 48 loadResultArray( numinarray : int=0 ) : array 48 loadAssoc( ) : array 48 loadAssocList( key : string='' ) : array 49 loadObject( ) : stdClass 49 loadObjectList( key : string='' ) : array 50 loadRow( ) : array 50 loadRowList( key : int ) : array 51 Using ADOdb 51 JTable 52 CRUD 54 Manipulating Common Fields 58 Publishing 59 Hits 59 Checking Out 59 Ordering 60 Parameter Fields 61 Date Fields 62 Summary 63 Chapter 4: Component Design 65 Setting up a Sandbox 65 The Structure 67 Table of Contents [ iii ] The MVC 68 Building a Model 70 Building a View 75 Building a Controller 78 Building an MVC Component 82 Rendering Other Document Types 87 Feed 87 PDF 90 Raw 91 Dealing with Component Configuration 93 Elements and Parameters 95 Extending JElement 96 Using Custom JElement Classes 98 Help Files 99 Routing 100 Packaging 102 XML Manifest File 103 SQL Install and Uninstall Files and Queries 110 Install and Uninstall Files 111 Summary 113 Chapter 5: Module Design 115 Setting Up a Sandbox 115 First Steps 116 Standalone Modules 117 Modules and Components Working Together 118 Frontend and Backend Module Display Positions 119 Module Settings (Parameters) 120 Helpers 121 Layouts (Templates) 124 Media 126 Translating 126 Packaging 127 XML Manifest File 127 Summary 131 Chapter 6: Plugin Design 133 Setting Up a Sandbox 134 Events 136 Listeners 138 Registering Listeners 138 Handling Events 138 [...]... we intend to create an open-source Joomla! project, it is advisable to consider using JoomlaCode.org to host the project, even if we do not intend to use all of the features it provides Development Tools There are numerous development tools available, which we can use to develop Joomla! extensions Most of these tools are not specific to Joomla! , but are PHP tools When we come to choose an editor for... about working with Joomla! is the encouragement of openness and friendliness amongst the members of the Joomla! community It is, without a doubt, the community that is driving the Joomla! project The name Joomla! ’ is derived from the Swahili word ‘Jumla’, meaning ‘all together’ The Joomla! community lend a true sense of jumla to the project In this chapter we have seen that there are essentially six types... 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... with Joomla! [ 11 ] Introduction to Joomla! Tools are not installed to Joomla! ; they are generally standalone scripts or applications, which may, or may not, require their own form of installation A good example of a Joomla! tool is JSAS (Joomla! Stand Alone Server) JSAS provides an easy way to set up Joomla! installations on a Windows-based system To learn more about JSAS please refer to http://jsas.joomlasolutions.com... templates modify the appearance of the backend (what the administrators see); these templates are less common There are many websites that offer free and commercial Joomla! templates, all of which are easy to locate using a search engine Tools Tools, although referred to as extensions, are very different to components, modules, and plugins The term 'tools' is used to describe any other type extension that can... http://www.apachefriends.org/xampp.html Another easy way to get started with Joomla! is to use JSAS (Joomla! Stand Alone Server) JSAS enables us to quickly set up multiple Joomla! installations on a Windows-based system To learn more about JSAS please refer to http://jsas.joomlasolutions.com Joomla! itself is relatively easy to set up and, if necessary, an administration and installation guide can be found on the official Joomla! help... explains some of the fundamental concepts behind Joomla! It describes the process from request to response We touch lightly on some of the coding aspects and explain how to use some of the more common Joomla! elements The Application and Document The application is a global object used to process a request The two application classes that we are interested in are JSite and JAdministrator Joomla! uses JSite... Unlike the application, to access the global document object we use the static JFactory::getInstance() method: $document =& JFactory::getDocument(); Note that we use the =& assignment operator to retrieve the document This ensures that we get a reference to the global document object and that we do not create a copy of the object Request to Response Frontend and backend requests are placed with the root... classes to specific events that Joomla! can throw using the global event dispatcher [ 10 ] Chapter 1 This table describes the different core plugin types: Plugin Type Description authentication Authenticate users during the login process content Process content items before they are displayed editors WYSIWYG editors that can be used to edit content editors-xtd Editor extensions (normally additional editor... announced that they intended to abandon Mambo Open Source The group formed a non-profit organization called 'Open Source Matters' Open Source Matters created the Joomla! project, a guaranteed 100% open-source GPL project The first release of Joomla! (Joomla! 1.0) was very similar to the then current release of Mambo, the majority of extensions at the time being compatible with both Restraints within Joomla! . Mastering Joomla! 1.5 Extension and Framework Development The Professional's Guide to Programming Joomla! James Kennard BIRMINGHAM - MUMBAI Mastering Joomla! . 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

Ngày đăng: 23/12/2013, 10:15

Từ khóa liên quan

Tài liệu cùng người dùng

  • Đang cập nhật ...

Tài liệu liên quan