Chapter 9: Intranet Contact Manager 315 . displayDeleteOptions(): (Msn web hosting)

Chapter 9: Intranet Contact Manager 315 . displayDeleteOptions(): This method is used to display deletion options (a deletion options page that contains two radio buttons and a list box/combo box) to the user. This is how it works: It checks whether there is a category ID supplied to the method. If there is no category ID, it shows an alert message and returns to the previous page. A delete option menu template ($CONTACT_CAT_DEL_OPT_TEMPLATE) is loaded in a template object called $template. This template includes a Web form with two radio buttons. One of the buttons is to delete all subcategories and contacts under the selected category. The other button is to transfer all its subcategories and contacts to some other category (to be selected from a combo box). If the category to be deleted is a parent category, then the combo box is loaded with all of the other parent categories. If the category to be deleted is a subcategory, then the combo box is loaded with the subcategories that fall under the subcategory s parent. The contents of the $template object are inserted into the $themeTemplate object s content block, and the results are printed on user s browser screen. . displayAddModifyMenu(): This method displays the add or modify category Web form as needed. It works as follows: An add modify menu template ($CONTACT_CAT_ADD_MOD_TEMPLATE) is loaded in a template object called $template. The template includes a Web form that takes input such as category name, category description, and category hierarchy (parent/sub). The list of parent categories becomes enabled when the user chooses the category to be a parent category. Finally, the contents of the $template object are inserted into the $themeTemplate object s content block and the results are printed on the user s browser screen. . modifyCategory(): This method is used to modify a given category. It works as follows: It checks whether there is category ID supplied to the method. If there is no category ID, it shows an alert message and returns to the previous page. If the request is to change a parent category to a subcategory, this method denies that if the parent (main) category already has subcategories (we re limited to one level of subcategory). Under this circumstance, it shows an alert method and takes the administrator back to previous page.

Leave a Reply