private void SetupWorkflowControls() { if (HttpContext.Current == null) { return; } if (siteModule == null) { return; } if (module == null) { return; } CmsPage cmsPage = this.Page as CmsPage; if ((cmsPage != null) && (cmsPage.ViewMode == PageViewMode.WorkInProgress)) { switch (workflowStatus) { case ContentWorkflowStatus.Draft: ibPostDraftContentForApproval.ImageUrl = Page.ResolveUrl(WebConfigSettings.RequestApprovalImage); ibPostDraftContentForApproval.ToolTip = Resource.RequestApprovalToolTip; ibPostDraftContentForApproval.Visible = true; statusLink.HelpKey = "workflowstatus-draft-help"; break; case ContentWorkflowStatus.AwaitingApproval: //if (WebUser.IsAdminOrContentAdminOrContentPublisher) if ( (cmsPage.CurrentPage != null) && ( (isAdminEditor || WebUser.IsInRoles(cmsPage.CurrentPage.EditRoles)) || (WebUser.IsInRoles(this.module.AuthorizedEditRoles)) ) ) { //add in the reject and approve links: ibApproveContent.ImageUrl = Page.ResolveUrl(WebConfigSettings.ApproveContentImage); ibApproveContent.Visible = true; ibApproveContent.ToolTip = Resource.ApproveContentToolTip; lnkRejectContent.NavigateUrl = String.Format("{0}/Admin/RejectContent.aspx?mid={1}&pageid={2}", siteRoot, module.ModuleId.ToInvariantString(), module.PageId.ToInvariantString()); lnkRejectContent.ImageUrl = Page.ResolveUrl(WebConfigSettings.RejectContentImage); lnkRejectContent.ToolTip = Resource.RejectContentToolTip; lnkRejectContent.Visible = true; } statusLink.HelpKey = "workflowstatus-awaitingapproval-help"; break; case ContentWorkflowStatus.ApprovalRejected: statusLink.HelpKey = "workflowstatus-rejected-help"; break; } if ( (workflowStatus != ContentWorkflowStatus.Cancelled) && (workflowStatus != ContentWorkflowStatus.Approved) && (workflowStatus != ContentWorkflowStatus.None) ) { //allow changes to be cancelled: ibCancelChanges.ImageUrl = Page.ResolveUrl(WebConfigSettings.CancelContentChangesImage); ibCancelChanges.ToolTip = Resource.CancelChangesToolTip; ibCancelChanges.Visible = true; } } }