edit action module Called from PIE customise screen, prepares the specific resource editing forms for display and carries out some editing functions (createnewlist) action routine Input: CGI data from UIG (including userid, itemid, pageid, createnewlist) Output: Transformed CGI data PDL Set return="edit" - by default, return to edit form If createnewlist != "" Call createlist routine Want to ignore response and go directly back to customise page (because want to rerun customise action to configure customise forms) Print http location command with appropriate URL Exit 0 Else Call resedit routine and return its output resedit routine Sets up the information needed to display edit forms about resource Input: CGI data from action routine (depending on which submit button used, itemid to edit will be in a parameter named edit.[itemid], or if required to delete, delete.[itemid] for a set of items) Output: Transformed CGI data PDL Foreach CGI parameter If parameter is of form edit.[itemid] Set itemid If parameter is of form delete.[itemid] and delete parameter != "" Set return="customise" to go back to customise form Set itemid Delete item from item table Delete item info from editgroups, readgroups tables Delete item info from search, search_resources tables Delete item from every user's entries in viewitem table Elseif parameter is of form chlistname.[itemid] Set return="customise" to go back to customise form Set itemid Update item table to change list name Update viewitem table to change list name for every user Elseif parameter is of form dellist.[itemid] Set return="customise" to go back to customise form Set itemid Call recdel routine to delete list Elseif parameter is of form editlist.[itemid] Set return="editsearch" to go to saved search editing form Set itemid Set type if parameter is "type" Set itemid in CGI parameters If return="customise" Want to ignore response and go directly to customise page (because want to rerun customise action to configure customise forms) Print http location command with appropriate URL Exit 0 Elseif return="editsearch" Set response parameter to editsearch Return Get information about item from item table Call onerror unless item defined Set type unless already defined by checking location of item Append " " description to ensure that the word is not substituted for an empty description by UIG Set CGI parameters with information about item Get information about item's parent from item table Set listname parameter to parent title Delete children of edit page from viewitem table Create pageform child of edit page in viewitem table Create resourceform child of edit page in viewitem table Create listlist child of edit page in viewitem table Get list of pages that can be edited by user from item, groups, userdata and editgroups tables Create HTML list of pages that can be edited by user Set pagelist parameter in CGI data Set listlist="" - to contain information about editable lists on pages Foreach page (from pagelist) Get information about children (of list/new_list type) of page from item table Set lshtml="" - information about items on these children (to be table embedded in listlist) Foreach child Select items which are children of this list and share the title of the resource being edited from item table If there are then set checked to be HTML checkbox Append to lshtml form data with checked variable included Replace first