Esempio n. 1
0
 private void DrawContentAliasesTable()
 {
     bool _isManualAliasEnabled = true;
     if (Ektron.Cms.DataIO.LicenseManager.LicenseManager.IsFeatureEnable(_ContentApi.RequestInformationRef, Ektron.Cms.DataIO.LicenseManager.Feature.UrlAliasing, false))
     {
         Ektron.Cms.UrlAliasing.UrlAliasSettingsApi _aliasSettings = new Ektron.Cms.UrlAliasing.UrlAliasSettingsApi();
         if (_aliasSettings.IsManualAliasEnabled)
         {
             StringBuilder sb = new StringBuilder();
             if (_FolderData.AliasInherited)
             {
                 sb.Append("<input type=\"checkbox\" id=\"chkInheritAliases\" checked=\"checked\" disabled=\"disabled\" /> "+ _MessageHelper.GetMessage("lbl Inherit Parent Configuration"));
             }
             else
             {
                 sb.Append("<input type=\"checkbox\" id=\"chkInheritAliases\" disabled=\"disabled\" /> "+ _MessageHelper.GetMessage("lbl Inherit Parent Configuration"));
             }
             sb.Append("<div class=\"ektronTopSpace\"></div>");
             sb.Append("<table class=\"ektronForm\">");
             sb.Append(" <tr class=\"evenrow\"><td>");
             if (_FolderData.AliasRequired)
             {
                 sb.Append("     <input disabled=\"disabled\" checked=\"checked\" type=\"checkbox\" name=\"chkForceAliasing\" id=\"chkForceAliasing\" />");
             }
             else
             {
                 sb.Append("     <input disabled=\"disabled\" type=\"checkbox\" name=\"chkForceAliasing\" id=\"chkForceAliasing\" />");
             }
             sb.Append("    " + _MessageHelper.GetMessage("lbl manual alias required"));
             sb.Append(" </td></tr>");
             sb.Append("</table>");
             ltrFolderAliases2.Text = sb.ToString();
         }
         else
         {
             _isManualAliasEnabled = false;
         }
     }
     else
     {
         _isManualAliasEnabled = false;
     }
     phFolderAliases.Visible = phFolderAliases2.Visible = _isManualAliasEnabled;
 }
Esempio n. 2
0
    private void Display_ViewContent()
    {
        m_refMsg = m_refContentApi.EkMsgRef;
        bool bCanAlias = false;
        PermissionData security_task_data;
        StringBuilder sSummaryText;
        Ektron.Cms.UrlAliasing.UrlAliasManualApi m_aliasname = new Ektron.Cms.UrlAliasing.UrlAliasManualApi();
        Ektron.Cms.UrlAliasing.UrlAliasAutoApi m_autoaliasApi = new Ektron.Cms.UrlAliasing.UrlAliasAutoApi();
        Ektron.Cms.Common.UrlAliasManualData d_alias;
        System.Collections.Generic.List<Ektron.Cms.Common.UrlAliasAutoData> auto_aliaslist = new System.Collections.Generic.List<Ektron.Cms.Common.UrlAliasAutoData>();
        Ektron.Cms.UrlAliasing.UrlAliasSettingsApi m_urlAliasSettings = new Ektron.Cms.UrlAliasing.UrlAliasSettingsApi();
        int i;
        bool IsStagingServer;

        IsStagingServer = m_refContentApi.RequestInformationRef.IsStaging;

        security_task_data = m_refContentApi.LoadPermissions(m_intId, "tasks", ContentAPI.PermissionResultType.Task);
        security_data = m_refContentApi.LoadPermissions(m_intId, "content", ContentAPI.PermissionResultType.All);
        security_data.CanAddTask = security_task_data.CanAddTask;
        security_data.CanDestructTask = security_task_data.CanDestructTask;
        security_data.CanRedirectTask = security_task_data.CanRedirectTask;
        security_data.CanDeleteTask = security_task_data.CanDeleteTask;

        active_subscription_list = m_refContentApi.GetAllActiveSubscriptions();

        if ("viewstaged" == m_strPageAction)
        {
            ContentStateData objContentState;
            objContentState = m_refContentApi.GetContentState(m_intId);
            if ("A" == objContentState.Status)
            {
                // Can't view staged
                m_strPageAction = "view";
            }
        }
        try
        {
            if (m_strPageAction == "view")
            {
                content_data = m_refContentApi.GetContentById(m_intId, 0);
            }
            else if (m_strPageAction == "viewstaged")
            {
                content_data = m_refContentApi.GetContentById(m_intId, ContentAPI.ContentResultType.Staged);
            }
        }
        catch (Exception ex)
        {
            Response.Redirect("reterror.aspx?info=" + EkFunctions.UrlEncode(ex.Message), true);
            return;
        }

        if ((content_data != null) && (Ektron.Cms.Common.EkConstants.IsAssetContentType(Convert.ToInt64 (content_data.Type), Convert.ToBoolean (-1))))
        {
            ContentPaneHeight = "700px";
        }
        //ekrw = m_refContentApi.EkUrlRewriteRef()
        //ekrw.Load()
        if (((m_urlAliasSettings.IsManualAliasEnabled || m_urlAliasSettings.IsAutoAliasEnabled) && m_refContentApi.IsARoleMember(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.EditAlias)) && (content_data != null) && (content_data.AssetData != null) && !(Ektron.Cms.Common.EkFunctions.IsImage((string)("." + content_data.AssetData.FileExtension))))
        {
            bCanAlias = true;
        }

        blog_post_data = new BlogPostData();
        blog_post_data.Categories = (string[])Array.CreateInstance(typeof(string), 0);
        if (content_data.MetaData != null)
        {
            for (i = 0; i <= (content_data.MetaData.Length - 1); i++)
            {
                if ((string)(content_data.MetaData[i].TypeName.ToLower()) == "blog categories")
                {
                    content_data.MetaData[i].Text = content_data.MetaData[i].Text.Replace("&#39;", "\'");
                    content_data.MetaData[i].Text = content_data.MetaData[i].Text.Replace("&quot", "\"");
                    content_data.MetaData[i].Text = content_data.MetaData[i].Text.Replace("&gt;", ">");
                    content_data.MetaData[i].Text = content_data.MetaData[i].Text.Replace("&lt;", "<");
                    blog_post_data.Categories = Strings.Split((string)(content_data.MetaData[i].Text), ";", -1, 0);
                }
                else if ((string)(content_data.MetaData[i].TypeName.ToLower()) == "blog pingback")
                {
                    if (!(content_data.MetaData[i].Text.Trim().ToLower() == "no"))
                    {
                        m_bIsBlog = true;
                    }
                    blog_post_data.Pingback = Ektron.Cms.Common.EkFunctions.GetBoolFromYesNo((string)(content_data.MetaData[i].Text));
                }
                else if ((string)(content_data.MetaData[i].TypeName.ToLower()) == "blog tags")
                {
                    blog_post_data.Tags = (string)(content_data.MetaData[i].Text);
                }
                else if ((string)(content_data.MetaData[i].TypeName.ToLower()) == "blog trackback")
                {
                    blog_post_data.TrackBackURL = (string)(content_data.MetaData[i].Text);
                }
            }
        }

        //THE FOLLOWING LINES ADDED DUE TO TASK
        //:BEGIN / PROPOSED BY PAT
        //TODO: Need to recheck this part of the code e.r.
        if (content_data == null)
        {
            if (ContentLanguage != 0)
            {
                if (ContentLanguage.ToString() != (string)(Ektron.Cms.CommonApi.GetEcmCookie()["DefaultLanguage"]))
                {
                    Response.Redirect((string)(Request.ServerVariables["URL"] + "?" + Strings.Replace(Request.ServerVariables["Query_String"], (string)("LangType=" + ContentLanguage), (string)("LangType=" + m_refContentApi.DefaultContentLanguage), 1, -1, 0)), false);
                    return;
                }
            }
            else
            {
                if (ContentLanguage.ToString() != (string)(Ektron.Cms.CommonApi.GetEcmCookie()["DefaultLanguage"]))
                {
                    Response.Redirect((string)(Request.ServerVariables["URL"] + "?" + Request.ServerVariables["Query_String"] + "&LangType=" + m_refContentApi.DefaultContentLanguage), false);
                    return;
                }
            }
        }
        //:END
        if (m_intFolderId == -1)
        {
            m_intFolderId = content_data.FolderId;
        }
        HoldMomentMsg.Text = m_refMsg.GetMessage("one moment msg");

        if ((active_subscription_list == null) || (active_subscription_list.Length == 0))
        {
            phWebAlerts.Visible = false;
            phWebAlerts2.Visible = false;
        }
        content_state_data = m_refContentApi.GetContentState(m_intId);

        jsFolderId.Text = m_intFolderId.ToString ();
        jsIsForm.Text = content_data.Type.ToString ();
        jsBackStr.Text = "back_file=content.aspx";
        if (m_strPageAction.Length > 0)
        {
            jsBackStr.Text += "&back_action=" + m_strPageAction;
        }
        if (Convert.ToString(m_intFolderId).Length > 0)
        {
            jsBackStr.Text += "&back_folder_id=" + m_intFolderId;
        }
        if (Convert.ToString(m_intId).Length > 0)
        {
            jsBackStr.Text += "&back_id=" + m_intId;
        }
        if (Convert.ToString((short)ContentLanguage).Length > 0)
        {
            jsBackStr.Text += "&back_LangType=" + ContentLanguage;
        }
        jsToolId.Text = m_intId.ToString ();
        jsToolAction.Text = m_strPageAction;
        jsLangId.Text = m_refContentApi.ContentLanguage.ToString ();
        if (content_data.Type == 3333)
        {
            ViewCatalogToolBar();
        }
        else
        {
            ViewToolBar();
        }

        if (bCanAlias && content_data.SubType != Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.PageBuilderMasterData) //And folder_data.FolderType <> 1 Don't Show alias tab for Blogs.
        {
            string m_strAliasPageName = "";

            d_alias = m_aliasname.GetDefaultAlias(content_data.Id);
            if (d_alias.QueryString != "")
            {
                m_strAliasPageName = d_alias.AliasName + d_alias.FileExtension + d_alias.QueryString; //content_data.ManualAlias
            }
            else
            {
                m_strAliasPageName = d_alias.AliasName + d_alias.FileExtension; //content_data.ManualAlias
            }

            if (m_strAliasPageName != "")
            {

                if (IsStagingServer && folder_data.DomainStaging != string.Empty)
                {
                    m_strAliasPageName = (string)("http://" + folder_data.DomainStaging + "/" + m_strAliasPageName);
                }
                else if (folder_data.IsDomainFolder)
                {
                    m_strAliasPageName = (string)("http://" + folder_data.DomainProduction + "/" + m_strAliasPageName);
                }
                else
                {
                    m_strAliasPageName = SitePath + m_strAliasPageName;
                }
                m_strAliasPageName = "<a href=\"" + m_strAliasPageName + "\" target=\"_blank\" >" + m_strAliasPageName + "</a>";
            }
            else
            {
                m_strAliasPageName = " [Not Defined]";
            }
            tdAliasPageName.InnerHtml = m_strAliasPageName;
        }
        else
        {
            phAliases.Visible = false;
            phAliases2.Visible = false;
        }
        auto_aliaslist = m_autoaliasApi.GetListForContent(content_data.Id);
        autoAliasList.InnerHtml = "<div class=\"ektronHeader\">" + m_refMsg.GetMessage("lbl automatic") + "</div>";
        autoAliasList.InnerHtml += "<div class=\"ektronBorder\">";
        autoAliasList.InnerHtml += "<table width=\"100%\">";
        autoAliasList.InnerHtml += "<tr class=\"title-header\">";
        autoAliasList.InnerHtml += "<th>" + m_refMsg.GetMessage("generic type") + "</th>";
        autoAliasList.InnerHtml += "<th>" + m_refMsg.GetMessage("lbl alias name") + "</th>";
        autoAliasList.InnerHtml += "</tr>";
        for (i = 0; i <= auto_aliaslist.Count() - 1; i++)
        {
            autoAliasList.InnerHtml += "<tr class=\"row\">";
            if (auto_aliaslist[i].AutoAliasType == Ektron.Cms.Common.EkEnumeration.AutoAliasType.Folder)
            {
                autoAliasList.InnerHtml += "<td><img src =\"" + m_refContentApi.AppPath + "images/UI/Icons/folder.png\"  alt=\"" + m_refContentApi.EkMsgRef.GetMessage("lbl folder") + "\" title=\"" + m_refContentApi.EkMsgRef.GetMessage("lbl folder") + "\"/ ></td>";
            }
            else
            {
                autoAliasList.InnerHtml += "<td><img src =\"" + m_refContentApi.AppPath + "images/UI/Icons/taxonomy.png\"  alt=\"" + m_refContentApi.EkMsgRef.GetMessage("generic taxonomy lbl") + "\" title=\"" + m_refContentApi.EkMsgRef.GetMessage("generic taxonomy lbl") + "\"/ ></td>";
            }

            if (IsStagingServer && folder_data.DomainStaging != string.Empty)
            {
                autoAliasList.InnerHtml = autoAliasList.InnerHtml + "<td> <a href = \"http://" + folder_data.DomainStaging + "/" + auto_aliaslist[i].AliasName + "\" target=\"_blank\" >" + auto_aliaslist[i].AliasName + " </a></td></tr>";
            }
            else if (folder_data.IsDomainFolder)
            {
                autoAliasList.InnerHtml += "<td> <a href = \"http://" + folder_data.DomainProduction + "/" + auto_aliaslist[i].AliasName + "\" target=\"_blank\" >" + auto_aliaslist[i].AliasName + " </a></td>";
            }
            else
            {
                autoAliasList.InnerHtml += "<td> <a href = \"" + SitePath + auto_aliaslist[i].AliasName + "\" target=\"_blank\" >" + auto_aliaslist[i].AliasName + " </a></td>";
            }
            autoAliasList.InnerHtml += "</tr>";
        }
        autoAliasList.InnerHtml += "</table>";
        autoAliasList.InnerHtml += "</div>";
        if (content_data == null)
        {
            content_data = m_refContentApi.GetContentById(m_intId, 0);
        }
        if (content_data.Type == 3333)
        {
            m_refCatalog = new CatalogEntry(m_refContentApi.RequestInformationRef);
            m_refCurrency = new Currency(m_refContentApi.RequestInformationRef);
            //m_refMedia = MediaData()
            entry_edit_data = m_refCatalog.GetItemEdit(m_intId, ContentLanguage, false);

            Ektron.Cms.Commerce.ProductType m_refProductType = new Ektron.Cms.Commerce.ProductType(m_refContentApi.RequestInformationRef);
            prod_type_data = m_refProductType.GetItem(entry_edit_data.ProductType.Id, true);

            if (prod_type_data.Attributes.Count == 0)
            {
                phAttributes.Visible = false;
                phAttributes2.Visible = false;
            }

            Display_PropertiesTab(content_data);
            Display_PricingTab();
            Display_ItemTab();
            Display_MetadataTab();
            Display_MediaTab();
        }
        else
        {
            ViewContentProperties(content_data);
            phCommerce.Visible = false;
            phCommerce2.Visible = false;
            phItems.Visible = false;
        }

        bool bPackageDisplayXSLT = false;
        string CurrentXslt = "";
        int XsltPntr;

        if ((!(content_data.XmlConfiguration == null)) && (content_data.Type == Ektron.Cms.Common.EkConstants.CMSContentType_CatalogEntry || content_data.Type == Ektron.Cms.Common.EkConstants.CMSContentType_Content || content_data.Type == Ektron.Cms.Common.EkConstants.CMSContentType_Forms))
        {
            if (!(content_data.XmlConfiguration == null))
            {
                if (content_data.XmlConfiguration.DefaultXslt.Length > 0)
                {
                    if (content_data.XmlConfiguration.DefaultXslt == "0")
                    {
                        bPackageDisplayXSLT = true;
                    }
                    else
                    {
                        bPackageDisplayXSLT = false;
                    }
                    if (!bPackageDisplayXSLT)
                    {
                        XsltPntr = int.Parse(content_data.XmlConfiguration.DefaultXslt);
                        if (XsltPntr > 0)
                        {
                            Collection tmpXsltColl = (Collection)content_data.XmlConfiguration.PhysPathComplete;
                            if (tmpXsltColl["Xslt" + XsltPntr] != null)
                            {
                                CurrentXslt = (string)(tmpXsltColl["Xslt" + XsltPntr]);
                            }
                            else
                            {
                                tmpXsltColl = (Collection)content_data.XmlConfiguration.LogicalPathComplete;
                                CurrentXslt = (string)(tmpXsltColl["Xslt" + XsltPntr]);
                            }
                        }
                    }
                }
                else
                {
                    bPackageDisplayXSLT = true;
                }
                //End If

                Ektron.Cms.Xslt.ArgumentList objXsltArgs = new Ektron.Cms.Xslt.ArgumentList();
                objXsltArgs.AddParam("mode", string.Empty, "preview");
                if (bPackageDisplayXSLT)
                {
                    divContentHtml.InnerHtml = m_refContentApi.XSLTransform(content_data.Html, content_data.XmlConfiguration.PackageDisplayXslt, false, false, objXsltArgs, true, true);
                }
                else
                {
                    // CurrentXslt is always obtained from the object in the database.
                    divContentHtml.InnerHtml = m_refContentApi.XSLTransform(content_data.Html, CurrentXslt, true, false, objXsltArgs, true, true);
                }
            }
            else
            {
                divContentHtml.InnerHtml = content_data.Html;
            }
        }
        else
        {
            if (content_data.Type == 104)
            {
                media_html.Value = content_data.MediaText;
                //Get Url from content
                string tPath = m_refContentApi.RequestInformationRef.AssetPath + m_refContentApi.EkContentRef.GetFolderParentFolderIdRecursive(content_data.FolderId).Replace(",", "/") + "/" + content_data.AssetData.Id + "." + content_data.AssetData.FileExtension;
                string mediaHTML = FixPath(content_data.Html, tPath);
                int scriptStartPtr = 0;
                int scriptEndPtr = 0;
                int len = 0;
                //Registering the javascript & CSS
                this.Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "linkReg", "<link href=\"" + m_refContentApi.ApplicationPath + "csslib/EktTabs.css\" rel=\"stylesheet\" type=\"text/css\" />", false);
                mediaHTML = mediaHTML.Replace("<link href=\"" + m_refContentApi.ApplicationPath + "csslib/EktTabs.css\" rel=\"stylesheet\" type=\"text/css\" />", "");
                while (1 == 1)
                {
                    scriptStartPtr = mediaHTML.IndexOf("<script", scriptStartPtr);
                    scriptEndPtr = mediaHTML.IndexOf("</script>", scriptEndPtr);
                    if (scriptStartPtr == -1 || scriptEndPtr == -1)
                    {
                        break;
                    }
                    len = scriptEndPtr - scriptStartPtr + 9;
                    this.Page.ClientScript.RegisterClientScriptBlock(this.GetType(), (string)("scriptreg" + scriptEndPtr), mediaHTML.Substring(scriptStartPtr, len), false);
                    mediaHTML = mediaHTML.Replace(mediaHTML.Substring(scriptStartPtr, len), "");
                    scriptStartPtr = 0;
                    scriptEndPtr = 0;
                }
                media_display_html.Value = mediaHTML;
                divContentHtml.InnerHtml = "<a href=\"#\" onclick=\"document.getElementById(\'" + divContentHtml.ClientID + "\').innerHTML = document.getElementById(\'" + media_display_html.ClientID + "\').value;return false;\" alt=\"" + m_refMsg.GetMessage("alt show media content") + "\" title=\"" + m_refMsg.GetMessage("alt show media content") + "\">" + m_refMsg.GetMessage("lbl show media content") + "<br/><img align=\"middle\" src=\"" + m_refContentApi.AppPath + "images/filmstrip_ph.jpg\" /></a>";
            }
            else
            {
                if (Ektron.Cms.Common.EkConstants.IsAssetContentType(content_data.Type, Convert .ToBoolean (-1)))
                {
                    string ver = "";
                    ver = (string)("&version=" + content_data.AssetData.Version);
                    if (IsImage(content_data.AssetData.Version))
                    {
                        divContentHtml.InnerHtml = "<img src=\"" + m_refContentApi.SitePath + "assetmanagement/DownloadAsset.aspx?ID=" + content_data.AssetData.Id + ver + "\" />";
                    }
                    else
                    {
                        divContentHtml.InnerHtml = "<div align=\"center\" style=\"padding:15px;\"><a style=\"text-decoration:none;\" href=\"#\" onclick=\"javascript:window.open(\'" + m_refContentApi.SitePath + "assetmanagement/DownloadAsset.aspx?ID=" + content_data.AssetData.Id + ver + "\',\'DownloadAsset\',\'toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=1,width=1000,height=800\');return false;\"><img align=\"middle\" src=\"" + m_refContentApi.AppPath + "images/application/download.gif\" />" + m_refMsg.GetMessage("btn download") + " &quot;" + content_data.Title + "&quot;</a></div>";
                    }

                }
                else if (content_data.SubType == Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.PageBuilderData || content_data.SubType == Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.PageBuilderMasterData)
                {
                    Ektron.Cms.API.UrlAliasing.UrlAliasCommon u = new Ektron.Cms.API.UrlAliasing.UrlAliasCommon();
                    FolderData fd = this.m_refContentApi.GetFolderById(content_data.FolderId);
                    string stralias = u.GetAliasForContent(content_data.Id);
                    if (stralias == string.Empty || fd.IsDomainFolder)
                    {
                        stralias = content_data.Quicklink;
                    }

                    string link = "";
                    if (content_data.ContType == (int)EkEnumeration.CMSContentType.Content || (content_data.ContType == (int)EkEnumeration.CMSContentType.Archive_Content && content_data.EndDateAction != 1))
                    {
                        string url = this.m_refContent.RequestInformation.SitePath + stralias;
                        if (url.Contains("?"))
                        {
                            url += "&";
                        }
                        else
                        {
                            url += "?";
                        }
                        if ("viewstaged" == m_strPageAction)
                        {
                            url += "view=staged";
                        }
                        else
                        {
                            url += "view=published";
                        }
                        url += (string)("&LangType=" + content_data.LanguageId.ToString());
                        link = "<a href=\"" + url + "\" onclick=\"window.open(this.href);return false;\">Click here to view the page</a><br/><br/>";
                    }
                    divContentHtml.InnerHtml = link + Ektron.Cms.PageBuilder.PageData.RendertoString(content_data.Html);
                }
                else
                {
                    if ((int)Ektron.Cms.Common.EkEnumeration.CMSContentType.Forms == content_data.Type || (int)Ektron.Cms.Common.EkEnumeration.CMSContentType.Archive_Forms == content_data.Type)
                    {
                        divContentHtml.InnerHtml = content_data.Html.Replace("[srcpath]", m_refContentApi.ApplicationPath + m_refContentApi.AppeWebPath);
                        divContentHtml.InnerHtml = divContentHtml.InnerHtml.Replace("[skinpath]", m_refContentApi.ApplicationPath + "csslib/ContentDesigner/");
                    }
                    else
                    {
                        divContentHtml.InnerHtml = content_data.Html;
                    }
                    if (m_bIsBlog)
                    {
                        Collection blogData = m_refContentApi.EkContentRef.GetBlogData(content_data.FolderId);
                        if (blogData != null)
                        {
                            if (blogData["enablecomments"].ToString() != string.Empty)
                            {
                                litBlogComment.Text = "<div class=\"ektronTopSpace\"></div><a class=\"button buttonInline greenHover buttonNoIcon\" href=\"" + m_refContentApi.AppPath + "content.aspx?id=" + content_data.FolderId + "&action=ViewContentByCategory&LangType=" + content_data.LanguageId + "&ContType=" + Ektron.Cms.Common.EkConstants.CMSContentType_BlogComments + "&contentid=" + content_data.Id + "&viewin=" + content_data.LanguageId + "\" title=\"" + m_refMsg.GetMessage("alt view comments label") + "\">" + m_refMsg.GetMessage("view comments") + "</a>";
                                litBlogComment.Visible = true;
                            }
                        }
                    }
                }
            }
        }

        sSummaryText = new StringBuilder();
        if ((int)Ektron.Cms.Common.EkEnumeration.CMSContentType.Forms == content_data.Type || (int)Ektron.Cms.Common.EkEnumeration.CMSContentType.Archive_Forms == content_data.Type)
        {
            if (content_data.Teaser != null)
            {
                if (content_data.Teaser.IndexOf("<ektdesignpackage_design") > -1)
                {
                    string strDesign;
                    strDesign = m_refContentApi.XSLTransform(null, null, true, false, null, true);
                    tdsummarytext.InnerHtml = strDesign;
                }
                else
                {
                    tdsummarytext.InnerHtml = content_data.Teaser;
                }
            }
            else
            {
                tdsummarytext.InnerHtml = "";
            }
        }
        else
        {
            if (m_bIsBlog)
            {
                sSummaryText.AppendLine("<table class=\"ektronGrid\">");
                sSummaryText.AppendLine("	<tr>");
                sSummaryText.AppendLine("		<td valign=\"top\" class=\"label\">");
                sSummaryText.AppendLine("			" + m_refMsg.GetMessage("generic description") + "");
                sSummaryText.AppendLine("		</td>");
                sSummaryText.AppendLine("		<td valign=\"top\">");
            }
            sSummaryText.AppendLine(content_data.Teaser);
            if (m_bIsBlog)
            {
                sSummaryText.AppendLine("		</td>");
                sSummaryText.AppendLine("	</tr>");
                sSummaryText.AppendLine("	<tr>");
                sSummaryText.AppendLine("		<td valign=\"top\" class=\"label\">");
                sSummaryText.AppendLine("			" + m_refMsg.GetMessage("lbl blog cat") + "");
                sSummaryText.AppendLine("		</td>");
                sSummaryText.AppendLine("		<td>");
                if (!(blog_post_data.Categories == null))
                {
                    arrBlogPostCategories = blog_post_data.Categories;
                    if (arrBlogPostCategories.Length > 0)
                    {
                        Array.Sort(arrBlogPostCategories);
                    }
                }
                else
                {
                    arrBlogPostCategories = null;
                }
                if (blog_post_data.Categories.Length > 0)
                {
                    for (i = 0; i <= (blog_post_data.Categories.Length - 1); i++)
                    {
                        if (blog_post_data.Categories[i].ToString() != "")
                        {
                            sSummaryText.AppendLine("				<input type=\"checkbox\" name=\"blogcategories" + i.ToString() + "\" value=\"" + blog_post_data.Categories[i].ToString() + "\" checked=\"true\" disabled>&nbsp;" + Strings.Replace((string)(blog_post_data.Categories[i].ToString()), "~@~@~", ";", 1, -1, 0) + "<br />");
                        }
                    }
                }
                else
                {
                    sSummaryText.AppendLine("No categories defined.");
                }
                sSummaryText.AppendLine("		</td>");
                sSummaryText.AppendLine("	</tr>");
                sSummaryText.AppendLine("	<tr>");
                sSummaryText.AppendLine("		<td class=\"label\" valign=\"top\">");
                sSummaryText.AppendLine("			" + m_refMsg.GetMessage("lbl personal tags") + "");
                sSummaryText.AppendLine("		</td>");
                sSummaryText.AppendLine("		<td>");
                if (!(blog_post_data == null))
                {
                    sSummaryText.AppendLine(blog_post_data.Tags);
                }
                sSummaryText.AppendLine("		</td>");
                sSummaryText.AppendLine("	</tr>");
                sSummaryText.AppendLine("	<tr>");
                sSummaryText.AppendLine("	    <td class=\"label\">");
                if (!(blog_post_data == null))
                {
                    sSummaryText.AppendLine("   <input type=\"hidden\" name=\"blogposttrackbackid\" id=\"blogposttrackbackid\" value=\"" + blog_post_data.TrackBackURLID.ToString() + "\" />");
                    sSummaryText.AppendLine("   <input type=\"hidden\" id=\"isblogpost\" name=\"isblogpost\" value=\"true\"/>" + m_refMsg.GetMessage("lbl trackback url") + "");
                    sSummaryText.AppendLine("		</td>");
                    sSummaryText.AppendLine("		<td>");
                    sSummaryText.AppendLine("<input type=\"text\" size=\"75\" id=\"trackback\" name=\"trackback\" value=\"" + EkFunctions.HtmlEncode(blog_post_data.TrackBackURL) + "\" disabled/>");
                    sSummaryText.AppendLine("		</td>");
                    sSummaryText.AppendLine("	</tr>");
                    sSummaryText.AppendLine("	<tr>");
                    sSummaryText.AppendLine("		<td class=\"label\">");
                    if (blog_post_data.Pingback == true)
                    {
                        sSummaryText.AppendLine("" + m_refMsg.GetMessage("lbl blog ae ping") + "");
                        sSummaryText.AppendLine("		</td>");
                        sSummaryText.AppendLine("		<td>");
                        sSummaryText.AppendLine("           <input type=\"checkbox\" name=\"pingback\" id=\"pingback\" checked disabled/>");

                    }
                    else
                    {
                        sSummaryText.AppendLine("" + m_refMsg.GetMessage("lbl blog ae ping") + "");
                        sSummaryText.AppendLine("		</td>");
                        sSummaryText.AppendLine("		<td>");
                        sSummaryText.AppendLine("           <input type=\"checkbox\" name=\"pingback\" id=\"pingback\" disabled/>");
                    }
                }
                else
                {
                    sSummaryText.AppendLine("           <input type=\"hidden\" name=\"blogposttrackbackid\" id=\"blogposttrackbackid\" value=\"\" />");
                    sSummaryText.AppendLine("           <input type=\"hidden\" id=\"isblogpost\" name=\"isblogpost\" value=\"true\"/>" + m_refMsg.GetMessage("lbl trackback url") + "");
                    sSummaryText.AppendLine("<input type=\"text\" size=\"75\" id=\"trackback\" name=\"trackback\" value=\"\" disabled/>");
                    sSummaryText.AppendLine("		</td>");
                    sSummaryText.AppendLine("	</tr>");
                    sSummaryText.AppendLine("	<tr>");
                    sSummaryText.AppendLine("		<td class=\"label\">" + m_refMsg.GetMessage("lbl blog ae ping") + "");
                    sSummaryText.AppendLine("		</td>");
                    sSummaryText.AppendLine("		<td>");
                    sSummaryText.AppendLine("           <input type=\"checkbox\" name=\"pingback\" id=\"pingback\" disabled/>");
                }
                sSummaryText.AppendLine("		</td>");
                sSummaryText.AppendLine("	</tr>");
                sSummaryText.AppendLine("</table>");
            }
            tdsummarytext.InnerHtml = sSummaryText.ToString();
        }

        ViewMetaData(content_data);

        tdcommenttext.InnerHtml = content_data.Comment;
        AddTaskTypeDropDown();
        ViewTasks();
        ViewSubscriptions();
        Ektron.Cms.Content.EkContent cref;
        cref = m_refContentApi.EkContentRef;
        TaxonomyBaseData[] dat;
        dat = cref.GetAllFolderTaxonomy(folder_data.Id);
        if (dat == null || dat.Length == 0)
        {
            phCategories.Visible = false;
            phCategories2.Visible = false;
        }
        ViewAssignedTaxonomy();
        if ((content_data != null) && ((content_data.Type >= EkConstants.ManagedAsset_Min && content_data.Type <= EkConstants.ManagedAsset_Max && content_data.Type != 104) || (content_data.Type >= EkConstants.Archive_ManagedAsset_Min && content_data.Type <= EkConstants.Archive_ManagedAsset_Max && content_data.Type != 1104) || content_data.SubType == Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.PageBuilderData || content_data.SubType == Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.PageBuilderMasterData))
        {
            showAlert = false;
        }
        if (
            (Request.QueryString["menuItemType"] != null && Request.QueryString["menuItemType"].ToLower() == "viewproperties")
            ||
            (Request.QueryString["tab"] != null && Request.QueryString["tab"].ToLower() == "properties")
            )
        {
            DefaultTab.Value = "dvProperties";
            Util_ReloadTree(content_data.Path, content_data.FolderId);
        }
    }
