Book Image

Learning Joomla! 1.5 Extension Development: Creating Modules, Components, and Plugins with PHP

By : Joseph L. LeBlanc
Book Image

Learning Joomla! 1.5 Extension Development: Creating Modules, Components, and Plugins with PHP

By: Joseph L. LeBlanc

Overview of this book

<p>Joomla! is the world's hottest open-source content management system, and the winner of the 2006 Open Source CMS Prize.<br /><br />While Joomla! is packed with features, its greatest quality is that it is extremely extensible, allowing any number of complex applications to be cleanly integrated. Shopping carts, forums, social networking profiles, job boards, and real estate listings are all examples of extensions developers have written for Joomla!. All of these can run off one Joomla! site, while only one database, template, and core need to be maintained. When you build an extension to Joomla!, it will inherit the look and feel of the overall site. Any type of program that can be coded in PHP is a potential component waiting to be written!<br /><br />If you're eager to start creating extensions for Joomla!, this book is for you. Walk through the development of complete Joomla! components and modules with this tutorial for PHP programmers. Written for Joomla! version 1.5 and tested against pre-final releases, this book will get you started coding your first extensions as quickly as possible, and adds the features that will make your work look professional!<br /><br />The book builds example extensions to create, find, promote, and cross-link restaurant reviews. A component will handle common data items seen across all reviews such as price range, reservations, cuisine type, and location. Your visitors will be able to search and sort through the reviews; adding their own criteria to zero in on their dining options for the evening. <br /><br />Your modules will highlight new reviews, drawing the attention of frequent visitors. Finally, plugins will pull pieces of the reviews into feature articles and others will integrate them into searches. Even if you don't own a restaurant, you will still find the code applicable to your own development projects, and the skills you develop will make you a Joomla! developer to be reckoned with!</p>
Table of Contents (14 chapters)
Copyright
Credits
About the Author
About the Reviewer
Preface

Additional Toolbars


If you try to use any of the toolbars in place at the moment on any of the comment administration screens, you won’t get the results you are expecting. This is because the buttons are still pointing to the tasks for reviews. To fix this, we will need to create some new toolbars for the comments. Open /administrator/components/com_reviews/toolbar.reviews.html.php and add the following class:

class TOOLBAR_reviews_comments
{
  function _EDIT()
  {
    JToolBarHelper::save('saveComment');
    JToolBarHelper::cancel('comments');
  }
  function _DEFAULT()
  {
    JToolBarHelper::title( JText::_( 'Comments' ), 'generic.png' );
    JToolBarHelper::editList('editComment');
    JToolBarHelper::deleteList('Are you sure you want to remove
                       these comments?', 'removeComment');
  }
}

The first parameter in the calls to the save(), cancel(), and editList() member functions of JToolBarHelper overrides the default task, allowing us to redefine them with our own. The...