private Approval CheckRequiresApproval(List <FolderData> folders)
    {
        if (folders.Any())
        {
            List <Approval> storedApprovals = new List <Approval>();

            // Couldn't find way to work around legacy APIs. If Approval calculation is desired, this must be run within the site.
            var       cwUtilities = new ContentWorkflowUtilities(CommonApi.Current.RequestInformationRef);
            EkContent _content    = new EkContent(CommonApi.Current.RequestInformationRef);

            int        chainSize = 0;
            long       wfid      = 0;
            Collection items     = null;

            foreach (FolderData f in folders)
            {
                chainSize = 0;
                wfid      = 0;

                items     = _content.GetApprovalInfov2_0(f.Id, "folder");
                chainSize = int.Parse(items[1].ToString());

                wfid = cwUtilities.GetInheritedWorkflowDefinitionId(0, f.Id, CommonApi.Current.RequestInformationRef.ContentLanguage);

                if (chainSize > 0 || wfid > 0)
                {
                    if (!storedApprovals.Contains(Approval.Yes))
                    {
                        storedApprovals.Add(Approval.Yes);
                    }
                }
                else
                {
                    if (!storedApprovals.Contains(Approval.No))
                    {
                        storedApprovals.Add(Approval.No);
                    }
                }

                if (storedApprovals.Contains(Approval.Yes) &&
                    storedApprovals.Contains(Approval.No))
                {
                    break;
                }
            }

            if (storedApprovals.Contains(Approval.Yes) &&
                storedApprovals.Contains(Approval.No))
            {
                return(Approval.Sometimes);
            }
            else if (storedApprovals.Contains(Approval.Yes))
            {
                return(Approval.Yes);
            }
            else
            {
                return(Approval.No);
            }
        }
        return(Approval.No);
    }
    private Approval CheckRequiresApproval(List<FolderData> folders)
    {
        if (folders.Any())
        {
            List<Approval> storedApprovals = new List<Approval>();

            // Couldn't find way to work around legacy APIs. If Approval calculation is desired, this must be run within the site.
            var cwUtilities = new ContentWorkflowUtilities(CommonApi.Current.RequestInformationRef);
            EkContent _content = new EkContent(CommonApi.Current.RequestInformationRef);

            int chainSize = 0;
            long wfid = 0;
            Collection items = null;

            foreach (FolderData f in folders)
            {
                chainSize = 0;
                wfid = 0;

                items = _content.GetApprovalInfov2_0(f.Id, "folder");
                chainSize = int.Parse(items[1].ToString());

                wfid = cwUtilities.GetInheritedWorkflowDefinitionId(0, f.Id, CommonApi.Current.RequestInformationRef.ContentLanguage);

                if (chainSize > 0 || wfid > 0)
                {
                    if (!storedApprovals.Contains(Approval.Yes))
                        storedApprovals.Add(Approval.Yes);
                }
                else
                {
                    if (!storedApprovals.Contains(Approval.No))
                        storedApprovals.Add(Approval.No);
                }

                if (storedApprovals.Contains(Approval.Yes) &&
                    storedApprovals.Contains(Approval.No))
                    break;
            }

            if (storedApprovals.Contains(Approval.Yes) &&
                storedApprovals.Contains(Approval.No))
                return Approval.Sometimes;
            else if (storedApprovals.Contains(Approval.Yes))
                return Approval.Yes;
            else
                return Approval.No;
        }
        return Approval.No;
    }