Esempio n. 3
0
    private void DrawContentAliasesTable()
    {
        bool _isManualAliasEnabled = true;
        if (Ektron.Cms.DataIO.LicenseManager.LicenseManager.IsFeatureEnable(_ContentApi.RequestInformationRef, Ektron.Cms.DataIO.LicenseManager.Feature.UrlAliasing, false))
        {
            Ektron.Cms.UrlAliasing.UrlAliasSettingsApi _aliasSettings = new Ektron.Cms.UrlAliasing.UrlAliasSettingsApi();
            if (_aliasSettings.IsManualAliasEnabled)
            {
                if (parentfolderdata == null)
                {
                    parentfolderdata = _ContentApi.GetFolderById(_FolderData.ParentId, false);
                }
                inherit_alias_from.Value = Convert.ToString(parentfolderdata.AliasInheritedFrom);
                current_alias_required.Value = Convert.ToString(Convert.ToInt32(parentfolderdata.AliasRequired));
                StringBuilder sb = new StringBuilder();
                StringBuilder sb2 = new StringBuilder();
                sb2.Append("<div class=\"ektronTopSpace\"></div>");
                sb2.Append("<table class=\"ektronForm\">");
                sb2.Append(" <tr class=\"evenrow\"><td>");
                if (_FolderData.IsAliasInherited)
                {
                    sb.Append("<input type=\"checkbox\" name=\"chkInheritAliases\" id=\"chkInheritAliases\" checked=\"checked\"");
                    if (_FolderData.Id == 0)
                    {
                        sb.Append(" disabled=\"disabled\"");
                    }
                    sb.Append("onclick=\"InheritAliasedChanged('chkForceAliasing')\" /> " + _MessageHelper.GetMessage("lbl inherit parent configuration"));
                    if (_FolderData.AliasRequired)
                    {
                        sb2.Append("     <input checked=\"checked\" disabled=\"disabled\" type=\"checkbox\" name=\"chkForceAliasing\" id=\"chkForceAliasing\" />");
                    }
                    else
                    {
                        sb2.Append("     <input type=\"checkbox\" disabled=\"disabled\" name=\"chkForceAliasing\" id=\"chkForceAliasing\" />");
                    }
                }
                else
                {
                    sb.Append("<input type=\"checkbox\" name=\"chkInheritAliases\" id=\"chkInheritAliases\"");
                    if (_FolderData.Id == 0)
                    {
                        sb.Append(" disabled=\"disabled\"");
                    }
                    sb.Append("onclick=\"InheritAliasedChanged('chkForceAliasing')\" /> " + _MessageHelper.GetMessage("lbl inherit parent configuration"));
                    if (_FolderData.AliasRequired)
                    {
                        sb2.Append("     <input checked=\"checked\" type=\"checkbox\" name=\"chkForceAliasing\" id=\"chkForceAliasing\" />");
                    }
                    else
                    {
                        sb2.Append("     <input type=\"checkbox\" name=\"chkForceAliasing\" id=\"chkForceAliasing\" />");
                    }
                }
                sb2.Append(_MessageHelper.GetMessage("lbl manual alias required"));
                sb2.Append(" </td></tr>");
                sb2.Append("</table>");

                ltrFolderAliases2.Text = sb.ToString() + sb2.ToString();
            }
            else
            {
                _isManualAliasEnabled = false;
            }
        }
        else
        {
            _isManualAliasEnabled = false;
        }
        phFolderAliases.Visible = phFolderAliases2.Visible = _isManualAliasEnabled;
    }
    private string GetClientScript()
    {
        System.Text.StringBuilder result;
        string TreeRequested = "content";
        PermissionData security_data;
        Ektron.Cms.Common.EkMessageHelper objMessage;
        Ektron.Cms.Content.EkContent objContentRef;
        Ektron.Cms.UrlAliasing.UrlAliasSettingsApi m_urlAliasSettings = new Ektron.Cms.UrlAliasing.UrlAliasSettingsApi();
        result = new System.Text.StringBuilder();

        try
        {
            objMessage = m_refAPI.EkMsgRef;
            security_data = m_refAPI.LoadPermissions(0, "folder", 0);
            if (!(security_data.IsLoggedIn))
            {
                ShowLoginError();
                //break;
                return string.Empty;
            }
            if (!(security_data == null))
            {
                IsAdmin = security_data.IsAdmin;
                PerReadOnly = security_data.IsReadOnly;
                PerReadOnlyLib = security_data.IsReadOnlyLib;
            }
            IsSystemAccount = System.Convert.ToBoolean(m_refAPI.UserId == Ektron.Cms.Common.EkConstants.BuiltIn);
            if (!(Request.QueryString["tree"] == null))
            {
                TreeRequested = Request.QueryString["tree"].ToLower().Trim();
            }
            TreeRequested = Strings.LCase(Request.QueryString["tree"]);
            objContentRef = m_refAPI.EkContentRef;
            result.AppendLine("<script type=\"text/javascript\">");
            result.AppendLine("<!--");

            if ((TreeRequested) == ("content"))
            {
                if (PerReadOnly)
                {
                    result.Append("var urlInfoArray = new Array(\"frame\", \"content.aspx?action=ViewContentByCategory&id=0\", \"ek_main\");" + "\r\n");
                    result.Append("TopTreeLevel = CreateFolderInstance(\"" + objMessage.GetMessage("generic content title") + "\", urlInfoArray);" + "\r\n");
                }
                else
                {
                    result.Append("TopTreeLevel = CreateFolderInstance(\"" + objMessage.GetMessage("generic content title") + "\", \"\");" + "\r\n");
                }
                m_hashAllFolders = objContentRef.GetFolderTreeForUserID(0);
                result.Append(OutputFolders(0, 0, Ektron.Cms.Common.EkEnumeration.FolderTreeType.Content) + "\r\n");
            }
            else if ((TreeRequested) == ("library"))
            {
                if (PerReadOnlyLib)
                {
                    result.Append("var urlInfoArray = new Array(\"frame\", \"library.aspx?action=ViewLibraryByCategory&id=0\", \"ek_main\");");
                    result.Append("TopTreeLevel = CreateFolderInstance(\"" + objMessage.GetMessage("generic Library title") + "\", urlInfoArray);");
                }
                else
                {
                    result.Append("TopTreeLevel = CreateFolderInstance(\"" + objMessage.GetMessage("generic Library title") + "\", \"\");");
                }

                m_hashAllFolders = objContentRef.GetFolderTreeForUserID(0);
                result.Append(OutputFolders(0, 0, Ektron.Cms.Common.EkEnumeration.FolderTreeType.Library) + "\r\n");

                // commerce
            }
            else if ((TreeRequested) == ("admin"))
            {
                //Merging Module and Settings under Settings tab for Version 8.0.
                result.Append("TopTreeLevel = CreateFolderInstance(\"" + objMessage.GetMessage("administrate button text") + "\", \"\");");
                if (!IsSystemAccount)
                {

                    //Commerce
                    if (Ektron.Cms.DataIO.LicenseManager.LicenseManager.IsFeatureEnable(m_refAPI.RequestInformationRef, Feature.eCommerce) && (IsAdmin || m_refAPI.IsARoleMember(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.CommerceAdmin)))
                    {

                        result.Append("level1 = InsertFolder(TopTreeLevel, CreateFolderInstance(\"" + objMessage.GetMessage("lbl commerce") + "\", \"\"));");

                        result.Append("var urlInfoArray = new Array(\"frame\", \"\", \"ek_main\");");
                        result.Append("level2 = InsertFolder(level1, CreateFolderInstance(\"" + objMessage.GetMessage("lbl commerce catalog") + "\", urlInfoArray));");
                        result.Append("var urlInfoArray = new Array(\"frame\", \"Commerce/producttypes.aspx\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl product types") + "\", urlInfoArray));");
                        result.Append("var urlInfoArray = new Array(\"frame\", \"Commerce/Coupons/List/List.aspx\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl coupons") + "\", urlInfoArray));");

                        result.Append("var urlInfoArray = new Array(\"frame\", \"\", \"ek_main\");");
                        result.Append("level2 = InsertFolder(level1, CreateFolderInstance(\"" + objMessage.GetMessage("lbl commerce config") + "\", urlInfoArray));");
                        result.Append("var urlInfoArray = new Array(\"frame\", \"Commerce/locale/country.aspx\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl wa countries") + "\", urlInfoArray));");
                        result.Append("var urlInfoArray = new Array(\"frame\", \"Commerce/currency.aspx\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl wa currency") + "\", urlInfoArray));");
                        result.Append("var urlInfoArray = new Array(\"frame\", \"Commerce/creditcardtypes.aspx\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl cc wa") + "\", urlInfoArray));");
                        result.Append("var urlInfoArray = new Array(\"frame\", \"subscriptionmessages.aspx?mode=commerce\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl messages") + "\", urlInfoArray));");
                        result.Append("var urlInfoArray = new Array(\"frame\", \"Commerce/paymentgateway.aspx\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl payment options") + "\", urlInfoArray));");
                        result.Append("var urlInfoArray = new Array(\"frame\", \"Commerce/locale/region.aspx\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl wa regions") + "\", urlInfoArray));");
                        //result.Append("var urlInfoArray = new Array(\"frame\", \"Commerce/pricebook.aspx\", \"ek_main\");");
                        //result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl wa pricebooks") + "\", urlInfoArray));");

                        result.Append("var urlInfoArray = new Array(\"frame\", \"\", \"ek_main\");");
                        result.Append("level2 = InsertFolder(level1, CreateFolderInstance(\"" + objMessage.GetMessage("lbl fulfillment") + "\", urlInfoArray));");
                        result.Append("var urlInfoArray = new Array(\"frame\", \"Commerce/fulfillment.aspx\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl orders") + "\", urlInfoArray));");
                        result.Append("var urlInfoArray = new Array(\"frame\", \"Commerce/fulfillment/workflow.aspx\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl order workflow") + "\", urlInfoArray));");

                        result.Append("var urlInfoArray = new Array(\"frame\", \"\", \"ek_main\");");
                        result.Append("level2 = InsertFolder(level1, CreateFolderInstance(\"" + objMessage.GetMessage("generic reports title") + "\", urlInfoArray));");
                        result.Append("var urlInfoArray = new Array(\"frame\", \"Commerce/reporting/CustomerReports.aspx?page=normal\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl customer reports") + "\", urlInfoArray));");
                        result.Append("var urlInfoArray = new Array(\"frame\", \"Commerce/inventory.aspx\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl inventory reports") + "\", urlInfoArray));");
                        result.Append("var urlInfoArray = new Array(\"frame\", \"Commerce/reporting/KeyPerformanceIndicators.aspx\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl key performance indicators") + "\", urlInfoArray));");
                        result.Append("var urlInfoArray = new Array(\"frame\", \"Commerce/reporting/PaymentReports.aspx\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl payment reports") + "\", urlInfoArray));");
                        result.Append("var urlInfoArray = new Array(\"frame\", \"Commerce/reporting/SalesTrend.aspx\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl sales trend") + "\", urlInfoArray));");
                        result.Append("var urlInfoArray = new Array(\"frame\", \"Commerce/reporting/TopProducts.aspx\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl top products") + "\", urlInfoArray));");

                        result.Append("var urlInfoArray = new Array(\"frame\", \"\", \"ek_main\");");
                        result.Append("level2 = InsertFolder(level1, CreateFolderInstance(\"" + objMessage.GetMessage("lbl wa shipping") + "\", urlInfoArray));");
                        result.Append("var urlInfoArray = new Array(\"frame\", \"Commerce/shipping/shippingmethods.aspx\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl wa shipping methods") + "\", urlInfoArray));");
                        result.Append("var urlInfoArray = new Array(\"frame\", \"Commerce/shipping/shippingsource.aspx\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl wa warehouses") + "\", urlInfoArray));");
                        result.Append("var urlInfoArray = new Array(\"frame\", \"Commerce/shipping/packagesize.aspx\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl wa packagesize") + "\", urlInfoArray));");

                        result.Append("var urlInfoArray = new Array(\"frame\", \"\", \"ek_main\");");
                        result.Append("level2 = InsertFolder(level1, CreateFolderInstance(\"" + objMessage.GetMessage("lbl wa tax") + "\", urlInfoArray));");
                        result.Append("var urlInfoArray = new Array(\"frame\", \"Commerce/tax/taxclass.aspx\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl wa tax classes") + "\", urlInfoArray));");
                        result.Append("var urlInfoArray = new Array(\"frame\", \"Commerce/tax/postaltaxtables.aspx\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl wa postal tax tables") + "\", urlInfoArray));");
                        result.Append("var urlInfoArray = new Array(\"frame\", \"Commerce/tax/taxtables.aspx\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl wa tax tables") + "\", urlInfoArray));");
                        result.Append("var urlInfoArray = new Array(\"frame\", \"Commerce/tax/countrytaxtables.aspx\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl wa country tax tables") + "\", urlInfoArray));");

                        // commerce folder links
                        result.Append("var urlInfoArray = new Array(\"frame\", \"Commerce/audit/audit.aspx\", \"ek_main\");");
                        result.Append("InsertFile(level1, CreateLink(\"" + objMessage.GetMessage("lbl audit") + "\", urlInfoArray));");
                        result.Append("var urlInfoArray = new Array(\"frame\", \"Commerce/customers.aspx\", \"ek_main\");");
                        result.Append("InsertFile(level1, CreateLink(\"" + objMessage.GetMessage("lbl customers") + "\", urlInfoArray));");
                    }
                    //Commerce Ends

                    //Community Management
                    result.Append("level1 = InsertFolder(TopTreeLevel, CreateFolderInstance(\"" + objMessage.GetMessage("lbl community management") + "\", \"\"));");

                    // flagging
                    result.Append("level2 = InsertFolder(level1, CreateFolderInstance(\"" + objMessage.GetMessage("lbl flagging") + "\", \"\"));");
                    if (IsAdmin)
                    {
                        result.Append("var urlInfoArray = new Array(\"frame\", \"contentflagging/flagsets.aspx?communityonly=true\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("wa tree community flag def") + "\", urlInfoArray));");
                    }
                    result.Append("var urlInfoArray = new Array(\"frame\", \"reports.aspx?action=ContentFlags\", \"ek_main\");");
                    result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl flagged content") + "\", urlInfoArray));");
                    if (IsAdmin)
                    {
                        result.Append("var urlInfoArray = new Array(\"frame\", \"contentflagging/flagsets.aspx\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("wa tree flag def") + "\", urlInfoArray));");
                    }

                    // memberships
                    if (Ektron.Cms.DataIO.LicenseManager.LicenseManager.IsFeatureEnable(m_refAPI.RequestInformationRef, Feature.MembershipUsers))
                    {
                        if (IsAdmin || m_refAPI.IsARoleMember(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.AdminUsers) || m_refAPI.IsARoleMember(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.CommunityAdmin))
                        {
                            result.Append("level2 = InsertFolder(level1, CreateFolderInstance(\"" + objMessage.GetMessage("lbl memberships") + "\", \"\"));");
                            result.Append("var urlInfoArray = new Array(\"frame\", \"users.aspx?backaction=viewallusers&LangType=" + m_refAPI.RequestInformationRef.ContentLanguage + "&action=viewallusers&grouptype=1&groupid=888888\", \"ek_main\");");
                            result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("generic Users") + "\", urlInfoArray));");
                            result.Append("var urlInfoArray = new Array(\"frame\", \"users.aspx?action=viewallgroups&LangType=" + m_refAPI.RequestInformationRef.ContentLanguage + "&grouptype=1\", \"ek_main\");");
                            result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("generic User Groups") + "\", urlInfoArray));");
                            result.Append("var urlInfoArray = new Array(\"frame\", \"users.aspx?backaction=viewallusers&LangType=" + m_refAPI.RequestInformationRef.ContentLanguage + "&action=viewallusers&grouptype=1&groupid=888888&ty=nonverify\", \"ek_main\");");
                            result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("generic Users not verified") + "\", urlInfoArray));");
                        }
                    }
                }

                if (Ektron.Cms.DataIO.LicenseManager.LicenseManager.IsFeatureEnable(m_refAPI.RequestInformationRef, Feature.SocialNetworking))
                {
                    if ((IsAdmin || m_refAPI.IsARoleMember(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.CommunityAdmin)) && !IsSystemAccount)
                    {
                        //Notifications
                        result.Append("level2 = InsertFolder(level1, CreateFolderInstance(\"" + objMessage.GetMessage("lbl notifications") + "\", \"\"));");
                        result.Append("level3 = InsertFolder(level2, CreateFolderInstance(\"" + objMessage.GetMessage("lbl default preferences") + "\", \"\"));");
                        result.Append("var urlInfoArray = new Array(\"frame\", \"notifications/DefaultNotificationPreferences.aspx?mode=colleagues\", \"ek_main\");");
                        result.Append("InsertFile(level3, CreateLink(\"" + objMessage.GetMessage("lbl friends") + "\", urlInfoArray));");
                        result.Append("var urlInfoArray = new Array(\"frame\", \"notifications/DefaultNotificationPreferences.aspx?mode=groups\", \"ek_main\");");
                        result.Append("InsertFile(level3, CreateLink(\"" + objMessage.GetMessage("lbl groups") + "\", urlInfoArray));");
                        result.Append("var urlInfoArray = new Array(\"frame\", \"notifications/DefaultNotificationPreferences.aspx?mode=privacy\", \"ek_main\");");
                        result.Append("InsertFile(level3, CreateLink(\"" + objMessage.GetMessage("lbl privacy") + "\", urlInfoArray));");
                        result.Append("var urlInfoArray = new Array(\"frame\", \"notifications/ActivityTypes.aspx?mode=viewgrid\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl activity types") + "\", urlInfoArray));");
                        result.Append("var urlInfoArray = new Array(\"frame\", \"notifications/agents.aspx?mode=viewgrid\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl agent") + "\", urlInfoArray));");
                        result.Append("var urlInfoArray = new Array(\"frame\", \"notifications/notificationmessages.aspx?mode=viewnotificationmsggrid\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl messages") + "\", urlInfoArray));");
                        result.Append("var urlInfoArray = new Array(\"frame\", \"notifications/settings.aspx?mode=view\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("administrate button text") + "\", urlInfoArray));");
                    }
                }

                if (!IsSystemAccount)
                {

                    // tags
                    result.Append("var urlInfoArray = new Array(\"frame\", \"Community/personaltags.aspx\", \"ek_main\");");
                    result.Append("level2 = InsertFolder(level1, CreateFolderInstance(\"" + objMessage.GetMessage("lbl tags") + "\", \"\"));");
                    result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("view all tags") + "\", urlInfoArray));");
                    if (IsAdmin)
                    {
                        result.Append("var urlInfoArray = new Array(\"frame\",\"Community/personaltags.aspx?action=viewdefaulttags&objectType=" + System.Convert.ToInt32(EkEnumeration.CMSObjectTypes.Content) + "\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl default content tags") + "\", urlInfoArray));");
                        if (Ektron.Cms.DataIO.LicenseManager.LicenseManager.IsFeatureEnable(m_refAPI.RequestInformationRef, Feature.SocialNetworking))
                        {
                            result.Append("var urlInfoArray = new Array(\"frame\", \"Community/personaltags.aspx?action=viewdefaulttags&objectType=" + System.Convert.ToInt32(EkEnumeration.CMSObjectTypes.CommunityGroup) + "\", \"ek_main\");");
                            result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl default group tags") + "\", urlInfoArray));");
                        }

                        result.Append("var urlInfoArray = new Array(\"frame\",\"Community/personaltags.aspx?action=viewdefaulttags&objectType=" + System.Convert.ToInt32(EkEnumeration.CMSObjectTypes.Library) + "\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl default library tags") + "\", urlInfoArray));");
                        if (Ektron.Cms.DataIO.LicenseManager.LicenseManager.IsFeatureEnable(m_refAPI.RequestInformationRef, Feature.SocialNetworking))
                        {
                            result.Append("var urlInfoArray = new Array(\"frame\",\"Community/personaltags.aspx?action=viewdefaulttags&objectType=" + System.Convert.ToInt32(EkEnumeration.CMSObjectTypes.User) + "\", \"ek_main\");");
                            result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl default user tags") + "\", urlInfoArray));");
                        }
                    }

                    // community groups
                    if (Ektron.Cms.DataIO.LicenseManager.LicenseManager.IsFeatureEnable(m_refAPI.RequestInformationRef, Feature.SocialNetworking))
                    {
                        result.Append("var urlInfoArray = new Array(\"frame\", \"Community/groups.aspx?action=viewallgroups\", \"ek_main\");");
                        result.Append("InsertFile(level1, CreateLink(\"" + objMessage.GetMessage("lbl groups") + "\", urlInfoArray));");
                    }

                    if (IsAdmin)
                    {
                        // messages
                        result.Append("var urlInfoArray = new Array(\"frame\", \"subscriptionmessages.aspx?mode=userprop\", \"ek_main\");");
                        result.Append("InsertFile(level1, CreateLink(\"" + objMessage.GetMessage("lbl messages") + "\", urlInfoArray));");
                    }
                    if (IsAdmin || objContentRef.IsARoleMember(Convert.ToInt64(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.MessageBoardAdmin), currentUserID, false))
                    {
                        // message board
                        result.Append("var urlInfoArray = new Array(\"frame\", \"Community/messageboard.aspx\", \"ek_main\");");
                        result.Append("InsertFile(level1, CreateLink(\"" + objMessage.GetMessage("lbl msg board") + "\", urlInfoArray));");
                    }

                    // reviews
                    result.Append("var urlInfoArray = new Array(\"frame\", \"reports.aspx?action=ContentReviews\", \"ek_main\");");
                    result.Append("InsertFile(level1, CreateLink(\"" + objMessage.GetMessage("lbl reviews") + "\", urlInfoArray));");

                    // templates
                    if (Ektron.Cms.DataIO.LicenseManager.LicenseManager.IsFeatureEnable(m_refAPI.RequestInformationRef, Feature.SocialNetworking))
                    {
                        if (IsAdmin)
                        {
                            result.Append("var urlInfoArray = new Array(\"frame\",\"Community/communitytemplates.aspx?action=view\", \"ek_main\");");
                            result.Append("InsertFile(level1, CreateLink(\"" + objMessage.GetMessage("lbl templates") + "\", urlInfoArray));");
                        }
                    }
                    //Community Management Ends
                }

                //Configuration
                if (IsAdmin)
                {
                    result.Append("level1 = InsertFolder(TopTreeLevel, CreateFolderInstance(\"" + objMessage.GetMessage("config page html title") + "\", \"\"));");
                    SiteAPI m_refSiteApi = new SiteAPI();
                    SettingsData settings_data;
                    settings_data = m_refSiteApi.GetSiteVariables(m_refSiteApi.UserId);
                    if (!(settings_data == null))
                    {
                        if (settings_data.IsAdInstalled)
                        {
                            result.Append("level2 = InsertFolder(level1, CreateFolderInstance(\"" + objMessage.GetMessage("generic Active Directory") + "\", \"\"));");
                            if (m_refSiteApi.RequestInformationRef.ADAdvancedConfig == true)
                            {
                                result.Append("var urlInfoArray = new Array(\"frame\", \"AD/ADDomains.aspx\", \"ek_main\");");
                                result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("generic ad domains") + "\", urlInfoArray));");
                            }
                            result.Append("var urlInfoArray = new Array(\"frame\", \"adconfigure.aspx\", \"ek_main\");");
                            result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("generic Setup") + "\", urlInfoArray));");
                            result.Append("var urlInfoArray = new Array(\"frame\", \"adreports.aspx?action=ViewAllReportTypes\", \"ek_main\");");
                            result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("generic Status") + "\", urlInfoArray));");
                        }
                    }
                    if (!IsSystemAccount)
                    {
                        if (System.Configuration.ConfigurationSettings.AppSettings["ek_Dictionary"] != null && Convert.ToBoolean(System.Configuration.ConfigurationSettings.AppSettings["ek_Dictionary"]))
                        {
                            // Dictionary
                            result.Append("level2 = InsertFolder(level1, CreateFolderInstance(\"Dictionary\", \"\"));");
                            result.Append("var urlInfoArray = new Array(\"frame\", \"dictionary/addnew.aspx\", \"ek_main\");");
                            result.Append("InsertFile(level2, CreateLink(\"Add new dictionary\", urlInfoArray));");

                            ICmsDictionary dictionaryManager = ObjectFactory.GetCmsDictionary();
                            Criteria<CmsDictionaryProperty> dictionaryCriteria = new Criteria<CmsDictionaryProperty>();
                            dictionaryCriteria.OrderByDirection = EkEnumeration.OrderByDirection.Ascending;
                            dictionaryCriteria.OrderByField = CmsDictionaryProperty.Name;
                            List<CmsDictionaryData> dictionaryList = dictionaryManager.GetList(dictionaryCriteria);
                            for (int i = 0; i < dictionaryList.Count; i++)
                            {
                                result.Append("var urlInfoArray = new Array(\"frame\", \"dictionary/editvalues.aspx?id=" + dictionaryList[i].Id + "\", \"ek_main\");");
                                result.Append("InsertFile(level2, CreateLink(\"" + dictionaryList[i].Name + "\", urlInfoArray));");
                            }
                            // Dictionary
                        }

                        result.Append("level2 = InsertFolder(level1, CreateFolderInstance(\"" + objMessage.GetMessage("lbl web alert properties") + "\", \"\"));");
                        // email from list
                        result.Append("var urlInfoArray = new Array(\"frame\", \"subscriptionemailfromlist.aspx\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl subscription emailfrom properties") + "\", urlInfoArray));");
                        // messages
                        result.Append("var urlInfoArray = new Array(\"frame\", \"subscriptionmessages.aspx\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl subscription message properties") + "\", urlInfoArray));");
                        // subscriptions
                        result.Append("var urlInfoArray = new Array(\"frame\", \"subscriptions.aspx?action=ViewAllSubscriptions\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl subscription properties") + "\", urlInfoArray));");

                        //search properties
                        result.Append("level2 = InsertFolder(level1, CreateFolderInstance(\"" + objMessage.GetMessage("generic search") + "\", \"\"));");
                        result.Append("var urlInfoArray = new Array(\"frame\", \"search/suggestedresults.aspx?action=ViewSuggestedResults\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl suggested results") + "\", urlInfoArray));");
                        result.Append("var urlInfoArray = new Array(\"frame\", \"search/status.aspx?action=ViewSearchStatus\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl search status") + "\", urlInfoArray));");
                        result.Append("var urlInfoArray = new Array(\"frame\", \"search/synonyms.aspx?action=ViewSynonyms\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl synonyms") + "\", urlInfoArray));");
                        result.Append("var urlInfoArray = new Array(\"frame\", \"search/mappings.aspx\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl integrated search mappings") + "\", urlInfoArray));");

                        //forum properties
                        result.Append("level2 = InsertFolder(level1, CreateFolderInstance(\"" + objMessage.GetMessage("lbl disc boards") + "\", \"\"));");
                        result.Append("var urlInfoArray = new Array(\"frame\", \"threadeddisc/replacewords.aspx?isemoticon=1\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl emoticons") + "\", urlInfoArray));");
                        result.Append("var urlInfoArray = new Array(\"frame\", \"subscriptionmessages.aspx?mode=forum\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl subscription message properties") + "\", urlInfoArray));");
                        result.Append("var urlInfoArray = new Array(\"frame\", \"threadeddisc/replacewords.aspx\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl replace words") + "\", urlInfoArray));");
                        result.Append("var urlInfoArray = new Array(\"frame\", \"threadeddisc/restrictIP.aspx\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl restricted ips") + "\", urlInfoArray));");
                        result.Append("var urlInfoArray = new Array(\"frame\", \"threadeddisc/userranks.aspx\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl user ranks") + "\", urlInfoArray));");

                        //Url Aliasing 7.6
                        //Licensing For 7.6
                        if (Ektron.Cms.DataIO.LicenseManager.LicenseManager.IsFeatureEnable(m_refAPI.RequestInformationRef, Ektron.Cms.DataIO.LicenseManager.Feature.UrlAliasing, false))
                        {

                            result.Append("level2 = InsertFolder(level1, CreateFolderInstance(\"" + objMessage.GetMessage("lbl navtree urlaliasing") + "\", \"\"));");
                            // automatic
                            result.Append("var urlInfoArray = new Array(\"frame\", \"urlmanualaliaslistmaint.aspx?mode=auto\", \"ek_main\");");
                            result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl tree url automatic aliasing") + "\", urlInfoArray));");
                            //community
                            result.Append("var urlInfoArray = new Array(\"frame\", \"urlmanualaliaslistmaint.aspx?mode=community\", \"ek_main\");");
                            result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("community text") + "\", urlInfoArray));");
                            // manual
                            result.Append("var urlInfoArray = new Array(\"frame\", \"urlmanualaliaslistmaint.aspx\", \"ek_main\");");
                            result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl tree url manual aliasing") + "\", urlInfoArray));");
                            // regex
                            result.Append("var urlInfoArray = new Array(\"frame\", \"urlRegExAliaslistMaint.aspx\", \"ek_main\");");
                            result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl tree url regex aliasing") + "\", urlInfoArray));");
                            // settings
                            result.Append("var urlInfoArray = new Array(\"frame\", \"urlaliassettings.aspx?action=view\", \"ek_main\");");
                            result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("administrate button text") + "\", urlInfoArray));");
                            //End If
                        }

                            //personalization
                            result.Append("level2 = InsertFolder(level1, CreateFolderInstance(\"" + objMessage.GetMessage("lbl personalizations") + "\", \"\"));");
                            if (Ektron.Cms.DataIO.LicenseManager.LicenseManager.IsFeatureEnable(m_refAPI.RequestInformationRef, Ektron.Cms.DataIO.LicenseManager.Feature.Personalization, false))
                            {
                                result.Append("var urlInfoArray = new Array(\"frame\", \"widgetsettings.aspx?action=widgetspace\", \"ek_main\");");
                                result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl widgets space") + "\", urlInfoArray));");
                            }
                            result.Append("var urlInfoArray = new Array(\"frame\", \"widgetsettings.aspx?action=widgetsync\", \"ek_main\");");
                            result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl widgets") + "\", urlInfoArray));");

                            result.Append("var urlInfoArray = new Array(\"frame\", \"TargetedContent/targetcontentlist.aspx\", \"ek_main\");");
                            result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl targeted content") + "\", urlInfoArray));");

                        //replication
                        if (m_refAPI.EnableReplication)
                        {
                            result.Append("var urlInfoArray = new Array(\"frame\", \"DynReplication.aspx\", \"ek_main\");");
                            result.Append("InsertFile(level1, CreateLink(\"" + objMessage.GetMessage("lbl navtree quickdeploy") + "\", urlInfoArray));");
                        }
                    }

                    // asset server setup
                    result.Append("var urlInfoArray = new Array(\"frame\", \"assetconfig.aspx\", \"ek_main\");");
                    result.Append("InsertFile(level1, CreateLink(\"" + objMessage.GetMessage("lbl asset server type") + "\", urlInfoArray));");
                    // custom properties
                    result.Append("var urlInfoArray = new Array(\"frame\", \"users.aspx?action=ViewCustomProp\", \"ek_main\");");
                    result.Append("InsertFile(level1, CreateLink(\"" + objMessage.GetMessage("custom properties") + "\", urlInfoArray));");
                    if (!IsSystemAccount)
                    {
                         // Devices
                        result.Append("var urlInfoArray = new Array(\"frame\", \"settings.aspx?action=viewalldeviceconfigurations\", \"ek_main\");");
                        result.Append("InsertFile(level1, CreateLink(\"" + objMessage.GetMessage("device configuration") + "\", urlInfoArray));");
                    }

                    if ((Convert.ToInt64(EkEnumeration.UserGroups.BuiltIn) != currentUserID) && (IsSystemAccount || IsAdmin))
                    {
                       if( System.IO.File.Exists(Server.MapPath(m_refAPI.AppPath + "sync/SyncDiag.aspx")))
                       {
                         result.Append("var urlInfoArray = new Array(\"frame\", \"sync/SyncDiag.aspx\", \"ek_main\");");
                         result.Append("InsertFile(level1, CreateLink(\"" + objMessage.GetMessage("lbl Diagnostics") + "\", urlInfoArray));");
                       }
                    }

                    if(!IsSystemAccount)
                    {
                        // fonts
                        result.Append("var urlInfoArray = new Array(\"frame\", \"font.aspx?action=ViewFontsByGroup\", \"ek_main\");");
                        result.Append("InsertFile(level1, CreateLink(\"" + objMessage.GetMessage("generic Fonts") + "\", urlInfoArray));");

                        //integrated search folder (Hidden until this is supported in Search 4.0 - CB 1/4/11)
                        //result.Append("var urlInfoArray = new Array(\"frame\", \"IntegratedSearch.aspx?action=ViewAllIntegratedFolders\", \"ek_main\");");
                        //result.Append("InsertFile(level1, CreateLink(\"" + objMessage.GetMessage("lbl Integrated Search Folder") + "\", urlInfoArray));");

                                        //load balancing
                        if (m_refContentApi.GetAssetMgtConfigInfo()[System.Convert.ToInt32(AsetConfigType.LoadBalanced)].Value == "1")
                        {
                            result.Append("var urlInfoArray = new Array(\"frame\", \"loadbalancing.aspx\", \"ek_main\");");
                            result.Append("InsertFile(level1, CreateLink(\"" + objMessage.GetMessage("lbl load balancing") + "\", urlInfoArray));");
                        }

                        // metadata definition
                        result.Append("var urlInfoArray = new Array(\"frame\", \"meta_data50.aspx?action=ViewAllMetaDefinitions\", \"ek_main\");");
                        result.Append("InsertFile(level1, CreateLink(\"" + objMessage.GetMessage("meta_data page html title") + "\", urlInfoArray));");
                    }

                    // setup
                    result.Append("var urlInfoArray = new Array(\"frame\", \"configure.aspx\", \"ek_main\");");
                    result.Append("InsertFile(level1, CreateLink(\"" + objMessage.GetMessage("generic Setup") + "\", urlInfoArray));");
                    if (!IsSystemAccount)
                    {
                        //smart form configurations
                        result.Append("var urlInfoArray = new Array(\"frame\", \"xml_config.aspx?action=ViewAllXmlConfigurations\", \"ek_main\");");
                        result.Append("InsertFile(level1, CreateLink(\"" + objMessage.GetMessage("generic XML Configurations") + "\", urlInfoArray));");
                        // synchronization
                        if (LicenseManager.IsFeatureEnable(m_refAPI.RequestInformationRef, Feature.eSync))
                        {
                            result.Append("var urlInfoArray = new Array(\"frame\", \"sync/Sync.aspx?action=viewallsync\", \"ek_main\");");
                            result.Append("InsertFile(level1, CreateLink(\"" + objMessage.GetMessage("lbl sync") + "\", urlInfoArray));");
                        }
                        // task types
                        result.Append("var urlInfoArray = new Array(\"frame\", \"tasks.aspx?action=ViewTaskType\", \"ek_main\");");
                        result.Append("InsertFile(level1, CreateLink(\"" + objMessage.GetMessage("lbl task types") + "\", urlInfoArray));");
                        // template configuration
                        result.Append("var urlInfoArray = new Array(\"frame\", \"template_config.aspx\", \"ek_main\");");
                        result.Append("InsertFile(level1, CreateLink(\"" + "" + objMessage.GetMessage("lbl Template Configuration") + "" + "\", urlInfoArray));");
                        //user property

                    }
                }
                else
                {
                    result.Append("level1 = InsertFolder(TopTreeLevel, CreateFolderInstance(\"" + objMessage.GetMessage("config page html title") + "\", \"\"));");

                    // User is not part of administrator group, but has taxonomy administrator role, display Custom Property link with only Taxonomy Custom Property screen and hide the User option in the drop down list.

                    if (objContentRef.IsARoleMember(Convert.ToInt64(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.TaxonomyAdministrator), currentUserID, false))
                    {
                        result.Append("var urlInfoArray = new Array(\"frame\", \"customproperties.aspx?action=viewall&type=1&objtype=0\", \"ek_main\");");
                        result.Append("InsertFile(level1, CreateLink(\"" + objMessage.GetMessage("custom properties") + "\", urlInfoArray));");
                    }

                    if (objContentRef.IsARoleMember(Convert.ToInt64(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.AdminPersonalize), currentUserID, false))
                    {
                         //personalization
                        result.Append("level2 = InsertFolder(level1, CreateFolderInstance(\"" + objMessage.GetMessage("lbl personalizations") + "\", \"\"));");
                        if (Ektron.Cms.DataIO.LicenseManager.LicenseManager.IsFeatureEnable(m_refAPI.RequestInformationRef, Ektron.Cms.DataIO.LicenseManager.Feature.Personalization, false))
                        {
                            result.Append("var urlInfoArray = new Array(\"frame\", \"widgetsettings.aspx?action=widgetspace\", \"ek_main\");");
                            result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl widgets space") + "\", urlInfoArray));");
                        }
                        result.Append("var urlInfoArray = new Array(\"frame\", \"widgetsettings.aspx?action=widgetsync\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl widgets") + "\", urlInfoArray));");

                        result.Append("var urlInfoArray = new Array(\"frame\", \"TargetedContent/targetcontentlist.aspx\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl targeted content") + "\", urlInfoArray));");
                    }

                    if (objContentRef.IsARoleMember(Convert.ToInt64(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.UrlAliasingAdmin), currentUserID, false))
                    {
                        if (Ektron.Cms.DataIO.LicenseManager.LicenseManager.IsFeatureEnable(m_refAPI.RequestInformationRef, Ektron.Cms.DataIO.LicenseManager.Feature.UrlAliasing, false))
                        {
                            result.Append("level2 = InsertFolder(level1, CreateFolderInstance(\"" + objMessage.GetMessage("lbl navtree urlaliasing") + "\", \"\"));");
                            result.Append("var urlInfoArray = new Array(\"frame\", \"urlaliassettings.aspx?action=view\", \"ek_main\");");
                            result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("administrate button text") + "\", urlInfoArray));");
                            //If (m_urlAliasSettings.IsManualAliasEnabled) Then
                            result.Append("var urlInfoArray = new Array(\"frame\", \"urlmanualaliaslistmaint.aspx\", \"ek_main\");");
                            result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl tree url manual aliasing") + "\", urlInfoArray));");

                            result.Append("var urlInfoArray = new Array(\"frame\", \"urlmanualaliaslistmaint.aspx?mode=auto\", \"ek_main\");");
                            result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl tree url automatic aliasing") + "\", urlInfoArray));");

                            //community
                            result.Append("var urlInfoArray = new Array(\"frame\", \"urlmanualaliaslistmaint.aspx?mode=community\", \"ek_main\");");
                            result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("community text") + "\", urlInfoArray));");

                            result.Append("var urlInfoArray = new Array(\"frame\", \"urlRegExAliaslistMaint.aspx\", \"ek_main\");");
                            result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl tree url regex aliasing") + "\", urlInfoArray));");
                            //End If
                        }
                    }
                    //Search Admin to set Synonyms and Suggested Results
                    if (objContentRef.IsARoleMember(Convert.ToInt64(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.SearchAdmin), currentUserID, false))
                    {
                        result.Append("level2 = InsertFolder(level1, CreateFolderInstance(\"" + objMessage.GetMessage("generic search") + "\", \"\"));");
                        result.Append("var urlInfoArray = new Array(\"frame\", \"search/suggestedresults.aspx?action=ViewSuggestedResults\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl suggested results") + "\", urlInfoArray));");
                        result.Append("var urlInfoArray = new Array(\"frame\", \"search/status.aspx?action=ViewSearchStatus\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl search status") + "\", urlInfoArray));");
                        result.Append("var urlInfoArray = new Array(\"frame\", \"search/synonyms.aspx?action=ViewSynonyms\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl synonyms") + "\", urlInfoArray));");
                        result.Append("var urlInfoArray = new Array(\"frame\", \"search/mappings.aspx\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl integrated search mappings") + "\", urlInfoArray));");
                    }
                    if (objContentRef.IsARoleMember(Convert.ToInt64(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.AdminMetadata), currentUserID, false))
                    {
                        result.Append("var urlInfoArray = new Array(\"frame\", \"meta_data50.aspx?action=ViewAllMetaDefinitions\", \"ek_main\");");
                        result.Append("InsertFile(level1, CreateLink(\"" + objMessage.GetMessage("meta_data page html title") + "\", urlInfoArray));");
                    }
                    if (objContentRef.IsARoleMember(Convert.ToInt64(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.SyncAdmin), currentUserID, false))
                    {
                        result.Append("var urlInfoArray = new Array(\"frame\", \"loadbalancing.aspx\", \"ek_main\");");
                        result.Append("InsertFile(level1, CreateLink(\"" + objMessage.GetMessage("lbl load balancing") + "\", urlInfoArray));");
                    }
                    if (objContentRef.IsARoleMember(Convert.ToInt64(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.AdminXmlConfig), currentUserID, false))
                    {
                        result.Append("var urlInfoArray = new Array(\"frame\", \"xml_config.aspx?action=ViewAllXmlConfigurations\", \"ek_main\");");
                        result.Append("InsertFile(level1, CreateLink(\"" + objMessage.GetMessage("generic XML Configurations") + "\", urlInfoArray));");
                    }

                    if (objContentRef.IsARoleMember(Convert.ToInt64(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.TemplateConfigurations), currentUserID, false))
                    {
                        result.Append("var urlInfoArray = new Array(\"frame\", \"template_config.aspx\", \"ek_main\");");
                        result.Append("InsertFile(level1, CreateLink(\"" + objMessage.GetMessage("lbl Template Configuration") + "\", urlInfoArray));");
                    }
                    if (LicenseManager.IsFeatureEnable(m_refAPI.RequestInformationRef, Feature.eSync))
                    {
                        if (objContentRef.IsARoleMember(Convert.ToInt64(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.SyncAdmin), currentUserID, false) || objContentRef.IsARoleMember(Convert.ToInt64(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.SyncUser), currentUserID, false))
                        {
                            result.Append("var urlInfoArray = new Array(\"frame\", \"sync/Sync.aspx?action=viewallsync\", \"ek_main\");");
                            result.Append("InsertFile(level1, CreateLink(\"" + objMessage.GetMessage("lbl sync") + "\", urlInfoArray));");
                        }
                    }
                }
                //Configuration Ends.

                //Localization
                if (!IsSystemAccount)
                {
                    bool xliffEnabled = System.Convert.ToBoolean(m_refAPI.IsARoleMember(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.AdminXliff) && Ektron.Cms.DataIO.LicenseManager.LicenseManager.IsFeatureEnable(m_refAPI.RequestInformationRef, Feature.Xliff));
                    if (xliffEnabled || IsAdmin)
                    {
                        result.Append("level1 = InsertFolder(TopTreeLevel, CreateFolderInstance(\"" + objMessage.GetMessage("lbl localization") + "\", \"\"));");
                        // Import XLIFF Files
                        if (xliffEnabled)
                        {
                            // dashboard
                            result.Append("var urlInfoArray = new Array(\"frame\", \"localization/Dashboard/CreateReport.aspx\", \"ek_main\");");
                            result.Append("InsertFile(level1, CreateLink(\"" + objMessage.GetMessage("sam dashboard") + "\", urlInfoArray));");
                            // export translation files
                            result.Append("var urlInfoArray = new Array(\"frame\", \"localization/exportjobs.aspx\", \"ek_main\");");
                            result.Append("InsertFile(level1, CreateLink(\"" + objMessage.GetMessage("lbl export for translation") + "\", urlInfoArray));");
                            // import translation files
                            result.Append("var urlInfoArray = new Array(\"frame\", \"localization/localization.aspx\", \"ek_main\");");
                            result.Append("InsertFile(level1, CreateLink(\"" + objMessage.GetMessage("lbl import translated files") + "\", urlInfoArray));");
                        }
                        // Languages and Regions
                        if (IsAdmin)
                        {
                            result.Append("var urlInfoArray = new Array(\"frame\", \"localization/languages.aspx\", \"ek_main\");");
                            result.Append("InsertFile(level1, CreateLink(\"" + objMessage.GetMessage("lbl language settings") + "\", urlInfoArray));");
                        }
                        if (xliffEnabled)
                        {
                            // Locale Taxonomy
                            result.Append("var urlInfoArray = new Array(\"frame\", \"Localization/localeTaxonomy.aspx\", \"ek_main\");");
                            result.Append("InsertFile(level1, CreateLink(\"" + objMessage.GetMessage("lbl translation packages") + "\", urlInfoArray));");}
                        }
                }
                //Roles
                if (IsAdmin && !IsSystemAccount)
                {
                    // Add roles:
                    result.Append("level1 = InsertFolder(TopTreeLevel, CreateFolderInstance(\"" + objMessage.GetMessage("lbl Roles") + "\", \"\"));");
                    result.Append("level2 = InsertFolder(level1, CreateFolderInstance(\"" + objMessage.GetMessage("lbl Built-In") + "\", \"\"));");
                    result.Append("level3 = InsertFolder(level2, CreateFolderInstance(\"" + objMessage.GetMessage("lbl System-Wide") + "\", \"\"));");
                    if (Ektron.Cms.DataIO.LicenseManager.LicenseManager.IsFeatureEnable(m_refAPI.RequestInformationRef, Feature.UrlAliasing))
                    {
                        result.Append("var urlInfoArray = new Array(\"frame\", \"roles.aspx?action=aliasedit&LangType=" + m_refAPI.RequestInformationRef.ContentLanguage + "\", \"ek_main\");");
                        result.Append("InsertFile(level3, CreateLink(\"" + objMessage.GetMessage("lbl Alias-Edit") + "\", urlInfoArray));");
                        result.Append("var urlInfoArray = new Array(\"frame\", \"roles.aspx?action=aliasadmin&LangType=" + m_refAPI.RequestInformationRef.ContentLanguage + "\", \"ek_main\");");
                        result.Append("InsertFile(level3, CreateLink(\"" + objMessage.GetMessage("lbl Alias-Admin") + "\", urlInfoArray));");
                    }
                    if (Ektron.Cms.DataIO.LicenseManager.LicenseManager.IsFeatureEnable(m_refAPI.RequestInformationRef, Feature.WebSiteAnalytics))
                    {
                        result.Append("var urlInfoArray = new Array(\"frame\", \"roles.aspx?action=analyticsviewer&LangType=" + m_refAPI.RequestInformationRef.ContentLanguage + "\", \"ek_main\");");
                        result.Append("InsertFile(level3, CreateLink(\"" + objMessage.GetMessage("lbl role analytics-viewer") + "\", urlInfoArray));");
                    }
                    result.Append("var urlInfoArray = new Array(\"frame\", \"roles.aspx?action=ruleedit&LangType=" + m_refAPI.RequestInformationRef.ContentLanguage + "\", \"ek_main\");");
                    result.Append("InsertFile(level3, CreateLink(\"" + objMessage.GetMessage("lbl Business Rule Editor") + "\", urlInfoArray));");
                    bool EnableClassicCalendar;
                    bool.TryParse(ConfigurationManager.AppSettings["ek_enableClassicCalendar"], out EnableClassicCalendar);
                    if (EnableClassicCalendar)
                    {
                        //Calendar
                        result.Append("var urlInfoArray = new Array(\"frame\", \"roles.aspx?action=calendaradmin&LangType=" + m_refAPI.RequestInformationRef.ContentLanguage + "\", \"ek_main\");");
                        result.Append("InsertFile(level3, CreateLink(\"" + objMessage.GetMessage("lbl Calendar-Admin") + "\", urlInfoArray));");
                        //Calendar Ends
                    }

                    result.Append("var urlInfoArray = new Array(\"frame\", \"roles.aspx?action=collectionmenuadmin&LangType=" + m_refAPI.RequestInformationRef.ContentLanguage + "\", \"ek_main\");");
                    result.Append("InsertFile(level3, CreateLink(\"" + objMessage.GetMessage("lbl Collection and Menu Admin") + "\", urlInfoArray));");

                    result.Append("var urlInfoArray = new Array(\"frame\", \"roles.aspx?action=collectionadmin&LangType=" + m_refAPI.RequestInformationRef.ContentLanguage + "\", \"ek_main\");");
                    result.Append("InsertFile(level3, CreateLink(\"" + objMessage.GetMessage("lbl collection admin") + "\", urlInfoArray));");

                    result.Append("var urlInfoArray = new Array(\"frame\", \"roles.aspx?action=collectionapprovers&LangType=" + m_refAPI.RequestInformationRef.ContentLanguage + "\", \"ek_main\");");
                    result.Append("InsertFile(level3, CreateLink(\"" + objMessage.GetMessage("lbl Collection Approver") + "\", urlInfoArray));");
                    if (Ektron.Cms.DataIO.LicenseManager.LicenseManager.IsFeatureEnable(m_refAPI.RequestInformationRef, Feature.eCommerce))
                    {
                        result.Append("var urlInfoArray = new Array(\"frame\", \"roles.aspx?action=commerceadmin&LangType=" + m_refAPI.RequestInformationRef.ContentLanguage + "\", \"ek_main\");");
                        result.Append("InsertFile(level3, CreateLink(\"" + objMessage.GetMessage("lbl role commerce-admin") + "\", urlInfoArray));");
                    }
                    if (Ektron.Cms.DataIO.LicenseManager.LicenseManager.IsFeatureEnable(m_refAPI.RequestInformationRef, Feature.SocialNetworking))
                    {
                        result.Append("var urlInfoArray = new Array(\"frame\", \"roles.aspx?action=communityadmin&LangType=" + m_refAPI.RequestInformationRef.ContentLanguage + "\", \"ek_main\");");
                        result.Append("InsertFile(level3, CreateLink(\"" + objMessage.GetMessage("lbl role community-admin") + "\", urlInfoArray));");
                        result.Append("var urlInfoArray = new Array(\"frame\", \"roles.aspx?action=communitygroupadmin&LangType=" + m_refAPI.RequestInformationRef.ContentLanguage + "\", \"ek_main\");");
                        result.Append("InsertFile(level3, CreateLink(\"" + objMessage.GetMessage("lbl role communitygroup-admin") + "\", urlInfoArray));");
                        result.Append("var urlInfoArray = new Array(\"frame\", \"roles.aspx?action=communitygroupcreate&LangType=" + m_refAPI.RequestInformationRef.ContentLanguage + "\", \"ek_main\");");
                        result.Append("InsertFile(level3, CreateLink(\"" + objMessage.GetMessage("lbl role communitygroup-create") + "\", urlInfoArray));");
                    }
                    result.Append("var urlInfoArray = new Array(\"frame\", \"roles.aspx?action=masterlayoutcreate&LangType=" + m_refAPI.RequestInformationRef.ContentLanguage + "\", \"ek_main\");");
                    result.Append("InsertFile(level3, CreateLink(\"" + objMessage.GetMessage("lbl masterlayout-create") + "\", urlInfoArray));");
                    result.Append("var urlInfoArray = new Array(\"frame\", \"roles.aspx?action=menuadmin&LangType=" + m_refAPI.RequestInformationRef.ContentLanguage + "\", \"ek_main\");");
                    result.Append("InsertFile(level3, CreateLink(\"" + objMessage.GetMessage("lbl menu admin") + "\", urlInfoArray));");
                    if (Ektron.Cms.DataIO.LicenseManager.LicenseManager.IsFeatureEnable(m_refAPI.RequestInformationRef, Feature.SocialNetworking))
                    {
                        result.Append("var urlInfoArray = new Array(\"frame\", \"roles.aspx?action=messageboardadmin&LangType=" + m_refAPI.RequestInformationRef.ContentLanguage + "\", \"ek_main\");");
                        result.Append("InsertFile(level3, CreateLink(\"" + objMessage.GetMessage("lbl Messageboard-Admin") + "\", urlInfoArray));");
                    }
                    result.Append("var urlInfoArray = new Array(\"frame\", \"roles.aspx?action=metadataadmin&LangType=" + m_refAPI.RequestInformationRef.ContentLanguage + "\", \"ek_main\");");
                    result.Append("InsertFile(level3, CreateLink(\"" + objMessage.GetMessage("lbl Metadata-Admin") + "\", urlInfoArray));");
                    result.Append("var urlInfoArray = new Array(\"frame\", \"roles.aspx?action=multivariatetester&LangType=" + m_refAPI.RequestInformationRef.ContentLanguage + "\", \"ek_main\");");
                    result.Append("InsertFile(level3, CreateLink(\"" + objMessage.GetMessage("alt multivariate tester") + "\", urlInfoArray));");
                    result.Append("var urlInfoArray = new Array(\"frame\", \"roles.aspx?action=searchadmin&LangType=" + m_refAPI.RequestInformationRef.ContentLanguage + "\", \"ek_main\");");
                    result.Append("InsertFile(level3, CreateLink(\"" + objMessage.GetMessage("lbl role search-admin") + "\", urlInfoArray));");
                    result.Append("var urlInfoArray = new Array(\"frame\", \"roles.aspx?action=xmlconfigadmin&LangType=" + m_refAPI.RequestInformationRef.ContentLanguage + "\", \"ek_main\");");
                    result.Append("InsertFile(level3, CreateLink(\"" + objMessage.GetMessage("lbl Smart Forms Admin") + "\", urlInfoArray));");
                    if (LicenseManager.IsFeatureEnable(m_refAPI.RequestInformationRef, Feature.eSync))
                    {
                        result.Append("var urlInfoArray = new Array(\"frame\", \"roles.aspx?action=syncadmin&LangType=" + m_refAPI.RequestInformationRef.ContentLanguage + "\", \"ek_main\");");
                        result.Append("InsertFile(level3, CreateLink(\"" + objMessage.GetMessage("lbl sync admin") + "\", urlInfoArray));");
                        result.Append("var urlInfoArray = new Array(\"frame\", \"roles.aspx?action=syncuser&LangType=" + m_refAPI.RequestInformationRef.ContentLanguage + "\", \"ek_main\");");
                        result.Append("InsertFile(level3, CreateLink(\"" + objMessage.GetMessage("lbl sync user") + "\", urlInfoArray));");
                    }
                    result.Append("var urlInfoArray = new Array(\"frame\", \"roles.aspx?action=taskcreate&LangType=" + m_refAPI.RequestInformationRef.ContentLanguage + "\", \"ek_main\");");
                    result.Append("InsertFile(level3, CreateLink(\"" + objMessage.GetMessage("lbl Task-Create") + "\", urlInfoArray));");
                    result.Append("var urlInfoArray = new Array(\"frame\", \"roles.aspx?action=taskdelete&LangType=" + m_refAPI.RequestInformationRef.ContentLanguage + "\", \"ek_main\");");
                    result.Append("InsertFile(level3, CreateLink(\"" + objMessage.GetMessage("lbl Task-Delete") + "\", urlInfoArray));");
                    result.Append("var urlInfoArray = new Array(\"frame\", \"roles.aspx?action=taskredirect&LangType=" + m_refAPI.RequestInformationRef.ContentLanguage + "\", \"ek_main\");");
                    result.Append("InsertFile(level3, CreateLink(\"" + objMessage.GetMessage("lbl Task-Redirect") + "\", urlInfoArray));");
                    result.Append("var urlInfoArray = new Array(\"frame\", \"roles.aspx?action=taxonomyadministrator&LangType=" + m_refAPI.RequestInformationRef.ContentLanguage + "\", \"ek_main\");");
                    result.Append("InsertFile(level3, CreateLink(\"" + objMessage.GetMessage("lbl Taxonomy Administrator") + "\", urlInfoArray));");
                    result.Append("var urlInfoArray = new Array(\"frame\", \"roles.aspx?action=templateconfig&LangType=" + m_refAPI.RequestInformationRef.ContentLanguage + "\", \"ek_main\");");
                    result.Append("InsertFile(level3, CreateLink(\"" + objMessage.GetMessage("lbl Template Configuration") + "\", urlInfoArray));");
                    result.Append("var urlInfoArray = new Array(\"frame\", \"roles.aspx?action=useradmin&LangType=" + m_refAPI.RequestInformationRef.ContentLanguage + "\", \"ek_main\");");
                    result.Append("InsertFile(level3, CreateLink(\"" + objMessage.GetMessage("lbl User Admin") + "\", urlInfoArray));");
                    result.Append("var urlInfoArray = new Array(\"frame\", \"roles.aspx?action=translationstateadmin&LangType=" + m_refAPI.RequestInformationRef.ContentLanguage + "\", \"ek_main\");");
                    result.Append("InsertFile(level3, CreateLink(\"" + objMessage.GetMessage("lbl translation state admin") + "\", urlInfoArray));");
                    result.Append("var urlInfoArray = new Array(\"frame\", \"roles.aspx?action=xliffadmin&LangType=" + m_refAPI.RequestInformationRef.ContentLanguage + "\", \"ek_main\");");
                    result.Append("InsertFile(level3, CreateLink(\"" + objMessage.GetMessage("lbl XLIFF admin") + "\", urlInfoArray));");
                    //Personalization
                    //result.Append("level4 = InsertFolder(level3, CreateFolderInstance(\"" + objMessage.GetMessage("lbl personalizations") + "\", \"\"));");
                    //result.Append("var urlInfoArray = new Array(\"frame\", \"roles.aspx?action=personalizationadmin&LangType=" + m_refAPI.RequestInformationRef.ContentLanguage + "\", \"ek_main\");");
                    //result.Append("InsertFile(level4, CreateLink(\"" + objMessage.GetMessage("lbl Admins") + "\", urlInfoArray));");
                    //result.Append("var urlInfoArray = new Array(\"frame\", \"roles.aspx?action=personalizationaddonly&LangType=" + m_refAPI.RequestInformationRef.ContentLanguage + "\", \"ek_main\");");
                    //result.Append("InsertFile(level4, CreateLink(\"" + objMessage.GetMessage("alt add web parts") + "\", urlInfoArray));");
                    //result.Append("var urlInfoArray = new Array(\"frame\", \"roles.aspx?action=personalizationeditonly&LangType=" + m_refAPI.RequestInformationRef.ContentLanguage + "\", \"ek_main\");");
                    //result.Append("InsertFile(level4, CreateLink(\"" + objMessage.GetMessage("alt edit web parts properties") + "\", urlInfoArray));");
                    //result.Append("var urlInfoArray = new Array(\"frame\", \"roles.aspx?action=personalizationmoveonly&LangType=" + m_refAPI.RequestInformationRef.ContentLanguage + "\", \"ek_main\");");
                    //result.Append("InsertFile(level4, CreateLink(\"" + objMessage.GetMessage("alt move web parts") + "\", urlInfoArray));");
                    result.Append("level3 = InsertFolder(level2, CreateFolderInstance(\"" + objMessage.GetMessage("lbl folder specific") + "\", \"\"));");
                    result.Append("var urlInfoArray = new Array(\"frame\", \"roles.aspx?action=folderuseradmin&LangType=" + m_refAPI.RequestInformationRef.ContentLanguage + "\", \"ek_main\");");
                    result.Append("InsertFile(level3, CreateLink(\"" + objMessage.GetMessage("lbl Folder User Admin") + "\", urlInfoArray));");
                    result.Append("var urlInfoArray = new Array(\"frame\", \"roles.aspx?action=moveorcopy&LangType=" + m_refAPI.RequestInformationRef.ContentLanguage + "\", \"ek_main\");");
                    result.Append("InsertFile(level3, CreateLink(\"" + objMessage.GetMessage("lbl move or copy") + "\", urlInfoArray));");
                    result.Append("var urlInfoArray = new Array(\"frame\", \"roles.aspx?action=managecustompermissions&LangType=" + m_refAPI.RequestInformationRef.ContentLanguage + "\", \"ek_main\");");
                    result.Append("InsertFile(level1, CreateLink(\"" + objMessage.GetMessage("lbl custom permissions") + "\", urlInfoArray));");

                }
                //Roles Ends
                if (!IsSystemAccount)
                {
                    //Business Rules
                    result.Append("var urlInfoArray = new Array(\"frame\", \"businessrules/ruleset.aspx\", \"ek_main\");");
                    result.Append("InsertFile(TopTreeLevel, CreateLink(\"" + objMessage.GetMessage("lbl Business Rules") + "\", urlInfoArray));");
                    //Business Rules Ends

                    bool EnableClassicCalendar = false;
                    bool.TryParse(ConfigurationManager.AppSettings["ek_enableClassicCalendar"], out EnableClassicCalendar);
                    if (EnableClassicCalendar)
                    {
                        //Calendar
                        result.Append("var urlInfoArray = new Array(\"frame\", \"cmscalendar.aspx?action=ViewAllCalendars\", \"ek_main\");");
                        result.Append("InsertFile(TopTreeLevel, CreateLink(\"" + objMessage.GetMessage("calendar lbl") + "\", urlInfoArray));");
                        //Calendar Ends
                    }

                }

                //User Groups
                if (IsAdmin)
                {
                    result.Append("var urlInfoArray = new Array(\"frame\", \"users.aspx?action=viewallgroups&LangType=" + m_refAPI.RequestInformationRef.ContentLanguage + "&grouptype=0\", \"ek_main\");");
                    result.Append("InsertFile(TopTreeLevel, CreateLink(\"" + objMessage.GetMessage("generic User Groups") + "\", urlInfoArray));");
                }
                else
                {
                    if (objContentRef.IsARoleMember(Convert.ToInt64(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.AdminUsers), currentUserID, false))
                    {
                        result.Append("var urlInfoArray = new Array(\"frame\", \"users.aspx?action=viewallgroups&LangType=" + m_refAPI.RequestInformationRef.ContentLanguage + "&grouptype=0\", \"ek_main\");");
                        result.Append("level1 = InsertFolder(TopTreeLevel, CreateFolderInstance(\"" + objMessage.GetMessage("generic User Groups") + "\", urlInfoArray));");
                    }
                }
                //User Groups Ends

                //Users
                if (IsAdmin || (objContentRef.IsARoleMember(Convert.ToInt64(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.AdminUsers), currentUserID, false)))
                {
                    result.Append("var urlInfoArray = new Array(\"frame\", \"users.aspx?backaction=viewallusers&action=viewallusers&LangType=" + m_refAPI.RequestInformationRef.ContentLanguage + "&grouptype=0&groupid=2&id=2&FromUsers=1\", \"ek_main\");");
                    result.Append("InsertFile(TopTreeLevel, CreateLink(\"" + objMessage.GetMessage("generic Users") + "\", urlInfoArray));");
                }
                else
                {
                    result.Append("var urlInfoArray = new Array(\"frame\", \"users.aspx?action=View&grouptype=0&LangType=" + m_refAPI.RequestInformationRef.ContentLanguage + "&groupid=2&id=" + currentUserID + "\", \"ek_main\");");
                    result.Append("level1 = InsertFolder(TopTreeLevel, CreateFolderInstance(\"" + objMessage.GetMessage("generic User Profile") + "\", urlInfoArray));");
                }

            }
            else if ((TreeRequested) == ("report"))
            {
                result.Append("var urlInfoArray = new Array(\"frame\", \"\", \"ek_main\");");
                result.Append("TopTreeLevel = CreateFolderInstance(\"" + objMessage.GetMessage("generic reports title") + "\", urlInfoArray);");

                //Commerce
                if (Ektron.Cms.DataIO.LicenseManager.LicenseManager.IsFeatureEnable(m_refAPI.RequestInformationRef, Feature.eCommerce) && (IsAdmin || m_refAPI.IsARoleMember(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.CommerceAdmin)))
                {

                    result.Append("var urlInfoArray = new Array(\"frame\", \"\", \"ek_main\");");
                    result.Append("level2 = InsertFolder(TopTreeLevel, CreateFolderInstance(\"" + objMessage.GetMessage("lbl commerce") + "\", \"\"));");
                    result.Append("var urlInfoArray = new Array(\"frame\", \"Commerce/reporting/CustomerReports.aspx?page=normal\", \"ek_main\");");
                    result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl customer reports") + "\", urlInfoArray));");
                    result.Append("var urlInfoArray = new Array(\"frame\", \"Commerce/inventory.aspx\", \"ek_main\");");
                    result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl inventory reports") + "\", urlInfoArray));");
                    result.Append("var urlInfoArray = new Array(\"frame\", \"Commerce/reporting/KeyPerformanceIndicators.aspx\", \"ek_main\");");
                    result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl key performance indicators") + "\", urlInfoArray));");
                    result.Append("var urlInfoArray = new Array(\"frame\", \"Commerce/reporting/PaymentReports.aspx\", \"ek_main\");");
                    result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl payment reports") + "\", urlInfoArray));");
                    result.Append("var urlInfoArray = new Array(\"frame\", \"Commerce/reporting/SalesTrend.aspx\", \"ek_main\");");
                    result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl sales trend") + "\", urlInfoArray));");
                    result.Append("var urlInfoArray = new Array(\"frame\", \"Commerce/reporting/TopProducts.aspx\", \"ek_main\");");
                    result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl top products") + "\", urlInfoArray));");

                }

                //Add a New folder for Content reports
                result.Append("var urlInfoArray = new Array(\"frame\", \"\", \"ek_main\");");
                result.Append("level2 = InsertFolder(TopTreeLevel, CreateFolderInstance(\"" + objMessage.GetMessage("lbl web alert contents") + "\", urlInfoArray));");

                result.Append("var urlInfoArray = new Array(\"frame\", \"approval.aspx?action=viewApprovalList&location=workarea\", \"ek_main\");");
                result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("generic Approvals") + "\", urlInfoArray));");

                result.Append("var urlInfoArray = new Array(\"frame\", \"reports.aspx?action=ViewCheckedIn\", \"ek_main\");");
                result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("content reports checked in title") + "\", urlInfoArray));");
                if (IsAdmin)
                {
                    result.Append("var urlInfoArray = new Array(\"frame\", \"reports.aspx?action=ViewCheckedOut\", \"ek_main\");");
                }
                else
                {
                    result.Append("var urlInfoArray = new Array(\"frame\", \"reports.aspx?action=ViewCheckedOut&interval=&filtertype=USER&filterId=" + m_refContentApi.RequestInformationRef.UserId + "&orderby=\", \"ek_main\");");
                }
                result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("content reports checked out title") + "\", urlInfoArray));");

                result.Append("var urlInfoArray = new Array(\"frame\", \"reports.aspx?action=ViewNewContent\", \"ek_main\");");
                result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("content reports new title") + "\", urlInfoArray));");

                result.Append("var urlInfoArray = new Array(\"frame\", \"reports.aspx?action=ViewSubmitted\", \"ek_main\");");
                result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("content reports submitted title") + "\", urlInfoArray));");

                result.Append("var urlInfoArray = new Array(\"frame\", \"reports.aspx?action=ViewPending\", \"ek_main\");");
                result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("content reports pending title") + "\", urlInfoArray));");

                result.Append("var urlInfoArray = new Array(\"frame\", \"reports.aspx?action=ViewRefreshReport\", \"ek_main\");");
                result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("content reports refresh title") + "\", urlInfoArray));");

                result.Append("var urlInfoArray = new Array(\"frame\", \"reports.aspx?action=ViewExpired\", \"ek_main\");");
                result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("content reports expired title") + "\", urlInfoArray));");

                result.Append("var urlInfoArray = new Array(\"frame\", \"reports.aspx?action=ViewToExpire&interval=10\", \"ek_main\");");
                result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl expire all smrtdesk") + "\", urlInfoArray));");

                result.Append("var urlInfoArray = new Array(\"frame\", \"reports.aspx?action=SiteUpdateActivity\", \"ek_main\");");
                result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl Site Update Activity Content Report") + "\", urlInfoArray));");

                result.Append("var urlInfoArray = new Array(\"frame\", \"reports.aspx?action=ViewAsynchLogFile\", \"ek_main\");");
                result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl Asynchronous Log File Report") + "\", urlInfoArray));");

                result.Append("var urlInfoArray = new Array(\"frame\", \"reports.aspx?action=ViewSearchPhraseReport\", \"ek_main\");");
                result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl Search Phrase Report") + "\", urlInfoArray));");

                if (PerReadOnly)
                {
                    SiteAPI m_refSiteApi = new SiteAPI();
                    SettingsData setting_data = new SettingsData();
                    setting_data = m_refSiteApi.GetSiteVariables(m_refSiteApi.UserId);
                    if (setting_data.EnablePreApproval)
                    {
                        result.Append("var urlInfoArray = new Array(\"frame\", \"reports.aspx?action=ViewPreapproval\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl Preapproval Groups") + "\", urlInfoArray));");
                    }
                }

                result.Append("var urlInfoArray = new Array(\"frame\", \"BadLinkCheck.aspx\", \"ek_main\");");
                result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl Bad Link Report") + "\", urlInfoArray));");

                result.Append("var urlInfoArray = new Array(\"frame\", \"reports.aspx?action=ContentFlags\", \"ek_main\");");
                result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl flag report") + "\", urlInfoArray));");

                result.Append("var urlInfoArray = new Array(\"frame\", \"reports.aspx?action=ContentReviews\", \"ek_main\");");
                result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl review report") + "\", urlInfoArray));");

                //Site Analytics
                Ektron.Cms.Analytics.IAnalytics dataManager = ObjectFactory.GetAnalytics();
                if (Ektron.Cms.DataIO.LicenseManager.LicenseManager.IsFeatureEnable(m_refAPI.RequestInformationRef, Feature.WebSiteAnalytics) && dataManager.IsAnalyticsViewer())
                {
                    result.AppendLine("var urlInfoArray = new Array(\"frame\", \"\", \"ek_main\");");
                    result.AppendLine("level1 = InsertFolder(TopTreeLevel, CreateFolderInstance(\"" + m_refAPI.EkMsgRef.GetMessage("lbl site analytics") + "\", urlInfoArray));");
                    System.Collections.Generic.List<string> analyticsProviders = new System.Collections.Generic.List<string>();
                    analyticsProviders = dataManager.GetProviderList();
                    if (analyticsProviders.Count() > 0)
                    {
                        foreach (string providerName in analyticsProviders)
                        {
                            string folderName = providerName;
                            if (providerName == "Google")
                                folderName = objMessage.GetMessage("generic google");
                            else if (providerName == "WebTrends")
                                folderName = objMessage.GetMessage("Generic WebTrends");
                            else if(providerName =="SiteCatalyst" )
                                folderName = objMessage.GetMessage("Generic SiteCatalyst");
                            result.AppendLine("var urlInfoArray = new Array(\"frame\", \"\", \"ek_main\");");
                            result.AppendLine("level2 = InsertFolder(level1, CreateFolderInstance(\"" + folderName + "\", urlInfoArray));"); //
                            string providerType = dataManager.GetProviderType(providerName);
                            if ((string)(providerType) == "Ektron.Cms.Analytics.Providers.GoogleAnalyticsProvider")
                            {
                                AppendTreeItems(result, (System.Web.UI.HtmlControls.HtmlGenericControl)GoogleAnalyticsContainer.TreeContainer, 2, providerName, true);
                            }
                            else if ((string)(providerType) == "Ektron.Cms.Analytics.Providers.WebTrendsProvider")
                            {
                                AppendTreeItems(result, (System.Web.UI.HtmlControls.HtmlGenericControl)WebTrendsContainer.GetTreeContainer(providerName), 2, providerName, false);
                            }
                            else if ((string)(providerType) == "Ektron.Cms.Analytics.Providers.SiteCatalystProvider")
                            {
                                AppendTreeItems(result, (System.Web.UI.HtmlControls.HtmlGenericControl)SiteCatalystContainer.TreeContainer, 2, providerName, true);
                            }
                            else
                            {
                            }
                        }
                    }
                    result.Append("var urlInfoArray = new Array(\"frame\", \"Analytics/reporting/reports.aspx?report=CmsSearchTerms\", \"ek_main\");");
                    result.Append("InsertFile(level1, CreateLink(\"" + objMessage.GetMessage("analytics searches") + "\", urlInfoArray));");
                }
                //Site Analytics Ends

                //Pre Version 8 Analytics
                bool EnableClassicAnalytics;
                bool.TryParse(ConfigurationManager.AppSettings["ek_enableClassicAnalytics"], out EnableClassicAnalytics);
                if (EnableClassicAnalytics)
                {
                    result.Append("var urlInfoArray = new Array(\"frame\", \"ContentAnalytics.aspx\", \"ek_main\");");
                    result.Append("level1 = InsertFolder(TopTreeLevel, CreateFolderInstance(\"" + m_refAPI.EkMsgRef.GetMessage("lbl pre8 site analytics") + "\", urlInfoArray));");

                    result.Append("var urlInfoArray = new Array(\"frame\", \"ContentAnalytics.aspx?type=content\", \"ek_main\");");
                    result.Append("InsertFile(level1, CreateLink(\"" + m_refAPI.EkMsgRef.GetMessage("top content") + "\", urlInfoArray));");
                    result.Append("var urlInfoArray = new Array(\"frame\", \"ContentAnalytics.aspx?type=page\", \"ek_main\");");
                    result.Append("InsertFile(level1, CreateLink(\"" + m_refAPI.EkMsgRef.GetMessage("lbl top templates") + "\", urlInfoArray));");
                    result.Append("var urlInfoArray = new Array(\"frame\", \"ContentAnalytics.aspx?type=referring\", \"ek_main\");");
                    result.Append("InsertFile(level1, CreateLink(\"" + m_refAPI.EkMsgRef.GetMessage("top referrers") + "\", urlInfoArray));");
                    result.Append("var urlInfoArray = new Array(\"frame\", \"reports.aspx?action=ViewSearchPhraseReport\", \"ek_main\");");
                    result.Append("InsertFile(level1, CreateLink(\"" + m_refAPI.EkMsgRef.GetMessage("lbl Search Phrase Report") + "\", urlInfoArray));");
                }
                //Pre Version 8 Analytics Ends

                //new tasks folder
                result.Append("level2 = InsertFolder(TopTreeLevel, CreateFolderInstance(\"" + objMessage.GetMessage("lbl Tasks") + "\", \"\"));");
                result.Append("var urlInfoArray = new Array(\"frame\", \"tasks.aspx?action=ViewTasks&ty=all\", \"ek_main\");");
                if (IsAdmin)
                {
                    result.Append("level3 = InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl All Open Tasks") + "\", urlInfoArray));");
                }
                result.Append("var urlInfoArray = new Array(\"frame\", \"tasks.aspx?action=ViewTasks&ty=both\", \"ek_main\");");
                result.Append("level3 = InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("assigned by and to me") + "\", urlInfoArray));");
                result.Append("var urlInfoArray = new Array(\"frame\", \"tasks.aspx?action=ViewTasks&ty=to\", \"ek_main\");");
                result.Append("level3 = InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl Assigned to me") + "\", urlInfoArray));");
                result.Append("var urlInfoArray = new Array(\"frame\", \"tasks.aspx?action=ViewTasks&ty=by\", \"ek_main\");");
                result.Append("level3 = InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl Assigned by me") + "\", urlInfoArray));");
                result.Append("var urlInfoArray = new Array(\"frame\", \"tasks.aspx?action=ViewTasks&ty=created\", \"ek_main\");");
                result.Append("level3 = InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl Created by me") + "\", urlInfoArray));");
                result.Append("var urlInfoArray = new Array(\"frame\", \"tasks.aspx?action=ViewTasks&ty=touser\", \"ek_main\");");
                result.Append("level3 = InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl Assigned to User") + "\", urlInfoArray));");
                result.Append("var urlInfoArray = new Array(\"frame\", \"tasks.aspx?action=ViewTasks&ty=notstarted\", \"ek_main\");");
                result.Append("level3 = InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl Not Started") + "\", urlInfoArray));");
                result.Append("var urlInfoArray = new Array(\"frame\", \"tasks.aspx?action=ViewTasks&ty=active\", \"ek_main\");");
                result.Append("level3 = InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("Active label") + "\", urlInfoArray));");
                result.Append("var urlInfoArray = new Array(\"frame\", \"tasks.aspx?action=ViewTasks&ty=awaitingdata\", \"ek_main\");");
                result.Append("level3 = InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl Awaiting Data") + "\", urlInfoArray));");
                result.Append("var urlInfoArray = new Array(\"frame\", \"tasks.aspx?action=ViewTasks&ty=onhold\", \"ek_main\");");
                result.Append("level3 = InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl On hold") + "\", urlInfoArray));");
                result.Append("var urlInfoArray = new Array(\"frame\", \"tasks.aspx?action=ViewTasks&ty=pending\", \"ek_main\");");
                result.Append("level3 = InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl Pending") + "\", urlInfoArray));");
                result.Append("var urlInfoArray = new Array(\"frame\", \"tasks.aspx?action=ViewTasks&ty=reopened\", \"ek_main\");");
                result.Append("level3 = InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl Reopened") + "\", urlInfoArray));");
                result.Append("var urlInfoArray = new Array(\"frame\", \"tasks.aspx?action=ViewTasks&ty=completed\", \"ek_main\");");
                result.Append("level3 = InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl Completed") + "\", urlInfoArray));");
                result.Append("var urlInfoArray = new Array(\"frame\", \"tasks.aspx?action=ViewTasks&ty=archived\", \"ek_main\");");
                if (IsAdmin)
                {
                    result.Append("level3 = InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl Archived") + "\", urlInfoArray));");
                }
                result.Append("var urlInfoArray = new Array(\"frame\", \"tasks.aspx?action=ViewTasks&ty=deleted\", \"ek_main\");");
                if (IsAdmin)
                {
                    result.Append("level3 = InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl Deleted") + "\", urlInfoArray));");
                }

            }
            if (TreeRequested != "smartdesktop" && TreeRequested != "help")
            {
                result.Append("if (IsValid())" + "\r\n");
                result.Append("InitializeFolderControl();" + "\r\n");
            }
            //result.AppendLine("}); // Ektron.ready")
            result.AppendLine("//-->");
            result.AppendLine("</script>");
            result.Append("<script type=\"text/javascript\">" + "\r\n");
            result.Append("<!--" + "\r\n");
            result.Append("function OpenWorkareaFolder() {" + "\r\n");
            if (Request.QueryString["autonav"] != "")
            {
                result.Append("OpenFolder(\"" + Strings.Replace(EkFunctions.HtmlEncode(Request.QueryString["autonav"]), "\\", "\\\\", 1, -1, 0) + "\", false);" + "\r\n");
            }
            result.Append("}" + "\r\n");
            result.Append("OpenWorkareaFolder();" + "\r\n");
            result.Append("//--></script>" + "\r\n");
        }
        catch (Exception ex)
        {
            result.Length = 0;
            result.Append(ex.ToString());
        }
        finally
        {
        }
        return (result.ToString());
    }
