// Use WebSiteAdmin.nui // Web Site Administration use WebAppFramework.nui // The works use SiteA001.dd // Site Administration - System table use SiteA002.dd // Site Administration - User comments to the site object oWebSiteAdminLayout is a WebLayoutTable register_procedure DoTopBar register_procedure DoLeftMenu register_procedure DoBottomBar set psTableStyle to "width:994px" send add_column 0 "" "width:130px" send add_column 1 "" "width:864px" send begin_cells send add_cell 0 0 MSG_DoTopBar 0 "topbar" 0 set span_values to 0 2 set class_and_style to "" "background-color:#ff6c5c;height:50px;vertical-align:top" // reddish send add_cell 1 0 MSG_DoLeftMenu 0 "leftmenu" 0 set class_and_style to "" "background-color:#e4e4e4;height:668px;vertical-align:top;width:130px" send add_cell 1 1 0 0 "main" 0 set class_and_style to "" "background-color:#f8f8f8;vertical-align:top;text-align:center" send add_cell 2 0 MSG_DoBottomBar 0 "bottombar" 0 set span_values to 0 2 set class_and_style to "" "background-color:#c0c0c0;height:30px;vertical-align:top" send end_cells end_object use WebFormNew.nui object oCommentForm is a cWebBusinessProcess set pbClearAfterSave to FALSE object oSiteA002_DD is a SiteA002_DataDictionary send DefineAllExtendedFields end_object // oCountry_DD set Main_DD to oSiteA002_DD object oWebForm is a wForm set server to oSiteA002_DD set piMainFileFindIndex to 2 set psFormName to "CommentForm" set psFormCollection to "WebSiteAdmin" set psFormTitle to "User comments" set psFormDirections to "Enter your comments regarding the function of the site." set pbMessageLine to TRUE set pbAllowCommentState to FALSE set phWriter to oStandardFormWriter object oUiContainer is a wfUserInterface set phWriter to oStandardFormWriter // Why is this necessary? set value WFCP_ENC_COLOR to "#eeeeee" object oGroup1 is a wfGroup set value WFCP_TITLE to "Pre-registered information" object oSiteA002_Module is a wfInput send DoSetFileFieldDD file_field SiteA002.Module WFIT_AUTO set value WFIP_READONLY to TRUE set value WFIP_TRANSPARENT to TRUE end_object object oSiteA002_Page is a wfInput send DoSetFileFieldDD file_field SiteA002.Page WFIT_AUTO set value WFIP_READONLY to TRUE set value WFIP_TRANSPARENT to TRUE end_object object oSiteA002_Form_Collection is a wfInput send DoSetFileFieldDD file_field SiteA002.Form_Collection WFIT_AUTO set value WFIP_READONLY to TRUE set value WFIP_TRANSPARENT to TRUE end_object object oSiteA002_Form_Id is a wfInput send DoSetFileFieldDD file_field SiteA002.Form_Id WFIT_AUTO set value WFIP_READONLY to TRUE set value WFIP_TRANSPARENT to TRUE end_object object oSiteA002_Language is a wfInput send DoSetFileFieldDD file_field SiteA002.Language WFIT_AUTO set value WFIP_READONLY to TRUE set value WFIP_TRANSPARENT to TRUE end_object object oSiteA002_Browser is a wfInput send DoSetFileFieldDD file_field SiteA002.Browser WFIT_AUTO set value WFIP_READONLY to TRUE set value WFIP_TRANSPARENT to TRUE end_object end_object object oGroup2 is a wfGroup set value WFCP_TITLE to "Your comment" object oSiteA002_Type is a wfInput send DoSetFileFieldDD file_field SiteA002.Type WFIT_AUTO end_object object oSiteA002_Comment is a wfInput send DoSetFileFieldDD file_field SiteA002.Comment WFIT_AUTO set value WFIP_ROWS to 10 end_object end_object // oGroup object oBottomButtonBar is a wfBarContainer object oEditButtons is a wfButtonArray send add_button_value "ls.btn.save" "save" end_object end_object object oHiddenFields is a wfGroup set value WFCP_HIDDEN_STATE to TRUE object oSiteA002_QueryString is a wfInput send DoSetFileFieldDD file_field SiteA002.QueryString WFIT_AUTO end_object end_object end_object // oUiContainer register_object oWebSiteAdmin_Module procedure GotoOkPage //string lsUrl //get value of oBaseSessionVariables WSV_CURRENT_URL to lsUrl //set psContinueLink of oWebSiteAdmin_Module to (lsUrl+"?"+trim(SiteA002.QueryString)) //send GotoPage "siteadmin" "commentaccepted" end_procedure procedure OnSetDefaultValues set field_changed_value of oSiteA002_DD field SiteA002.Module to (WafGetQueryString("sam")) set field_changed_value of oSiteA002_DD field SiteA002.Page to (WafGetQueryString("sap")) set field_changed_value of oSiteA002_DD field SiteA002.Form_Collection to (WafGetQueryString("sac")) set field_changed_value of oSiteA002_DD field SiteA002.Form_Id to (WafGetQueryString("saf")) set field_changed_value of oSiteA002_DD field SiteA002.Language to (WafGetQueryString("sal")) set field_changed_value of oSiteA002_DD field SiteA002.Browser to (WafGetQueryString("sab")) set field_changed_value of oSiteA002_DD field SiteA002.QueryString to (value(oBaseSessionVariables,WSV_PREV_QRYSTR)) end_procedure end_object // oWebForm object oSelectionForm is a wForm set psFormName to "CommentList" set psFormCollection to "WebSiteAdmin" set phWriter to oStandardFormWriter object oUiContainer is a wfUserInterface set value WFCP_ENC_WIDTH to "600px" set value WFCP_ENC_COLOR to "#eeeeee" object oModuleCombo is a wfInput set value WFIP_INPUT_TYPE to WFIT_DROPDOWN set value WFIP_LABEL to "Module:" set value WFIP_NAME to "module" set value WFIP_TOOLTIP to "Constrain the list to only one module or select all" set value WFIP_AUTO_SUBMIT to TRUE send DoCreateOptionsObject procedure DoEntryDisplay integer lhModules liRow liMax string lsModule forward send DoEntryDisplay send DoResetOptions send DoAddOption "ALL" "All modules" move oWafModuleList to lhModules get row_count of lhModules to liMax decrement liMax for liRow from 0 to liMax get psModuleName.i of lhModules liRow to lsModule send DoAddOption lsModule lsModule loop end_procedure end_object // oModuleCombo object oPageCombo is a wfInput set value WFIP_INPUT_TYPE to WFIT_DROPDOWN set value WFIP_LABEL to "Page:" set value WFIP_NAME to "page" set value WFIP_TOOLTIP to "Constrain the list to only one page within the selected module" set value WFIP_AUTO_SUBMIT to TRUE set value WFIP_LOCATION to 2 send DoCreateOptionsObject procedure DoEntryDisplay integer lhModule liRow liMax string lsModule lsPage forward send DoEntryDisplay send DoResetOptions send DoAddOption "ALL" "All pages" get value of oModuleCombo WFIP_VALUE to lsModule get WafModuleObject lsModule to lhModule if lhModule begin get row_count of lhModule to liMax decrement liMax for liRow from 0 to liMax get psPageName.i of lhModule liRow to lsPage send DoAddOption lsPage lsPage loop end end_procedure end_object // oPageCombo object oHandledCombo is a wfInput set value WFIP_INPUT_TYPE to WFIT_DROPDOWN set value WFIP_LABEL to "Status:" set value WFIP_NAME to "handled" set value WFIP_TOOLTIP to "Constrain the list to only one page within the selected module" set value WFIP_AUTO_SUBMIT to TRUE set value WFIP_LOCATION to 2 send DoCreateOptionsObject send DoAddOption "FALSE" "Un-handled" send DoAddOption "TRUE" "Already handled" end_object // oHandledCombo object oTypeCombo is a wfInput set value WFIP_INPUT_TYPE to WFIT_DROPDOWN set value WFIP_LABEL to "Type:" set value WFIP_NAME to "type" set value WFIP_TOOLTIP to "Constrain the list to only one type of comments" set value WFIP_AUTO_SUBMIT to TRUE set value WFIP_LOCATION to 0 send DoCreateOptionsObject send DoAddOption "A" "All" send DoAddOption "C" "Comments" send DoAddOption "S" "Suggestions" send DoAddOption "E" "Errors" end_object // oTypeCombo object oBtn is a wfButton set button_value to "Run report" "run" set value WFIP_TOOLTIP to "Run the report" set value WFIP_LOCATION to 2 procedure OnClick string lsName if (lsName="run") begin end end_procedure end_object // oBtn object oList is a WebSelectionList set piMainFile to SiteA002.file_number set piOrdering to 2 set piRecordsPerPage to 0 set psSubmitIdPrefix to "cl" object oColumns is a WebReportColumnLayout set pbScrollable to FALSE send AddColumn "Module" "100px" 0 send AddColumn "Page" "100px" 0 send AddColumn "Status" "50px" 0 send AddColumn "Type" "50px" 0 send AddColumn "Comment" "300px" 0 set piLinkType to 1 // Submit type link procedure OnWriteRecord set ColumnValue 0 to (trim(SiteA002.Module)) "" set ColumnValue 1 to (trim(SiteA002.Page)) "" set ColumnValue 2 to (trim(SiteA002.Handled)) "" set ColumnValue 3 to (trim(SiteA002.Type)) "" // set ColumnValue 4 to (trim(SiteA002.Comment)) "" send OutputDataRow SiteA002.recnum end_procedure end_object set phReportColumnLayout to (oColumns(self)) end_object object oGrid is a wfGrid set phGridController to oList set value WFIP_SPAN to 2 // Span both columns of the layout end_object end_object // oUiContainer end_object // oSelectionForm end_object object oWebSiteAdmin_Module is a WebModule set psModuleName to "siteadmin" set psDefaultPage to "bla" property string psContinueLink procedure DoLeftMenu integer liUserId lhWebForm string lsUrl lsQueryStr send WebQuickMenu_Reset get value of oBaseSessionVariables WSV_USER_ID to liUserId send WebQuickMenu_AddLinkInt "Site log" "siteadmin" "sitelog" "" send WebQuickMenu_AddLinkInt "List comments" "siteadmin" "commentlist" "" send WebQuickMenu_AddLinkInt "List tables" "siteadmin" "" "" send WebQuickMenu_AddLinkInt "Setup info" "siteadmin" "" "" // send WebQuickMenu_AddLinkInt "" "siteadmin" "" "" // send WebQuickMenu_AddLinkInt "" "siteadmin" "" "" // send WebQuickMenu_AddLinkInt "" "siteadmin" "" "" // send WebQuickMenu_AddLinkInt "" "siteadmin" "" "" send WebQuickMenu_WriteHtml MS_VERTICAL get value of oBaseSessionVariables WSV_CURRENT_URL to lsUrl get value of oBaseSessionVariables WSV_CURRENT_QRYSTR to lsQueryStr send XHTML_Add_VerticalSpace "100px" send XHTML_Add_Open_Element "div" send XHTML_Add_Attribute "style" "text-align:center;bottom:2px;background-color:#ededed;font-weight:normal" send QryString_PrepareUrlAndQueryStr lsUrl lsQueryStr send QryString_AddParamProtected "html" "true" send XHTML_Add_Closed_Element "a" "View Source" send XHTML_Add_Attribute "href" (QryString_Value()) send XHTML_Add_Attribute "title" "View the XHTML source in separate window" send XHTML_Add_Attribute "target" "_blank" send XHTML_Add_Closed_Element "br" "" send XHTML_Add_Closed_Element "a" "XHTML Validate" send XHTML_Add_Attribute "title" "Validate current page using W3C's XHTML validator" send XHTML_Add_Attribute "href" "http://validator.w3.org/check?uri=referer" // W3C Validator send XHTML_Close_Element // div end_procedure procedure DoTopBar integer liUserId string lsValue send XHTML_Add_Open_Element "table" send XHTML_Add_Attribute "style" "width:100%" send XHTML_Add_Open_Element "tr" send XHTML_Add_Open_Element "td" send XHTML_Add_Attribute "style" "width:300px;text-align:left;padding-left:10px" get value of oBaseSessionVariables WSV_USER_ID to liUserId if liUserId get value of oBaseSessionVariables WSV_USER_NAME to lsValue else move "anonymous" to lsValue send XHTML_Add_Closed_Element "span" ("Current user: "+lsValue) send XHTML_Add_Closed_Element "br" "" send XHTML_Add_Closed_Element "span" ("User id: "+string(liUserId)) send XHTML_Close_Element // td send XHTML_Add_Open_Element "td" send XHTML_Add_Attribute "style" "text-align:center" send XHTML_Add_Closed_Element "h3" "Site Administration" send XHTML_Close_Element // td send XHTML_Add_Open_Element "td" send XHTML_Add_Attribute "style" "width:300px;text-align:right;padding-right:10px" send XHTML_Add_Closed_Element "span" "A little bit of text" send XHTML_Add_Closed_Element "br" "" send XHTML_Add_Closed_Element "span" "Another little bit of text" send XHTML_Close_Element // td send XHTML_Close_Element // tr send XHTML_Close_Element // table end_procedure procedure DoBottomBar string lsTime lsCopyright get sCopyrightText 2004 "Sture ApS" to lsCopyright move (TS_ConvertToString(TS_SysTime())) to lsTime send XHTML_Add_Open_Element "table" send XHTML_Add_Attribute "style" "width:100%" send XHTML_Add_Open_Element "tr" send XHTML_Add_Closed_Element "td" "Site Administration ver 0.5" send XHTML_Add_Attribute "style" "text-align:left;padding-left:10px" send XHTML_Add_Closed_Element "td" ("Server time: "+lsTime) send XHTML_Add_Attribute "style" "text-align:center" send XHTML_Add_Closed_Element "td" lsCopyright send XHTML_Add_Attribute "style" "text-align:right;padding-right:10px" send XHTML_Close_Element // tr send XHTML_Close_Element // table end_procedure object oNoEntryPage is a WebPage set psPageName to "noentry" set phPageLayoutObject to (oWebSiteAdminLayout(self)) procedure OnWriteCell string lsLabel integer liAux string lsLink if (lsLabel="main") begin get psContinueLink to lsLink send XHTML_Add_VerticalSpace "30px" send XHTML_Add_Closed_Element "div" "No access to this area!" end end_procedure end_object // oEnterCommentPage object oEnterCommentPage is a WebPage set psPageName to "commentform" set phPageLayoutObject to (oWebSiteAdminLayout(self)) procedure OnWriteCell string lsLabel integer liAux integer lhWebForm if (lsLabel="main") begin send XHTML_Add_VerticalSpace "30px" get WebForm_FindFormObject "CommentForm" "WebSiteAdmin" to lhWebForm send DoWriteHtml of lhWebForm end end_procedure end_object // oEnterCommentPage object oListCommentsPage is a WebPage set psPageName to "commentlist" set phPageLayoutObject to (oWebSiteAdminLayout(self)) procedure OnWriteCell string lsLabel integer liAux integer lhWebForm if (lsLabel="main") begin send XHTML_Add_VerticalSpace "30px" get WebForm_FindFormObject "CommentList" "WebSiteAdmin" to lhWebForm send DoWriteHtml of lhWebForm end end_procedure end_object // oListCommentsPage // ------------------------------------------------------------------ function SiteAdmUserCommentLinkValue integer lhForm returns string string lsModule lsPage lsFormCollection lsFormName integer liLanguage liBrowser // Get current page and module: get value of oBaseSessionVariables WSV_MODULE_NAME to lsModule get value of oBaseSessionVariables WSV_PAGE_NAME to lsPage if lhForm begin get psFormCollection of lhForm to lsFormCollection get psFormName of lhForm to lsFormName end else begin move "" to lsFormCollection move "" to lsFormName end get value of oBaseSessionVariables WSV_LANGUAGE to liLanguage get value of oWebBrowserInfo WBI_BROWSER_ID to liBrowser send QryString_PrepareModulePage "siteadmin" "commentform" if (lsModule<>"") send QryString_AddParam "sam" lsModule if (lsPage<>"") send QryString_AddParam "sap" lsPage if (lsFormCollection<>"") send QryString_AddParam "sac" lsFormCollection if (lsFormName<>"") send QryString_AddParam "saf" lsFormName send QryString_AddParam "sal" liLanguage send QryString_AddParam "sab" liBrowser function_return (QryString_Value()) end_function procedure OnModuleSetup string lsPage string lsSubmitButton string lsFormName string lsFormCollection integer liUserId get value of oBaseSessionVariables WSV_USER_ID to liUserId if (liUserId=0 and lsPage<>"noentry") send GotoPage "siteadmin" "noentry" else forward send OnModuleSetup lsPage lsSubmitButton lsFormName lsFormCollection end_procedure end_object // oWebSiteAdmin_Module