Esempio n. 1
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            try
            {
                var htmlContentItemID = -1;
                var htmlContent       = _htmlTextController.GetTopHtmlText(ModuleId, false, WorkflowID);

                if ((htmlContent != null))
                {
                    htmlContentItemID = htmlContent.ItemID;
                }

                if (!Page.IsPostBack)
                {
                    var workflowStates = _workflowStateController.GetWorkflowStates(WorkflowID);
                    var maxVersions    = _htmlTextController.GetMaximumVersionHistory(PortalId);
                    var userCanEdit    = UserInfo.IsSuperUser || PortalSecurity.IsInRole(PortalSettings.AdministratorRoleName);

                    lblMaxVersions.Text = maxVersions.ToString();
                    dgVersions.PageSize = Math.Min(Math.Max(maxVersions, 5), 10); //min 5, max 10

                    switch (workflowStates.Count)
                    {
                    case 1:
                        CurrentWorkflowType = WorkflowType.DirectPublish;
                        break;

                    case 2:
                        CurrentWorkflowType = WorkflowType.ContentStaging;
                        break;
                    }

                    if (htmlContentItemID != -1)
                    {
                        DisplayContent(htmlContent);
                        //DisplayPreview(htmlContent);
                        DisplayHistory(htmlContent);
                    }
                    else
                    {
                        DisplayInitialContent(workflowStates[0] as WorkflowStateInfo);
                    }

                    divPublish.Visible       = CurrentWorkflowType != WorkflowType.DirectPublish;
                    phCurrentVersion.Visible = CurrentWorkflowType != WorkflowType.DirectPublish;
                    phPreviewVersion.Visible = CurrentWorkflowType != WorkflowType.DirectPublish;
                    //DisplayVersions();

                    BindRenderItems();
                    ddlRender.SelectedValue = txtContent.Mode;
                }
            }
            catch (Exception exc)
            {
                Exceptions.ProcessModuleLoadException(this, exc);
            }
        }
 private void DisplayWorkflowDetails()
 {
     if ((cboWorkflow.SelectedValue != null))
     {
         var objWorkflow    = new WorkflowStateController();
         var strDescription = "";
         var arrStates      = objWorkflow.GetWorkflowStates(int.Parse(cboWorkflow.SelectedValue));
         if (arrStates.Count > 0)
         {
             foreach (WorkflowStateInfo objState in arrStates)
             {
                 strDescription = strDescription + " >> " + "<strong>" + objState.StateName + "</strong>";
             }
             strDescription = strDescription + "<br />" + ((WorkflowStateInfo)arrStates[0]).Description;
         }
         lblDescription.Text = strDescription;
     }
 }
Esempio n. 3
0
 private void DisplayWorkflowDetails()
 {
     if ((cboWorkflow.SelectedValue != null))
     {
         var objWorkflow = new WorkflowStateController();
         var strDescription = "";
         var arrStates = objWorkflow.GetWorkflowStates(int.Parse(cboWorkflow.SelectedValue));
         if (arrStates.Count > 0)
         {
             foreach (WorkflowStateInfo objState in arrStates)
             {
                 strDescription = strDescription + " >> " + "<strong>" + objState.StateName + "</strong>";
             }
             strDescription = strDescription + "<br />" + ((WorkflowStateInfo) arrStates[0]).Description;
         }
         lblDescription.Text = strDescription;
     }
 }