Esempio n. 5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Packages.jQuery.jQueryUI.ThemeRoller.Register(this);
            Packages.jQuery.jQueryUI.Tabs.Register(this);
            Packages.jQuery.jQueryUI.Datepicker.Register(this);

            ICmsContextService cmsContextService = ServiceFactory.CreateCmsContextService();
            JS.RegisterJSInclude(this, cmsContextService.UIPath + "/js/jQuery/Plugins/globinfo/ektron.glob." + ClientCulture.Name + ".js", "EktronGlobalCulture_" + ClientCulture.Name + "_JS");
            JS.RegisterJSInclude(this, JS.ManagedScript.EktronBlockUiJS);
            JS.RegisterJSInclude(this, ContentApi.AppPath + "WebCalendar/DefaultTemplate/timeselector/jquery.ptTimeSelect.js", "WebCalendarAdvancedFormTimePickerJS");
            JS.RegisterJSInclude(this, ContentApi.AppPath + "WebCalendar/defaulttemplate/advancedform.js", "WebCalendarAdvancedFormJS");

            labelfortitle.Text = ContentApi.EkMsgRef.GetMessage("generic title label");
            labelforlocation.Text = ContentApi.EkMsgRef.GetMessage("generic location") + ":";

            UpdateButton.ValidationGroup = Owner.ValidationGroup;
            UpdateButton.CommandName = Mode == AdvancedFormMode.Edit ? "Update" : "Insert";
            UpdateButton.Command += new CommandEventHandler(CommandHandler);
            CancelButton.Command += new CommandEventHandler(CancelButton_Command);
            AdvancedEditCloseButton.Command += new CommandEventHandler(CancelButton_Command);

            AdvCalendarSelect.Visible = (Provider.DataSources.Count > 1);
            long lastselectedfolder = Folder;
            sourceSelector.Items.Clear();

            foreach (EventRadScheduleProvider.CalendarData cd in Provider.DataSources)
            {
                if (cd.PermissionData.CanAdd)
                {
                    FolderData fd = ContentApi.GetFolderById(cd.FolderID, false, false);
                    IsEventSearchable = fd.IscontentSearchable;
                    Ektron.Cms.API.User.User uapi = new Ektron.Cms.API.User.User();
                    Ektron.Cms.API.Community.CommunityGroup cgapi = new Ektron.Cms.API.Community.CommunityGroup();
                    if (fd != null)
                    {
                        string name = "";
                        switch (cd.sourceType)
                        {
                            case Ektron.Cms.Controls.SourceType.SystemCalendar:
                                name = "System Calendar: " + fd.Name + " (ID: " + cd.FolderID + ")";
                                break;
                            case Ektron.Cms.Controls.SourceType.GroupCalendar:
                                CommunityGroupData cgd = cgapi.GetCommunityGroupByID(cd.defaultId);
                                name = "Group Calendar: " + cgd.GroupName + " (Group ID: " + cd.defaultId + ")";
                                break;
                            case Ektron.Cms.Controls.SourceType.UserCalendar:
                                UserData thisUser = uapi.GetUser(cd.defaultId, false, true);
                                if (cd.defaultId == 0 || cd.defaultId == ContentApi.UserId)
                                {
                                    name = "My Calendar (" + thisUser.DisplayUserName + ")";
                                }
                                else
                                {
                                    name = "User Calendar: " + thisUser.DisplayUserName + " (User ID: " + cd.defaultId + ")";
                                }
                                break;
                        }
                        sourceSelector.Items.Add(new ListItem(name, cd.FolderID.ToString() + "|" + cd.SelectedTaxID.ToString()));
                    }
                }
            }
            if (Provider.DataSources.Count == 1)
            {
                SelectedTaxID = Provider.DataSources[0].SelectedTaxID;
                Folder = Provider.DataSources[0].FolderID;
            }
            if (sourceSelector.SelectedValue == string.Empty && sourceSelector.Items.Count > 0)
            {
                sourceSelector.Items[0].Selected = true;
            }
            if (lastselectedfolder != 0)
            {
                Folder = lastselectedfolder;
            }
            if (EventData != null)
            {
                Folder = EventData.FolderId;
                sourceSelector.Enabled = false;
            }
            if (Folder > 0)
            {
                TaxonomySelector.FolderID = Folder;
                MetadataSelector.FolderID = Folder;
                if (Ektron.Cms.DataIO.LicenseManager.LicenseManager.IsFeatureEnable(ContentApi.RequestInformationRef, Ektron.Cms.DataIO.LicenseManager.Feature.UrlAliasing, false))
                {
                    Ektron.Cms.UrlAliasing.UrlAliasSettingsApi _aliasSettings = new Ektron.Cms.UrlAliasing.UrlAliasSettingsApi();
                    FolderData fd = ContentApi.GetFolderById(Folder, false, false);
                    if (_aliasSettings.IsManualAliasEnabled)
                    {
                        if (ContentApi.IsARoleMember(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.EditAlias))
                        {
                            phAliases.Visible = phAliasTab.Visible = pnlManualAlias.Visible = true;
                            aliasRequired.InnerText = fd.AliasRequired.ToString().ToLower();
                        }
                    }
                    if (_aliasSettings.IsAutoAliasEnabled)
                    {
                        System.Collections.Generic.List<UrlAliasAutoData> autoAliasList = new System.Collections.Generic.List<UrlAliasAutoData>();
                        Ektron.Cms.UrlAliasing.UrlAliasAutoApi autoAliasApi = new Ektron.Cms.UrlAliasing.UrlAliasAutoApi();
                        phAliases.Visible = phAliasTab.Visible = pnlAutoAlias.Visible = true;
                        if (EventData != null)
                        {
                            autoAliasList = autoAliasApi.GetListForContent(EventData.Id);
                            rpAutoAlias.DataSource = autoAliasList;
                        }
                    }

                     //-------------------DisplayTabs Based on selected options from Folder properties----------------------------------
                    if (((fd.DisplaySettings & (int)EkEnumeration.FolderTabDisplaySettings.AllTabs) == (int)EkEnumeration.FolderTabDisplaySettings.AllTabs) && fd.DisplaySettings != 0)
                    {

                        if ((fd.DisplaySettings & (int)EkEnumeration.FolderTabDisplaySettings.MetaData) == (int)EkEnumeration.FolderTabDisplaySettings.MetaData)
                        {
                          phMetadata.Visible=  MetadataSelector.Visible = true;
                        }
                        else
                        {
                            if (!MetadataSelector.MetadataRequired)
                                phMetadata.Visible = MetadataSelector.Visible = false;
                        }
                        if ((_aliasSettings.IsManualAliasEnabled || _aliasSettings.IsAutoAliasEnabled) && _contentApi.IsARoleMember(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.EditAlias)) //And Not (m_bIsBlog)
                        {
                            if ((fd.DisplaySettings & (int)EkEnumeration.FolderTabDisplaySettings.Aliasing) == (int)EkEnumeration.FolderTabDisplaySettings.Aliasing)
                            { phAliases.Visible = phAliasTab.Visible = pnlManualAlias.Visible = pnlAutoAlias.Visible = true; }
                            else
                            {
                                if (!fd.AliasRequired)
                                    phAliases.Visible = phAliasTab.Visible = pnlManualAlias.Visible = pnlAutoAlias.Visible = false;
                            }
                        }

                        if ((fd.DisplaySettings & (int)EkEnumeration.FolderTabDisplaySettings.Taxonomy) == (int)EkEnumeration.FolderTabDisplaySettings.Taxonomy)
                        { phTaxonomyTab.Visible = phTaxonomy.Visible = true; }
                        else
                        {
                            if (!fd.IsCategoryRequired)
                                phTaxonomyTab.Visible = phTaxonomy.Visible = false;
                        }

                    }
                    //-------------------DisplayTabs Based on selected options from Folder properties End-----------------------------
                }
            }

            if (!FormInitialized)
            {
                initHiddenData();
                InitializeManualAliases();
                PrefillEventControls();
                PrefillRecurrenceControls();
                UpdateResetExceptionsVisibility();
                bool failed = false;
                string initform = String.Format("Ektron.WebCalendar.AdvancedForm.init(\"{0}\", \"{1}\", {2});", Owner.ClientID, ContentApi.AppPath, ContentApi.RequestInformationRef.WorkAreaOperationMode.ToString().ToLower());
                try
                {
                    JavaScript.RegisterJavaScriptBlock(this, initform);
                }
                catch
                {
                    failed = true;
                }
                if (failed || Controls.IsReadOnly)
                {
                    //we're apparently in a full postback which doesn't care for registerjsblock
                    extrascript.Text = "<script type=\"text/javascript\" defer=\"defer\"> window.setTimeout(function(){" + initform + "}, 750); </script>";
                    extrascript.Visible = true;
                }
            }
            else
            {
                extrascript.Visible = false;
            }
            btnHelp.Text = "<li class=\"actionbarDivider\">&nbsp;</li>" + m_refStyle.GetHelpButton("editevent", "");
        }
