Shared web hosting - Chapter 8: Intranet Simple Document Publisher 269 Here
Chapter 8: Intranet Simple Document Publisher 269 Here are the methods in this application: . 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. Here s how it works: 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. If the application is called with the cmd=del query parameter, deleteDriver() is run. Similarly, cmd=add calls addDriver(), cmd=mod calls modifyDriver(), and cmd=reo calls reorderDriver(). . reorderDriver(): This method is used to change the order of the categories in the system. Categories can be displayed in navigation displayed by the home.php (discussed in Chapter 7) in the given order set by this method. In addition, when the categories are listed in the document index page, the order of each category is determined by order information stored in the database. This method allows you to change the order. It is called when cmd=reo is passed as a query parameter to the application. Here is how it works: The method checks to see if the application is being run by an administrator. If it isn t, the method returns a null. The reordering of categories requires that first the user is given a chance to set the order and then apply the requested order. So the method uses the $step query parameter to control the application state. If step=1 is passed, the method displays the Web form that allows the user to reorder the categories. This Web form is created by calling displayReorderMenu(). If step=2 is passed, the method updates the order of the category because the step=2 is only passed from the Web form displayed by displayReorderMenu(), which is shown when step=1 is passed. . deleteDriver(): This method controls how delete operations are per formed on documents, responses, and categories. It works as follows: If the obj=doc query parameter is passed to this method when called, it calls deleteDoc() to start the document delete process. If the obj=response query parameter is passed, it runs deleteResponse() to start the delete process for response for a document. If the obj=category query parameter is passed, it runs deleteCategory() to start the category delete process.