customise action module Called from any PIE screen, prepares the customise forms for display or carries out delete page customise function action routine Input: CGI data from UIG (includes delete parameter, pageid for page to customise) Output: Transformed CGI data PDL Set pgetable to make displayed items use viewitem table as fundamental If delete parameter set Call delete_page routine on item table Call delete_page routine on viewitem table Set things up so that same customise page is displayed again (reset pageid) Delete customise item and children from viewitem table (note: customise item will automatically be recreated when the HTML for page is generated by UIG) Get information about page being customised from item table Check whether user allowed to edit page from editgroups and groups tables If user allowed to edit page Create expanded pageform child of customise item in viewitem table Else Create contracted pageform child of customise item in viewitem table (displays as warning saying page cannot be edited) Create weblinkform child of customise item in viewitem table Create viewform child of customise item in viewitem table If user allowed to edit page Create listlist child of customise item in viewitem table Get information about children of page item from item table Set listhtml="" (contains the specific HTML for this page to appear in listlist item) Foreach child If child has type "searchresults" Add HTML to listhtml Else Set background colour depending on whether new_list or list type Add start of list HTML to listhtml Get list of children of list from item table Foreach child Add resource HTML to listhtml Add end of list HTML to listhtml Add listhtml to CGI parameters Add page title and description to CGI parameters Get list of groups that can read current page Add list of groups to CGI parameters Get list of groups that can edit current page Add list of groups to CGI parameters Call get_editable_pages to get list of pages that can be edited Set pagelisthtml CGI parameter (contains the specific HTML to display this list) Get list of pages other than system pages that can be read from item, groups, userdata and readgroups tables (these are the pages a user can create a new page as a copy of) Set pagelistfull CGI parameter (contains the specific HTML to display this list) Get information about user's default page from item,userdata tables Set defaultpage CGI parameter Get list of pages filtered out of LH side of page from pagesnotviewed table (we already have the list of all the pages they can read which could be potentially in this table) Set variables no_of_pages,pageviewlist (HTML),hiddenlist Set count=0 Foreach page from full list of pages Next if page is system default Add page to hiddenlist unless page is user default Count++ If page is listed in pages_not_viewed Append HTML to pageviewlist Else If page is user default Append HTML to pageviewlist Else Append HTML to pageviewlist Start second column if no_of_pages <= 2* count < no_of_pages + 2 (i.e. if we're halfway through list) by appending appropriate HTML to pageviewlist Complete pageviewlist HTML Set pagedel (box to allow deletion of current page if not user default) If page is default Append message to pagedel Else Append HTML form to pagedel Set pagedel CGI parameter Set notdefault (list of writeable pages which are not the default) Foreach page Append HTML of notdefault unless page is default Set notdefault CGI parameter Set response CGI parameter to "customise" to force display of customise page Return CGI info delete_page routine Deletes a page and its children (Note: This routine is probably redundant as there is a better recursive delete function which should be used instead) Input: pageid, table (item or viewitem), userid Output: none PDL Delete children of children of page from table Delete children of page from table Delete page from table Return