Esempio n. 6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            Session["EkDavSessionVal"] = null;
        }
        jsMetaUrl.Text = "";
        _messageHelper = contentAPI.EkMsgRef;
        if (!Ektron.Site.SiteData.Current.User.IsLoggedIn)
        {
            Response.Redirect(contentAPI.ApplicationPath + "reterror.aspx?info=" + Server.UrlEncode(_messageHelper.GetMessage("msg login cms user")), false);
            return;
        }
        RegisterResources();
        //set help link
        aHelp.HRef = "#Help";
        aHelp.Attributes.Add("onclick", "window.open('" + contentAPI.fetchhelpLink("add_assets") + "', '', 'width=800,height=500,resizable=yes,toolbar=no,scrollbars=yes,location=no,directories=no,status=no,menubar=no,copyhistory=no');return false;");
        ExplorerDragDrop dropuploader = new ExplorerDragDrop();
        if (Request.QueryString["mode"] == null || Request.QueryString["mode"] == "0")
        {
            if (Request.QueryString["addforlang"] == null || Request.QueryString["addforlang"] == "0")
            {
                if (Request.QueryString["id"] != null && Request.QueryString["id"] != "")
                {
                    _folderID = Convert.ToInt64(Request.QueryString["id"]);
                    dropuploader.FolderID = _folderID;
                }
                else
                {
                    if (Request.QueryString["folder_id"] != null && Request.QueryString["folder_id"] != "")
                        _folderID = Convert.ToInt64(Request.QueryString["folder_id"]);
                    else
                        _folderID = Convert.ToInt64(Request.QueryString["mode_id"]);
                    dropuploader.FolderID = _folderID;
                }
            }
            else
            {
                if (Request.QueryString["id"] != null && Request.QueryString["id"] != "")
                    dropuploader.AssetID = Request.QueryString["id"];
                else
                    dropuploader.AssetID = Request.QueryString["mode_id"];

                if (((Request.QueryString["lang_id"] != null) && Microsoft.VisualBasic.Information.IsNumeric(Request.QueryString["lang_id"]) && (0 < Convert.ToInt32(Request.QueryString["lang_id"]))))
                {
                    _contentLanguage = Convert.ToInt32(Request.QueryString["lang_id"]);
                    dropuploader.ContentLanguage = _contentLanguage;
                }
                _folderID = Convert.ToInt64(Request.QueryString["folder_id"]);
                dropuploader.FolderID = _folderID;
            }
        }
        else
        {
            if (Request.QueryString["id"] != null && Request.QueryString["id"] != "")
            {
                dropuploader.AssetID = Request.QueryString["id"];
            }
            else
            {
                dropuploader.AssetID = Request.QueryString["mode_id"];
            }
            _folderID = Convert.ToInt64(Request.QueryString["folder_id"]);
            dropuploader.FolderID = _folderID;
        }
        if (Request.QueryString["lang_id"] != null && Request.QueryString["lang_id"] != "")
        {
            _contentLanguage = Convert.ToInt32(Request.QueryString["lang_id"]);
            dropuploader.ContentLanguage = _contentLanguage;
        }
        if (Request.QueryString["TaxonomyId"] != null && Request.QueryString["TaxonomyId"] != "")
        {
            dropuploader.TaxonomyId = Convert.ToInt64(Request.QueryString["TaxonomyId"]);
            _taxonomyIdList = Request.QueryString["TaxonomyId"].ToString();
        }

        this.isImage.Value = "0";
        if (Request.QueryString["isimage"] != null && Request.QueryString["isimage"] != "")
        {
            dropuploader.IsImage = Convert.ToInt32(Request.QueryString["isimage"]);
            if (dropuploader.IsImage == 1)
                this.isImage.Value = "1";
        }

        if (Request.QueryString["overrideextension"] != null && Request.QueryString["overrideextension"] != "")
        {
            dropuploader.OverrideExtension = Request.QueryString["overrideextension"];
        }
        if (Request.QueryString["hidecancel"] != null && Request.QueryString["hidecancel"] == "true")
        {
            btnCancel.Visible = false;
        }

        if (Request.QueryString["isimagegallery"] != null && Request.QueryString["isimagegallery"] == "true")
        {
            _isImageGallery = true;
        }

        if (contentAPI.EkContentRef.DoesFolderRequireMetadataOrTaxonomy(_folderID, _contentLanguage))
        {
            isMetadataOrTaxonomyRequired = true;
        }
        isUrlAliasRequired = false;

        fdTmp = this.contentAPI.EkContentRef.GetFolderById(_folderID);

        Ektron.Cms.UrlAliasing.UrlAliasSettingsApi m_urlAliasSettings = new Ektron.Cms.UrlAliasing.UrlAliasSettingsApi();

        if (m_urlAliasSettings.IsManualAliasEnabled)
        {
            if (fdTmp.AliasRequired)
            {
                isUrlAliasRequired = true;
            }
        }

        //Hide Multiple and Dragdrop
        if (Request.QueryString["hideMultiple"] != null && Request.QueryString["hideMultiple"] == "true")
        {
            hideMultiple = true;
        }

        //Force the extension to be same
        if (Request.QueryString["forceExtension"] != null && Request.QueryString["forceExtension"] == "true")
        {
            forceExtension.Value = "true";
            oldfilename.Value = GetOldFileName(Convert.ToInt64(Request.QueryString["AssetID"])); //AssetID= ContentID
        }

        //If the browser if firefox, showing the drag drop tab
        if (Request.Browser.Type.IndexOf("Firefox") != -1)
        {
            //If updatemode of assetcontrol, do not display drag and drop tab.
            if ((Request.QueryString["mode"] == null || (Request.QueryString["mode"] != null && Request.QueryString["mode"] != "1")) && !hideMultiple)
            {
                liDragDrop.Visible = true;
                tabDragDrop.Visible = true;
                tabDragDrop.Controls.Add(dropuploader);
            }
        }

        assetcontrolupdate.Value = "";
        //If updatemode, doesn't make sense to display multiple dms as one can only select one file.
        if ((Request.QueryString["mode"] != null && Request.QueryString["mode"] == "1") )
        {
            liMultipleDMS.Visible = false;
            tabMultipleDMS.Visible = false;
            assetcontrolupdate.Value = "update";
            long id = 0;
            Int64.TryParse(dropuploader.AssetID, out id);
            oldfilename.Value = GetOldFileName(id);

        }
        else if(hideMultiple)
        {
            liMultipleDMS.Visible = false;
            tabMultipleDMS.Visible = false;
        }

        bool _useSSL = Ektron.Cms.Common.EkFunctions.GetConfigBoolean("ek_UseOffloadingSSL", false);
        string _scheme = string.Empty;
        if (_useSSL)
            _scheme = "https";
        else
            _scheme = Page.Request.Url.Scheme;

        NextUsing.Value = _scheme + Uri.SchemeDelimiter + Page.Request.Url.Authority + contentAPI.ApplicationPath + "content.aspx";

        content_id.Value = "-1";
        content_folder.Value = _folderID.ToString();
        content_language.Value = _contentLanguage.ToString();
        content_teaser.Value = FillImageGalleryDescription();
        requireMetaTaxonomy.Value = isMetadataOrTaxonomyRequired.ToString();
        taxonomyselectedtree.Value = _taxonomyIdList.ToString();

        string filetypes = "";
        if (this.isImage.Value == "1")
        {
            string[] AllowedFileTypes = null;
            if (DocumentManagerData.Instance.FileTypes.Length > 0)
            {
                AllowedFileTypes = DocumentManagerData.Instance.FileTypes.Split(',');
                if (AllowedFileTypes != null && AllowedFileTypes.Length > 0)
                {
                    foreach (string filetype in AllowedFileTypes)
                    {
                        if (EkFunctions.IsImage(filetype.Trim().Replace("*", "")))
                        {
                            if (filetypes.Length > 0)
                                filetypes += "," + filetype;
                            else
                                filetypes = filetype;
                        }
                    }
                }
            }
        }
        else
            filetypes = DocumentManagerData.Instance.FileTypes;

        HtmlGenericControl linebreak = new HtmlGenericControl("div");
        linebreak.InnerHtml += "<div id='divFileTypes'> " + _messageHelper.GetMessage("lbl valid file types") + "<p class='dmsSupportedFileTypes'>" + filetypes + "</p></div>";
        linebreak.InnerHtml += "<div id=idMultipleView style='display:inline'>";
        linebreak.InnerHtml += "<script type=\"text/javascript\">" + Environment.NewLine;
        linebreak.InnerHtml += " AC_AX_RunContent('id','idUploadCtl','name','idUploadCtl','classid','CLSID:07B06095-5687-4d13-9E32-12B4259C9813','width','100%','height','350px');" + Environment.NewLine;
        linebreak.InnerHtml += Environment.NewLine + " </script> </div> " + Environment.NewLine;

        //Checkif ManualAlias is required by this folder

        if (isUrlAliasRequired)
        {
            jsfolderRequireManualAlias.Text = "true";
            jsManualAliasAlert.Text = _messageHelper.GetMessage("js:url aliasing is required dms mupload");// "Url aliasing is required for this folder. Non-image assets will be uploaded but unpublished.";
        }

        if (Request.Cookies[DMSCookieName]!=null && !string.IsNullOrEmpty(Request.Cookies[DMSCookieName].Value))
        {
            pnl_versionToggle.Visible = pnl_DMSMultiUpload.Visible = true;
            pnl_OfficeVerSelector.Visible = false;

            if (Request.Cookies[DMSCookieName].Value == "2010")
            {
                ExplorerDragDrop edd = new ExplorerDragDrop();
                if (Request.QueryString["TaxonomyId"] != null && Request.QueryString["TaxonomyId"] != "")
                {
                    edd.TaxonomyId = Convert.ToInt64(Request.QueryString["TaxonomyId"]);
                }
                edd.ContentLanguage = this._contentLanguage;
                destination.Value = edd.GetFolderPath(_folderID).Replace(Page.Request.Url.GetLeftPart(UriPartial.Authority), "");
                putopts.Value = "false";
                btnMUpload.OnClientClick = "return MultipleDocumentUpload(0);";
                lbtn_toggleVersion.Attributes.Add("onclick", string.Format(_messageHelper.GetMessage("js office version toggle confirm format"), _messageHelper.GetMessage("li text office 2010 name")));
                lbtn_toggleVersion.Text = _messageHelper.GetMessage("lbtn dms switch office version")+"(Office 2010 selected)";
            }
            else
            {
                if (this.isImage.Value == "1")
                {
                    destination.Value = _scheme + Uri.SchemeDelimiter + this.Page.Request.Url.Authority + contentAPI.ApplicationPath + "processMultiupload.aspx?close=true&isimage=" + this.isImage.Value+"&searc="+fdTmp.IscontentSearchable;
                    PostURL.Value = _scheme + Uri.SchemeDelimiter + this.Page.Request.Url.Authority + contentAPI.ApplicationPath + "processMultiupload.aspx?close=true&isimage=" + this.isImage.Value + "&searc=" + fdTmp.IscontentSearchable;
                }
                else
                {
                    destination.Value = _scheme + Uri.SchemeDelimiter + this.Page.Request.Url.Authority + contentAPI.ApplicationPath + "processMultiupload.aspx?close=true&searc="+fdTmp.IscontentSearchable;
                    PostURL.Value = _scheme + Uri.SchemeDelimiter + this.Page.Request.Url.Authority + contentAPI.ApplicationPath + "processMultiupload.aspx?close=true&searc=" + fdTmp.IscontentSearchable;
                }
                putopts.Value = "true";
                btnMUpload.OnClientClick = "MultipleDocumentUpload(1);";
                lbtn_toggleVersion.Attributes.Add("onclick", string.Format(_messageHelper.GetMessage("js office version toggle confirm format"), _messageHelper.GetMessage("li text other office ver name")));
                lbtn_toggleVersion.Text = _messageHelper.GetMessage("lbtn dms switch office version")+"(Office 2003/2007 selected)";

            }
            tabMultipleDMS.Controls.Add(linebreak);
        }
        else
        {
            pnl_versionToggle.Visible = pnl_DMSMultiUpload.Visible = false;
            pnl_OfficeVerSelector.Visible = true;
        }

        GenerateStrings();
        if (Request.QueryString["showtab"] != null && Request.QueryString["showtab"] == "multiple")
        {
            ltrNoUpload.Text = _messageHelper.GetMessage("lbl upload file");
            ClientScript.RegisterStartupScript(this.GetType(), "selectTab", "var ddTabs = $ektron('#DMStabs').tabs({select: function(event, ui){ReSizeContainer(ui);}}); ddTabs.tabs('select', 1);", true);
        }
    }
