Web hosting directory - Chapter 9: Intranet Contact Manager 317 Method Description
Wednesday, November 21st, 2007Chapter 9: Intranet Contact Manager 317 Method Description addDriver() Controls how add operations are performed on contacts and categories. If step is set to 1 or is unset, it calls displayAddModifyMenu() with an add parameter to display the new category Web form. If step is set to 2, it runs addCategory() to start the category-creation process. deleteContactsByCatID() Deletes all contacts for the given category. All information related to the contacts is also deleted. It takes the category ID as the parameter and uses the getContactsByCatID() and deleteContact() methods of the Contact class to find and delete the contacts, respectively. The Contact Manager Application The application contact_mngr.php is responsible for managing contacts. This application is included on the CD-ROM in the ch9/apps directory. Let s take a look at its methods: . run(): When the application is run, this method is called. It decides which functionality is requested by the user and calls the appropriate driver method to perform the desired operations: Creates a theme object, $this->themeObj. The current user s theme choice is stored in $this->theme by calling the getUserTheme() method of the theme object created. Remembers, themes are part of the intranet as they allow users see the intranet pages in a certain look and feel. It decides which method to call depending on the value of cmd. If no cmd is specified, it calls searchDriver() to show the search menu. . mailToContact(): This method gets e-mail information for the given contact, such as e-mail address, CC To, subject, body, and so forth, and sends e-mail to the contact. This is how it works: It checks whether the e-mail body has been supplied or not. If not, it shows an alert message and takes the user back to the previous page.