Book Image

Learning Joomla! 1.5 Extension Development

Book Image

Learning Joomla! 1.5 Extension Development

Overview of this book

Table of Contents (17 chapters)
Learning Joomla! 1.5 Extension Development
Credits
About the Author
About the Reviewer
Preface

Managing comments


Back in Chapter 4, we added a feature to the site which allows visitors to add their comments to reviews on the site. Unfortunately, websites offering comments are frequently abused. We need to build a backend manager where comments can be removed or edited.

Before we start adding models, views, and controller methods, let's stop to think about how we want to organize the new code. At the moment, the controller handles everything related to managing the records in the jos_reviews table. We could add methods to the current controller for managing the jos_reviews_comments table as well.

This approach would require us to come up with task names that would not conflict with the existing ones; for instance, we would have to add saveComment() so as not to conflict with save(). This would also require that all of the new toolbar buttons have tasks to match the ones we are adding. This is entirely possible for most buttons, you simply pass the new task you want to use as the first...