Esempio n. 7
0
    private void ProcessPage(string filename, string assetId, bool fileChanged, List<AssetFileData> assetIdFileNameList)
    {
        System.Text.StringBuilder result = new System.Text.StringBuilder();
        string[] Files;
        string[] AssetIds;
        string[] MimeTypes;
        string[] Extensions;
        int i = 0;
        int lMultiType = 0;
        Ektron.Cms.Common.AssetData[] asset_list;
        Ektron.Cms.Common.ContentResponseData[] AddMultiResult;
        Collection cMetadataTypes = new Collection();
        Collection cCont = new Collection();
        Collection cContRet = new Collection();
        string editaction = Request.Form["editaction"];
        int iContLoop = 1;
        string strSearchText = "";
        string go_live = "";
        string end_date = "";
        string end_date_action = "";
        string[] acMetaInfo = new string[4];
        long MetaCount = 0;
        Collection page_subscription_data = new Collection();
        Collection page_sub_temp = new Collection();
        Array arrSubscriptions;
        SubscriptionPropertiesData sub_prop_data = new SubscriptionPropertiesData();
        int isub = 0;
        string contentCount = "";
        long intContentId;
        Ektron.Cms.API.Metadata metaDataAPI = new Ektron.Cms.API.Metadata();
        CustomAttributeList MetaFields = new CustomAttributeList();

        if (assetIdFileNameList != null)
        {
            Files = new string[assetIdFileNameList.Count - 1 + 1];
            AssetIds = new string[assetIdFileNameList.Count - 1 + 1];
            MimeTypes = new string[assetIdFileNameList.Count - 1 + 1];
            Extensions = new string[assetIdFileNameList.Count - 1 + 1];
            for (int index = 0; index <= assetIdFileNameList.Count - 1; index++)
            {
                Files[index] = Path.GetFileName((string)(assetIdFileNameList[index].FileName));
                AssetIds[index] = (string)(assetIdFileNameList[index].AssetId);
                MimeTypes[index] = ConfigManager.GetMimeTypeForExt(ConfigManager.GetExtensionFromName(Files[index]));
                Extensions[index] = Path.GetExtension(Files[index]);
            }
        }
        else
        {
            Files = new string[] { Path.GetFileName(filename) };
            AssetIds = new string[] { assetId };
            MimeTypes = new string[] { ConfigManager.GetMimeTypeForExt(ConfigManager.GetExtensionFromName(filename)) };
            Extensions = new string[] { Path.GetExtension(filename) };
        }
        if (AppUI.UserId == 0)
        {
            throw (new Exception("Invalid User"));
        }

        lMultiType = GetAddMultiType();
        string TaxonomyTreeIdList = "";
        if ((Request.QueryString["taxoverride"] != null) && Convert.ToInt64(Request.QueryString["taxoverride"]) != 0)
        {
            TaxonomyTreeIdList = Request.QueryString["taxoverride"];
        }
        if (Request.Form["taxonomyselectedtree"] != null)
        {
            TaxonomyTreeIdList = Request.Form["taxonomyselectedtree"];
            if (TaxonomyTreeIdList.Trim().EndsWith(","))
            {
                TaxonomyTreeIdList = TaxonomyTreeIdList.Substring(0, TaxonomyTreeIdList.Length - 1);
            }
        }
        cCont.Add(TaxonomyTreeIdList, "Taxonomy", null, null);
        asset_list = new Ektron.Cms.Common.AssetData[Files.Length - 1 + 1];

        if ((actionType != "add") && (Request.Form["content_id"] != "-1" && Request.Form["content_id"] != "0"))
        {
            cCont.Add(AssetIds[0], m_AssetInfoKeys[0], null, null);
            cCont.Add("", m_AssetInfoKeys[1], null, null);
            cCont.Add(Files[0], m_AssetInfoKeys[2], null, null);
            cCont.Add(MimeTypes[0], m_AssetInfoKeys[3], null, null);
            cCont.Add(Extensions[0], m_AssetInfoKeys[4], null, null);
        }
        else
        {
            if (Path.GetFileName(filename) != "" || Files.Length > 0)
            {
                for (i = 0; i <= Files.Length - 1; i++)
                {
                    asset_list[i] = new Ektron.Cms.Common.AssetData();
                    asset_list[i].Id = AssetIds[i];
                    asset_list[i].FileName = Files[i];
                    if (ConfigManager.GetMimeTypeForExt(Path.GetExtension(filename)) == "")
                    {
                        asset_list[i].MimeType = "";
                    }
                    else
                    {
                        asset_list[i].MimeType = MimeTypes[i];
                    }
                    asset_list[i].FileExtension = Extensions[i];
                    asset_list[i].Type = lMultiType;
                    asset_list[i].Language = ContentLanguage;
                }
            }
            cCont.Add(AssetIds, "AssetIds", null, null);
        }
        if (editaction == null)
        {
            editaction = "publish";
        }
        cCont.Add(editaction, "Mode", null, null);
        if ((actionType == "add") || (Request.Form["content_id"] == "-1" || Request.Form["content_id"] == "0"))
        {
            cCont.Add(true, "BatchProcess", null, null);
            cCont.Add(asset_list, "AssetInfo", null, null);
        }
        cCont.Add(ContentLanguage, "ContentLanguage", null, null);
        cCont.Add(Request.Form["content_folder"], "FolderID", null, null);
        cCont.Add(Request.Form["mycollection"], "MyCollection", null, null);

        if (Request.Form["content_html"] == null)
        {
            cCont.Add("", "ContentHtml", null, null);
        }
        else
        {
            cCont.Add(Request.Form["content_html"], "ContentHtml", null, null);
        }

        if (Request.Form["content_id"] != "-1" && Request.Form["content_id"] != "0")
        {
            if (Convert.ToInt32(Request.Form["content_type"]) == 104)
            {
                cCont.Add("", "MediaText", null, null);
            }
            if (Request.Form["content_type"] != null)
            {
                cCont.Add(Request.Form["content_type"], "ContentType", null, null);
            }
            else
            {
                cCont.Add(lMultiType, "ContentType", null, null);
            }
        }
        else
        {
            cCont.Add(Request.Form["content_type"], "ContentType", null, null);
        }

        if (Convert.ToInt32(Request.Form["content_type"]) == 104)
        {
            if (Request.Form["content_html"] != null)
            {
                if (Request.Form["content_html"] != "")
                {
                    cCont.Remove("MediaText");
                    cCont.Add(Request.Form["content_html"].Replace("&", "&amp;"), "MediaText", null, null);
                    cCont.Remove("ContentHtml");
                    cCont.Add(Request.Form["content_html"], "ContentHtml", null, null);
                }
                else
                {
                    if (EkFunctions.DoesKeyExist(cCont, "MediaText"))
                    {
                        cCont.Remove("MediaText");
                    }
                    cCont.Add("", "MediaText", null, null);
                }
            }
            else
            {
                cCont.Remove("MediaText");
                cCont.Add("", "MediaText", null, null);
            }
        }

        string strContentTitle = "";
        if (!String.IsNullOrEmpty(Request.Form["content_title"]))
        {
            strContentTitle = Request.Form["content_title"];
        }
        else if (contentCount == null)
        {
            strContentTitle = Path.GetFileName(Files[0]);
        }
        string strImage = "";
        if (!String.IsNullOrEmpty(Request.Form["content_image"]))
        {
            strImage = Request.Form["content_image"];
        }
        else
        {
            strImage = "";
        }
        cCont.Add(strImage, "Image", null, null);
        cCont.Add(Request.Form["LockedContentLink"], "LockedContentLink", null, null);
        cCont.Add(strContentTitle, "ContentTitle", null, null);
        cCont.Add(Request.Form["content_comment"], "Comment", null, null);
        if (!String.IsNullOrEmpty(Request.Form["content_id"]) && Request.Form["content_id"] != "-1" && Request.Form["content_id"] != "0")
        {
            cCont.Add(Request.Form["content_id"], "ContentID", null, null);
        }
        else
        {
            cCont.Add(0, "ContentID", null, null);
        }

        if (!String.IsNullOrEmpty(Request.Form["frm_validcounter"]))
        {
            MetaCount = System.Convert.ToInt32(Request.Form["frm_validcounter"]);
            for (i = 1; i <= MetaCount; i++)
            {
                acMetaInfo[1] = Request.Form["frm_meta_type_id_" + i];
                if (Request.Form["content_id"] != "-1" && Request.Form["content_id"] != "0")
                {
                    acMetaInfo[2] = Request.Form["content_id"];
                }
                else
                {
                    acMetaInfo[2] = ""; // adding content, so no content ID
                }
                acMetaInfo[3] = Request.Form["frm_text_" + i];
                cMetadataTypes.Add(acMetaInfo, i.ToString(), null, null);
                acMetaInfo = new string[4];
            }
        }
        //Image Gallery metadata
        acMetaInfo = UpdateMetadataContent();
        if (acMetaInfo != null)
        {
            cMetadataTypes.Add(acMetaInfo, System.Convert.ToString(cMetadataTypes.Count + 1), null, null);
        }

        cCont.Add(Request.Form["createtask"], "CreateTask", null, null);
        cCont.Add(Request.QueryString["addto"], "AddToCollectionType", null, null);

        if (!String.IsNullOrEmpty(Request.QueryString["mycollection"]))
        {
            cCont.Add(Request.QueryString["mycollection"], "MyCollection", null, null);
        }
        else if (!String.IsNullOrEmpty(Request.Form["mycollection"]))
        {
            cCont.Add(Request.Form["mycollection"], "MyCollection", null, null);
        }
        cCont.Add(cMetadataTypes, "ContentMetadata", null, null);
        if (!String.IsNullOrEmpty(Request.Form["ekImagegalleryDescription"]))
        {
            cCont.Add(Request.Form["ekImagegalleryDescription"], "ContentTeaser", null, null);
        }
        else
        {
            if (Request.Form["content_teaser"] != null)
            {
                cCont.Add(Request.Form["content_teaser"], "ContentTeaser", null, null);
            }
            else
            {
                cCont.Add("", "ContentTeaser", null, null);
            }
        }

        while (Strings.Len(Request.Form["searchtext" + iContLoop]) > 0)
        {
            strSearchText = strSearchText + Request.Form["searchtext" + iContLoop];
            iContLoop = System.Convert.ToInt32(iContLoop + 1);
        }
        cCont.Add(strSearchText, "SearchText", null, null);

        if (Request.Form["go_live"] != "")
        {
            try
            {
                go_live = DateTime.Parse(Strings.Trim(Request.Form["go_live"])).ToString();
            }
            catch (Exception)
            {
                // ignore exceptions
            }
        }
        if (Request.Form["end_date"] != "")
        {
            try
            {
                end_date = DateTime.Parse(Strings.Trim(Request.Form["end_date"])).ToString();
            }
            catch (Exception)
            {
                //ignore exceptions
            }
            end_date_action = Request.Form["end_date_action_radio"];
        }
        cCont.Add(go_live, "GoLive", null, null);
        cCont.Add(end_date, "EndDate", null, null);
        cCont.Add(end_date_action, "EndDateAction", null, null);
        // dropupload should always add the quicklink

        if (!((Strings.Len(Request.Form["suppressnotification"])) > 0))
        {
            sub_prop_data.BreakInheritance = true;
            if (!String.IsNullOrEmpty(Request.Form["send_notification_button"]))
            {
                sub_prop_data.SendNextNotification = true;
                sub_prop_data.SuspendNextNotification = false;
            }
            else
            {
                sub_prop_data.SendNextNotification = false;
            }
            if (Request.Form["notify_option"] == ("Always"))
            {
                sub_prop_data.NotificationType = Ektron.Cms.Common.EkEnumeration.SubscriptionPropertyNotificationTypes.Always;
            }
            else if (Request.Form["notify_option"] == ("Initial"))
            {
                sub_prop_data.NotificationType = Ektron.Cms.Common.EkEnumeration.SubscriptionPropertyNotificationTypes.Initial;
                if (!(actionType == "update")) // if new, then set flag to email out
                {
                    sub_prop_data.SendNextNotification = true;
                    sub_prop_data.SuspendNextNotification = false;
                }
                else
                {
                    if (!String.IsNullOrEmpty((Request.Form["send_notification_button"])))
                    {
                        sub_prop_data.SendNextNotification = true;
                        sub_prop_data.SuspendNextNotification = false;
                    }
                    else
                    {
                        sub_prop_data.SendNextNotification = false;
                    }
                }
            }
            else if (Request.Form["notify_option"] == ("Never"))
            {
                sub_prop_data.NotificationType = Ektron.Cms.Common.EkEnumeration.SubscriptionPropertyNotificationTypes.Never;
            }
            if (!String.IsNullOrEmpty(Request.Form["suspend_notification_button"]))
            {
                sub_prop_data.SuspendNextNotification = true;
                sub_prop_data.SendNextNotification = false;
            }
            else
            {
                sub_prop_data.SuspendNextNotification = false;
            }
            sub_prop_data.OptOutID = Convert.ToInt64(Request.Form["notify_optoutid"]);
            if (!String.IsNullOrEmpty(Request.Form["use_message_button"]))
            {
                sub_prop_data.DefaultMessageID = Convert.ToInt64(Request.Form["notify_messageid"]);
            }
            else
            {
                sub_prop_data.DefaultMessageID = 0;
            }
            if (!String.IsNullOrEmpty(Request.Form["use_summary_button"]))
            {
                sub_prop_data.SummaryID = 1;
            }
            else
            {
                sub_prop_data.SummaryID = 0;
            }
            if (!String.IsNullOrEmpty(Request.Form["use_content_button"]))
            {
                sub_prop_data.ContentID = Convert.ToInt64(Request.Form["frm_content_id"]);
            }
            else
            {
                sub_prop_data.ContentID = 0;
            }
            sub_prop_data.UnsubscribeID = Convert.ToInt64(Request.Form["notify_unsubscribeid"]);

            if (!String.IsNullOrEmpty(Request.Form["notify_url"]))
            {
                sub_prop_data.URL = Request.Form["notify_url"];
            }
            else
            {
                sub_prop_data.URL = Request.ServerVariables["HTTP_HOST"];
            }

            if (!String.IsNullOrEmpty(Request.Form["notify_weblocation"]))
            {
                sub_prop_data.FileLocation = Server.MapPath(m_refContApi.AppPath + "subscriptions");
            }
            else
            {
                sub_prop_data.FileLocation = Server.MapPath(m_refContApi.AppPath + "subscriptions");
            }
            if (!String.IsNullOrEmpty(Request.Form["notify_weblocation"]))
            {
                sub_prop_data.WebLocation = Request.Form["notify_weblocation"];
            }
            else
            {
                sub_prop_data.WebLocation = "subscriptions";
            }
            if (!String.IsNullOrEmpty(Request.Form["notify_subject"]))
            {
                sub_prop_data.Subject = Request.Form["notify_subject"];
            }
            else
            {
                sub_prop_data.Subject = "";
            }
            if (!String.IsNullOrEmpty(Request.Form["notify_emailfrom"]))
            {
                sub_prop_data.EmailFrom = Request.Form["notify_emailfrom"];
            }
            else
            {
                sub_prop_data.EmailFrom = "";
            }

            sub_prop_data.UseContentTitle = "";

            if (!String.IsNullOrEmpty(Request.Form["use_contentlink_button"]))
            {
                sub_prop_data.UseContentLink = 1;
            }
            else
            {
                sub_prop_data.UseContentLink = 0;
            }

            if (!String.IsNullOrEmpty(Request.Form["content_sub_assignments"]))
            {
                arrSubscriptions = Strings.Split(Strings.Trim(Request.Form["content_sub_assignments"]), " ", -1, 0);
                if (arrSubscriptions.Length > 0)
                {
                    for (isub = 0; isub <= (arrSubscriptions.Length - 1); isub++)
                    {
                        page_sub_temp = new Collection();
                        page_sub_temp.Add(long.Parse(Strings.Mid(arrSubscriptions.GetValue(isub).ToString(), 10)), "ID", null, null);
                        page_subscription_data.Add(page_sub_temp, null, null, null);
                    }
                }
            }
            else
            {
                page_subscription_data = null;
            }
            page_sub_temp = null;

            if (!((Request.Form["content_id"] != "-1") && (Request.Form["content_id"] != "0") && (actionType != "add")))
            {
                if (!((contentCount == null) && (actionType != "multiple,add")))
                {
                    cCont.Add(sub_prop_data, "SubscriptionProperties", null, null);
                    cCont.Add(page_subscription_data, "Subscriptions", null, null);
                }
            }
        }

        if ((Request.Form["AddQlink"] == "AddQlink") || (editaction == ""))
        {
            cCont.Add(true, "AddToQlink", null, null);
        }
        else
        {
            //in case Drag and drop AddQlink is nothing
            if (Request.Form["AddQlink"] == null)
            {
                cCont.Add(true, "AddToQlink", null, null);
            }
            else if (Request.Form["AddQlink"] == "")
            {
                cCont.Add(true, "AddToQlink", null, null);
            }
            else if (Request.Form["AddQlink"] == "1")
            {
                cCont.Add(true, "AddToQlink", null, null);
            }
            else
            {
                cCont.Add(false, "AddToQlink", null, null);
            }
        }

        if (Request.Form["IsSearchable"] == "IsSearchable")
        {
            cCont.Add(true, "IsSearchable", null, null);
        }
        else
        {
            //in case Drag and drop IsSearchable is nothing
            if (Request.Form["IsSearchable"] == null)
            {

                cCont.Add(false, "IsSearchable", null, null);
            }
        }

        if (Request.Form["templateSelect"] != "")
        {
            cCont.Add(Request.Form["templateSelect"], "MultiTemplateID", null, null);
        }

        long manualAliasId;
        manualAliasId = System.Convert.ToInt64(Request.Form["frm_manalias_id"]);
        m_prevManualAliasName = Request.Form["prev_frm_manalias_name"];
        m_prevManualAliasExt = Request.Form["prev_frm_manalias_ext"];
        m_currManualAliasName = Request.Form["frm_manalias"];
        m_currManualAliasExt = Request.Form["frm_manaliasExt"];
        cCont.Add(manualAliasId, "UrlAliasId", null, null);
        cCont.Add(m_currManualAliasName, "NewUrlAliasName", null, null);
        cCont.Add(m_currManualAliasExt, "NewUrlAliasExt", null, null);
        cCont.Add(m_prevManualAliasName, "OldUrlAliasName", null, null);
        cCont.Add(m_prevManualAliasExt, "OldUrlAliasExt", null, null);

        if (Request.Form["Method"] == "updatepublish")
        {
            m_refContent.CheckContentOutv2_0(Convert.ToInt64(Request.Form["ContentId"]));
        }

        cCont.Add(fileChanged, "FileChanged", null, null);

        if ((Request.Form["content_id"] != "-1") && (Request.Form["content_id"] != "0") && (actionType != "add") && Request.Form["translate"] != "true")
        {

            intContentId = Convert.ToInt64(Request.Form["content_id"]);

            try
            {

                m_refContent.CheckContentOutv2_0(intContentId);
                m_refContent.SaveContentv2_0(cCont);
                if (!((Request.Form["suppress_notification"]) != ""))
                {
                    m_refContent.UpdateSubscriptionPropertiesForContent(intContentId, sub_prop_data);
                    m_refContent.UpdateSubscriptionsForContent(intContentId, page_subscription_data);
                }

                // process tag info
                ProcessTags(intContentId, ContentLanguage);

                if (editaction == "checkin")
                {
                    m_refContent.CheckIn(intContentId, "");
                }
                if (editaction == "publish")
                {
                    m_refContent.CheckIn(intContentId, "");
                    m_refContent.SubmitForPublicationv2_0(intContentId, Convert.ToInt64(Request.Form["FolderID"]), "");
                }
                if (Request.Form["Toolbar"] == "True")
                {
                    if (cCont["AssetFilename"].ToString().IndexOf(".dot") > 1)
                    {
                        m_refContent.UpdateDocumentMetadata(cCont["AssetID"].ToString(), intContentId, -1, "");
                    }
                }
                if (Request.Form["FromEE"] == "true" || Request.QueryString["close"] == "true")
                {
                    if (Request.QueryString["close"] == "true")
                    {
                        Response.Redirect("close.aspx?reload=true", false);
                    }
                    else
                    {
                        Response.Redirect("close.aspx", false);
                    }
                }
                else
                {
                    //if save was clicked redirect to edit screen else content.aspx
                    if (editaction == "save")
                    {
                        string queryStr = "";
                        long taxonomyId;
                        if ((Request.Form["TaxonomyOverrideId"] != null) && (long.TryParse(Request.Form["TaxonomyOverrideId"], out taxonomyId)) && (taxonomyId > 0))
                        {
                            queryStr = (string)("&TaxonomyId=" + Request.Form["TaxonomyOverrideId"]);
                        }
                        if ((!(Request.QueryString["pullapproval"] == null)) && (Request.QueryString["pullapproval"].Length > 0))
                        {
                            queryStr += (string)("&pullapproval=" + Request.QueryString["pullapproval"]);
                        }
                        Response.Redirect((string)("edit.aspx?close=false&LangType=" + ContentLanguage.ToString() + "&id=" + intContentId + "&type=update&back_file=content.aspx&back_action=View&back_folder_id=" + Request.Form["content_folder"] + "&back_id=" + intContentId + "&back_callerpage=content.aspx&back_origurl=action%3dViewContentByCategory%26id%3d" + Request.Form["content_folder"] + "&back_LangType=" + ContentLanguage + queryStr), false);
                    }
                    else
                    {
                        Response.Redirect((string)("content.aspx?id=" + Request.Form["content_id"] + "&action=viewstaged&LangType=" + ContentLanguage), false);
                    }
                }
            }
            catch (Exception ex)
            {
                Utilities.ShowError(ex.Message);
            }
        }
        else
        {
            if (((contentCount == null) && (actionType != "multiple,add")) || Request.Form["translate"] == "true")
            {
                try
                {
                    if (Request.Form["Method"] == "copy")
                    {
                        cCont.Add(true, "DontCreateAsset", null, null);
                        cCont.Remove("ContentID");
                        cCont.Add(Request.Form["ContentId"], "ContentID", null, null);
                    }
                    AddMultiResult = m_refContent.AddMultiContent(cCont);
                    intContentId = AddMultiResult[0].ContentId; //m_refContent.AddNewContentv2_0(cCont);
                    if (!((Request.Form["suppress_notification"]) != ""))
                    {
                        m_refContent.UpdateSubscriptionPropertiesForContent(intContentId, sub_prop_data);
                        m_refContent.UpdateSubscriptionsForContent(intContentId, page_subscription_data);
                    }

                    // process tag info
                    ProcessTags(intContentId, ContentLanguage);
                    /*
                    if (editaction == "checkin")
                    {
                        m_refContent.CheckIn(intContentId, "");
                    }
                    if (editaction == "publish")
                    {
                        m_refContent.CheckIn(intContentId, "");
                        m_refContent.SubmitForPublicationv2_0(intContentId, Convert.ToInt64(Request.Form["FolderID"]), "");
                    }*/
                    if (Request.Form["Toolbar"] == "True")
                    {
                        if (cCont["AssetFilename"].ToString().IndexOf(".dot") > 1)
                        {
                            m_refContent.UpdateDocumentMetadata(cCont["AssetID"].ToString(), intContentId, -1, "");
                        }
                    }
                }
                catch (Exception ex)
                {
                    Utilities.ShowError(ex.Message);
                }
                if (Request.Form["FromEE"] == "true" || Request.QueryString["close"] == "true")
                {
                    if (Request.QueryString["close"] == "true")
                    {
                        Response.Redirect("close.aspx?reload=true", false);
                    }
                    else
                    {
                        Response.Redirect("close.aspx", false);
                    }
                }
                else
                {
                    Response.Redirect((string)("content.aspx?id=" + Request.Form["content_folder"] + "&action=ViewContentByCategory&LangType=" + ContentLanguage), false);
                }
            }
            else
            {
                bool isUrlAliasRequired = false;

                FolderData fdTmp = this.m_refContApi.EkContentRef.GetFolderById(long.Parse(Request.Form["content_folder"]));
                searc = fdTmp.IscontentSearchable;
                Ektron.Cms.UrlAliasing.UrlAliasSettingsApi m_urlAliasSettings = new Ektron.Cms.UrlAliasing.UrlAliasSettingsApi();

                if (m_urlAliasSettings.IsManualAliasEnabled)
                {
                    if (fdTmp.AliasRequired)
                    {
                        isUrlAliasRequired = true;
                    }
                }

                AddMultiResult = m_refContent.AddMultiContent(cCont);
                for (i = 0; i <= AddMultiResult.Length - 1; i++)
                {
                    if (AddMultiResult[i].ErrorMessage != null && AddMultiResult[i].ErrorMessage.Length > 0)
                    {
                        //make sure an error code is returned if there is an error message!
                        result.Append(AddMultiResult[i].ErrorMessage);
                        Utilities.ShowError(result.ToString());
                        return;
                    }
                    else
                    {
                        ContentData cdTmp = this.m_refContent.GetContentById(AddMultiResult[i].ContentId);
                        //------------ContentSearchable----------------------
                        if(Request.UrlReferrer.Segments.Count(x=>x.ToLower()=="edit.aspx")==0) // run the next line only if the url is not coming from edit.aspx
                            IsContentSearchableSection(AddMultiResult[i].ContentId);
                        //--------------ContentSearchable End-------------
                        bool isImage = ConfigManager.IsImageAsset(cdTmp.AssetData.FileExtension);
                        if (!isImage && isUrlAliasRequired && ( isCallerDmsDragDropCtl ||  Request.Form["FromMenuMultiDMS"]!=null) )
                        {
                            if (cdTmp.Status == "A")//only need to process published content
                            {
                                m_refContent.CheckContentOutv2_0(AddMultiResult[i].ContentId);
                                m_refContent.CheckIn(AddMultiResult[i].ContentId, "");
                            }

                        }

                        if (Request.Form["Toolbar"] == "True")
                        {
                            if (Files[i].IndexOf(".dot") > 1)
                            {
                                m_refContent.UpdateDocumentMetadata(AssetIds[i], System.Convert.ToInt64(cCont["FolderID"]), -1, AddMultiResult[i].AssetVersion);
                            }
                        }

                        // process tag info
                        ProcessTags(AddMultiResult[i].ContentId, ContentLanguage);
                    }
                }
                //If some invalid file types did not get uploaded
                if ((actionType == "multiple,add") && (isCallerDmsDragDropCtl == false) && (Session[Convert.ToString(userId) + Convert.ToString(loginToken) + "RejectedFiles"] != null) && (Session[Convert.ToString(userId) + Convert.ToString(loginToken) + "RejectedFiles"].ToString().Length > 0))
                {
                    if (Request.Form["FromEE"] == "true" || Request.QueryString["close"] == "true")
                    {
                        if (Request.QueryString["close"] == "true")
                        {
                            Response.Redirect("close.aspx?reload=true", false);
                        }
                        else
                        {
                            Response.Redirect("close.aspx", false);
                        }
                    }
                    else
                    {
                        Response.Redirect((string)("content.aspx?id=" + Request.Form["content_folder"] + "&action=ViewContentByCategory&LangType=" + ContentLanguage), false);
                    }
                }
                else
                {
                    if (isCallerDmsDragDropCtl == true && Request.Form["requireMetaTaxonomy"].ToString().ToLower() == "true")
                    {
                        string _taxString = string.Empty;
                        string _idString = string.Empty;
                        string _contentId = string.Empty;
                        foreach (Ektron.Cms.Common.ContentResponseData multiData in AddMultiResult)
                        {
                            if (_idString.Length == 0)
                            {
                                _contentId = multiData.ContentId.ToString();
                            }
                            _idString += multiData.ContentId + ",";
                        }
                        Boolean metadataOrTaxonomyRequired = false;
                        if (!string.IsNullOrEmpty(Request.Form["requireMetaTaxonomy"]) && Request.Form["requireMetaTaxonomy"].ToLower().ToString() == "true")
                        {
                            metadataOrTaxonomyRequired = true;
                        }
                        if (metadataOrTaxonomyRequired)
                        {
                            if ((Request.Form["taxonomyselectedtree"] != null) && Request.Form["taxonomyselectedtree"].ToString().Length > 1)
                            {
                                _taxString = (string)("&taxonomyId=" + Request.Form["taxonomyselectedtree"].ToString());
                            }
                            Response.Redirect((string)("DMSMetadata.aspx?contentId=" + _contentId + "&idString=" + _idString + "&close=true&displayUrlAlias=false&folderId=" + Request.Form["content_folder"] + _taxString), false);
                        }
                    }
                    if (AddMultiResult != null && AddMultiResult.Length == 1)
                    {
                        if (Request.Form["FromEE"] == "true" || Request.QueryString["close"] == "true")
                        {
                            if (Request.QueryString["close"] == "true")
                            {
                                Response.Redirect("close.aspx?reload=true", false);
                            }
                            else
                            {
                                Response.Redirect("close.aspx", false);
                            }
                        }
                        else
                        {
                            //if save was clicked redirect to edit screen else content.aspx
                            if (editaction == "save")
                            {
                                string queryStr = "";
                                long taxonomyId;
                                if ((Request.Form["TaxonomyOverrideId"] != null) && (long.TryParse(Request.Form["TaxonomyOverrideId"], out taxonomyId)) && (taxonomyId > 0))
                                {
                                    queryStr = (string)("&TaxonomyId=" + Request.Form["TaxonomyOverrideId"]);
                                }
                                if ((!(Request.QueryString["pullapproval"] == null)) && (Request.QueryString["pullapproval"].Length > 0))
                                {
                                    queryStr += (string)("&pullapproval=" + Request.QueryString["pullapproval"]);
                                }
                                Response.Redirect((string)("edit.aspx?close=false&LangType=" + ContentLanguage.ToString() + "&id=" + AddMultiResult[0].ContentId + "&type=update&back_file=content.aspx&back_action=View&back_folder_id=" + Request.Form["content_folder"] + "&back_id=" + AddMultiResult[0].ContentId + "&back_callerpage=content.aspx&back_origurl=action%3dViewContentByCategory%26id%3d" + Request.Form["content_folder"] + "&back_LangType=" + ContentLanguage + queryStr), false);
                            }
                            else
                            {
                                //If coming from DragDropCtl.aspx, close thickbox
                                if (isCallerDmsDragDropCtl == true)
                                {
                                    //if any rejected files, display error message before closing thickbox
                                    if ((Session[Convert.ToString(userId) + Convert.ToString(loginToken) + "RejectedFiles"] != null) && Session[Convert.ToString(userId) + Convert.ToString(loginToken) + "RejectedFiles"].ToString() != "")
                                    {
                                        this.jsInvalidFiles.Text = m_refMsg.GetMessage("lbl error message for multiupload") + " " + Session[Convert.ToString(userId) + Convert.ToString(loginToken) + "RejectedFiles"].ToString().Replace("\\", "\\\\").Replace("\'", "\\\'");
                                        this.jsInvalidFiles.Text += "\\n" + m_refMsg.GetMessage("js:cannot add file with add and plus");
                                        this.uxAlertInvalidFileType.Visible = true;
                                        Session.Remove(Convert.ToString(userId) + Convert.ToString(loginToken) + "RejectedFiles");

                                    }
                                    this.uxCloseThickBox.Visible = true;
                                }
                                else
                                {
                                    Response.Redirect((string)("content.aspx?id=" + AddMultiResult[0].ContentId + "&action=viewstaged&LangType=" + ContentLanguage), false);
                                }
                            }
                        }
                    }
                    else
                    {
                        if (Request.Form["FromEE"] == "true" || Request.QueryString["close"] == "true")
                        {
                            if (Request.QueryString["close"] == "true")
                            {
                                Response.Redirect("close.aspx?reload=true", false);
                            }
                            else
                            {
                                Response.Redirect("close.aspx", false);
                            }
                        }
                        else
                        {
                            if (isCallerDmsDragDropCtl == true)
                            {
                                this.uxCloseThickBox.Visible = true;
                            }
                            else
                            {
                                Response.Redirect((string)("content.aspx?id=" + Request.Form["content_folder"] + "&action=ViewContentByCategory&LangType=" + ContentLanguage), false);
                            }
                        }
                    }
                }
            }
        }
    }
Esempio n. 8
0
    private void ProcessUploadOffice2010()
    {
        try
        {
            string File = null;
            Int64 contentID = -1;
            Collection cCont = new Collection();

            ContentEditData cData = null;
            int MetaCount = -1;
            //if (Session["EkDavSessionASDList"] == null)
            //{
            //    ClientScript.RegisterStartupScript(this.GetType(), "selectTab", "alert('" + this.m_refContApi.EkMsgRef.GetMessage("lbl no files selected for multiupload") + "')", true);
            //    return;
            //}
            //if (((List<Ektron.Cms.AssetFileData>)Session["EkDavSessionASDList"]).Count == 0)
            //{
            //    ClientScript.RegisterStartupScript(this.GetType(), "selectTab", "alert('" + this.m_refContApi.EkMsgRef.GetMessage("lbl no files selected for multiupload") + "')", true);
            //    return;
            //}
            foreach (NameValueCollection item in (List<System.Collections.Specialized.NameValueCollection>)Session["EkDavSessionASDList"])
            {
                if (Int64.TryParse(item.Keys[0], out contentID))
                {
                    if (contentID == -1)
                        continue;

                    cData = m_refContent.GetContentForEditing(contentID);
                    cData.Comment = Request.Form["content_comment"];
                    cData.IsSearchable = (Request.Form["IsSearchable"] == "IsSearchable");
                    cData.Teaser = Request.Form["content_teaser"];

                    if (Request.Form["go_live"] != "")
                    {
                        try { cData.GoLive = DateTime.Parse(Strings.Trim(Request.Form["go_live"])).ToString(); }
                        catch (Exception) { }
                    }
                    if (Request.Form["end_date"] != "")
                    {
                        try { cData.EndDate = DateTime.Parse(Strings.Trim(Request.Form["end_date"])).ToString(); }
                        catch (Exception) { }
                        int edAction = -1;
                        if (int.TryParse(Request.Form["end_date_action_radio"], out edAction))
                        { cData.EndDateAction = edAction; }
                    }

                    //Update META
                    Collection cMetadataTypes = new Collection();
                    string[] acMetaInfo = new string[4];
                    if (!String.IsNullOrEmpty(Request.Form["frm_validcounter"]))
                    {
                        MetaCount = System.Convert.ToInt32(Request.Form["frm_validcounter"]);

                        for (int i = 1; i <= MetaCount; i++)
                        {
                            acMetaInfo[1] = Request.Form["frm_meta_type_id_" + i];
                            acMetaInfo[2] = contentID.ToString();
                            acMetaInfo[3] = Request.Form["frm_text_" + i];
                            cMetadataTypes.Add(acMetaInfo, i.ToString(), null, null);
                            acMetaInfo = new string[4];
                        }
                    }
                    //Image Gallery metadata
                    acMetaInfo = UpdateMetadataContent();
                    if (acMetaInfo != null)
                    {
                        cMetadataTypes.Add(acMetaInfo, System.Convert.ToString(cMetadataTypes.Count + 1), null, null);
                    }
                    if (MetaCount > 0)
                        m_refContApi.EkContentRef.UpdateMetaData(cMetadataTypes);
                    //END Update META

                    //Update Taxnomoy
                    if (!string.IsNullOrEmpty(Request.Form["taxonomyselectedtree"]))
                    {
                        string taxIdstr = Request.Form["taxonomyselectedtree"];
                        TaxonomyContentRequest request_t = new TaxonomyContentRequest();
                        request_t.ContentId = contentID;
                        request_t.TaxonomyList = taxIdstr;
                        request_t.FolderID = Convert.ToInt64(Request.Form["FolderID"]);
                        m_refContApi.EkContentRef.AddTaxonomyItem(request_t);
                    }
                    cData.FileChanged = false;
                    m_refContent.CheckContentOutv2_0(contentID);
                    m_refContent.SaveContentv2_0(cData);

                    bool isUrlAliasRequired = false;

                    FolderData fdTmp = this.m_refContApi.EkContentRef.GetFolderById(cData.FolderId);
                    Ektron.Cms.UrlAliasing.UrlAliasSettingsApi m_urlAliasSettings = new Ektron.Cms.UrlAliasing.UrlAliasSettingsApi();

                    if (m_urlAliasSettings.IsManualAliasEnabled)
                    {
                        if (fdTmp.AliasRequired)
                        {
                            isUrlAliasRequired = true;
                        }
                    }
                    bool isImage = ConfigManager.IsImageAsset(cData.AssetData.FileExtension);

                    switch (Request.Form["editaction"])
                    {
                        case "checkin":
                            m_refContent.CheckIn(contentID, "");
                            break;
                        case "publish":
                            m_refContent.CheckIn(contentID, "");
                            if (isImage || (!isUrlAliasRequired))//publish image file or folder not require Url Alias
                                m_refContent.SubmitForPublicationv2_0(contentID, Convert.ToInt64(Request.Form["FolderID"]), "");
                            break;
                        case "save":
                            //do nothing. leave them in checkout state.
                            break;
                    }

                    File = item[item.Keys[0]];
                }
            }

            Response.Redirect((string)("content.aspx?id=" + Request.Form["content_folder"] + "&action=ViewContentByCategory&LangType=" + ContentLanguage), false);
        }
        catch (Exception ex)
        {
            Utilities.ShowError(ex.Message.ToString());
        }
        finally
        {
            //reset session vars
            Session["EkDavSessionVal"] = null;
            Session["EkDavSessionASDList"] = null;
        }
    }
Esempio n. 9
0
    void EditUrlAlias(long contId, long folderId)
    {
        bool required = false;
        //ContentData cont = m_ContentApi.EkContentRef.gec(contId);
        FolderData fdTmp = this.m_ContentApi.EkContentRef.GetFolderById(folderId);
        Ektron.Cms.UrlAliasing.UrlAliasSettingsApi m_urlAliasSettings = new Ektron.Cms.UrlAliasing.UrlAliasSettingsApi();

        if (m_urlAliasSettings.IsManualAliasEnabled)
        {
            if (fdTmp.AliasRequired)
            {
                required = true;
            }
        }
        if (!required)
            return;

        if (isFromMultiUpload)
        {
            ContentData cData = m_ContentApi.GetContentById(contId);
            if (Ektron.ASM.AssetConfig.ConfigManager.IsImageAsset(cData.AssetData.FileExtension))
                htImagesAssets.Add(contId, true);
            else
                htImagesAssets.Add(contId, false);
            return;
        }
        else
        {
            Collection page_content_data = m_ContentApi.EkContentRef.GetContentByIDv2_0(contId);
            string m_strManualAlias = (Request.Form["frm_manalias"] != null ? Request.Form["frm_manalias"].ToString().Trim() : null);
            string m_strManualAliasExt = (Request.Form["frm_manaliasExt"] != null ? Request.Form["frm_manaliasExt"].ToString() : null);
            //ast_frm_manaliasExt.Value = Request.Form["frm_manaliasExt"];
            string m_prevManualAliasName = (Request.Form["prev_frm_manalias_name"] != null ? Request.Form["prev_frm_manalias_name"].ToString() : "");
            string m_prevManualAliasExt = (Request.Form["prev_frm_manalias_ext"] != null ? Request.Form["prev_frm_manalias_ext"].ToString() : "");
            string m_currManualAliasName = m_strManualAlias;
            string m_currManualAliasExt = m_strManualAliasExt;
            string m_currManualAliasStatus = "";
            long m_intManualAliasId = 0;

            if (m_prevManualAliasName == "" && m_currManualAliasName != "" || m_prevManualAliasExt == "" && m_currManualAliasExt != "")
            {
                m_currManualAliasStatus = "New";
            }
            else if (m_prevManualAliasName != "" && m_currManualAliasName != "" && (m_currManualAliasName != m_prevManualAliasName || m_prevManualAliasExt != m_currManualAliasExt))
            {
                m_currManualAliasStatus = "Modified";
            }
            else if (m_prevManualAliasName != "" && m_currManualAliasName == "")
            {
                m_currManualAliasStatus = "Deleted";
            }
            else
            {
                m_currManualAliasStatus = "None";
            }
            if (!string.IsNullOrEmpty(Request.Form["frm_manalias_id"]))
            {
                m_intManualAliasId = System.Convert.ToInt64(Request.Form["frm_manalias_id"]);
            }
            if (EkFunctions.DoesKeyExist(page_content_data, "FileChanged"))
                page_content_data.Remove("FileChanged");
            page_content_data.Add("False", "FileChanged", null, null);

            if (EkFunctions.DoesKeyExist(page_content_data, "NewUrlAliasName"))
                page_content_data.Remove("NewUrlAliasName");
            page_content_data.Add(m_strManualAlias, "NewUrlAliasName", null, null);

            if (EkFunctions.DoesKeyExist(page_content_data, "UrlAliasId"))
                page_content_data.Remove("UrlAliasId");
            page_content_data.Add(m_intManualAliasId, "UrlAliasId", null, null);

            if (EkFunctions.DoesKeyExist(page_content_data, "NewUrlAliasExt"))
                page_content_data.Remove("NewUrlAliasExt");
            page_content_data.Add(m_strManualAliasExt, "NewUrlAliasExt", null, null);

            if (EkFunctions.DoesKeyExist(page_content_data, "UrlAliasStatus"))
                page_content_data.Remove("UrlAliasStatus");
            page_content_data.Add(m_currManualAliasStatus, "UrlAliasStatus", null, null);

            if (EkFunctions.DoesKeyExist(page_content_data, "OldUrlAliasName"))
                page_content_data.Remove("OldUrlAliasName");
            page_content_data.Add(m_prevManualAliasName, "OldUrlAliasName", null, null);

            if (EkFunctions.DoesKeyExist(page_content_data, "OldUrlAliasExt"))
                page_content_data.Remove("OldUrlAliasExt");
            page_content_data.Add(m_prevManualAliasExt, "OldUrlAliasExt", null, null);

            if (EkFunctions.DoesKeyExist(page_content_data, "ManualAlias"))
                page_content_data.Remove("ManualAlias");
            page_content_data.Add(m_strManualAlias, "ManualAlias", null, null);

            if (EkFunctions.DoesKeyExist(page_content_data, "ManualAliasID"))
                page_content_data.Remove("ManualAliasID");
            page_content_data.Add(m_intManualAliasId, "ManualAliasID", null, null);

            if (page_content_data["ContentStatus"].ToString().ToUpper() != "O")
                m_ContentApi.EkContentRef.CheckContentOutv2_0(contId);
            m_ContentApi.EkContentRef.SaveContentv2_0(page_content_data);
        }
    }
Esempio n. 10
0
    private void DisplayUrlAlias(long contentId, long folderId)
    {
        bool required = false;
        ContentData cont = m_ContentApi.GetContentById(contentId);
        FolderData fdTmp = this.m_ContentApi.EkContentRef.GetFolderById(folderId);
        Ektron.Cms.UrlAliasing.UrlAliasSettingsApi m_urlAliasSettings = new Ektron.Cms.UrlAliasing.UrlAliasSettingsApi();

        if (m_urlAliasSettings.IsManualAliasEnabled)
        {
            if (fdTmp.AliasRequired)
            {
                required = true;
            }
        }
        if (required && !isFromMultiUpload)
        {
            if (Ektron.ASM.AssetConfig.ConfigManager.IsImageAsset(cont.AssetData.FileExtension))
                required = false;
        }
        if (required)
        {
            if (!isFromMultiUpload)
            {
                jsURLRequired.Text = "true";
                ltrShowUrlAlias.Text = "<li><a title=\"Set URL Alias\" id=\"urlAnchor\" onclick=\"dmsMetadataShowHideCategory('urlalias');return false;\" href=\"#\">URL Alias</a></li>";
                ltrUrlAliasBody.Text = EditAliasHtmlScripts(cont, fdTmp, m_urlAliasSettings);
            }
            else
            {
                jsURLRequired.Text = "false";
                ltrShowUrlAlias.Text = "<input type='hidden' id='isFromMultiUpload' name='isFromMultiUpload' value='true' />";
            }
        }
        else
        {
            jsURLRequired.Text = "false";
            ltrShowUrlAlias.Text = "";
        }
    }
Esempio n. 11
0
    private void EditContentHtmlScripts()
    {
        StringBuilder sbHtml = new StringBuilder();
        string strAssetID = "";
        string strSnippet = "";
        string strPath = "";
        string editLiveCSS = "";
        long copyContID = 0;
        bool addFileUpload = false;
        string MenuItemType;

        if (content_stylesheet.Length > 0)
        {
            strPath = (string)(GetServerPath() + SitePath + content_stylesheet);
            editLiveCSS = (string)("&css=" + content_stylesheet);
        }
        if (!String.IsNullOrEmpty (Request.QueryString["content_id"]))
        {
            //this key is also used for media asset translated.
            copyContID = Convert.ToInt64(Request.QueryString["content_id"]);
        }

        isOfficeDoc.Value = "false";
        MultiupLoadTitleMsg.Text = "";
        content_title.Visible = true;
        this.type.Value = "";

        if ((IsMac) && !(Utilities.IsAsset(lContentType, strAssetID)))
        {
            if (content_edit_data != null && (content_edit_data.Type == 1 || content_edit_data.Type == 3) && (content_edit_data.SubType == Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.PageBuilderData || content_edit_data.SubType == Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.PageBuilderMasterData || content_edit_data.SubType == Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.WebEvent))
            {
                string typeaction = Request.QueryString["type"];
                if ((typeaction != null) && typeaction.ToLower() == "update")
                {
                    isOfficeDoc.Value = "true";
                }
                HtmlGenericControl linebreak = new HtmlGenericControl("div");
                linebreak.InnerHtml = "<br /><br />";
                m_ctlContentPane.Controls.Add(linebreak);
                HtmlGenericControl htmlGen = new HtmlGenericControl("span");
                htmlGen.InnerHtml = Ektron.Cms.PageBuilder.PageData.RendertoString(content_edit_data.Html);
                m_ctlContentPane.Controls.Add(htmlGen);
            }
            else if ("ContentDesigner" == m_SelectedEditControl)
            {
                m_ctlContentDesigner.Visible = true;
                m_ctlContentDesigner.Width = new Unit(editorWidthUnits, editorWidthUnitType);
                m_ctlContentDesigner.Height = new Unit(635, UnitType.Pixel);
                if (content_stylesheet.Length > 0)
                {
                    m_ctlContentDesigner.Stylesheet = strPath;
                }
                if (editorPackage.Length > 0)
                {
                    m_ctlContentDesigner.LoadPackage(m_refContApi, editorPackage);
                    m_ctlContentDesigner.DataDocumentXml = m_strContentHtml;
                }
                else
                {
                    m_ctlContentDesigner.Content = m_strContentHtml;
                }
                m_ctlContentValidator.ValidationExpression = Utilities.BuildRegexToCheckMaxLength(iMaxContLength);
                m_ctlContentValidator.Visible = true;
            }
            else
            {
                if (!IsBrowserIE)
                {
                    sbHtml.Append("<input type=\"hidden\" name=\"ephox\" id=\"ephox\" value=\"true\">");
                    sbHtml.Append("<input type=\"hidden\" name=\"selectedtext\" id=\"selectedtext\">");
                    sbHtml.Append("<input type=\"hidden\" name=\"selectedhtml\" id=\"selectedhtml\">");
                    System.Text.StringBuilder strJSEditLive = new System.Text.StringBuilder();
                    strJSEditLive.Append("<script language=\"JavaScript\" src=\"" + this.AppeWebPath + "editlivejava/editlivejava.js\"></script>" + "\r\n");
                    sbHtml.Append("<input type=\"hidden\" name=\"EphoxContent\" id=\"EphoxContent\" value=\"" + EkFunctions.UrlEncode(Server.HtmlDecode(m_strContentHtml)) + "\">");
                    strJSEditLive.Append("<script language=\"JavaScript\">" + "\r\n");
                    strJSEditLive.Append("      var strContent;");
                    strJSEditLive.Append("		elx1 = new EditLiveJava(\"content_html\", \"700\", \"400\");");
                    strJSEditLive.Append("		elx1.setXMLURL(\"" + this.AppeWebPath + "editlivejava/config.aspx?apppath=" + this.AppPath + "&sitepath=" + this.SitePath + editLiveCSS + "\");");
                    strJSEditLive.Append("      elx1.setOutputCharset(\"UTF-8\");");
                    strJSEditLive.Append("		elx1.setBody(document.forms[0].EphoxContent.value);");
                    strJSEditLive.Append("		elx1.setDownloadDirectory(\"" + this.AppeWebPath + "editlivejava\");");
                    strJSEditLive.Append("		elx1.setLocalDeployment(false);");
                    strJSEditLive.Append("		elx1.setCookie(\"\");");
                    strJSEditLive.Append("		elx1.show();" + "\r\n");
                    strJSEditLive.Append("	</script>" + "\r\n");
                    sbHtml.Append(strJSEditLive.ToString());
                }
                else
                {
                    sbHtml.Append("<input type=\"hidden\" name=\"ephox\" id=\"ephox\" value=\"false\">");
                    sbHtml.Append("<textarea id=\"content_html\" name=\"content_html\" cols=\"90\" rows=\"24\" ID=\"Textarea2\">" + m_strContentHtml + "</textarea>");
                }
                Literal litSnippet = new Literal();
                litSnippet.ID = "ephox_control_literal";
                litSnippet.Text = sbHtml.ToString();
                m_ctlContentPane.Controls.Add(litSnippet);
            }
        }
        else
        {
            sbHtml.Append("<input type=\"hidden\" name=\"ephox\" id=\"ephox\" value=\"false\">");
            strAssetID = asset_info["AssetID"].ToString();
            if (content_edit_data != null && (content_edit_data.Type == 1 || content_edit_data.Type == 3) && (content_edit_data.SubType == Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.PageBuilderData || content_edit_data.SubType == Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.PageBuilderMasterData || content_edit_data.SubType == Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.WebEvent))
            {
                string typeaction = Request.QueryString["type"];

                if ((typeaction != null) && typeaction.ToLower() == "update")
                {
                    isOfficeDoc.Value = "true";
                }
                HtmlGenericControl linebreak = new HtmlGenericControl("div");
                linebreak.InnerHtml = "<br /><br />";
                m_ctlContentPane.Controls.Add(linebreak);
                HtmlGenericControl htmlGen = new HtmlGenericControl("span");
                htmlGen.InnerHtml = Ektron.Cms.PageBuilder.PageData.RendertoString(content_edit_data.Html);
                m_ctlContentPane.Controls.Add(htmlGen);
            }
            else if (Utilities.IsAsset(lContentType, strAssetID))
            {
                if (m_strType == "multiple,add")
                {
                    bool isUrlAliasRequired = false;

                    FolderData fdTmp = this.m_refContApi.EkContentRef.GetFolderById(Int64.Parse(Request.QueryString["folderid"]));
                    Ektron.Cms.UrlAliasing.UrlAliasSettingsApi m_urlAliasSettings = new Ektron.Cms.UrlAliasing.UrlAliasSettingsApi();

                    if (m_urlAliasSettings.IsManualAliasEnabled)
                    {
                        if (fdTmp.AliasRequired)
                        {
                            isUrlAliasRequired = true;
                        }
                    }

                    jsManualAliasAlert.Text = m_refMsg.GetMessage("js:url aliasing is required dms mupload");// "Url aliasing is required for this folder. Non-image assets will be uploaded but unpublished.";

                    if (Request.Cookies[DMSCookieName] != null && !string.IsNullOrEmpty(Request.Cookies[DMSCookieName].Value))
                    {
                        if (Request.Cookies[DMSCookieName].Value == "2010")
                        {
                            if (isUrlAliasRequired)
                            {
                                jsfolderRequireManualAlias2010.Text = "true";
                            }

                            Button btnMupload = new Button();
                            //btnMupload.ClientIDMode = System.Web.UI.ClientIDMode.Static;
                            btnMupload.ID = "btnMupload";
                            btnMupload.Text = "Upload";
                            btnMupload.Attributes.Add("onclick", "return DocumentUploadOffice2010()");
                            m_ctlContentPane.Controls.Add(btnMupload);
                        }
                        else
                        {
                            if (isUrlAliasRequired)
                            {
                                jsfolderRequireManualAlias.Text = "true";
                            }
                            HiddenField hfTmp = new HiddenField();
                            hfTmp.ID = "FromMenuMultiDMS";
                            hfTmp.Value = "";
                            m_ctlContentPane.Controls.Add(hfTmp);

                        }
                    }

                    HtmlGenericControl linebreak = new HtmlGenericControl("div");
                    linebreak.InnerHtml += "<br /><br />" + "\r\n";
                    linebreak.InnerHtml += "<div id=idMultipleView style=\'display:none\'>";
                    linebreak.InnerHtml += "<script type=\"text/javascript\">" + "\r\n";
                    linebreak.InnerHtml += " AC_AX_RunContent(\'id\',\'idUploadCtl\',\'name\',\'idUploadCtl\',\'classid\',\'CLSID:07B06095-5687-4d13-9E32-12B4259C9813\',\'width\',\'100%\',\'height\',\'350px\');" + "\r\n";
                    linebreak.InnerHtml += "\r\n" + " </script> </div> " + "\r\n";
                    linebreak.InnerHtml += "<br /><br />";
                    linebreak.InnerHtml += "<div> " + m_refMsg.GetMessage("lbl valid file types") + DocumentManagerData.Instance.FileTypes + "</div>";
                    m_ctlContentPane.Controls.Add(linebreak);
                    strSnippet += "\r\n" + "<script language=\"JavaScript\">" + "\r\n";
                    strSnippet += "MultipleUploadView();" + "\r\n";
                    strSnippet += "\r\n" + "</script>";
                    content_title.Visible = false;
                    MultiupLoadTitleMsg.Text = m_refMsg.GetMessage("lbl msg for multiupload title");
                    this.type.Value = "multiple,add";
                }
                else if (strAssetID.Length == 0)
                {
                    HtmlGenericControl linebreak = new HtmlGenericControl("div");
                    linebreak.InnerHtml = "<br /><br />";
                    m_ctlContentPane.Controls.Add(linebreak);
                    HtmlGenericControl htmlGen = new HtmlGenericControl("span");
                    htmlGen.InnerHtml =  m_refMsg.GetMessage("lbl upload file");
                    m_ctlContentPane.Controls.Add(htmlGen);
                    HtmlGenericControl fileUploadWrapper = new HtmlGenericControl("span");
                    fileUploadWrapper.ID = "fileUploadWrapper";
                    System.Web.UI.WebControls.FileUpload fileUpload = new System.Web.UI.WebControls.FileUpload();
                    fileUpload.ID = "fileupload";
                    fileUploadWrapper.Controls.Add(fileUpload);
                    m_ctlContentPane.Controls.Add(fileUploadWrapper);
                    oldfilename.Value = "";
                    addFileUpload = true;
                    this.type.Value = "add";
                }
                else
                {
                    if (lContentType == Ektron.Cms.Common.EkConstants.CMSContentType_Media)
                    {

                        Multimedia_commonparams mediaParams;
                        mediaParams = (Multimedia_commonparams)(LoadControl("controls/media/commonparams.ascx"));
                        mediaParams.ID = m_strContentTitle;
                        if (m_strType == "add" && copyContID != 0)
                        {
                            mediaParams.ContentHtml = this.m_refContent.CreateMediaXML(content_data.AssetData, m_intContentFolder);
                            mediaParams.AssetID = content_data.AssetData.Id;
                            mediaParams.MimeType = content_data.AssetData.MimeType;
                            mediaParams.AssetVersion = content_data.AssetData.Version;
                            mediaParams.AssetFileName = m_refContApi.GetViewUrl(content_data.AssetData.Id, Ektron.Cms.Common.EkConstants.CMSContentType_Media);
                        }
                        else
                        {
                            mediaParams.ContentHtml = m_strContentHtml;
                            mediaParams.AssetID = strAssetID;
                            mediaParams.MimeType = asset_info["MimeType"].ToString();
                            mediaParams.AssetVersion = asset_info["AssetVersion"].ToString();
                            mediaParams.AssetFileName = m_refContApi.RequestInformationRef.AssetPath + m_refContApi.EkContentRef.GetFolderParentFolderIdRecursive(content_edit_data.FolderId).Replace(",", "/") + "/" + content_edit_data.AssetData.Id + "." + content_edit_data.AssetData.FileExtension;
                            mediaParams.AssetFileName = (content_edit_data.IsPrivate ? m_refContApi.RequestInformationRef.SitePath + "PrivateAssets/" : m_refContApi.RequestInformationRef.AssetPath) + m_refContApi.EkContentRef.GetFolderParentFolderIdRecursive(content_edit_data.FolderId).Replace(",", "/") + "/" + content_edit_data.AssetData.Id + "." + content_edit_data.AssetData.FileExtension;
                        }

                        m_ctlContentPane.Controls.Add(mediaParams);
                    }
                    else
                    {
                        //check for type = 'add' here
                        if (m_strType == "add")
                        {
                            HtmlGenericControl linebreak = new HtmlGenericControl("div");
                            linebreak.InnerHtml = "<br /><br />";
                            m_ctlContentPane.Controls.Add(linebreak);
                            HtmlGenericControl htmlGen = new HtmlGenericControl("span");
                            htmlGen.InnerHtml = m_refMsg.GetMessage("lbl upload file");
                            HtmlGenericControl fileUploadWrapper = new HtmlGenericControl("span");
                            fileUploadWrapper.ID = "fileUploadWrapper";
                            System.Web.UI.WebControls.FileUpload fileUpload = new System.Web.UI.WebControls.FileUpload();
                            fileUpload.ID = "fileupload";
                            fileUploadWrapper.Controls.Add(fileUpload);
                            m_ctlContentPane.Controls.Add(fileUploadWrapper);
                            oldfilename.Value = "";
                            addFileUpload = true;
                        }
                        else
                        {
                            if (Ektron.ASM.AssetConfig.ConfigManager.IsOfficeDoc(content_edit_data.AssetData.FileExtension))
                            {

                                AssetManagement.AssetManagementService assetmanagementService = new AssetManagement.AssetManagementService();
                                Ektron.ASM.AssetConfig.AssetData assetData = assetmanagementService.GetAssetData(content_edit_data.AssetData.Id);
                                string strfilename;
                                strfilename = (string)(GetFolderPath(content_edit_data.FolderId) + assetData.Handle);
                                filename.Value = strfilename;
                                HtmlGenericControl linebreak = new HtmlGenericControl("div");
                                linebreak.InnerHtml = "<br /><br /> Currently uploaded file: " + assetData.Handle + " <br /><br />";
                                m_ctlContentPane.Controls.Add(linebreak);
                                m_ctlContentPane.Controls.Add(linebreak);
                                HtmlGenericControl htmlGen = new HtmlGenericControl("span");
                                htmlGen.InnerHtml = m_refMsg.GetMessage("lbl upload file");
                                m_ctlContentPane.Controls.Add(htmlGen);

                                HtmlGenericControl fileUploadWrapper = new HtmlGenericControl("span");
                                fileUploadWrapper.ID = "fileUploadWrapper";

                                System.Web.UI.WebControls.FileUpload fileUpload = new System.Web.UI.WebControls.FileUpload();
                                fileUpload.ID = "fileupload";

                                fileUploadWrapper.Controls.Add(fileUpload);
                                m_ctlContentPane.Controls.Add(fileUploadWrapper);

                                oldfilename.Value = assetData.Handle;
                                //This hidden field is used to hide content tab if office is not installed or browser is non-ie, else show content tab with browse button
                                isOfficeDoc.Value = "true";
                            }
                            else
                            {
                                AssetManagement.AssetManagementService assetmanagementService = new AssetManagement.AssetManagementService();
                                Ektron.ASM.AssetConfig.AssetData assetData = assetmanagementService.GetAssetData(asset_info["AssetID"].ToString());
                                HtmlGenericControl linebreak = new HtmlGenericControl("div");
                                linebreak.InnerHtml = "<br /><br /> Currently uploaded file: " + assetData.Handle + " <br /><br />";
                                m_ctlContentPane.Controls.Add(linebreak);
                                m_ctlContentPane.Controls.Add(linebreak);
                                HtmlGenericControl htmlGen = new HtmlGenericControl("span");
                                htmlGen.InnerHtml = m_refMsg.GetMessage("lbl upload file");
                                m_ctlContentPane.Controls.Add(htmlGen);

                                HtmlGenericControl fileUploadWrapper = new HtmlGenericControl("span");
                                fileUploadWrapper.ID = "fileUploadWrapper";

                                System.Web.UI.WebControls.FileUpload fileUpload = new System.Web.UI.WebControls.FileUpload();
                                fileUpload.ID = "fileupload";

                                fileUploadWrapper.Controls.Add(fileUpload);
                                m_ctlContentPane.Controls.Add(fileUploadWrapper);

                                oldfilename.Value = assetData.Handle;
                            }
                            MenuItemType = Request.QueryString["menuItemType"];
                            if ((MenuItemType != null) && MenuItemType.ToLower() == "editproperties")
                            {
                                isOfficeDoc.Value = "true";
                            }
                        }
                    }
                }
                sbHtml.Append(strSnippet);

                sbHtml.Append("<input type=\"hidden\" id=\"content_html\" name=\"content_html\" value=\"" + EkFunctions.HtmlEncode(m_strContentHtml) + "\">");

                //fix for 32909 - in case of Add multimedia file to Menu, lContentType is CMSContentType_Media but
                //since it is add we show the fileupload browse button, not the DragDropExplorer control
                if ((lContentType == Ektron.Cms.Common.EkConstants.CMSContentType_Media) && (addFileUpload == false) && m_strType == "update")
                {
                    HtmlGenericControl DragDropContainer = new HtmlGenericControl("div");
                    DragDropContainer.ID = "DragDropContainer";
                    DragDropContainer.Style.Add("width", "35%");
                    string multiUploadAssetID = "&AssetID=" + m_refContentId.ToString();
                    string multiUploadTaxString = string.Empty;
                    TaxonomyBaseData[] taxonomies = m_refContent.ReadAllAssignedCategory(m_refContentId);
                    if (!((taxonomies == null)) && taxonomies.Length > 0)
                    {
                        multiUploadTaxString = "&TaxonomyId=" + taxonomies[0].Id.ToString();
                    }
                    Literal uploaderSnippet = new Literal();
                    uploaderSnippet.ID = "UploadSnippet";
                    editaction.Value = m_strType;
                    uploaderSnippet.Text = m_refMsg.GetMessage("lbl upload file replace") + ": " + "<a href=\"" + m_refContApi.AppPath + "DragDropCtl.aspx?id=" + m_intContentFolder.ToString() + multiUploadAssetID + multiUploadTaxString + "&lang_id=" + m_intContentLanguage.ToString() + "&hideMultiple=true&forceExtension=true&EkTB_iframe=true&height=120&width=500&refreshCaller=true&scrolling=false&modal=true\" class=\"ek_thickbox\" title=\"" + m_refMsg.GetMessage("Document Management System") + "\"><img id=\"DeskTopHelp\" title= \"" + m_refMsg.GetMessage("alt add assets text") + "\" border=\"0\" src=\"images/UI/Icons/Import.png\"/></a>";
                    DragDropContainer.Controls.Add(uploaderSnippet);
                    m_ctlContentPane.Controls.Add(DragDropContainer);
                }
                Literal litSnippet = new Literal();
                litSnippet.ID = "ContentHtml";
                litSnippet.Text = sbHtml.ToString();
                m_ctlContentPane.Controls.Add(litSnippet);
            }
            else
            {
                if (m_strType == "add" && (content_data != null) && (content_data.SubType == Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.PageBuilderData || content_data.SubType == Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.PageBuilderMasterData || content_data.SubType == Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.WebEvent))
                {
                    isOfficeDoc.Value = "true";
                }
                HtmlInputHidden ctlEphox = new HtmlInputHidden();
                ctlEphox.ID = "ephox";
                ctlEphox.Value = "false";
                m_ctlContentPane.Controls.Add(ctlEphox);

                if ("ContentDesigner" == m_SelectedEditControl)
                {
                    m_ctlContentDesigner.Visible = true;
                    m_ctlContentDesigner.Width = new Unit(editorWidthUnits, editorWidthUnitType);
                    m_ctlContentDesigner.Height = new Unit(635, UnitType.Pixel);
                    if (content_stylesheet.Length > 0)
                    {
                        m_ctlContentDesigner.Stylesheet = strPath;
                    }
                    if (editorPackage.Length > 0)
                    {
                        m_ctlContentDesigner.LoadPackage(m_refContApi, editorPackage);
                        m_ctlContentDesigner.DataDocumentXml = m_strContentHtml;
                    }
                    else
                    {
                        m_ctlContentDesigner.Content = m_strContentHtml;
                    }
                    m_ctlContentValidator.ValidationExpression = Utilities.BuildRegexToCheckMaxLength(iMaxContLength);
                    m_ctlContentValidator.Visible = true;
                }
                else
                {
                    Ektron.Cms.Controls.HtmlEditor ctlEditor = new Ektron.Cms.Controls.HtmlEditor();
                    ctlEditor.WorkareaMode(2);
                    ctlEditor.ID = "content_html";
                    ctlEditor.Width = new Unit(editorWidthUnits, editorWidthUnitType);
                    ctlEditor.Height = new Unit(100, UnitType.Percentage);
                    ctlEditor.Path = AppeWebPath;
                    ctlEditor.MaxContentSize = iMaxContLength;
                    ctlEditor.Locale = AppeWebPath + "locale" + AppLocaleString + "b.xml";
                    if (editorPackage.Length > 0)
                    {
                        Ektron.WebEditorNet2.eWebEditProField objField;
                        objField = new Ektron.WebEditorNet2.eWebEditProField();
                        objField.Name = "datadesignpackage";
                        objField.SetContentType = "datadesignpackage";
                        objField.GetContentType = "";
                        objField.Text = editorPackage;
                        ctlEditor.Fields.Add(objField);

                        objField = new Ektron.WebEditorNet2.eWebEditProField();
                        objField.Name = "datadocumentxml";
                        objField.SetContentType = "datadocumentxml";
                        objField.GetContentType = ""; // content is retrieved manually
                        objField.Text = m_strContentHtml;
                        ctlEditor.Fields.Add(objField);
                        objField = null;
                    }
                    else
                    {
                        ctlEditor.Text = m_strContentHtml;
                    }
                    System.Web.UI.HtmlControls.HtmlGenericControl eWebEditProWrapper = new System.Web.UI.HtmlControls.HtmlGenericControl("DIV");
                    eWebEditProWrapper.Attributes.Add("class", "ewebeditproWrapper ewebeditpro_dvContent");
                    eWebEditProWrapper.Controls.Add(ctlEditor);
                    m_ctlContentPane.Controls.Add(eWebEditProWrapper);
                }
            }
        }
        // fix for Defect: #43308, why output this tab if you are jsut going to hide it?  We always hide it for
        //   office docs, so...IE ONLY
        //if (isOfficeDoc.Value == "true" && IsBrowserIE)
        //{
        //    phContent.Visible = false;
        //    phEditContent.Visible = false;
        //}

          if (!String.IsNullOrEmpty(m_strContentHtml))
          {
              if (m_ctlContentDesigner != null)
              {
                  m_ctlContentDesigner.CurrentCharCount = m_strContentHtml.Length;

                  if (m_ctlContentDesigner.CurrentCharCount > m_ctlContentDesigner.WordPasteThreshold)
                  {
                      m_ctlContentDesigner.ShowPasteWarning = false;

                      WarningMessage.Visible = true;
                      WarningMessage.Text = m_refMsg.GetMessage("WordPasteWarningMessage");
                  }
              }
          }
    }