示例#1
0
    private void ViewToolBar(HtmlGenericControl objTitleBar, HtmlGenericControl objHTMToolBar)
    {
        System.Text.StringBuilder result = new System.Text.StringBuilder();
            // place the proper title in the Title Bar
            objTitleBar.InnerHtml = m_refStyle.GetTitleBar(m_refMsg.GetMessage("msg view synonyms"));

            // build the string for rendering the htmToolBar
            result.Append("<table cellspacing=\"0\"><tr>");

            bool addHelpDivider = false;

            if (ContentLanguage != -1)
            {
                result.Append(m_refStyle.GetButtonEventsWCaption(AppPath + "images/ui/icons/add.png", (string)("synonyms.aspx?action=AddSynonym&LangType=" + ContentLanguage), m_refMsg.GetMessage("alt add button text synonym"), m_refMsg.GetMessage("btn add synonym"), "", StyleHelper.AddButtonCssClass, true));

                addHelpDivider = true;
            }
            // if the system is
            if (m_refContentApi.EnableMultilingual == 1)
            {
                result.Append(StyleHelper.ActionBarDivider);

                SiteAPI m_refsite = new SiteAPI();
                LanguageData[] language_data = new LanguageData[1];
                language_data = m_refsite.GetAllActiveLanguages();

                result.Append("<td class=\"label\" id=\"viewText\">");

                result.Append("&nbsp;" + m_refMsg.GetMessage("generic view") + ": ");
                result.Append("<select id=\'LangType\' name=\'LangType\'OnChange=\"javascript:LoadLanguage(this.options[this.selectedIndex].value);\">");
                if (ContentLanguage == -1)
                {
                    result.Append("<option value=" + Ektron.Cms.Common.EkConstants.ALL_CONTENT_LANGUAGES + " selected>" + m_refMsg.GetMessage("generic all") + "</option>");
                }
                else
                {
                    result.Append("<option value=" + Ektron.Cms.Common.EkConstants.ALL_CONTENT_LANGUAGES + ">" + m_refMsg.GetMessage("generic all") + "</option>");
                }

                for (int count = 0; count <= language_data.Length - 1; count++)
                {
                    if (Convert.ToString((short) ContentLanguage) == Convert.ToString(language_data[count].Id))
                    {
                        result.Append("<option value=" + language_data[count].Id + " selected>" + language_data[count].Name + "</option>");
                    }
                    else
                    {
                        result.Append("<option value=" + language_data[count].Id + ">" + language_data[count].Name + "</option>");
                    }
                }
                result.Append("</select></td>");

                addHelpDivider = true;
            }

            if (addHelpDivider)
            {
                result.Append(StyleHelper.ActionBarDivider);
            }

            result.Append("<td>");
            result.Append(m_refStyle.GetHelpButton("synonymsets", ""));
            result.Append("</td>");
            result.Append("</tr></table>");

            // output the result string to the htmToolBar
            objHTMToolBar.InnerHtml = result.ToString();
    }
示例#2
0
        public void AddLanguageDropdown(bool ShowAll)
        {
            System.Text.StringBuilder result = new System.Text.StringBuilder();
            if (m_refContentApi.EnableMultilingual == 1)
            {
                SiteAPI m_refsite = new SiteAPI();
                LanguageData[] language_data = m_refsite.GetAllActiveLanguages();

                result.Append(StyleHelper.ActionBarDivider);
                result.Append("<td class=\"label\">");
                result.Append(m_refMsg.GetMessage("lbl Language"));
                result.Append(":</td>");
                result.Append("<td>");
                result.Append("<select id=selLang name=selLang OnChange=\"javascript:LoadLanguage(\'frmContent\');\">");
                if (ShowAll)
                {
                    result.Append("<option value=\"" + Ektron.Cms.Common.EkConstants.ALL_CONTENT_LANGUAGES + "\"");
                    if (ContentLanguage == Ektron.Cms.Common.EkConstants.ALL_CONTENT_LANGUAGES)
                    {
                        result.Append(" selected=\"selected\"");
                    }
                    result.Append(">");
                    result.Append("All");
                    result.Append("</option>");
                }
                for (int count = 0; count <= language_data.Length - 1; count++)
                {
                    LanguageData with_1 = language_data[count];
                    result.Append("<option value=\"" + with_1.Id + "\"");
                    if (with_1.Id == ContentLanguage)
                    {
                        result.Append(" selected=\"selected\"");
                    }
                    else
                    {
                    }
                    result.Append(">");
                    result.Append(with_1.LocalName);
                    result.Append("</option>");
                }
                result.Append("</select></td>");
            }
            result.Append("<td>");
            aButtons.Add(result.ToString());
        }
    private void LoadManualAliasList(string siteID)
    {
        PagingInfo req = new PagingInfo();
        System.Collections.Generic.List<UrlAliasManualData> manualAliasList;
        System.Collections.Generic.List<UrlAliasAutoData> autoAliasList;
        System.Collections.Generic.List<UrlAliasCommunityData> communityAliasList;
        Ektron.Cms.Common.EkEnumeration.UrlAliasingOrderBy orderBy = Ektron.Cms.Common.EkEnumeration.UrlAliasingOrderBy.None;
        Ektron.Cms.Common.EkEnumeration.AutoAliasOrderBy orderAutoAlias = Ektron.Cms.Common.EkEnumeration.AutoAliasOrderBy.None;
        Ektron.Cms.Common.EkEnumeration.CommunityAliasOrderBy orderCommunityAlias = Ektron.Cms.Common.EkEnumeration.CommunityAliasOrderBy.None;
        LocalizationAPI objLocalizationApi = new LocalizationAPI();
        string defaultIcon = string.Empty;
        long currentSiteKey = 0;
        bool _isRemoveAlias = false;
        string mode = string.Empty;
        SiteAPI _refsiteApi = new SiteAPI();
        LanguageData[] languageData = _refsiteApi.GetAllActiveLanguages();
        string strSelectedLanguageName = "";
        string strName;

        req = new PagingInfo(_refContentApi.RequestInformationRef.PagingSize);
        req.CurrentPage = currentPageNumber;

        if (Request.QueryString["action"] == "removealias")
        {
            _isRemoveAlias = true;
        }

        if (Request.QueryString["mode"] == "auto" && !String.IsNullOrEmpty(Request.QueryString["orderby"]))
        {
            orderAutoAlias = (EkEnumeration.AutoAliasOrderBy)Enum.Parse(typeof(EkEnumeration.AutoAliasOrderBy), Convert.ToString(Request.QueryString["orderby"]), true);
        }
        else if (Request.QueryString["mode"] == "community" && !String.IsNullOrEmpty(Request.QueryString["orderby"]))
        {
            orderCommunityAlias = (EkEnumeration.CommunityAliasOrderBy)Enum.Parse(typeof(EkEnumeration.CommunityAliasOrderBy), Convert.ToString(Request.QueryString["orderby"]), true);
        }
        else if (!String.IsNullOrEmpty(Request.QueryString["orderby"]) && Request.QueryString["mode"] != "auto")
        {
            orderBy = (EkEnumeration.UrlAliasingOrderBy)Enum.Parse(typeof(EkEnumeration.UrlAliasingOrderBy), Convert.ToString(Request.QueryString["orderby"]), true);
        }
        if (Page.IsPostBack && (Request.Form["siteSearchItem"] != null))
        {
            long.TryParse((string)(Request.Form["siteSearchItem"]), out currentSiteKey);
        }
        else if (_isRemoveAlias || siteID != "")
        {
            long.TryParse(siteID, out currentSiteKey);
        }
        else
        {
            siteDictionary = _manualAliasList.GetSiteList();
            foreach (System.Collections.Generic.KeyValuePair<long, string> tempLoopVar_siteList in siteDictionary)
            {
                siteList = tempLoopVar_siteList;
                long.TryParse(siteList.Key.ToString(), out currentSiteKey);
                break;
            }
        }
        strKeyWords = Request.Form["txtSearch"];

        mode = Request.QueryString["mode"];

        if (mode == "auto")
        {
            if (!String.IsNullOrEmpty(Request.QueryString["searchlist"]))
            {
                _autoSelectedItem = (EkEnumeration.AutoAliasSearchField)Enum.Parse(typeof(EkEnumeration.AutoAliasSearchField), Convert.ToString(Request.QueryString["searchlist"]), true);
            }
            autoAliasList = _autoAliasList.GetList(req, currentSiteKey, Convert.ToInt32(_refContentApi.GetCookieValue("LastValidLanguageID")), _autoSelectedItem, strKeyWords, orderAutoAlias);
            totalPagesNumber = req.TotalPages;
            PageSettings();
            if ((autoAliasList != null) && autoAliasList.Count > 0)
            {
                if (_isRemoveAlias)
                {
                    CollectionListGrid.Columns.Add(_refStyle.CreateBoundField("DELETE", msgHelper.GetMessage("generic delete title"), "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(3), Unit.Percentage(3), false, false));
                    CollectionListGrid.Columns.Add(_refStyle.CreateBoundField("ACTIVE", "<center><a href=\"urlmanualaliaslistmaint.aspx?orderby=" + EkEnumeration.AutoAliasOrderBy.Active + "&action=removealias&mode=auto&fId=" + currentSiteKey.ToString() + "\">" + msgHelper.GetMessage("lbl active") + "</a></center>", "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(5), Unit.Percentage(5), false, false));
                    CollectionListGrid.Columns.Add(_refStyle.CreateBoundField("LANG", "<center><a href=\"urlmanualaliaslistmaint.aspx?orderby=" + EkEnumeration.AutoAliasOrderBy.ContentLanguage + "&mode=auto&fId=" + currentSiteKey.ToString() + "\">" + msgHelper.GetMessage("lbl language") + "</a></center>", "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(4), Unit.Percentage(4), false, false));
                    CollectionListGrid.Columns.Add(_refStyle.CreateBoundField("SOURCENAME", "<a href=\"urlmanualaliaslistmaint.aspx?orderby=" + EkEnumeration.AutoAliasOrderBy.SourceName + "&action=removealias&mode=auto&fId=" + currentSiteKey.ToString() + "\">" + msgHelper.GetMessage("lbl source name") + "</a>", "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(15), Unit.Percentage(15), false, false));
                    CollectionListGrid.Columns.Add(_refStyle.CreateBoundField("TYPE", "<center><a href=\"urlmanualaliaslistmaint.aspx?orderby=" + EkEnumeration.AutoAliasOrderBy.Type + "&action=removealias&mode=auto&fId=" + currentSiteKey.ToString() + "\">" + msgHelper.GetMessage("type label") + "</a></center>", "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(4), Unit.Percentage(4), false, false));
                    CollectionListGrid.Columns.Add(_refStyle.CreateBoundField("ALIAS", msgHelper.GetMessage("lbl example alias"), "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(25), Unit.Percentage(25), false, false));

                }
                else
                {
                    CollectionListGrid.Columns.Add(_refStyle.CreateBoundField("ACTIVE", "<center><a href=\"urlmanualaliaslistmaint.aspx?orderby=" + EkEnumeration.AutoAliasOrderBy.Active + "&mode=auto&fId=" + currentSiteKey.ToString() + "\">" + msgHelper.GetMessage("lbl active") + "</a></center>", "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(5), Unit.Percentage(5), false, false));
                    CollectionListGrid.Columns.Add(_refStyle.CreateBoundField("LANG", "<center><a href=\"urlmanualaliaslistmaint.aspx?orderby=" + EkEnumeration.AutoAliasOrderBy.ContentLanguage + "&mode=auto&fId=" + currentSiteKey.ToString() + "\">" + msgHelper.GetMessage("lbl language") + "</a></center>", "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(4), Unit.Percentage(4), false, false));
                    CollectionListGrid.Columns.Add(_refStyle.CreateBoundField("SOURCENAME", "<a href=\"urlmanualaliaslistmaint.aspx?orderby=" + EkEnumeration.AutoAliasOrderBy.SourceName + "&mode=auto&fId=" + currentSiteKey.ToString() + "\">" + msgHelper.GetMessage("lbl source name") + "</a>", "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(15), Unit.Percentage(15), false, false));
                    CollectionListGrid.Columns.Add(_refStyle.CreateBoundField("TYPE", "<center><a href=\"urlmanualaliaslistmaint.aspx?orderby=" + EkEnumeration.AutoAliasOrderBy.Type + "&mode=auto&fId=" + currentSiteKey.ToString() + "\">" + msgHelper.GetMessage("type label") + "</a></center>", "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(4), Unit.Percentage(4), false, false));
                    CollectionListGrid.Columns.Add(_refStyle.CreateBoundField("ALIAS", msgHelper.GetMessage("lbl example alias"), "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(25), Unit.Percentage(25), false, false));
                }

                DataTable dt = new DataTable();
                DataRow dr;
                if (_isRemoveAlias)
                {
                    dt.Columns.Add(new DataColumn("DELETE", typeof(string)));
                }
                dt.Columns.Add(new DataColumn("SOURCENAME", typeof(string)));
                dt.Columns.Add(new DataColumn("TYPE", typeof(string)));
                dt.Columns.Add(new DataColumn("ACTIVE", typeof(string)));
                dt.Columns.Add(new DataColumn("ALIAS", typeof(string)));
                dt.Columns.Add(new DataColumn("LANG", typeof(string)));

                for (int i = 0; i <= autoAliasList.Count - 1; i++)
                {
                    dr = dt.NewRow();
                    if (_isRemoveAlias)
                    {
                        dr["DELETE"] = "<input type=\"checkbox\" name=\"deleteAliasId\" value=\"" + (autoAliasList[i].AutoId.ToString()) + "\">";
                    }
                    dr["SOURCENAME"] = "<a href=\"urlautoaliasmaint.aspx?action=view&LangType=" + _refContentApi.GetCookieValue("LastValidLanguageID") + "&fid=" + currentSiteKey + "&id=" + autoAliasList[i].AutoId + "\">" + autoAliasList[i].SourceName + "</a>";
                    if (autoAliasList[i].AutoAliasType == Ektron.Cms.Common.EkEnumeration.AutoAliasType.Folder)
                    {
                        dr["TYPE"] = "<center><img src =\"" + _refContentApi.AppPath + "images/ui/icons/folder.png\" alt=\"" + msgHelper.GetMessage("lbl folder") + "\" title=\"" + msgHelper.GetMessage("lbl folder") + "\"/ ></center>";
                    }
                    else
                    {
                        dr["TYPE"] = "<center><img src =\"" + _refContentApi.AppPath + "images/ui/icons/taxonomy.png\" alt=\"" + msgHelper.GetMessage("generic taxonomy lbl") + "\" title=\"" + msgHelper.GetMessage("generic taxonomy lbl") + "\"/ ></center>";
                    }
                    if (autoAliasList[i].IsEnabled)
                    {
                        dr["ACTIVE"] = "<center><span style=\"color:green\">On</span></center>"; //maliaslist(i).IsEnabled"
                    }
                    else
                    {
                        dr["ACTIVE"] = "<center><span style=\"color:red\">Off</span></center>";
                    }

                    dr["ALIAS"] = autoAliasList[i].Example;
                    if (autoAliasList[i].AutoAliasType == Ektron.Cms.Common.EkEnumeration.AutoAliasType.Taxonomy)
                    {
                        for (int iLang = 0; iLang <= languageData.Length - 1; iLang++)
                        {
                            LanguageData with_1 = languageData[iLang];
                            strName = with_1.LocalName;
                            if (autoAliasList[i].LanguageId == with_1.Id)
                            {
                                strSelectedLanguageName = strName;
                            }
                        }
                    }
                    else
                    {
                        strSelectedLanguageName = "N/A";
                    }
                    dr["LANG"] = "<center><img src=" + objLocalizationApi.GetFlagUrlByLanguageID(System.Convert.ToInt32(autoAliasList[i].LanguageId)) + " alt=\"" + strSelectedLanguageName + "\" title=\"" + strSelectedLanguageName + "\" /></center>";
                    dt.Rows.Add(dr);
                }
                DataView dv = new DataView(dt);
                CollectionListGrid.DataSource = dv;
                CollectionListGrid.DataBind();
            }
        }
        else if (mode == "community")
        {
            communityAliasList = _communityAliasList.GetList(req, currentSiteKey, orderCommunityAlias);
            totalPagesNumber = req.TotalPages;
            PageSettings();
            if (communityAliasList != null && communityAliasList.Count > 0)
            {
                if (_isRemoveAlias)
                {
                    CollectionListGrid.Columns.Add(_refStyle.CreateBoundField("DELETE", msgHelper.GetMessage("generic delete title"), "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(3), Unit.Percentage(3), false, false));
                    CollectionListGrid.Columns.Add(_refStyle.CreateBoundField("DEFAULT", "<center>" + msgHelper.GetMessage("lbl primary") + "</center>", "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(2), Unit.Percentage(2), false, false));
                    CollectionListGrid.Columns.Add(_refStyle.CreateBoundField("ACTIVE", "<center><a href=\"urlmanualaliaslistmaint.aspx?orderby=" + EkEnumeration.CommunityAliasOrderBy.Active + "&action=removealias&mode=community&fId=" + currentSiteKey.ToString() + "\">" + msgHelper.GetMessage("lbl active") + "</a></center>", "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(5), Unit.Percentage(5), false, false));
                    CollectionListGrid.Columns.Add(_refStyle.CreateBoundField("ALIAS PATH", msgHelper.GetMessage("lbl alias path"), "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(5), Unit.Percentage(5), false, false));
                    CollectionListGrid.Columns.Add(_refStyle.CreateBoundField("TYPE", "<center><a href=\"urlmanualaliaslistmaint.aspx?orderby=" + EkEnumeration.AutoAliasOrderBy.Type + "&action=removealias&mode=community&fId=" + currentSiteKey.ToString() + "\">" + msgHelper.GetMessage("generic type") + "</a></center>", "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(4), Unit.Percentage(4), false, false));
                    CollectionListGrid.Columns.Add(_refStyle.CreateBoundField("ALIAS", msgHelper.GetMessage("lbl example alias"), "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(25), Unit.Percentage(25), false, false));

                }
                else
                {
                    CollectionListGrid.Columns.Add(_refStyle.CreateBoundField("DEFAULT", "<center>" + msgHelper.GetMessage("lbl primary") + "</center>", "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(2), Unit.Percentage(2), false, false));
                    CollectionListGrid.Columns.Add(_refStyle.CreateBoundField("ACTIVE", "<center><a href=\"urlmanualaliaslistmaint.aspx?orderby=" + EkEnumeration.CommunityAliasOrderBy.Active + "&mode=community&fId=" + currentSiteKey.ToString() + "\">" + msgHelper.GetMessage("lbl active") + "</a></center>", "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(3), Unit.Percentage(3), false, false));
                    CollectionListGrid.Columns.Add(_refStyle.CreateBoundField("ALIAS PATH", msgHelper.GetMessage("lbl alias path"), "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(5), Unit.Percentage(5), false, false));
                    CollectionListGrid.Columns.Add(_refStyle.CreateBoundField("TYPE", "<center><a href=\"urlmanualaliaslistmaint.aspx?orderby=" + EkEnumeration.CommunityAliasOrderBy.Type + "&mode=community&fId=" + currentSiteKey.ToString() + "\">" + msgHelper.GetMessage("generic type") + "</a></center>", "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(4), Unit.Percentage(4), false, false));
                    CollectionListGrid.Columns.Add(_refStyle.CreateBoundField("ALIAS", msgHelper.GetMessage("lbl example alias"), "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(25), Unit.Percentage(25), false, false));

                }

                DataTable dt = new DataTable();
                DataRow dr;
                if (_isRemoveAlias)
                {
                    dt.Columns.Add(new DataColumn("DELETE", typeof(string)));
                }

                dt.Columns.Add(new DataColumn("DEFAULT", typeof(string)));
                dt.Columns.Add(new DataColumn("TYPE", typeof(string)));
                dt.Columns.Add(new DataColumn("ACTIVE", typeof(string)));
                dt.Columns.Add(new DataColumn("ALIAS", typeof(string)));
                dt.Columns.Add(new DataColumn("ALIAS PATH", typeof(string)));

                for (int i = 0; i <= communityAliasList.Count - 1; i++)
                {
                    dr = dt.NewRow();
                    if (_isRemoveAlias)
                    {
                        dr["DELETE"] = "<input type=\"checkbox\" name=\"deleteAliasId\" value=\"" + (communityAliasList[i].Id.ToString()) + "\">";
                    }
                    if (communityAliasList[i].IsDefault)
                    {
                        defaultIcon = "<center><img src=\"" + _refContentApi.AppPath + "images/ui/icons/check.png\" border=\"0\" alt=\"Item is Enabled\" title=\"Item is Enabled\"/></center>";
                        dr["DEFAULT"] = defaultIcon;
                    }
                    if (communityAliasList[i].IsEnabled)
                    {
                        dr["ACTIVE"] = "<center><span style=\"color:green\">On</span></center>";
                    }
                    else
                    {
                        dr["ACTIVE"] = "<center><span style=\"color:red\">Off</span></center>";
                    }
                    if (communityAliasList[i].CommunityAliasType == Ektron.Cms.Common.EkEnumeration.CommunityAliasType.Group)
                    {
                        dr["TYPE"] = "<center><img src =\"" + _refContentApi.AppPath + "images/ui/icons/usersMemberGroups.png\" alt=\"" + msgHelper.GetMessage("lbl group") + "\" title=\"" + msgHelper.GetMessage("lbl group") + "\"/ ></center>";
                    }
                    else
                    {
                        dr["TYPE"] = "<center><img src =\"" + _refContentApi.AppPath + "images/ui/icons/user.png\" alt=\"" + msgHelper.GetMessage("lbl wa mkt user goals") + "\" title=\"" + msgHelper.GetMessage("lbl wa mkt user goals") + "\"/ ></center>";
                    }
                    for (int iLang = 0; iLang <= languageData.Length - 1; iLang++)
                    {
                        LanguageData with_2 = languageData[iLang];
                        strName = with_2.LocalName;
                        if (communityAliasList[i].LanguageId == with_2.Id)
                        {
                            strSelectedLanguageName = strName;
                        }
                    }
                    dr["ALIAS"] = communityAliasList[i].Example;
                    dr["ALIAS PATH"] = "<a href=\"urlcommunityaliasmaint.aspx?action=view&id=" + communityAliasList[i].Id + "&fId=" + communityAliasList[i].SiteId + "&LangType=" + _refContentApi.GetCookieValue("LastValidLanguageID") + "\">" + communityAliasList[i].AliasPath + "</a>";

                    dt.Rows.Add(dr);
                }
                DataView dv = new DataView(dt);
                CollectionListGrid.DataSource = dv;
                CollectionListGrid.DataBind();
            }
        }
        else
        {
            if (!String.IsNullOrEmpty(Request.Form["searchlist"]))
            {
                _strSelectedItem = (EkEnumeration.UrlAliasSearchField)Enum.Parse(typeof(EkEnumeration.UrlAliasSearchField), Convert.ToString((Request.Form["searchlist"])), true);
            }

            manualAliasList = _manualAliasList.GetList(req, currentSiteKey, Convert.ToInt32(_refContentApi.GetCookieValue("LastValidLanguageID")), _strSelectedItem, strKeyWords, orderBy);
            totalPagesNumber = req.TotalPages;

            PageSettings();

            if ((manualAliasList != null) && manualAliasList.Count > 0)
            {
                if (_isRemoveAlias)
                {
                    CollectionListGrid.Columns.Add(_refStyle.CreateBoundField("DELETE", msgHelper.GetMessage("generic delete title"), "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(3), Unit.Percentage(3), false, false));
                    CollectionListGrid.Columns.Add(_refStyle.CreateBoundField("DEFAULT", "<a href=\"urlmanualaliaslistmaint.aspx?orderby=4&action=removealias&fId=" + currentSiteKey.ToString() + "\">" + msgHelper.GetMessage("lbl primary") + "</a>", "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(4), Unit.Percentage(4), false, false));
                    CollectionListGrid.Columns.Add(_refStyle.CreateBoundField("ACTIVE", "<a href=\"urlmanualaliaslistmaint.aspx?orderby=5&action=removealias&fId=" + currentSiteKey.ToString() + "\">" + msgHelper.GetMessage("lbl active") + "</a>", "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(3), Unit.Percentage(3), false, false));
                    CollectionListGrid.Columns.Add(_refStyle.CreateBoundField("LANG", "<a href=\"urlmanualaliaslistmaint.aspx?orderby=2&fId=" + currentSiteKey.ToString() + "\">"+msgHelper.GetMessage("lbl language")+"</a>", "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(4), Unit.Percentage(4), false, false));
                    CollectionListGrid.Columns.Add(_refStyle.CreateBoundField("ALIAS", "<a href=\"urlmanualaliaslistmaint.aspx?orderby=10&action=removealias&fId=" + currentSiteKey.ToString() + "\">" + msgHelper.GetMessage("lbl alias") + "</a>", "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(25), Unit.Percentage(25), false, false));
                    CollectionListGrid.Columns.Add(_refStyle.CreateBoundField("ORIGINAL LINK", "<a href=\"urlmanualaliaslistmaint.aspx?orderby=6&action=removealias&fId=" + currentSiteKey.ToString() + "\">" + msgHelper.GetMessage("lbl original link") + "</a>", "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(35), Unit.Percentage(40), false, false));
                    CollectionListGrid.Columns.Add(_refStyle.CreateBoundField("CONTENT ID", "<a href=\"urlmanualaliaslistmaint.aspx?orderby=1&action=removealias&fId=" + currentSiteKey.ToString() + "\">" + msgHelper.GetMessage("generic content id") + "</a>", "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(10), Unit.Percentage(10), false, false));
                }
                else
                {
                    CollectionListGrid.Columns.Add(_refStyle.CreateBoundField("DEFAULT", "<a href=\"urlmanualaliaslistmaint.aspx?orderby=4&fId=" + currentSiteKey.ToString() + "\">" + msgHelper.GetMessage("lbl primary") + "</a>", "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(4), Unit.Percentage(4), false, false));
                    CollectionListGrid.Columns.Add(_refStyle.CreateBoundField("ACTIVE", "<a href=\"urlmanualaliaslistmaint.aspx?orderby=5&fId=" + currentSiteKey.ToString() + "\">" + msgHelper.GetMessage("lbl active") + "</a>", "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(3), Unit.Percentage(3), false, false));
                    CollectionListGrid.Columns.Add(_refStyle.CreateBoundField("LANG", "<a href=\"urlmanualaliaslistmaint.aspx?orderby=2&fId=" + currentSiteKey.ToString() + "\">" + msgHelper.GetMessage("lbl language") + "</a>", "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(4), Unit.Percentage(4), false, false));
                    CollectionListGrid.Columns.Add(_refStyle.CreateBoundField("ALIAS", "<a href=\"urlmanualaliaslistmaint.aspx?orderby=10&fId=" + currentSiteKey.ToString() + "\">" + msgHelper.GetMessage("lbl alias") + "</a>", "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(25), Unit.Percentage(25), false, false));
                    CollectionListGrid.Columns.Add(_refStyle.CreateBoundField("ORIGINAL LINK", "<a href=\"urlmanualaliaslistmaint.aspx?orderby=6&fId=" + currentSiteKey.ToString() + "\">" + msgHelper.GetMessage("lbl original link") + "</a>", "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(35), Unit.Percentage(40), false, false));
                    CollectionListGrid.Columns.Add(_refStyle.CreateBoundField("CONTENT ID", "<a href=\"urlmanualaliaslistmaint.aspx?orderby=1&fId=" + currentSiteKey.ToString() + "\">" + msgHelper.GetMessage("generic content id") + "</a>", "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(10), Unit.Percentage(10), false, false));
                }

                DataTable dt = new DataTable();
                DataRow dr;
                if (_isRemoveAlias)
                {
                    dt.Columns.Add(new DataColumn("DELETE", typeof(string)));
                }
                dt.Columns.Add(new DataColumn("DEFAULT", typeof(string)));
                dt.Columns.Add(new DataColumn("ACTIVE", typeof(string)));
                dt.Columns.Add(new DataColumn("LANG", typeof(string)));
                dt.Columns.Add(new DataColumn("ALIAS", typeof(string)));
                dt.Columns.Add(new DataColumn("ORIGINAL LINK", typeof(string)));
                dt.Columns.Add(new DataColumn("CONTENT ID", typeof(string)));

                for (int i = 0; i <= manualAliasList.Count - 1; i++)
                {
                    dr = dt.NewRow();
                    if (_isRemoveAlias)
                    {
                        dr["DELETE"] = "<input type=\"checkbox\" name=\"deleteAliasId\" value=\"" + (manualAliasList[i].AliasId.ToString()) + "\">";
                    }
                    if (manualAliasList[i].IsDefault)
                    {
                        defaultIcon = "<center><img src=\"" + _refContentApi.AppPath + "images/ui/icons/check.png\" border=\"0\" alt=\"Item is Enabled\" title=\"Item is Enabled\"/></center>";
                        dr["DEFAULT"] = defaultIcon;
                    }
                    if (manualAliasList[i].IsEnabled)
                    {
                        dr["ACTIVE"] = "<center><span style=\"color:green\">On</span></center>"; //maliaslist(i).IsEnabled"
                    }
                    else
                    {
                        dr["ACTIVE"] = "<center><span style=\"color:red\">Off</span></center>";
                    }
                    for (int iLang = 0; iLang <= languageData.Length - 1; iLang++)
                    {
                        LanguageData with_3 = languageData[iLang];
                        strName = with_3.LocalName;
                        if (manualAliasList[i].ContentLanguage == with_3.Id)
                        {
                            strSelectedLanguageName = strName;
                        }
                    }
                    dr["LANG"] = "<center><img src=" + objLocalizationApi.GetFlagUrlByLanguageID(System.Convert.ToInt32(manualAliasList[i].ContentLanguage)) + " alt=\"" + strSelectedLanguageName + "\" /></center>";
                    dr["ALIAS"] = "<a href=\"urlmanualaliasmaint.aspx?action=view&id=" + manualAliasList[i].AliasId + "&fId=" + manualAliasList[i].SiteId + "&LangType=" + _refContentApi.GetCookieValue("LastValidLanguageID") + "\">" + manualAliasList[i].DisplayAlias + "</a>";
                    if (manualAliasList[i].Target.ToLower().IndexOf("downloadasset.aspx?") == -1)
                    {
                        dr["ORIGINAL LINK"] = manualAliasList[i].Target;
                    }
                    else
                    {
                        string workareaPath = string.Empty;
                        workareaPath = Strings.Replace(_refContentApi.AppPath, _refContentApi.SitePath, "", 1, 1, 0);
                        dr["ORIGINAL LINK"] = workareaPath + manualAliasList[i].Target;
                    }

                    dr["CONTENT ID"] = manualAliasList[i].ContentId;
                    dt.Rows.Add(dr);
                }
                DataView dv = new DataView(dt);
                CollectionListGrid.DataSource = dv;
                CollectionListGrid.DataBind();
            }
        }
    }
示例#4
0
    private bool DisplayEditConfiguration()
    {
        SiteAPI m_refSiteApi = new SiteAPI();
        UserAPI m_refUserApi = new UserAPI();
        SettingsData settings_data;
        UserData user_data;
        UserGroupData[] group_data;
        UserPreferenceData preference_data;

        try
        {
            AppImgPath = m_refSiteApi.AppImgPath;
            AppName = m_refSiteApi.AppName;
            AppPath = m_refSiteApi.AppPath;
            SITEPATH = m_refSiteApi.SitePath;
            user_data = m_refUserApi.GetUserById(Ektron.Cms.Common.EkConstants.BuiltIn, false, false);
            preference_data = m_refUserApi.GetUserPreferenceById(0);
            group_data = m_refUserApi.GetAllUserGroups("GroupName");
            VerifyTrue = "<img src=\"" + AppPath + "images/UI/Icons/check.png\" border=\"0\" alt=\"Item is Enabled\" title=\"Item is Enabled\">";
            VerifyFalse = "<img src=\"" + AppImgPath + "icon_redx.gif\" border=\"0\" alt=\"Item is Disabled\" title=\"Item is Disabled\">";
            settings_data = m_refSiteApi.GetSiteVariables(m_refSiteApi.UserId, true);
            jsContentLanguage.Text = Convert.ToString(settings_data.Language);
            //VERSION
            td_version.InnerHtml = m_refMsg.GetMessage("version") + m_refSiteApi.Version + "&nbsp;" + m_refSiteApi.ServicePack;
            //BUILD NUMBER
            td_buildnumber.InnerHtml = "<i>(" + m_refMsg.GetMessage("build") + m_refSiteApi.BuildNumber + ")</i>";

            //Which Editor
            m_SelectedEditControl = Utilities.GetEditorPreference(Request);

            //LICENSE
            //defect: 60170
            //td_licensekey.InnerHtml = "<input type=\"text\" maxlength=\"4000\" name=\"license\" value=\"" + settings_data.LicenseKey + "\" />";
            td_licensekey.InnerHtml ="<TEXTAREA name=\"license\" rows=\"1\" cols=\"1\">" + settings_data.LicenseKey + "</TEXTAREA>";
            td_licensekey.InnerHtml += "<input type=\"hidden\" maxlength=\"4000\" name=\"license1\" value=\"" + settings_data.LicenseKey + "\" />";
            td_licensekey.InnerHtml += "<br/>";
            td_licensekey.InnerHtml += "<span class=\"ektronCaption\">" + m_refMsg.GetMessage("license key help text") + "</span>";
            //MODULE LICENSE
            System.Text.StringBuilder module_text = new System.Text.StringBuilder();
            int i = 0;
            if (!(settings_data.ModuleLicense == null))
            {
                for (i = 0; i <= settings_data.ModuleLicense.Length - 1; i++)
                {
                    if (i > 0)
                    {
                        module_text.Append("<div class=\"ektronTopSpaceSmall\"></div>");
                    }
                    module_text.Append(i + 1 + ". ");
                    module_text.Append("<input type=\"text\" maxlength=\"4000\" name=\"mlicense" + (i + 1) + "\" value=\"" + settings_data.ModuleLicense[i].License + "\">" + "\r\n");
                    module_text.Append("<input type=\"hidden\" name=\"mlicenseid" + (i + 1) + "\" value=\"" + settings_data.ModuleLicense[i].Id + "\">" + "\r\n");
                }
            }
            module_text.Append("<div class=\"ektronTopSpaceSmall\"></div>");
            module_text.Append(i + 1 + ". ");
            module_text.Append("<input type=\"text\" maxlength=\"4000\" name=\"mlicense" + (i + 1) + "\" value=\"\">" + "\r\n");
            module_text.Append("<input type=\"hidden\" name=\"mlicenseid" + (i + 1) + "\" value=\"0\">" + "\r\n");

            td_modulelicense.InnerHtml = module_text.ToString();
            //LANGUAGE LIST
            LanguageData[] active_lang_list;
            active_lang_list = m_refSiteApi.GetAllActiveLanguages();

            td_languagelist.InnerHtml = "<select id=\"language\" name=\"language\" selectedindex=\"0\">";
            if (!(active_lang_list == null))
            {
                for (i = 0; i <= active_lang_list.Length - 1; i++)
                {
                    //If (Convert.ToString(active_lang_list(i).Id) = settings_data.Language) Then
                    td_languagelist.InnerHtml += "<option  value=\"" + active_lang_list[i].Id + "\" ";
                    if (Convert.ToString(active_lang_list[i].Id) == settings_data.Language)
                    {
                        td_languagelist.InnerHtml += " selected";
                    }
                    td_languagelist.InnerHtml += "> " + active_lang_list[i].Name + "</option>";
                    //End If
                }
            }
            td_languagelist.InnerHtml += "</select>";

            //These settings only appliy to the eWebEditPro editor
            if (ConfigurationManager.AppSettings["ek_DataDesignControl"] != null && ConfigurationManager.AppSettings["ek_DataDesignControl"].ToString() == "eWebEditPro")
            {
                trSettings.Visible = true;
                trSummary.Visible = true;
                //MAX CONTENT SIZE
                td_maxcontent.InnerHtml = "<input type=\"Text\" maxlength=\"9\" size=\"9\" name=\"content_size\" value=\"" + settings_data.MaxContentSize + "\">";
                td_maxcontent.InnerHtml += "<br/>";
                td_maxcontent.InnerHtml += "<span class=\"ektronCaption\">" + m_refMsg.GetMessage("settings max content help text") + "</span>";

                //MAX SUMMARY SIZE

                td_maxsummary.InnerHtml = "<input type=\"Text\" maxlength=\"9\" size=\"9\" name=\"summary_size\" value=\"" + settings_data.MaxSummarySize + "\" >";
                td_maxsummary.InnerHtml += "<br/>";
                td_maxsummary.InnerHtml += "<span class=\"ektronCaption\">" + m_refMsg.GetMessage("settings max summary help text") + "</span>";
            }

            //SYSTEM EMAIL

            td_email.InnerHtml = "<input type=\"Text\" maxlength=\"50\" size=\"25\" name=\"SystemEmaillAddr\" value=\"" + settings_data.Email + "\">";
            td_email.InnerHtml += "<div class=\"ektronCaption\">";

            //EMAIL NOTIFICATION

            if (settings_data.EnableMessaging)
            {
                td_email.InnerHtml += "<input type=\"CHECKBOX\" name=\"EnableMessaging\" value=\"enable_msg\" CHECKED=\"True\">";
            }
            else
            {
                td_email.InnerHtml += "<input type=\"CHECKBOX\" name=\"EnableMessaging\" value=\"enable_msg\">";
            }
            td_email.InnerHtml += m_refMsg.GetMessage("enable mail messages") + "&nbsp;";
            td_email.InnerHtml += "</div>";

            //Server Type
            if (Convert.ToBoolean(settings_data.AsynchronousStaging))
            {
                td_server_type.InnerHtml += "<input type=\"CHECKBOX\" name=\"SystemAsynchStaging\" value=\"enable_msg\" CHECKED=\"True\">";
            }
            else
            {
                td_server_type.InnerHtml = "<input type=\"CHECKBOX\" name=\"SystemAsynchStaging\" value=\"enable_msg\" >";
            }
            td_server_type.InnerHtml += "Staging Server" + "&nbsp;";
            td_server_type.InnerHtml += "<br/>";
            td_server_type.InnerHtml += "<span class=\"ektronCaption\">" + m_refMsg.GetMessage("lbl enable server type message") + "</span>";

            //Asyncronous Processor Location

            if (!(settings_data.AsynchronousLocation == null))
            {
                // OldSystemAsynchLocation is needed because a disabled input field is not posted
                td_asynch_location.InnerHtml = "<input type=\"Hidden\" name=\"OldSystemAsynchLocation\" value=\"" + settings_data.AsynchronousLocation + "\">";
                td_asynch_location.InnerHtml += "<input type=\"Text\" maxlength=\"255\" name=\"SystemAsynchLocation\" value=\"" + settings_data.AsynchronousLocation + "\"";
            }
            else
            {
                td_asynch_location.InnerHtml = "<input type=\"Text\" maxlength=\"255\" name=\"SystemAsynchLocation\" value=\"\"";
            }
            td_asynch_location.InnerHtml += ">";
            td_asynch_location.InnerHtml += "<br/>";
            td_asynch_location.InnerHtml += "<span class=\"ektronCaption\">";
            td_asynch_location.InnerHtml += m_refMsg.GetMessage("lbl Example Location") + " http://localhost/CMS400Developer/Workarea/webservices/EktronAsyncProcessorWS.asmx";
            td_asynch_location.InnerHtml += "</span>";

            //PUBLISHPDF and PUBLISHHTML would check this flag.
            if (settings_data.PublishPdfSupported)
            {
                string schk = "";
                if (settings_data.PublishPdfEnabled)
                {
                    schk = " checked ";
                }
                PubPdf.Text = "<tr>";
                PubPdf.Text += "<td class=\"label shortLabel\">";
                PubPdf.Text += "<label for=\"PublishPdfEnabled\">" + m_refMsg.GetMessage("alt Enable office documents to be published in other format") + ":" + "</label>";
                PubPdf.Text += "</td>";
                PubPdf.Text += "<td class=\"value\">";
                PubPdf.Text += "<input type=\"checkbox\" name=\"PublishPdfEnabled\" id=\"PublishPdfEnabled\"" + schk + " >";
                PubPdf.Text += "</td>";
                PubPdf.Text += "</tr>";
            }
            else
            {
                PubPdf.Visible = false;
            }
            //LIBRARY FOLDER CREATION

            if (settings_data.FileSystemSupport)
            {
                td_libfolder.InnerHtml = "<input type=\"CHECKBOX\" name=\"filesystemsupport\" value=\"enable_msg\" CHECKED=\"True\" Onclick=\"javascript:return AreYouSure();\">";
            }
            else
            {
                td_libfolder.InnerHtml = "<input type=\"CHECKBOX\" name=\"filesystemsupport\" value=\"enable_msg\" Onclick=\"javascript: return AreYouSure()\">";
            }

            //BUILT IN USER
            //Dim x As System.Web.UI.WebControls.TextBox

            userid.Value = user_data.Id.ToString();
            username.Value = user_data.Username;
            TD_Pwd.InnerHtml = "<input type=\"password\" value=\"" + user_data.Password + "\" id=\"pwd\" name=\"pwd\" maxlength=\"50\" Onkeypress=\"javascript:return CheckKeyValue(event,\'34\');\">";
            TD_Pwd2.InnerHtml = "<input type=\"password\" value=\"" + user_data.Password + "\" id=\"confirmpwd\" name=\"confirmpwd\" maxlength=\"50\" Onkeypress=\"javascript:return CheckKeyValue(event,\'34\');\">";
            if ((m_refUserApi.RequestInformationRef.LoginAttempts != -1) && (m_refUserApi.IsAdmin() || m_refUserApi.UserId == 999999999 || (m_refUserApi.IsARoleMember(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.AdminUsers))))
            {
                accountLocked.Text = "<input type=\"checkbox\" id=\"chkAccountLocked\" name=\"chkAccountLocked\" ";
                if (user_data.IsAccountLocked(m_refUserApi.RequestInformationRef))
                {
                    accountLocked.Text += " checked ";
                }
                accountLocked.Text += " />";
            }
            else
            {
                accountLocked.Text = "<input type=\"hidden\" id=\"chkAccountLocked\" name=\"chkAccountLocked\" ";
                if (user_data.IsAccountLocked(m_refUserApi.RequestInformationRef))
                {
                    accountLocked.Text += " value=\"on\" />";
                }
                else
                {
                    accountLocked.Text += " value=\"\" />";
                }
            }
            //styles.Items.Add(New ListItem(m_refMsg.GetMessage("remove styles"), "remove"))
            //styles.Items.Add(New ListItem(m_refMsg.GetMessage("do not remove styles"), ""))
            //If (settings_data.RemoveStyles) Then
            //    styles.Items(0).Selected = True
            //Else
            //    styles.Items(1).Selected = True
            //End If
            //styles.Attributes.Add("onClick", "javascript:checkWordStlyes();")
            //If (settings_data.RemoveStyles) Then
            //    'jsRemoveStyle = "1"
            //End If

            if (settings_data.EnableFontButtons)
            {
                font_style.Checked = true;
            }
            if (settings_data.PreserveWordStyles)
            {
                word_styles.Checked = true;
            }
            if (settings_data.PreserveWordClasses)
            {
                word_classes.Checked = true;
            }

            if (preference_data.Template != "")
            {
                templatefilename.Value = preference_data.Template;
            }
            if (Convert.ToString(preference_data.FolderId) == "")
            {
                chkSmartDesktop.Checked = true;
            }
            folderId.Value = preference_data.FolderId;
            if (preference_data.ForceSetting)
            {
                forcePrefs.Checked = true;
            }
            //if (preference_data.DisplayTitleText == "1")
            //{
                //disptitletext.Checked = true;
            //}
            //txtHeight.Value = Convert.ToString(preference_data.Height)
            //txtWidth.Value = Convert.ToString(preference_data.Width)

            if (settings_data.VerifyUserOnAdd)
            {
                chkVerifyUserOnAdd.Checked = true;
            }

            if (settings_data.EnablePreApproval)
            {
                chkEnablePreApproval.Checked = true;
            }

            access_def.Value = settings_data.Accessibility;

            SetAccessibilityRadioButtons();

            return (false);
        }
        catch
        {
            return true;
        }
    }
示例#5
0
    private void Page_Load(System.Object sender, System.EventArgs e)
    {
        RegisterResources();

        SiteAPI m_refSiteApi = new SiteAPI();
        m_refMsg = m_refSiteApi.EkMsgRef;
        SettingsData settings_data;
        UserData user_data;
        UserGroupData[] group_data;
        UserPreferenceData preference_data;
        AppImgPath = m_refSiteApi.AppImgPath;
        AppName = m_refSiteApi.AppName;
        SITEPATH = m_refSiteApi.SitePath;
        user_data = m_refUserApi.GetUserById(Ektron.Cms.Common.EkConstants.BuiltIn, false, false);
        preference_data = m_refUserApi.GetUserPreferenceById(0);
        group_data = m_refUserApi.GetAllUserGroups("GroupName");
        VerifyTrue = "<img src=\"" + AppImgPath + "../UI/Icons/check.png\" border=\"0\" alt=\"Item is Enabled\" title=\"Item is Enabled\">";
        VerifyFalse = "<img src=\"" + AppImgPath + "icon_redx.gif\" border=\"0\" alt=\"Item is Disabled\" title=\"Item is Disabled\">";
        SetStrings();
        settings_data = m_refSiteApi.GetSiteVariables(m_refSiteApi.UserId, true);
        //VERSION
        td_version.InnerHtml = m_refMsg.GetMessage("version") + "&nbsp;" + m_refSiteApi.Version + "&nbsp;" + m_refSiteApi.ServicePack;
        //BUILD NUMBER
        td_buildnumber.InnerHtml = "<i>(" + m_refMsg.GetMessage("build") + m_refSiteApi.BuildNumber + ")</i>";

        //Which Editor
        m_SelectedEditControl = Utilities.GetEditorPreference(Request);
        if (m_SelectedEditControl == "ContentDesigner")
            tr_wordclass.Visible = true;

        LanguageData language_data;
        language_data = m_refSiteApi.GetLanguageById(m_refSiteApi.DefaultContentLanguage);
        td_Language.InnerHtml = language_data.Name;
        //LICENSE

        if (settings_data.LicenseKey.Length > 0)
        {
            td_licensekey.InnerHtml = settings_data.LicenseKey;
        }
        else
        {
            td_licensekey.InnerHtml = m_refMsg.GetMessage("none specified msg");
        }

        //MODULE LICENSE
        System.Text.StringBuilder module_text = new System.Text.StringBuilder();
        int i = 0;
        if (!(settings_data.ModuleLicense == null))
        {
            for (i = 0; i <= settings_data.ModuleLicense.Length - 1; i++)
            {
                module_text.Append(i + 1 + "." + settings_data.ModuleLicense[i].License);
                module_text.Append("<br/>");
            }
        }
        else
        {
            module_text.Append(m_refMsg.GetMessage("none specified msg"));
        }

        td_modulelicense.InnerHtml = module_text.ToString();
        //LANGUAGE LIST
        LanguageData[] active_lang_list;
        active_lang_list = m_refSiteApi.GetAllActiveLanguages();

        td_languagelist.InnerHtml = m_refMsg.GetMessage("none specified msg");
        if (!(active_lang_list == null))
        {
            for (i = 0; i <= active_lang_list.Length - 1; i++)
            {
                if (Convert.ToString(active_lang_list[i].Id) == settings_data.Language)
                {
                    td_languagelist.InnerHtml = active_lang_list[i].Name;
                    break;
                }
            }
        }

        //MAX CONTENT SIZE

        //td_maxcontent.InnerHtml = settings_data.MaxContentSize

        //MAX SUMMARY SIZE

        //td_maxsummary.InnerHtml = settings_data.MaxSummarySize;

        //SYSTEM EMAIL

        if (settings_data.Email.Length > 0)
        {
            td_email.InnerHtml = settings_data.Email;
        }
        else
        {
            td_email.InnerHtml = m_refMsg.GetMessage("none specified msg");
        }

        //EMAIL NOTIFICATION

        if (settings_data.EnableMessaging)
        {
            td_email_msg.InnerHtml = m_refMsg.GetMessage("sending email enabled msg");
        }
        else
        {
            td_email_msg.InnerHtml = m_refMsg.GetMessage("sending email disabled msg");
        }

        //Server Type
        td_server_type.InnerHtml += GetCheckValue(bool.Parse(settings_data.AsynchronousStaging)) + "&nbsp;" + m_refMsg.GetMessage("lbl enable server type message");

        //Asyncronous Processor Location

        if (!(settings_data.AsynchronousLocation == null) && (settings_data.AsynchronousLocation.Length > 0))
        {
            td_asynch_location.InnerHtml = settings_data.AsynchronousLocation;
        }
        else
        {
            td_asynch_location.InnerHtml = m_refMsg.GetMessage("none specified msg");
        }

        //PUBPDF
        trPublishPDF.Visible = settings_data.PublishPdfSupported;
        td_publish_pdf.InnerHtml += GetCheckValue(settings_data.PublishPdfEnabled) + "&nbsp;" + m_refMsg.GetMessage("alt Enable office documents to be published in other format");

        //LIBRARY FOLDER CREATION
        td_libfolder.InnerHtml = GetCheckValue(settings_data.FileSystemSupport) + "&nbsp;";
        td_libfolder.InnerHtml += m_refMsg.GetMessage("library filesystem folder prompt") + "&nbsp;";

        //BUILT IN USER
        td_user.InnerHtml = user_data.Username;
        //td_removestyle.InnerHtml = GetCheckValue(settings_data.RemoveStyles) & "&nbsp;" & m_refMsg.GetMessage("remove styles")
        td_enablefont.InnerHtml = GetCheckValue(settings_data.EnableFontButtons) + "&nbsp;" + m_refMsg.GetMessage("enable font buttons") + "&nbsp;";
        td_wordstyle.InnerHtml = GetCheckValue(settings_data.PreserveWordStyles) + "&nbsp;" + m_refMsg.GetMessage("preserve word styles");
        td_wordclass.InnerHtml = GetCheckValue(settings_data.PreserveWordClasses) + "&nbsp;" + m_refMsg.GetMessage("preserve word classes");
        td_access.InnerHtml = GetAccessibilityValue(settings_data.Accessibility);

        if (preference_data.Template == "")
        {
            td_template.InnerHtml = m_refMsg.GetMessage("refresh login page msg");
        }
        else
        {
            td_template.InnerHtml = SITEPATH + EkFunctions.HtmlEncode(preference_data.Template);
        }

        td_folder.InnerHtml = "<input type=\"checkbox\" disabled ";
        if (Convert.ToString(preference_data.FolderId) == "")
        {
            td_folder.InnerHtml += " checked ";
        }
        td_folder.InnerHtml += " id=\"checkbox\" name=\"chkSmartDexktop\">";
        td_force.InnerHtml = "<input type=\"checkbox\" disabled ";
        if (preference_data.ForceSetting)
        {
            td_force.InnerHtml += " checked ";
        }
        td_force.InnerHtml += " id=\"Checkbox1\" name=\"forcePrefs\">";
        //td_titletext.InnerHtml = "<input type=\"checkbox\" id=\"disptitletext\" disabled ";
        //if (!string.IsNullOrEmpty(preference_data.DisplayTitleText))
        //{
            //td_titletext.InnerHtml += " checked ";
        //}
        //td_titletext.InnerHtml += "name=\"disptitletext\">";
        //td_height.InnerHtml = preference_data.Height & "px"
        //td_width.InnerHtml = preference_data.Width & "px"

        td_verify_user_on_add.InnerHtml = "<input type=\"checkbox\" disabled ";
        if (settings_data.VerifyUserOnAdd)
        {
            td_verify_user_on_add.InnerHtml += " checked ";
        }
        td_verify_user_on_add.InnerHtml += " id=\"chkVerifyUserOnAdd\" name=\"chkVerifyUserOnAdd\" >";

        td_enable_preapproval.InnerHtml = "<input type=\"checkbox\" disabled ";
        if (settings_data.EnablePreApproval)
        {
            td_enable_preapproval.InnerHtml += " checked ";
        }
        td_enable_preapproval.InnerHtml += " id=\"chkEnablePreapproval\" name=\"chkEnablePreapproval\" >";
    }
示例#6
0
    public System.String ShowAllActiveLanguage(System.Boolean showAllOpt, System.String bgColor, System.String OnChangeEvt, System.String SelLang, bool showOnlySiteEnabled)
    {
        StringBuilder result = new StringBuilder();
        LanguageData[] language_data;
        SiteAPI m_refSiteApi = new SiteAPI();
        int LanguageId = m_refSiteApi.ContentLanguage;
        try
        {
            if (OnChangeEvt == "")
            {
                OnChangeEvt = "SelLanguage(this.value)";
            }
            if (SelLang.Trim() != "")
            {
                LanguageId = Convert.ToInt32(SelLang);
            }
            language_data = m_refSiteApi.GetAllActiveLanguages();
            result = new StringBuilder();
            if (m_refAPI.EnableMultilingual == 1)
            {
                result.Append("<select id=\"frm_langID\" name=\"frm_langID\" OnChange=\"" + OnChangeEvt + "\">" + "\r\n");
                if (showAllOpt)
                {
                    result.Append("<option value=\"" + Ektron.Cms.Common.EkConstants.ALL_CONTENT_LANGUAGES + "\"");
                    if (LanguageId == Ektron.Cms.Common.EkConstants.ALL_CONTENT_LANGUAGES)
                    {
                        result.Append(" selected=\"selected\"");
                    }
                    result.Append(">");
                    result.Append("All");
                    result.Append("</option>");
                }
                if (!(language_data == null))
                {

                    foreach (LanguageData lang in language_data)
                    {
                        result.Append(AddLanguageOption(lang, LanguageId, showOnlySiteEnabled));
                    }
                }
                result.Append("</select>");
            }
        }
        catch (Exception)
        {
            result.Length = 0;
        }
        return (result.ToString());
    }
示例#7
0
    private string ShowFilteredLangs(bool showAllOpt, string bgColor, string OnChangeEvt, int SelLang, string csvLangList, bool ExcludeLangsInList)
    {
        // See "ShowActiveLangsInList" and "ShowActiveLangsNotInList"
        StringBuilder sbResult = new StringBuilder();
        int[] aryLangFilterList;
        SiteAPI refSiteApi = new SiteAPI();
        int nContentLanguage;

        if (m_refAPI.EnableMultilingual == 1)
        {
            nContentLanguage = SelLang;
            if (Ektron.Cms.Common.EkConstants.CONTENT_LANGUAGES_UNDEFINED == nContentLanguage)
            {
                nContentLanguage = refSiteApi.ContentLanguage;
            }

            if (OnChangeEvt == "")
            {
                OnChangeEvt = "SelLanguage(this.value)";
            }

            string[] aryLangList;
            aryLangList = csvLangList.Split(",".ToCharArray());
            if (aryLangList.Length > 0)
            {
                aryLangFilterList = new int[aryLangList.Length - 1 + 1];
                for (int iLang = 0; iLang <= aryLangList.Length - 1; iLang++)
                {
                    string strLang = aryLangList[iLang].Trim();
                    if (Information.IsNumeric(strLang))
                    {
                        aryLangFilterList[iLang] = Convert.ToInt32(strLang);
                    }
                    else
                    {
                        aryLangFilterList[iLang] = Ektron.Cms.Common.EkConstants.CONTENT_LANGUAGES_UNDEFINED;
                    }
                }
            }
            else
            {
                if (ExcludeLangsInList)
                {
                    aryLangFilterList = null;
                }
                else
                {
                    aryLangFilterList = new int[1];
                    aryLangFilterList[0] = nContentLanguage;
                }
            }

            sbResult.Append("<select id=\"frm_langID\" name=\"frm_langID\" OnChange=\"" + OnChangeEvt + "\">" + "\r\n");

            if (showAllOpt)
            {
                if (Ektron.Cms.Common.EkConstants.ALL_CONTENT_LANGUAGES == nContentLanguage)
                {
                    sbResult.Append("<option value=\"" + Ektron.Cms.Common.EkConstants.ALL_CONTENT_LANGUAGES + "\" selected=\"selected\">All</option>");
                }
                else
                {
                    sbResult.Append("<option value=\"" + Ektron.Cms.Common.EkConstants.ALL_CONTENT_LANGUAGES + "\">All</option>");
                }
            }

            if (ExcludeLangsInList)
            {
                sbResult.Append("<option value=\"0\">Select a Language</option>");
            }

            LanguageData[] aryLangData;
            aryLangData = refSiteApi.GetAllActiveLanguages();

            for (int iLang = 0; iLang <= aryLangData.Length - 1; iLang++)
            {
                LanguageData with_1 = aryLangData[iLang];
                if (with_1.Id != Ektron.Cms.Common.EkConstants.CONTENT_LANGUAGES_UNDEFINED)
                {
                    if (IsInList(with_1.Id, aryLangFilterList) ^ ExcludeLangsInList)
                    {
                        sbResult.Append("<option value=\"" + with_1.Id + "\"");
                        if (with_1.Id == nContentLanguage)
                        {
                            sbResult.Append(" selected=\"selected\"");
                        }
                        else
                        {
                        }
                        sbResult.Append(">");
                        sbResult.Append(with_1.LocalName);
                        sbResult.Append("</option>");
                    }
                }
            }
            sbResult.Append("</select>");
        }

        return sbResult.ToString();
    }
示例#8
0
    private void Page_Load(System.Object sender, System.EventArgs e)
    {
        int count = 0;
          	m_refMsg = (new CommonApi()).EkMsgRef;
            System.Text.StringBuilder result = new System.Text.StringBuilder();
            Ektron.Cms.API.JS.RegisterJS(this, Ektron.Cms.API.JS.ManagedScript.EktronWorkareaHelperJS);
            AppImgPath = m_refContentApi.AppImgPath;
            result.Append("<table><tr>" + "\r\n");

            if (EnableDefaultTitlePrefix)
            {
                m_strTitlePrefix = m_refMsg.GetMessage("content reports title bar msg");
            }

            if (!(Request.QueryString["action"] == null))
            {
                PageAction = Request.QueryString["action"].ToLower();
            }

            bool addDivider = false;

            if (PageAction == "viewallreporttypes")
            {
                txtTitleBar.InnerHtml = m_refStyle.GetTitleBar(m_strTitlePrefix);
                result.Append(m_refStyle.GetButtonEventsWCaption(this.m_refContentApi.AppPath + "images/UI/Icons/back.png", "history.back()", m_refMsg.GetMessage("alt back button text"), m_refMsg.GetMessage("btn back"), "", StyleHelper.BackButtonCssClass, true));

                addDivider = true;
            }
            else
            {
                bool primaryCssApplied = false;

                txtTitleBar.InnerHtml = m_refStyle.GetTitleBar(m_strTitlePrefix + " " + TitleBarMsg);
                if (PageAction == "viewcheckedout")
                {
                    if (!(Data == null))
                    {
                        result.Append(m_refStyle.GetButtonEventsWCaption(this.m_refContentApi.AppPath + "images/UI/Icons/checkIn.png", "#", m_refMsg.GetMessage("alt:checkin all selected icon text"), m_refMsg.GetMessage("btn checkin"), "onclick=\"return GetIDs();\"", StyleHelper.CheckInButtonCssClass, !primaryCssApplied));

                        primaryCssApplied = true;
                        addDivider = true;
                    }
                }

                if (PageAction == "contentreviews")
                {
                    if (!(Data == null))
                    {
                        result.Append(m_refStyle.GetButtonEventsWCaption(this.m_refContentApi.AppPath + "images/UI/Icons/save.png", "#", m_refMsg.GetMessage("alt:save all sel rev icon text"), m_refMsg.GetMessage("btn save"), "onclick=\"CheckApproveSelect(); return false;\"", StyleHelper.SaveButtonCssClass, !primaryCssApplied));

                        primaryCssApplied = true;
                        addDivider = true;
                    }
                }

                if (PageAction == "contentflags")
                {
                    result.Append(m_refStyle.GetButtonEventsWCaption(this.m_refContentApi.AppPath + "images/UI/Icons/chartBar.png", "#", "Click here to view report", m_refMsg.GetMessage("btn report"), "onclick=\"return ReportContentFlags();\"", StyleHelper.ViewReportButtonCssClass, !primaryCssApplied));

                    primaryCssApplied = true;
                    addDivider = true;
                }

                if (PageAction == "viewcheckedin")
                {
                    if (!(Data == null))
                    {
                        result.Append(m_refStyle.GetButtonEventsWCaption(this.m_refContentApi.AppPath + "images/UI/Icons/approvalSubmitFor.png", "#", m_refMsg.GetMessage("alt:submit all selected icon text"), m_refMsg.GetMessage("btn submit"), "onclick=\"return GetIDs();\"", StyleHelper.ApproveButtonCssClass, !primaryCssApplied));

                        primaryCssApplied = true;
                        addDivider = true;
                    }
                }

                if (PageAction == "viewtoexpire")
                {
                    result.Append(m_refStyle.GetButtonEventsWCaption(this.m_refContentApi.AppPath + "images/UI/Icons/chartBar.png", "#", "Click here to view report", m_refMsg.GetMessage("btn report"), "onclick=\"return ReportContentToExpire();\"", StyleHelper.ViewReportButtonCssClass, !primaryCssApplied));

                    primaryCssApplied = true;
                    addDivider = true;
                }

                result.Append("<td>");

                if (true == HasData)
                {
                    result.Append(m_refStyle.GetButtonEventsWCaption(this.m_refContentApi.AppPath + "images/UI/Icons/print.png", "#", m_refMsg.GetMessage("Print Report button text"), m_refMsg.GetMessage("btn print"), "onclick=\"PrintReport();\"", StyleHelper.PrintButtonCssClass, !primaryCssApplied));

                    primaryCssApplied = true;

                    if (EnableEmail)
                    {
                        result.Append(m_refStyle.GetButtonEventsWCaption(this.m_refContentApi.AppPath + "images/UI/Icons/email.png", "#", m_refMsg.GetMessage("Email Report button text"), m_refMsg.GetMessage("btn email"), "onclick=\"LoadUserListChildPage(\'" + PageAction + "\');\"", StyleHelper.EmailButtonCssClass));
                    }

                    addDivider = true;
                }

                if ((PageAction.ToLower() != "siteupdateactivity") && (PageAction.ToLower() != "viewasynchlogfile") && (PageAction.ToLower() != "viewpreapproval") && EnableFolders)
                {
                    result.Append("<td>");
                    result.Append(m_refStyle.GetButtonEventsWCaption(this.m_refContentApi.AppPath + "images/UI/Icons/folder.png", "#", m_refMsg.GetMessage("filter report folder"), m_refMsg.GetMessage("filter report folder"), "onclick=\"LoadFolderChildPage(\'" + PageAction + "\',\'" + ContentLanguage + "\');\"", StyleHelper.FilterReportButtonCssClass, !primaryCssApplied));

                    primaryCssApplied = true;
                    addDivider = true;
                }

                result.Append("<td>");
                if (! Utilities.IsMac() && "siteupdateactivity" == PageAction.ToLower() && true == HasData)
                {
                    result.Append(m_refStyle.GetButtonEventsWCaption(this.m_refContentApi.AppPath + "images/UI/Icons/tableExport.png", "#", m_refMsg.GetMessage("btn export"), m_refMsg.GetMessage("btn export"), "onclick=\"export_result();\"", StyleHelper.ExportButtonCssClass, !primaryCssApplied));

                    primaryCssApplied = true;
                    addDivider = true;
                }
            }

            if (addDivider)
            {
                result.Append(StyleHelper.ActionBarDivider);
            }

            if (EnableMultilingual == 1 && (PageAction.ToLower() != "viewasynchlogfile") && (PageAction.ToLower() != "viewpreapproval"))
            {
                SiteAPI m_refsite = new SiteAPI();
                LanguageData[] language_data = m_refsite.GetAllActiveLanguages();
                count = 0;
                result.Append("<td class=\"label\">");
                result.Append(m_refMsg.GetMessage("lbl View") + ":");
                result.Append("</td>");
                result.Append("<td>");
                result.Append("<select id=selLang name=selLang OnChange=\"LoadLanguage(\'selections\');\">");
                if (ContentLanguage == -1)
                {
                    result.Append("<option value=" + Ektron.Cms.Common.EkConstants.ALL_CONTENT_LANGUAGES + " selected>All</option>");
                }
                else
                {
                    result.Append("<option value=" + Ektron.Cms.Common.EkConstants.ALL_CONTENT_LANGUAGES + ">All</option>");
                }
                for (count = 0; count <= language_data.Length - 1; count++)
                {
                    if (Convert.ToString((short) ContentLanguage) == Convert.ToString(language_data[count].Id))
                    {
                        result.Append("<option value=" + language_data[count].Id + " selected>" + language_data[count].Name + "</option>");
                    }
                    else
                    {
                        result.Append("<option value=" + language_data[count].Id + ">" + language_data[count].Name + "</option>");
                    }
                }
                result.Append("</select>");
                result.Append("</td>");
            }
            if ((PageAction.ToLower() != "viewasynchlogfile") && (PageAction.ToLower() != "viewpreapproval") && EnableContentTypes)
            {
                GetAddMultiType();
                // If there is no content type from querystring check for the cookie and restore it to that value else all types

                if (Request.QueryString[Ektron.Cms.Common.EkConstants.ContentTypeUrlParam] != "")
                {
                    if (Information.IsNumeric(Request.QueryString[Ektron.Cms.Common.EkConstants.ContentTypeUrlParam]))
                    {
                        lContentType = Convert.ToInt32(Request.QueryString[Ektron.Cms.Common.EkConstants.ContentTypeUrlParam]);
                        m_refContentApi.SetCookieValue(Ektron.Cms.Common.EkConstants.ContentTypeUrlParam, lContentType.ToString());
                    }
                }
                else if (Ektron.Cms.CommonApi.GetEcmCookie()[Ektron.Cms.Common.EkConstants.ContentTypeUrlParam] != "")
                {
                    if (Information.IsNumeric(Ektron.Cms.CommonApi.GetEcmCookie()[Ektron.Cms.Common.EkConstants.ContentTypeUrlParam]))
                    {
                        lContentType = System.Convert.ToInt32(Ektron.Cms.CommonApi.GetEcmCookie()[Ektron.Cms.Common.EkConstants.ContentTypeUrlParam]);
                    }
                }
            }

            result.Append(StyleHelper.ActionBarDivider);

            result.Append("<td>");
            result.Append(m_refStyle.GetHelpButton(m_strPageAction, ""));
            result.Append("</td>");
            result.Append("</tr></table>");
            htmToolBar.InnerHtml = result.ToString();
    }
示例#9
0
    private void ViewToolBar()
    {
        System.Text.StringBuilder result = new System.Text.StringBuilder();
        int count = 0;
        int lAddMultiType = 0;
        Collection fldr;

        if (_Folder == "")
        {
            divTitleBar.InnerHtml = _StyleHelper.GetTitleBar((string)(_MessageHelper.GetMessage("view all awaiting approval") + ""));
        }
        else
        {
            fldr = _EkContent.GetFolderInfov2_0(Convert.ToInt64(_Folder));
            divTitleBar.InnerHtml = _StyleHelper.GetTitleBar((string)(_MessageHelper.GetMessage("view awaiting approval (folder)") + " \"" + fldr["FolderName"] + "\""));
        }
        result.Append("<table><tr>");

        if (Request.QueryString["page"] == "workarea")
        {
            // redirect to workarea when user clicks back button if we're in workarea
            result.Append(_StyleHelper.GetButtonEventsWCaption(_CommonApi.AppPath + "images/UI/Icons/back.png", "javascript:top.switchDesktopTab()", _MessageHelper.GetMessage("alt back button text"), _MessageHelper.GetMessage("btn back"), "", StyleHelper.BackButtonCssClass, true));
        }
        else if (_Folder != "")
        {
            result.Append(_StyleHelper.GetButtonEventsWCaption(_CommonApi.AppPath + "images/UI/Icons/back.png", "approval.aspx?action=viewApprovalList", _MessageHelper.GetMessage("alt back button text"), _MessageHelper.GetMessage("btn back"), "", StyleHelper.BackButtonCssClass, true));
        }

        bool primaryCssApplied = false;

        if (_ApprovalsCollection.Count > 0)
        {
            result.Append(_StyleHelper.GetButtonEventsWCaption(_CommonApi.AppPath + "Images/ui/icons/approvalApproveItem.png", "#", _MessageHelper.GetMessage("alt approve all selected button text"), _MessageHelper.GetMessage("btn approve all"), "onclick=\"return Ektron.Workarea.Reports.Approval.submit(true);\"", StyleHelper.ApproveButtonCssClass, !primaryCssApplied));

            primaryCssApplied = true;

            result.Append(_StyleHelper.GetButtonEventsWCaption(_CommonApi.AppPath + "Images/ui/icons/approvalDenyItem.png", "#", _MessageHelper.GetMessage("alt deny all selected button text"), _MessageHelper.GetMessage("btn deny all"), "onclick=\"return Ektron.Workarea.Reports.Approval.submit(false);\"", StyleHelper.DeclineButtonCssClass));
        }

        if (!string.IsNullOrEmpty(_CommonApi.RequestInformationRef.SystemEmail))
        {
            result.Append(_StyleHelper.GetButtonEventsWCaption(_CommonApi.AppPath + "images/UI/Icons/email.png", "#", _MessageHelper.GetMessage("Email Report button text"), _MessageHelper.GetMessage("btn email"), "onclick=\"LoadUserListChildPage();\"", StyleHelper.EmailButtonCssClass, !primaryCssApplied));

            primaryCssApplied = true;
        }

        result.Append(_StyleHelper.GetButtonEventsWCaption(_CommonApi.AppPath + "images/UI/Icons/print.png", "#", _MessageHelper.GetMessage("Print Report button text"), _MessageHelper.GetMessage("btn print"), "onclick=\"PrintReport();\"", StyleHelper.PrintButtonCssClass, !primaryCssApplied));

        primaryCssApplied = true;

        result.Append(_StyleHelper.GetButtonEventsWCaption(_CommonApi.AppPath + "images/UI/Icons/folderopen.png", "#", _MessageHelper.GetMessage("alt select folder"), _MessageHelper.GetMessage("btn select folder"), "onclick=\"LoadFolderChildPage(\'viewapprovallist\',\'" + _ContentLanguage + "\');\"", StyleHelper.OpenFolderButtonCssClass));

        result.Append(StyleHelper.ActionBarDivider);

        if (_EnableMultilingual == 1)
        {
            SiteAPI m_refsite = new SiteAPI();
            LanguageData[] language_data = m_refsite.GetAllActiveLanguages();

            result.Append("<td class=\"label\">" + _MessageHelper.GetMessage("lbl View") + ":");
            result.Append("<select id=selLang name=selLang onchange=\"Ektron.Workarea.Reports.Approval.loadLanguage(\'frmMain\');\">");
            if (_ContentLanguage == -1)
            {
                result.Append("<option value=" + Ektron.Cms.Common.EkConstants.ALL_CONTENT_LANGUAGES);
                if (Request.QueryString["page"] == "tree" || Request.QueryString["location"] == "tree")
                    result.Append("&location=tree");
                result.Append(" selected>All</option>");
            }
            else
            {
                result.Append("<option value=" + Ektron.Cms.Common.EkConstants.ALL_CONTENT_LANGUAGES);
                if (Request.QueryString["page"] == "tree" || Request.QueryString["location"] == "tree")
                    result.Append("&location=tree");
                result.Append(">All</option>");
            }
            for (count = 0; count <= language_data.Length - 1; count++)
            {
                if (Convert.ToString((short)_ContentLanguage) == Convert.ToString(language_data[count].Id))
                {
                    result.Append("<option value=" + language_data[count].Id);
                    if (Request.QueryString["page"] == "tree" || Request.QueryString["location"] == "tree")
                        result.Append("&location=tree");
                    result.Append(" selected>" + language_data[count].Name + "</option>");
                }
                else
                {
                    result.Append("<option value=" + language_data[count].Id);
                    if (Request.QueryString["page"] == "tree" || Request.QueryString["location"] == "tree")
                        result.Append("&location=tree");
                    result.Append(">" + language_data[count].Name + "</option>");
                }
            }
            result.Append("</select></td>");
        }

        GetAddMultiType();
        // If there is no content type from querystring check for the cookie and restore it to that value else all types

        result.Append("<td><select id=selAssetSupertype name=selAssetSupertype onchange=\"Ektron.Workarea.Reports.Approval.updateView();\">");
        if (Ektron.Cms.Common.EkConstants.CMSContentType_AllTypes == _ContentType)
        {
            result.Append("<option value=\'" + Ektron.Cms.Common.EkConstants.CMSContentType_AllTypes + "\' selected>" + this._MessageHelper.GetMessage("lbl all types") + "</option>");
        }
        else
        {
            result.Append("<option value=\'" + Ektron.Cms.Common.EkConstants.CMSContentType_AllTypes + "\'>" + this._MessageHelper.GetMessage("lbl all types") + "</option>");
        }
        if (Ektron.Cms.Common.EkConstants.CMSContentType_Content == _ContentType)
        {
            result.Append("<option value=\'" + Ektron.Cms.Common.EkConstants.CMSContentType_Content + "\' selected>" + this._MessageHelper.GetMessage("lbl html content") + "</option>");
        }
        else
        {
            result.Append("<option value=\'" + Ektron.Cms.Common.EkConstants.CMSContentType_Content + "\'>" + this._MessageHelper.GetMessage("lbl html content") + "</option>");
        }
        if (!(_AssetInfoData == null))
        {
            if (_AssetInfoData.Length > 0)
            {
                for (count = 0; count <= _AssetInfoData.Length - 1; count++)
                {
                    if (Ektron.Cms.Common.EkConstants.ManagedAsset_Min <= _AssetInfoData[count].TypeId && _AssetInfoData[count].TypeId <= Ektron.Cms.Common.EkConstants.ManagedAsset_Max)
                    {
                        if ("*" == _AssetInfoData[count].PluginType)
                        {
                            lAddMultiType = _AssetInfoData[count].TypeId;
                        }
                        else
                        {
                            result.Append("<option value=\'" + _AssetInfoData[count].TypeId + "\'");
                            if (_AssetInfoData[count].TypeId == _ContentType)
                            {
                                result.Append(" selected");
                            }
                            result.Append(">" +GetMessageText( _AssetInfoData[count].CommonName) + "</option>");
                        }
                    }
                }
            }
        }
        if (Ektron.Cms.Common.EkConstants.CMSContentType_Forms == _ContentType)
        {
            result.Append("<option value=\'" + Ektron.Cms.Common.EkConstants.CMSContentType_Forms + "\' selected>" + this._MessageHelper.GetMessage("generic FormsSurvey") + "</option>");
        }
        else
        {
            result.Append("<option value=\'" + Ektron.Cms.Common.EkConstants.CMSContentType_Forms + "\'>" + this._MessageHelper.GetMessage("generic FormsSurvey") + "</option>");
        }
        //if (Ektron.Cms.Common.EkConstants.CMSContentType_Library == _ContentType)
        //{
        //    result.Append("<option value=\'" + Ektron.Cms.Common.EkConstants.CMSContentType_Library + "\' selected>Images</option>");
        //}
        //else
        //{
        //    result.Append("<option value=\'" + Ektron.Cms.Common.EkConstants.CMSContentType_Library + "\'>Images</option>");
        //}
        if (Ektron.Cms.Common.EkConstants.CMSContentType_NonImageLibrary == _ContentType)
        {
            result.Append("<option value=\'" + Ektron.Cms.Common.EkConstants.CMSContentType_NonImageLibrary + "\' selected>" + this._MessageHelper.GetMessage("Non Image Managed Files") + "</option>");
        }
        else
        {
            result.Append("<option value=\'" + Ektron.Cms.Common.EkConstants.CMSContentType_NonImageLibrary + "\'>" + this._MessageHelper.GetMessage("Non Image Managed Files") + "</option>");
        }
        if (Ektron.Cms.Common.EkConstants.CMSContentType_PDF == _ContentType)
        {
            result.Append("<option value=\'" + Ektron.Cms.Common.EkConstants.CMSContentType_PDF + "\' selected>"+this._MessageHelper.GetMessage("generic pdf")+"</option>");
        }
        else
        {
            result.Append("<option value=\'" + Ektron.Cms.Common.EkConstants.CMSContentType_PDF + "\'>"+this._MessageHelper.GetMessage("generic pdf")+"</option>");
        }
        result.Append("</select></td>");
        result.Append(StyleHelper.ActionBarDivider);
        result.Append("<td>");
        result.Append(_StyleHelper.GetHelpButton("viewApprovalList", ""));
        result.Append("</td>");
        result.Append("</tr></table>");
        divToolBar.InnerHtml = result.ToString();
    }
示例#10
0
    private void ViewRepliesToolBar()
    {
        System.Text.StringBuilder result = new System.Text.StringBuilder();
        string altText = "";
        long ParentId = _FolderData.ParentId;
        int count = 0;

        if (_PageAction == "viewcontentbycategory")
        {
            altText = _MessageHelper.GetMessage("Archive Content Title");
        }
        else
        {
            altText = _MessageHelper.GetMessage("view content title");
        }
        if (_PageAction == "viewcontentbycategory")
        {
            txtTitleBar.InnerHtml = _StyleHelper.GetTitleBar((string)(_MessageHelper.GetMessage("view replies in topic msg") + " \"" + _ContentData.Title + "\""));
        }
        else
        {
            txtTitleBar.InnerHtml = _StyleHelper.GetTitleBar((string)(_MessageHelper.GetMessage("view archive content title") + " \"" + _ContentData.Title + "\""));
        }
        result.Append("<table><tr>" + "\r\n");

        if (_From == "dashboard")
        {
            //result.Append(_StyleHelper.GetButtonEventsWCaption(_AppPath & "images/ui/Icons/back.png", "dashboard.aspx", _MessageHelper.GetMessage("alt back button"), _MessageHelper.GetMessage("btn back"), ""))
            result.Append(_StyleHelper.GetButtonEventsWCaption(_AppPath + "images/UI/Icons/back.png", "javascript:top.switchDesktopTab()", _MessageHelper.GetMessage("alt back button text"), _MessageHelper.GetMessage("btn back"), "", StyleHelper.BackButtonCssClass, true));
        }
        else if (Convert.ToInt32(Request.QueryString["ContType"]) == Ektron.Cms.Common.EkConstants.CMSContentType_BlogComments)
        {
            result.Append(_StyleHelper.GetButtonEventsWCaption(_AppPath + "images/ui/Icons/back.png", (string)("content.aspx?action=ViewContentByCategory&id=" + _Id), _MessageHelper.GetMessage("alt back button"), _MessageHelper.GetMessage("btn back"), "", StyleHelper.BackButtonCssClass, true));
        }

        bool primaryCssApplied = false;

        if ((_PermissionData.CanAddTask) && _PermissionData.IsReadOnlyLib == true)
        {
            result.Append(_StyleHelper.GetButtonEventsWCaption(_AppPath + "images/ui/Icons/add.png", "threadeddisc/addeditreply.aspx?action=Add&topicid=" + _ContentId + "&forumid=" + _Id + "&id=0", _MessageHelper.GetMessage("alt btn add reply"), _MessageHelper.GetMessage("btn add reply"), "", StyleHelper.AddButtonCssClass, !primaryCssApplied));

            primaryCssApplied = true;
        }

        if (_PermissionData.CanDelete && _PageAction == "viewcontentbycategory" && _Id != 0)
        {
            result.Append(_StyleHelper.GetButtonEventsWCaption(_AppPath + "images/ui/Icons/delete.png", (string)("content.aspx?LangType=" + _ContentApi.ContentLanguage + "&action=submitDelContAction&delete_id=" + _ContentId + "&page=&folder_id=" + _Id), _MessageHelper.GetMessage("alt delete topic button text"), _MessageHelper.GetMessage("btn delete topic"), " OnClick=\"return ConfirmDelete(true);return false;\" ", StyleHelper.DeleteButtonCssClass, !primaryCssApplied));

            primaryCssApplied = true;
        }

        if (_ContentData.Status.ToUpper() == "I" && (_PermissionData.CanAddToImageLib == true || _PermissionData.IsAdmin == true))
        {
            result.Append(_StyleHelper.GetButtonEventsWCaption(_AppImgPath + "icon_verify_good.gif", (string)("threadeddisc/addedittopic.aspx?id=" + _ContentId + "&folderid=" + _Id + "&action=approve&LangType=" + _ContentLanguage.ToString()), _MessageHelper.GetMessage("alt approve topic"), _MessageHelper.GetMessage("lbl approve topic"), "", StyleHelper.ApproveButtonCssClass, !primaryCssApplied));

            primaryCssApplied = true;
        }
        if (_ContentData.Status.ToUpper() != "I" && _PermissionData.CanEdit)
        {
            result.Append(_StyleHelper.GetButtonEventsWCaption(_AppPath + "images/ui/Icons/properties.png", (string)("threadeddisc/addedittopic.aspx?id=" + _ContentId + "&action=view&LangType=" + _ContentLanguage.ToString()), _MessageHelper.GetMessage("alt properties button text"), _MessageHelper.GetMessage("btn topic properties"), "", StyleHelper.ViewPropertiesButtonCssClass, !primaryCssApplied));

            primaryCssApplied = true;
        }

        if (!(this._ContentType == Ektron.Cms.Common.EkConstants.CMSContentType_BlogComments) && (_EnableMultilingual == 1))
        {
            SiteAPI m_refsite = new SiteAPI();
            LanguageData[] language_data = m_refsite.GetAllActiveLanguages();

            result.Append("<td class=\"label\">&nbsp;|&nbsp;" + _MessageHelper.GetMessage("lbl View") + ":");
            result.Append("<select id=selLang name=selLang OnChange=\"javascript:LoadLanguage(this.options[this.selectedIndex].value);\">");
            if (_ContentLanguage == -1)
            {
                result.Append("<option value=" + Ektron.Cms.Common.EkConstants.ALL_CONTENT_LANGUAGES + " selected>All</option>");
            }
            else
            {
                result.Append("<option value=" + Ektron.Cms.Common.EkConstants.ALL_CONTENT_LANGUAGES + ">All</option>");
            }
            for (count = 0; count <= language_data.Length - 1; count++)
            {
                if (Convert.ToString((short)_ContentLanguage) == Convert.ToString(language_data[count].Id))
                {
                    result.Append("<option value=" + language_data[count].Id + " selected>" + language_data[count].Name + "</option>");
                }
                else
                {
                    result.Append("<option value=" + language_data[count].Id + ">" + language_data[count].Name + "</option>");
                }
            }
            result.Append("</select></td>");
        }

        result.Append(StyleHelper.ActionBarDivider);

        result.Append("<td>");
        result.Append(_StyleHelper.GetHelpButton((string)(_StyleHelper.GetHelpAliasPrefix(_FolderData) + "topics_" + _PageAction), ""));
        result.Append("</td>");
        result.Append("</tr></table>");
        htmToolBar.InnerHtml = result.ToString();
    }
示例#11
0
    private void ViewDiscussionForumToolBar()
    {
        System.Text.StringBuilder result = new System.Text.StringBuilder();
        string altText = "";
        long ParentId = _FolderData.ParentId;
        int count = 0;
        bool bSelectedFound = false;

        if (_PageAction == "viewcontentbycategory")
        {
            altText = _MessageHelper.GetMessage("Archive forum Title");
        }
        else
        {
            altText = _MessageHelper.GetMessage("view forum title");
        }
        if (_PageAction == "viewcontentbycategory")
        {
            txtTitleBar.InnerHtml = _StyleHelper.GetTitleBar((string)(_MessageHelper.GetMessage("view content of forum msg") + " \"" + _FolderData.Name + "\""));
        }
        else
        {
            txtTitleBar.InnerHtml = _StyleHelper.GetTitleBar((string)(_MessageHelper.GetMessage("view archive forum title") + " \"" + _FolderData.Name + "\""));
        }
        result.Append("<table><tr>" + "\r\n");

        if (_From == "dashboard")
        {
            //result.Append(_StyleHelper.GetButtonEventsWCaption(_AppPath & "images/ui/Icons/back.png", "dashboard.aspx", _MessageHelper.GetMessage("alt back button"), _MessageHelper.GetMessage("btn back"), ""))
            result.Append(_StyleHelper.GetButtonEventsWCaption(_AppPath + "images/UI/Icons/back.png", "javascript:top.switchDesktopTab()", _MessageHelper.GetMessage("alt back button text"), _MessageHelper.GetMessage("btn back"), "", StyleHelper.BackButtonCssClass, true));
        }
        else if (Request.QueryString["ContType"] == Ektron.Cms.Common.EkConstants.CMSContentType_BlogComments.ToString())
        {
            result.Append(_StyleHelper.GetButtonEventsWCaption(_AppPath + "images/ui/Icons/back.png", (string)("content.aspx?action=ViewContentByCategory&id=" + _Id), _MessageHelper.GetMessage("alt back button"), _MessageHelper.GetMessage("btn back"), "", StyleHelper.BackButtonCssClass, true));
        }

        bool primaryCssApplied = false;

        if (((_PermissionData.CanAdd) && (_PageAction == "viewcontentbycategory")) || _PermissionData.IsReadOnly == true)
        {
            if ((_PermissionData.CanAdd) && (_PageAction == "viewcontentbycategory"))
            {
                if (!bSelectedFound)
                {
                    _ContentType = System.Convert.ToInt32(_CMSContentType_AllTypes);
                }
                // Don't allow user to add content if IsMac and XML-Config assigned to this folder:
                if ((!(_IsMac && _HasXmlConfig)) || ("ContentDesigner" == _SelectedEditControl))
                {
                    if (Request.QueryString["ContType"] != Ektron.Cms.Common.EkConstants.CMSContentType_BlogComments.ToString())
                    {
                        if (Convert.ToString(_EnableMultilingual) == "1" && _ContentLanguage < 1)
                        {
                            result.Append(_StyleHelper.GetButtonEventsWCaption(_AppPath + "images/ui/Icons/add.png", "javascript:AddNewTopic();", _MessageHelper.GetMessage("add topic msg"), _MessageHelper.GetMessage("btn add forumpost"), "", StyleHelper.AddButtonCssClass, !primaryCssApplied));
                        }
                        else
                        {
                            result.Append(_StyleHelper.GetButtonEventsWCaption(_AppPath + "images/ui/Icons/add.png", (string)("threadeddisc/addedittopic.aspx?action=add&id=" + _Id.ToString()), _MessageHelper.GetMessage("add topic msg"), _MessageHelper.GetMessage("btn add forumpost"), "", StyleHelper.AddButtonCssClass, !primaryCssApplied));
                        }

                        primaryCssApplied = true;
                    }
                }
            }
        }
        if (_PermissionData.IsAdmin && _TakeAction && _PageAction == "viewcontentbycategory")
        {
            if (Convert.ToString(_EnableMultilingual) == "1" && _ContentLanguage < 1)
            {
                result.Append(_StyleHelper.GetButtonEventsWCaption(_AppPath + "images/ui/Icons/delete.png", "javascript:alert(\'A language must be selected!\');", _MessageHelper.GetMessage("alt btn deletetopics"), _MessageHelper.GetMessage("btn deletetopics"), "", StyleHelper.DeleteButtonCssClass, !primaryCssApplied));
            }
            else
            {
                result.Append(_StyleHelper.GetButtonEventsWCaption(_AppPath + "images/ui/Icons/delete.png", (string)("content.aspx?LangType=" + _ContentLanguage + "&action=DeleteContentByCategory&id=" + _Id), _MessageHelper.GetMessage("alt btn deletetopics"), _MessageHelper.GetMessage("btn deletetopics"), "", StyleHelper.DeleteButtonCssClass, !primaryCssApplied));
            }

            primaryCssApplied = true;
        }
        //The properties button should be far right.
        if (((_PermissionData.CanEditFolders || _PermissionData.CanEditApprovals) && _PageAction == "viewcontentbycategory") || IsFolderAdmin())
        {
            result.Append(_StyleHelper.GetButtonEventsWCaption(_AppPath + "images/ui/Icons/properties.png", (string)("threadeddisc/addeditforum.aspx?LangType=" + _ContentLanguage + "&action=View&id=" + _Id), _MessageHelper.GetMessage("alt forum properties button text"), _MessageHelper.GetMessage("btn properties"), "", StyleHelper.ViewPropertiesButtonCssClass, !primaryCssApplied));

            primaryCssApplied = true;
        }

        if (_PermissionData.IsAdmin || _ContentApi.IsARoleMemberForFolder(Convert.ToInt64(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.AdminFolderUsers), _Id, _CurrentUserId, false))
        {
            result.Append(_StyleHelper.GetButtonEventsWCaption(_AppPath + "images/ui/Icons/permissions.png", (string)("content.aspx?LangType=" + _ContentLanguage + "&action=ViewPermissions&type=folder&id=" + _Id), _MessageHelper.GetMessage("alt permissions button text forum (view)"), _MessageHelper.GetMessage("btn view permissions"), "", StyleHelper.ViewPermissionsButtonCssClass, !primaryCssApplied));

            primaryCssApplied = true;
        }

        if (((_PermissionData.IsAdmin) || (_PermissionData.CanDeleteFolders)) && _PageAction == "viewcontentbycategory" && _Id != 0)
        {
            result.Append(_StyleHelper.GetButtonEventsWCaption(_AppPath + "images/ui/Icons/folderBoardDelete.png", (string)("content.aspx?LangType=" + _ContentLanguage + "&action=DoDeleteFolder&id=" + _Id + "&ParentID=" + ParentId), _MessageHelper.GetMessage("alt delete forum button text"), _MessageHelper.GetMessage("btn delete forum"), "onclick=\"return ConfirmFolderDelete(" + _Id + ");\" ", StyleHelper.DeleteButtonCssClass, !primaryCssApplied));

            primaryCssApplied = true;
        }

        if (_EnableMultilingual == 1)
        {
            SiteAPI m_refsite = new SiteAPI();
            LanguageData[] language_data = m_refsite.GetAllActiveLanguages();

            result.Append("<td class=\"label\">&nbsp;|&nbsp;" + _MessageHelper.GetMessage("lbl View") + ": ");
            result.Append("<select id=\"selLang\" name=\"selLang\" OnChange=\"LoadLanguage(this.options[this.selectedIndex].value);\">");
            if (_ContentLanguage == -1)
            {
                result.Append("<option value=" + Ektron.Cms.Common.EkConstants.ALL_CONTENT_LANGUAGES + " selected>All</option>");
            }
            else
            {
                result.Append("<option value=" + Ektron.Cms.Common.EkConstants.ALL_CONTENT_LANGUAGES + ">All</option>");
            }
            for (count = 0; count <= language_data.Length - 1; count++)
            {
                if (Convert.ToString((short)_ContentLanguage) == Convert.ToString(language_data[count].Id))
                {
                    result.Append("<option value=" + language_data[count].Id + " selected>" + language_data[count].Name + "</option>");
                }
                else
                {
                    result.Append("<option value=" + language_data[count].Id + ">" + language_data[count].Name + "</option>");
                }
            }
            result.Append("</select></td>");
        }

        result.Append(StyleHelper.ActionBarDivider);

        result.Append("<td>");
        result.Append(_StyleHelper.GetHelpButton((string)(_StyleHelper.GetHelpAliasPrefix(_FolderData) + _PageAction), ""));
        result.Append("</td>");
        result.Append("</tr></table>");
        htmToolBar.InnerHtml = result.ToString();
    }
示例#12
0
    private void ViewContentByCategoryToolBar()
    {
        System.Text.StringBuilder result = new System.Text.StringBuilder();
        string altText = "";
        long ParentId = _FolderData.ParentId;
        int count = 0;
        int lAddMultiType = 0;
        bool bSelectedFound = false;
        bool bViewContent = System.Convert.ToBoolean("viewcontentbycategory" == _PageAction); // alternative is archived content
        Ektron.Cms.PageBuilder.WireframeModel wireframeModel = new Ektron.Cms.PageBuilder.WireframeModel();

        if (bViewContent)
        {
            txtTitleBar.InnerHtml = _StyleHelper.GetTitleBar((string)(_MessageHelper.GetMessage("view contents of folder msg") + " \"" + _FolderData.Name + "\"")) + "&nbsp;&nbsp;<img style=\'vertical-align:middle;\' src=\'" + _LocalizationApi.GetFlagUrlByLanguageID(_ContentLanguage) + "\' />";
            altText = _MessageHelper.GetMessage("Archive Content Title");
        }
        else
        {
            txtTitleBar.InnerHtml = _StyleHelper.GetTitleBar((string)(_MessageHelper.GetMessage("view archive content title") + " \"" + _FolderData.Name + "\"")) + "&nbsp;&nbsp;<img style=\'vertical-align:middle;\' src=\'" + _LocalizationApi.GetFlagUrlByLanguageID(_ContentLanguage) + "\' />";
            altText = _MessageHelper.GetMessage("view content title");
        }
        result.Append("<table><tr>" + "\r\n");
        if ((_PermissionData.CanAdd && bViewContent) || _PermissionData.IsReadOnly == true)
        {

            if (_PermissionData.CanAdd && bViewContent)
            {
                if (!bSelectedFound)
                {
                    _ContentType = System.Convert.ToInt32(_CMSContentType_AllTypes);
                }
            }
        }

        string buttonId;

        if ((_PermissionData.CanAdd || _PermissionData.CanAddFolders) && bViewContent)
        {
            buttonId = Guid.NewGuid().ToString();

            result.Append("<td class=\"menuRootItem\" onclick=\"MenuUtil.use(event, \'file\', \'" + buttonId + "\');\" onmouseover=\"this.className=\'menuRootItemSelected\';MenuUtil.use(event, \'file\', \'" + buttonId + "\');\" onmouseout=\"this.className=\'menuRootItem\'\"><span id=\"" + buttonId + "\" class=\"new\">" + _MessageHelper.GetMessage("lbl New") + "</span></td>");
        }

        if ((_PermissionData.CanAdd) || _PermissionData.IsReadOnly)
        {
            buttonId = Guid.NewGuid().ToString();

            result.Append("<td class=\"menuRootItem\" onclick=\"MenuUtil.use(event, \'view\', \'" + buttonId + "\');\" onmouseover=\"this.className=\'menuRootItemSelected\';MenuUtil.use(event, \'view\', \'" + buttonId + "\');\" onmouseout=\"this.className=\'menuRootItem\'\"><span id=\"" + buttonId + "\" class=\"folderView\">" + _MessageHelper.GetMessage("lbl View") + "</span></td>");
        }

        int totalPages = 1;
        if (_PageAction == "viewarchivecontentbycategory")
        {
            // no comparable method; use member variable holding page count when viewing archived items (maybe we should always do this and drop the api hit of doing it again?)
            totalPages = _PagingTotalPagesNumber;
        }
        else
        {
            _ContentApi.GetChildContentByFolderId(_Id, false, "name", 1, ref totalPages, 1);
        }

        if ((_PermissionData.CanDeleteFolders && bViewContent && _Id != 0) || ((bViewContent && (_PermissionData.IsAdmin || IsFolderAdmin()) || _PermissionData.CanDelete) && totalPages > 0))
        {
            buttonId = Guid.NewGuid().ToString();

            result.Append("<td class=\"menuRootItem\" onclick=\"MenuUtil.use(event, \'delete\', \'" + buttonId + "\');\" onmouseover=\"this.className=\'menuRootItemSelected\';MenuUtil.use(event, \'delete\', \'" + buttonId + "\');\" onmouseout=\"this.className=\'menuRootItem\'\"><span id=\"" + buttonId + "\" class=\"delete\">" + _MessageHelper.GetMessage("lbl Delete") + "</span></td>");
        }

        buttonId = Guid.NewGuid().ToString();

        result.Append("<td class=\"menuRootItem\" onclick=\"MenuUtil.use(event, \'action\', \'" + buttonId + "\');\" onmouseover=\"this.className=\'menuRootItemSelected\';MenuUtil.use(event, \'action\', \'" + buttonId + "\');\" onmouseout=\"this.className=\'menuRootItem\'\"><span id=\"" + buttonId + "\" class=\"action\">" + _MessageHelper.GetMessage("lbl Action") + "</span></td>");

        if (_EnableMultilingual == 1)
        {
            SiteAPI m_refsite = new SiteAPI();
            LanguageData[] language_data = new LanguageData[1];
            language_data = m_refsite.GetAllActiveLanguages();
        }
        XmlConfigData[] active_xml_list;
        active_xml_list = _ContentApi.GetEnabledXmlConfigsByFolder(_FolderData.Id);
        bool smartFormsRequired = System.Convert.ToBoolean(!Utilities.IsNonFormattedContentAllowed(active_xml_list));
        bool canAddAssets = System.Convert.ToBoolean((_PermissionData.CanAdd || _PermissionData.CanAddFolders) && bViewContent);
        if (_ContentLanguage < 1 || _FolderData.FolderType == Convert.ToInt32(Ektron.Cms.Common.EkEnumeration.FolderType.Blog) || _FolderData.FolderType == Convert.ToInt32(Ektron.Cms.Common.EkEnumeration.FolderType.DiscussionForum) || _FolderData.FolderType == Convert.ToInt32(Ektron.Cms.Common.EkEnumeration.FolderType.DiscussionBoard) || smartFormsRequired == true || canAddAssets == false)
        {
        }
        else
        {
            if (Ektron.Cms.DataIO.LicenseManager.LicenseManager.IsFeatureEnable(_ContentApi.RequestInformationRef, Feature.DocumentManagement, false))
            {
                if (Request.Browser.Browser == "IE" && Request.UserAgent.Contains("Windows NT 6.0") && Request.ServerVariables["HTTPS"] == "on") //Vista IE Https then take the user to file upload since vista https is not supported by webdav
                {
                    result.Append("<td id='DmsMenu'>&nbsp;<a class=\"ek_thickbox " + StyleHelper.MergeCssClasses(new string[2] { StyleHelper.SecondaryFunctionCssClass, StyleHelper.AddAssetButtonCssClass }) + "\" href=\"" + _ContentApi.AppPath + "edit.aspx?id=" + _FolderData.Id + "&ContType=103&type=add&close=false&lang_id=" + _ContentLanguage.ToString() + "title=\"" + _MessageHelper.GetMessage("lbl file upload") + "\"><img id=\"DeskTopHelp\" title= \"" + _MessageHelper.GetMessage("alt add assets text") + "\" border=\"0\" src=\"images/UI/Icons/Import.png\"/></a>&nbsp;</td>");
                }
                else
                {
                    //result.Append("<td id='DmsMenu'>&nbsp;<a class=\"ek_thickbox " + StyleHelper.MergeCssClasses(new string[2] { StyleHelper.SecondaryFunctionCssClass, StyleHelper.AddAssetButtonCssClass }) + "\" href=\"" + _ContentApi.AppPath + "DragDropCtl.aspx?id=" + _Id.ToString() + "&lang_id=" + _ContentLanguage.ToString() + "&EkTB_iframe=true&height=120&width=500&refreshCaller=true&scrolling=false&modal=true\" class=\"ek_thickbox\" title=\"" + _MessageHelper.GetMessage("document management system") + "\"><img id=\"DeskTopHelp\" title= \"" + _MessageHelper.GetMessage("alt add assets text") + "\" border=\"0\" src=\"images/UI/Icons/Import.png\"/></a>&nbsp;</td>");
                    result.Append("<td id='DmsMenu'>&nbsp;<a class=\"ek_thickbox " + StyleHelper.MergeCssClasses(new string[2] { StyleHelper.SecondaryFunctionCssClass, StyleHelper.AddAssetButtonCssClass }) + "\" href=\"#\" onclick=\"ektb_show('" + _MessageHelper.GetMessage("document management system") + "', '" + _ContentApi.AppPath + "DragDropCtl.aspx?id=" + _Id.ToString() + "&lang_id=" + _ContentLanguage.ToString() + "&height=120&width=500&refreshCaller=true&scrolling=false&modal=true&EkTB_iframe=true', null, '', false);\" class=\"ek_thickbox\" title=\"" + _MessageHelper.GetMessage("document management system") + "\"><img id=\"DeskTopHelp\" title= \"" + _MessageHelper.GetMessage("alt add assets text") + "\" border=\"0\" src=\"images/UI/Icons/Import.png\"/></a>&nbsp;</td>");
                }
            }
        }

        result.Append(StyleHelper.ActionBarDivider);

        result.Append("<td>");
        result.Append(_StyleHelper.GetHelpButton(_PageAction, ""));
        result.Append("</td>");
        result.Append("</tr></table>");

        result.Append("<script type=\"text/javascript\">" + Environment.NewLine);
        result.Append("    var filemenu = new Menu( \"file\" );" + Environment.NewLine);

        if (_PermissionData.CanAddFolders || (_ContentApi.IsARoleMember(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.CommerceAdmin) && Ektron.Cms.DataIO.LicenseManager.LicenseManager.IsFeatureEnable(_ContentApi.RequestInformationRef, Ektron.Cms.DataIO.LicenseManager.Feature.eCommerce)))
        {

            if (_PermissionData.CanAddFolders)
            {

                if (!_FolderData.IsCommunityFolder)
                {
                    result.Append("    filemenu.addItem(\"&nbsp;<img src=\'images/UI/Icons/folder.png\' />&nbsp;&nbsp;" + _MessageHelper.GetMessage("lbl Folder") + "\", function() { window.location.href = \'content.aspx?LangType=" + _ContentLanguage + "&type=folder&action=AddSubFolder&id=" + _Id + "\' } );" + Environment.NewLine);
                }

                result.Append("    filemenu.addItem(\"&nbsp;<img valign=\'middle\' src=\'" + "images/UI/Icons/tree/folderBlogClosed.png" + "\' />&nbsp;&nbsp;" + _MessageHelper.GetMessage("lbl Blog") + "\", function() { window.location.href = \'content.aspx?LangType=" + _ContentLanguage + "&action=AddSubFolder&type=blog&id=" + _Id + "\' } );" + Environment.NewLine);
                result.Append("    filemenu.addItem(\"&nbsp;<img valign=\'middle\' src=\'" + "images/UI/Icons/folderBoard.png" + "\' />&nbsp;&nbsp;" + _MessageHelper.GetMessage("lbl Discussion Board") + "\", function() { window.location.href = \'content.aspx?LangType=" + _ContentLanguage + "&action=AddSubFolder&type=discussionboard&id=" + _Id + "\' } );" + Environment.NewLine);
                result.Append("    filemenu.addItem(\"&nbsp;<img valign=\'middle\' src=\'" + "images/UI/Icons/folderCommunity.png" + "\' />&nbsp;&nbsp;" + _MessageHelper.GetMessage("lbl Community Folder") + "\", function() { window.location.href = \'content.aspx?LangType=" + _ContentLanguage + "&action=AddSubFolder&type=communityfolder&id=" + _Id + "\' } );" + Environment.NewLine);
                result.Append("    filemenu.addItem(\"&nbsp;<img valign=\'middle\' src=\'" + "images/ui/icons/tree/folderCalendarClosed.png" + "\' />&nbsp;&nbsp;" + _MessageHelper.GetMessage("lbl Calendar Folder") + "\", function() { window.location.href = \'content.aspx?LangType=" + _ContentLanguage + "&action=AddSubFolder&type=calendar&id=" + _Id + "\' } );" + Environment.NewLine);

                if (Ektron.Cms.DataIO.LicenseManager.LicenseManager.IsFeatureEnable(_ContentApi.RequestInformationRef, Ektron.Cms.DataIO.LicenseManager.Feature.eCommerce))
                {
                    result.Append("    filemenu.addItem(\"&nbsp;<img valign=\'middle\' src=\'" + "images/UI/Icons/folderGreen.png" + "\' />&nbsp;&nbsp;" + _MessageHelper.GetMessage("lbl commerce catalog") + "\", function() { window.location.href = \'content.aspx?LangType=" + _ContentLanguage + "&action=AddSubFolder&type=catalog&id=" + _Id + "\' } );" + Environment.NewLine);
                }
                if (_Id == 0 && LicenseManager.IsFeatureEnable(_ContentApi.RequestInformationRef, Feature.MultiSite)) //domain folder
                {
                    result.Append("    filemenu.addItem(\"&nbsp;<img valign=\'middle\' src=\'" + "images/UI/Icons/folderSite.png" + "\' />&nbsp;&nbsp;" + _MessageHelper.GetMessage("lbl site Folder") + "\", function() { window.location.href = \'content.aspx?LangType=" + _ContentLanguage + "&type=site&action=AddSubFolder&id=" + _Id + "\' } );" + Environment.NewLine);
                }
                result.Append("    filemenu.addBreak();" + Environment.NewLine);

            }
            else
            {

                result.Append("    filemenu.addItem(\"&nbsp;<img valign=\'middle\' src=\'" + "images/UI/Icons/folderGreen.png" + "\' />&nbsp;&nbsp;" + _MessageHelper.GetMessage("lbl commerce catalog") + "\", function() { window.location.href = \'content.aspx?LangType=" + _ContentLanguage + "&action=AddSubFolder&type=catalog&id=" + _Id + "\' } );" + Environment.NewLine);
                result.Append("    filemenu.addBreak();" + Environment.NewLine);

            }

        }

        if (_PermissionData.CanAdd)
        {
            TemplateData[] active_templates;
            active_templates = _ContentApi.GetEnabledTemplatesByFolder(_FolderData.Id);
            bool foundWireframe = false;
            bool foundNormal = false;
            bool foundmasterlayout = false;

            foreach (TemplateData t in active_templates)
            {
                if (t.SubType == Ektron.Cms.Common.EkEnumeration.TemplateSubType.Wireframes)
                {
                    foundWireframe = true;
                }
                else if (t.SubType == Ektron.Cms.Common.EkEnumeration.TemplateSubType.MasterLayout)
                {
                    foundmasterlayout = true;
                }
                else
                {
                    foundNormal = true;
                }
                if (foundWireframe && foundNormal && foundmasterlayout)
                {
                    break;
                }
            }
            if (Utilities.IsNonFormattedContentAllowed(active_xml_list) && foundNormal)
            {
                result.Append("    filemenu.addItem(\"&nbsp;<img valign=\'middle\' src=\'" + "images/UI/Icons/contentHtml.png" + "\' />&nbsp;&nbsp;" + _MessageHelper.GetMessage("lbl html content") + "\", function() { " + _StyleHelper.GetAddAnchorByContentType(_Id, Ektron.Cms.Common.EkConstants.CMSContentType_Content, true) + " } );" + Environment.NewLine);
                if (((!_IsMac) && (!(_AssetInfoData == null))) || ("ContentDesigner" == _SelectedEditControl))
                {
                    result.Append("    filemenu.addItem(\"&nbsp;<img valign=\'middle\' src=\'" + "images/UI/Icons/contentForm.png" + "\' />&nbsp;&nbsp;" + _MessageHelper.GetMessage("lbl html formsurvey") + "\", function() { " + _StyleHelper.GetAddAnchorByContentType(_Id, Ektron.Cms.Common.EkConstants.CMSContentType_Forms, false) + " } );" + Environment.NewLine);
                }
            }

            if (foundWireframe || foundmasterlayout) //folder has a wireframe associated
            {
                // Register JS
                Ektron.Cms.API.JS.RegisterJS(this, Ektron.Cms.API.JS.ManagedScript.EktronJS);
                Ektron.Cms.API.JS.RegisterJS(this, Ektron.Cms.API.JS.ManagedScript.EktronXmlJS);
                Ektron.Cms.API.JS.RegisterJS(this, Ektron.Cms.API.JS.ManagedScript.EktronThickBoxJS);
                Ektron.Cms.API.JS.RegisterJS(this, Ektron.Cms.API.JS.ManagedScript.EktronModalJS);
                Ektron.Cms.API.JS.RegisterJS(this, _ContentApi.AppPath + "PageBuilder/Wizards/js/ektron.pagebuilder.wizards.js", "EktronPageBuilderWizardsJS");
                Ektron.Cms.API.JS.RegisterJS(this, _ContentApi.AppPath + "PageBuilder/Wizards/js/wizardResources.aspx", "EktronPageBuilderWizardResourcesJS");

                // register necessary CSS
                Ektron.Cms.API.Css.RegisterCss(this, Ektron.Cms.API.Css.ManagedStyleSheet.EktronModalCss);
                Ektron.Cms.API.Css.RegisterCss(this, _ContentApi.AppPath + "PageBuilder/Wizards/css/ektron.pagebuilder.wizards.css", "EktronPageBuilderWizardsCSS");

                if (foundWireframe || foundmasterlayout)
                {
                    string layoutstr;
                    layoutstr = "tmpContLang = AddNewPage(); if (tmpContLang > 0) { Ektron.PageBuilder.Wizards.showAddPage({mode: \'add\', folderId: " + _FolderData.Id + ", language: tmpContLang, fromWorkarea: true}) };";
                    result.Append("    filemenu.addItem(\"&nbsp;<img valign=\'middle\' src=\'" + "images/application/layout_content.png" + "\' />&nbsp;&nbsp;" + _MessageHelper.GetMessage("lbl pagebuilder layouts") + "\", function() { " + layoutstr + " } );" + Environment.NewLine);
                }

                if (foundWireframe && _ContentApi.IsARoleMember(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.CreateMasterLayout))
                {
                    string masterstr;
                    masterstr = "tmpContLang = AddNewPage(); if (tmpContLang > 0) { Ektron.PageBuilder.Wizards.showAddMasterPage({mode: \'add\', folderId: " + _FolderData.Id + ", language: tmpContLang, fromWorkarea: true}) };";
                    result.Append("    filemenu.addItem(\"&nbsp;<img valign=\'middle\' src=\'" + "images/application/layout_content.png" + "\' />&nbsp;&nbsp;" + _MessageHelper.GetMessage("lbl pagebuilder master layouts") + "\", function() { " + masterstr + " } );" + Environment.NewLine);
                }
            }

            if (!_IsMac || ("ContentDesigner" == _SelectedEditControl))
            {
                if ((foundWireframe && foundNormal) || foundNormal)
                {
                    if (active_xml_list.Length > 0 && Utilities.IsNonFormattedContentAllowed(active_xml_list))
                    {
                        if ((active_xml_list.Length == 1 && active_xml_list[0] == null) || (active_xml_list.Length == 1 && active_xml_list[0].Id == 0))
                        {

                        }
                        else
                        {
                            result.Append("    var contentTypesMenu = new Menu( \"contentTypes\" );" + Environment.NewLine);
                            result.Append("    filemenu.addBreak();" + Environment.NewLine);
                            int k;
                            for (k = 0; k <= active_xml_list.Length - 1; k++)
                            {
                                if (active_xml_list[k].Id != 0)
                                {
                                    result.Append("    contentTypesMenu.addItem(\"&nbsp;<img valign=\'middle\' src=\'" + _ContentApi.AppPath + "images/ui/icons/contentsmartform.png" + "\'/>&nbsp;&nbsp;" + active_xml_list[k].Title + "\", function() { " + _StyleHelper.GetTypeOverrideAddAnchor(_Id, active_xml_list[k].Id, Ektron.Cms.Common.EkConstants.CMSContentType_Content) + " } );" + Environment.NewLine);
                                }
                            }
                            //result.Append("    contentTypesMenu.addBreak();" & Environment.NewLine)
                            result.Append("    filemenu.addMenu(\"&nbsp;<img valign=\'middle\' src=\'" + _ContentApi.AppPath + "images/ui/icons/contentsmartform.png" + "\'/>&nbsp;&nbsp;" + _MessageHelper.GetMessage("lbl smart form") + "\", contentTypesMenu);" + Environment.NewLine);
                        }

                    }
                    else if (active_xml_list.Length > 0 && !Utilities.IsNonFormattedContentAllowed(active_xml_list))
                    {
                        result.Append("    filemenu.addBreak();" + Environment.NewLine);
                        int k;
                        for (k = 0; k <= active_xml_list.Length - 1; k++)
                        {
                            if (active_xml_list[k].Id != 0)
                            {
                                result.Append("    filemenu.addItem(\"&nbsp;<img valign=\'middle\' src=\'" + _ContentApi.AppPath + "images/ui/icons/contentsmartform.png" + "\'/>&nbsp;&nbsp;" + active_xml_list[k].Title + "\", function() { " + _StyleHelper.GetTypeOverrideAddAnchor(_Id, active_xml_list[k].Id, Ektron.Cms.Common.EkConstants.CMSContentType_Content) + " } );" + Environment.NewLine);
                            }
                        }
                    }
                }
                result.Append("    filemenu.addBreak();" + Environment.NewLine);
            }

            //If ((Not m_bIsMac) AndAlso (Not (IsNothing(asset_data))) AndAlso Utilities.IsNonFormattedContentAllowed(active_xml_list)) Then
            if ((!(_AssetInfoData == null)) && Utilities.IsNonFormattedContentAllowed(active_xml_list))
            {
                if (_AssetInfoData.Length > 0)
                {
                    for (count = 0; count <= _AssetInfoData.Length - 1; count++)
                    {
                        if (_ManagedAsset_Min <= _AssetInfoData[count].TypeId && _AssetInfoData[count].TypeId <= _ManagedAsset_Max)
                        {
                            if ("*" == _AssetInfoData[count].PluginType)
                            {
                                lAddMultiType = _AssetInfoData[count].TypeId;
                            }
                        }
                    }
                    string imgsrc = string.Empty;
                    string txtCommName = string.Empty;
                    if (Ektron.Cms.DataIO.LicenseManager.LicenseManager.IsFeatureEnable(_ContentApi.RequestInformationRef, Feature.DocumentManagement, false))
                    {

                        imgsrc = "&nbsp;<img valign=\'middle\' src=\'" + "images/UI/Icons/contentDMSDocument.png" + "\' />&nbsp;&nbsp;";
                        txtCommName = _MessageHelper.GetMessage("lbl dms documents");
                        result.Append("filemenu.addItem(\"" + imgsrc + "" + txtCommName + "\", function() { " + _StyleHelper.GetAddAnchorByContentType(_Id, 103, false) + " } );" + Environment.NewLine);
                        result.Append(" if (ShowMultipleUpload() && CheckSTSUpload()) {");
                        imgsrc = "&nbsp;<img valign=\'middle\' src=\'" + "images/ui/icons/contentStack.png" + "\' />&nbsp;&nbsp;";
                        txtCommName = _MessageHelper.GetMessage("lbl multiple documents");
                        if (Request.Cookies["DMS_Office_ver"] == null || string.IsNullOrEmpty(Request.Cookies["DMS_Office_ver"].Value))
                        {
                            result.Append("filemenu.addItem(\"" + imgsrc + "" + txtCommName + "\", function() { " + _StyleHelper.GetAddAnchorByContentType(_Id, 9875, false) + " } );" + Environment.NewLine);
                        }
                        else
                        {
                            result.Append("filemenu.addItem(\"" + imgsrc + "" + txtCommName + "\", function() { " + _StyleHelper.GetAddAnchorByContentType(_Id, 9876, false) + " } );" + Environment.NewLine);
                        }

                        result.Append("}");
                    }
                }
            }
        }
        if (CanDoCollections || CanDoMenus)
        {
            result.Append("    filemenu.addBreak();" + Environment.NewLine);

            if (CanDoCollections)
            {
                result.Append("    filemenu.addItem(\"&nbsp;<img valign=\'middle\' src=\'" + "images/UI/Icons/collection.png" + "\' />&nbsp;&nbsp;" + _MessageHelper.GetMessage("lbl Collection") + "\", function() { window.location.href = \'collections.aspx?LangType=" + _ContentLanguage + "&action=Add&folderid=" + _Id + "\' } );" + Environment.NewLine);
            }

            if (CanDoMenus)
            {
                result.Append("    filemenu.addItem(\"&nbsp;<img valign=\'middle\' src=\'" + "images/UI/Icons/menu.png" + "\' />&nbsp;&nbsp;" + _MessageHelper.GetMessage("lbl Menu") + "\", function() { window.location.href = \'collections.aspx?LangType=" + _ContentLanguage + "&action=AddMenu&back=" + EkFunctions.UrlEncode("content.aspx?action=ViewContentByCategory&id=" + _Id) + "&folderid=" + _Id + "\' } );" + Environment.NewLine);
            }

            result.Append("" + Environment.NewLine);
        }

        if (_PermissionData.CanAdd || _PermissionData.CanAddFolders)
        {
            result.Append("    MenuUtil.add( filemenu );" + Environment.NewLine);
        }

        result.Append("    var viewmenu = new Menu( \"view\" );" + Environment.NewLine);

        if (bViewContent)
        {
            result.Append("    viewmenu.addItem(\"&nbsp;<img valign=\'middle\' src=\'" + "images/UI/Icons/folderView.png" + "\' />&nbsp;&nbsp;" + MakeBold(_MessageHelper.GetMessage("lbl All Types"), 98, Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.AllTypes) + "\", function() { UpdateView(" + _CMSContentType_AllTypes + "); } );" + Environment.NewLine);
            result.Append("    viewmenu.addItem(\"&nbsp;<img valign=\'middle\' src=\'" + "images/UI/Icons/contentHtml.png" + "\' />&nbsp;&nbsp;" + MakeBold(_MessageHelper.GetMessage("lbl html content"), Ektron.Cms.Common.EkConstants.CMSContentType_Content, Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.Content) + "\", function() { UpdateViewwithSubtype(" + Ektron.Cms.Common.EkConstants.CMSContentType_Content + ", " + (int)Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.Content + ",false" + "); } );" + Environment.NewLine);
            if (((!_IsMac) && (!(_AssetInfoData == null))) || ("ContentDesigner" == _SelectedEditControl))
            {
                result.Append("    viewmenu.addItem(\"&nbsp;<img valign=\'middle\' src=\'" + "images/UI/Icons/contentForm.png" + "\' />&nbsp;&nbsp;" + MakeBold(_MessageHelper.GetMessage("lbl html formsurvey"), Ektron.Cms.Common.EkConstants.CMSContentType_Forms, Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.AllTypes) + "\", function() { UpdateView(" + Ektron.Cms.Common.EkConstants.CMSContentType_Forms + "); } );" + Environment.NewLine);
            }
            if (wireframeModel.FindByFolderID(_FolderData.Id).Length > 0) //folder has a wireframe associated
            {
                result.Append("    viewmenu.addItem(\"&nbsp;<img valign=\'middle\' src=\'" + "images/application/layout_content.png" + "\' />&nbsp;&nbsp;" + MakeBold(_MessageHelper.GetMessage("lbl pagebuilder layouts"), Ektron.Cms.Common.EkConstants.CMSContentType_Content, Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.PageBuilderData) + "\", function() { UpdateViewwithSubtype(" + Ektron.Cms.Common.EkConstants.CMSContentType_Content + ", " + (int)Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.PageBuilderData + ",false " + "); } );" + Environment.NewLine);
                result.Append("    viewmenu.addItem(\"&nbsp;<img valign=\'middle\' src=\'" + "images/application/layout_content.png" + "\' />&nbsp;&nbsp;" + MakeBold(_MessageHelper.GetMessage("lbl pagebuilder master layouts"), Ektron.Cms.Common.EkConstants.CMSContentType_Content, Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.PageBuilderMasterData) + "\", function() { UpdateViewwithSubtype(" + Ektron.Cms.Common.EkConstants.CMSContentType_Content + ", " + (int)Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.PageBuilderMasterData + ",false " + "); } );" + Environment.NewLine);
            }
        }
        else
        {
            result.Append("    viewmenu.addItem(\"&nbsp;<img valign=\'middle\' src=\'" + "images/UI/Icons/folderView.png" + "\' />&nbsp;&nbsp;" + MakeBold(_MessageHelper.GetMessage("lbl All Types"), 98, Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.AllTypes) + "\", function() { UpdateArchiveView(" + _CMSContentType_AllTypes + ",true " + "); } );" + Environment.NewLine);
            result.Append("    viewmenu.addItem(\"&nbsp;<img valign=\'middle\' src=\'" + "images/UI/Icons/contentHtml.png" + "\' />&nbsp;&nbsp;" + MakeBold(_MessageHelper.GetMessage("lbl html content"), Ektron.Cms.Common.EkConstants.CMSContentType_Content, Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.Content) + "\", function() { UpdateViewwithSubtype(" + Ektron.Cms.Common.EkConstants.CMSContentType_Content + ", " + (int)Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.Content + ",true " + "); } );" + Environment.NewLine);
            if (((!_IsMac) && (!(_AssetInfoData == null))) || ("ContentDesigner" == _SelectedEditControl))
            {
                result.Append("    viewmenu.addItem(\"&nbsp;<img valign=\'middle\' src=\'" + "images/UI/Icons/contentForm.png" + "\' />&nbsp;&nbsp;" + MakeBold(_MessageHelper.GetMessage("lbl html formsurvey"), Ektron.Cms.Common.EkConstants.CMSContentType_Forms, Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.AllTypes) + "\", function() { UpdateArchiveView(" + Ektron.Cms.Common.EkConstants.CMSContentType_Forms + ",true " + "); } );" + Environment.NewLine);
            }
            if (wireframeModel.FindByFolderID(_FolderData.Id).Length > 0) //folder has a wireframe associated
            {
                result.Append("    viewmenu.addItem(\"&nbsp;<img valign=\'middle\' src=\'" + "images/application/layout_content.png" + "\' />&nbsp;&nbsp;" + MakeBold(_MessageHelper.GetMessage("lbl pagebuilder layouts"), Ektron.Cms.Common.EkConstants.CMSContentType_Content, Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.PageBuilderData) + "\", function() { UpdateViewwithSubtype(" + Ektron.Cms.Common.EkConstants.CMSContentType_Content + ", " + (int)Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.PageBuilderData + ",true " + "); } );" + Environment.NewLine);
                result.Append("    viewmenu.addItem(\"&nbsp;<img valign=\'middle\' src=\'" + "images/application/layout_content.png" + "\' />&nbsp;&nbsp;" + MakeBold(_MessageHelper.GetMessage("lbl pagebuilder master layouts"), Ektron.Cms.Common.EkConstants.CMSContentType_Content, Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.PageBuilderMasterData) + "\", function() { UpdateViewwithSubtype(" + Ektron.Cms.Common.EkConstants.CMSContentType_Content + ", " + (int)Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.PageBuilderMasterData + ",true " + "); } );" + Environment.NewLine);
            }
        }

        result.Append("    viewmenu.addBreak();" + Environment.NewLine);
        if (((_PermissionData.CanAdd) && bViewContent) || _PermissionData.IsReadOnly == true)
        {
            if ((_AssetInfoData != null) && Ektron.Cms.DataIO.LicenseManager.LicenseManager.IsFeatureEnable(_ContentApi.RequestInformationRef, Feature.DocumentManagement, false))
            {
                if (_AssetInfoData.Length > 0)
                {
                    for (count = 0; count <= _AssetInfoData.Length - 1; count++)
                    {
                        if (_ManagedAsset_Min <= _AssetInfoData[count].TypeId && _AssetInfoData[count].TypeId <= _ManagedAsset_Max)
                        {
                            if ("*" == _AssetInfoData[count].PluginType)
                            {
                                lAddMultiType = _AssetInfoData[count].TypeId;
                            }
                            else
                            {
                                string imgsrc = string.Empty;
                                string txtCommName = string.Empty;
                                if (_IsArchivedEvent)
                                {
                                    if (_AssetInfoData[count].TypeId + 1000 == 1101)
                                    {
                                        imgsrc = "&nbsp;<img src=\'" + "images/UI/Icons/FileTypes/word.png" + "\' />&nbsp;&nbsp;";
                                        txtCommName = _MessageHelper.GetMessage("lbl Office Documents");
                                    }
                                    else if (_AssetInfoData[count].TypeId + 1000 == 1102)
                                    {
                                        imgsrc = "&nbsp;<img valign=\'middle\' src=\'" + "images/UI/Icons/contentManagedFiles.png" + " \' />&nbsp;&nbsp;";
                                        txtCommName = _MessageHelper.GetMessage("lbl Managed Files");
                                    }
                                    else if (_AssetInfoData[count].TypeId + 1000 == 1106)
                                    {
                                        imgsrc = "&nbsp;<img valign=\'middle\' src=\'" + "images/UI/Icons/FileTypes/image.png" + " \' />&nbsp;&nbsp;";
                                        txtCommName = _MessageHelper.GetMessage("lbl image assets");
                                    }
                                    else if (_AssetInfoData[count].TypeId + 1000 == 1104)
                                    {
                                        imgsrc = "&nbsp;<img valign=\'middle\' src=\'" + "images/UI/Icons/film.png" + " \' />&nbsp;&nbsp;";
                                        txtCommName = _MessageHelper.GetMessage("lbl Multimedia");
                                    }
                                    else
                                    {
                                        imgsrc = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
                                    }
                                    if (_AssetInfoData[count].TypeId + 1000 != 1105)
                                    {
                                        result.Append("viewmenu.addItem(\"" + imgsrc + "" + MakeBold(txtCommName, System.Convert.ToInt32(_AssetInfoData[count].TypeId + 1000), Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.AllTypes) + "\", function() { UpdateView(" + (_AssetInfoData[count].TypeId + 1000) + "); } );" + Environment.NewLine);
                                    }
                                }
                                else
                                {

                                    if (_AssetInfoData[count].TypeId == 101)
                                    {
                                        imgsrc = "&nbsp;<img src=\'" + "images/UI/Icons/FileTypes/word.png" + "\' />&nbsp;&nbsp;";
                                        txtCommName = _MessageHelper.GetMessage("lbl Office Documents");
                                    }
                                    else if (_AssetInfoData[count].TypeId == 102)
                                    {
                                        imgsrc = "&nbsp;<img valign=\'middle\' src=\'" + "images/UI/Icons/contentManagedFiles.png" + " \' />&nbsp;&nbsp;";
                                        txtCommName = _MessageHelper.GetMessage("lbl Managed Files");
                                    }
                                    else if (_AssetInfoData[count].TypeId == 106)
                                    {
                                        imgsrc = "&nbsp;<img valign=\'middle\' src=\'" + "images/UI/Icons/FileTypes/image.png" + " \' />&nbsp;&nbsp;";
                                        txtCommName = _MessageHelper.GetMessage("lbl image assets");
                                    }
                                    else if (_AssetInfoData[count].TypeId == 104)
                                    {
                                        imgsrc = "&nbsp;<img valign=\'middle\' src=\'" + "images/UI/Icons/film.png" + " \' />&nbsp;&nbsp;";
                                        txtCommName = _MessageHelper.GetMessage("lbl Multimedia");
                                    }
                                    else
                                    {
                                        imgsrc = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
                                    }
                                    if (_AssetInfoData[count].TypeId != 105)
                                    {
                                        result.Append("viewmenu.addItem(\"" + imgsrc + "" + MakeBold(txtCommName, _AssetInfoData[count].TypeId, Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.AllTypes) + "\", function() { UpdateView(" + _AssetInfoData[count].TypeId + "); } );" + Environment.NewLine);
                                    }
                                }

                            }
                        }
                    }
                }
            }

            AddLanguageMenu(result);

            result.Append("    viewmenu.addBreak();" + Environment.NewLine);

            if (bViewContent && CanDoMenus)
            {
                result.Append("    viewmenu.addItem(\"&nbsp;<img valign=\'middle\' src=\'" + "images/UI/Icons/menu.png" + "\' />&nbsp;&nbsp;" + _MessageHelper.GetMessage("lbl Menu") + "\", function() { window.location.href = \'collections.aspx?LangType=" + _ContentLanguage + "&action=ViewAllMenus&folderid=" + _Id + "\' } );" + Environment.NewLine);
            }
            if (bViewContent && CanDoCollections)
            {
                result.Append("    viewmenu.addItem(\"&nbsp;<img valign=\'middle\' src=\'" + "images/UI/Icons/collection.png" + "\' />&nbsp;&nbsp;" + _MessageHelper.GetMessage("lbl Collection") + "\", function() { window.location.href = \'collections.aspx?LangType=" + _ContentLanguage + "&action=mainPage&folderid=" + _Id + "\' } );" + Environment.NewLine);
            }
            if (bViewContent)
            {
                result.Append("    viewmenu.addItem(\"&nbsp;<img valign=\'middle\' src=\'" + "images/UI/Icons/contentArchived.png" + "\' />&nbsp;&nbsp;" + _MessageHelper.GetMessage("archive content") + "\", function() { window.location.href = \'content.aspx?action=" + _NextActionType + "&id=" + _Id + "&IsArchivedEvent=true" + "&LangType=" + _ContentLanguage + ((Ektron.Cms.Common.EkConstants.IsAssetContentType(Convert.ToInt64(_ContentTypeSelected), false)) ? ("&" + _ContentTypeUrlParam + "=" + Ektron.Cms.Common.EkConstants.MakeArchiveAssetContentType(Convert.ToInt64(_ContentTypeSelected))) : ((Ektron.Cms.Common.EkConstants.IsArchiveAssetContentType(Convert.ToInt64(_ContentTypeSelected))) ? ("&" + _ContentTypeUrlParam + "=" + Ektron.Cms.Common.EkConstants.MakeNonArchiveAssetContentType(Convert.ToInt64(_ContentTypeSelected))) : "")) + "\' } );" + Environment.NewLine);
            }
            else
            {
                result.Append("    viewmenu.addItem(\"&nbsp;<img valign=\'middle\' src=\'" + "images/UI/Icons/contentArchived.png" + "\' />&nbsp;&nbsp;&nbsp;" + _MessageHelper.GetMessage("top Content") + "\", function() { window.location.href = \'content.aspx?action=" + _NextActionType + "&id=" + _Id + "&LangType=" + _ContentLanguage + ((Ektron.Cms.Common.EkConstants.IsAssetContentType(Convert.ToInt64(_ContentTypeSelected), false)) ? ("&" + _ContentTypeUrlParam + "=" + (Convert.ToInt32(Ektron.Cms.Common.EkConstants.MakeArchiveAssetContentType(Convert.ToInt64(_ContentTypeSelected))))) : ((Ektron.Cms.Common.EkConstants.IsArchiveAssetContentType(Convert.ToInt64(_ContentTypeSelected))) ? ("&" + _ContentTypeUrlParam + "=" + Ektron.Cms.Common.EkConstants.MakeNonArchiveAssetContentType(Convert.ToInt64(_ContentTypeSelected))) : "")) + "\' } );" + Environment.NewLine);
            }

            if (((_PermissionData.CanEditFolders || _PermissionData.CanEditApprovals) && bViewContent) || IsFolderAdmin())
            {
                result.Append("    viewmenu.addBreak();" + Environment.NewLine);
                result.Append("    viewmenu.addItem(\"&nbsp;<img src=\'" + "images/UI/Icons/properties.png" + " \' />&nbsp;&nbsp;" + _MessageHelper.GetMessage("lbl Folder Properties") + "\", function() { window.location.href = \'content.aspx?LangType=" + _ContentLanguage + "&action=ViewFolder&id=" + _Id + "\' } );" + Environment.NewLine);
            }

            result.Append("    MenuUtil.add( viewmenu );" + Environment.NewLine);

            // Delete Menu
            if ((_PermissionData.CanDeleteFolders && bViewContent && _Id != 0) || ((bViewContent && (_PermissionData.IsAdmin || IsFolderAdmin()) || _PermissionData.CanDelete) && totalPages > 0))
            {

                result.Append("    var deletemenu = new Menu( \"delete\" );" + Environment.NewLine);
                if (_PermissionData.CanDeleteFolders && bViewContent && _Id != 0)
                {
                    string folderImgPath = "images/UI/Icons/folderDelete.png";

                    switch (_FolderType)
                    {
                        case 2: //Domain
                            folderImgPath = "images/UI/Icons/folderSiteDelete.png";
                            break;
                        case 6: //Community
                            folderImgPath = "images/UI/Icons/folderCommunityDelete.png";
                            break;
                        default:
                            break;
                        // use the default.
                    }
                    result.Append("    deletemenu.addItem(\"&nbsp;<img src=\'" + folderImgPath + " \' />&nbsp;&nbsp;" + _MessageHelper.GetMessage("lbl This Folder") + "\", function() { if( ConfirmFolderDelete(" + _Id + ") ) { window.location.href = \'content.aspx?LangType=" + _ContentLanguage + "&action=DoDeleteFolder&id=" + _Id + "&ParentID=" + ParentId + "\'; }} );" + Environment.NewLine);
                }
                if (bViewContent && (_PermissionData.IsAdmin || IsFolderAdmin()) || _PermissionData.CanDelete)
                {
                    // get a count for the content in this folder
                    if (totalPages > 0)
                    {
                        if ((Convert.ToString(_EnableMultilingual) == "1") && (_ContentLanguage < 1))
                        {
                            result.Append("    deletemenu.addItem(\"&nbsp;<img src=\'" + "images/UI/Icons/contentHtmlDelete.png" + " \' />&nbsp;&nbsp;" + _MessageHelper.GetMessage("top Content") + "\", function() { alert(\'A language must be selected!\'); } );" + Environment.NewLine);
                        }
                        else
                        {
                            //44595 - Delete content from the archive view should show up archived list rather than live content list.
                            if (_PageAction == "viewarchivecontentbycategory")
                            {
                                result.Append("    deletemenu.addItem(\"&nbsp;<img src=\'" + "images/UI/Icons/contentDelete.png" + " \' />&nbsp;&nbsp;" + _MessageHelper.GetMessage("top Content") + "\", function() { window.location.href = \'content.aspx?LangType=" + _ContentLanguage + "&action=DeleteContentByCategory&id=" + _Id + "&showarchive=true\'; } );" + Environment.NewLine);
                            }
                            else
                            {
                                result.Append("    deletemenu.addItem(\"&nbsp;<img src=\'" + "images/UI/Icons/contentDelete.png" + " \' />&nbsp;&nbsp;" + _MessageHelper.GetMessage("top Content") + "\", function() { window.location.href = \'content.aspx?LangType=" + _ContentLanguage + "&action=DeleteContentByCategory&id=" + _Id + "\'; } );" + Environment.NewLine);
                            }
                        }
                    }
                }
                result.Append("    MenuUtil.add( deletemenu );" + Environment.NewLine);
            }
        }

        result.Append("    var actionmenu = new Menu( \"action\" );" + Environment.NewLine);
        if (_ContentApi.IsARoleMember(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.AdminXliff) && bViewContent && Ektron.Cms.DataIO.LicenseManager.LicenseManager.IsFeatureEnable(_ContentApi.RequestInformationRef, Feature.Xliff, false))
        {
            result.Append("    actionmenu.addItem(\"&nbsp;<img src=\'" + "images/UI/Icons/translationExport.png" + " \' />&nbsp;&nbsp;" + this._MessageHelper.GetMessage("lbl Export for translation") + "\", function() { window.location.href = \'content.aspx?LangType=" + _ContentLanguage + "&action=Localize&backpage=ViewContentByCategory&id=" + _Id + "\'; } );" + Environment.NewLine);
        }

        result.Append("    actionmenu.addItem(\"&nbsp;<img src=\'" + "images/UI/Icons/magnifier.png" + " \' />&nbsp;&nbsp;" + _MessageHelper.GetMessage("generic Search") + "\", function() { window.location.href = \'isearch.aspx?LangType=" + _ContentLanguage + "&action=showdlg&folderid=" + _Id + "\'; } );" + Environment.NewLine);

        result.Append("    actionmenu.addBreak();" + Environment.NewLine);

        if (_CheckedInOrApproved && bViewContent && (_PermissionData.IsAdmin || IsFolderAdmin() || IsCopyOrMoveAdmin()) && (_PermissionData.CanAdd || _PermissionData.CanEdit))
        {
            if (Convert.ToString(_EnableMultilingual) == "1" && _ContentLanguage < 1)
            {
                result.Append("    actionmenu.addItem(\"&nbsp;<img src=\'" + "images/UI/Icons/cut.png" + " \' />&nbsp;&nbsp;" + _MessageHelper.GetMessage("lbl cut") + "\", function() { alert(\'A language must be selected!\'); } );" + Environment.NewLine);
                result.Append("    actionmenu.addItem(\"&nbsp;<img src=\'" + "images/UI/Icons/contentCopy.png" + " \' />&nbsp;&nbsp;" + _MessageHelper.GetMessage("lbl copy") + "\", function() { alert(\'A language must be selected!\'); } );" + Environment.NewLine);
            }
            else
            {
                result.Append("    actionmenu.addItem(\"&nbsp;<img src=\'" + "images/UI/Icons/cut.png" + " \' />&nbsp;&nbsp;" + _MessageHelper.GetMessage("lbl cut") + "\", function() { setClipBoard(); } );" + Environment.NewLine);
                result.Append("    actionmenu.addItem(\"&nbsp;<img src=\'" + "images/UI/Icons/contentCopy.png" + " \' />&nbsp;&nbsp;" + _MessageHelper.GetMessage("lbl copy") + "\", function() { setCopyClipBoard(); }) ;" + Environment.NewLine);
            }
        }

        SiteAPI site = new SiteAPI();
        EkSite ekSiteRef = site.EkSiteRef;
        if (_ContentApi.IsARoleMember(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.SyncAdmin) || _ContentApi.IsARoleMember(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.SyncUser))
        {
            result.Append(GetSyncMenuOption());
        }
        result.Append("    MenuUtil.add( actionmenu );" + Environment.NewLine);
        result.Append("    </script>" + Environment.NewLine);
        result.Append("" + Environment.NewLine);

        htmToolBar.InnerHtml = result.ToString();
    }
示例#13
0
    private void ViewCatalogToolBar(long entryCount)
    {
        System.Text.StringBuilder result = new System.Text.StringBuilder();
        string altText = "";
        long ParentId = _FolderData.ParentId;
        Ektron.Cms.Commerce.ProductType pProductType = new Ektron.Cms.Commerce.ProductType(_ContentApi.RequestInformationRef);
        bool bSelectedFound = false;
        bool bViewContent = System.Convert.ToBoolean("viewcontentbycategory" == _PageAction); // alternative is archived content
        bool bCommerceAdmin = true;
        bool bFolderAdmin = false;

        bCommerceAdmin = _ContentApi.IsARoleMember(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.CommerceAdmin);
        bFolderAdmin = System.Convert.ToBoolean(bFolderAdmin || bCommerceAdmin);

        if (bViewContent)
        {
            txtTitleBar.InnerHtml = _StyleHelper.GetTitleBar((string)(_MessageHelper.GetMessage("lbl view catalog") + " \"" + _FolderData.Name + "\"")) + "&nbsp;&nbsp;<img style=\'vertical-align:middle;\' src=\'" + _LocalizationApi.GetFlagUrlByLanguageID(_ContentLanguage) + "\' />";
            altText = _MessageHelper.GetMessage("Archive Content Title");
        }
        else
        {
            txtTitleBar.InnerHtml = _StyleHelper.GetTitleBar((string)(_MessageHelper.GetMessage("lbl view catalog archive") + " \"" + _FolderData.Name + "\"")) + "&nbsp;&nbsp;<img style=\'vertical-align:middle;\' src=\'" + _LocalizationApi.GetFlagUrlByLanguageID(_ContentLanguage) + "\' />";
            altText = _MessageHelper.GetMessage("view content title");
        }
        result.Append("<table><tr>" + "\r\n");
        if ((_PermissionData.CanAdd && bViewContent) || _PermissionData.IsReadOnly == true)
        {
            if (_PermissionData.CanAdd && bViewContent)
            {
                if (!bSelectedFound)
                {
                    _ContentType = System.Convert.ToInt32(_CMSContentType_AllTypes);
                }
            }
        }

        string buttonId;

        if ((_PermissionData.CanAdd || _PermissionData.CanAddFolders || bCommerceAdmin) && bViewContent)
        {
            buttonId = Guid.NewGuid().ToString();

            result.Append("<td class=\"menuRootItem\" onclick=\"MenuUtil.use(event, \'file\', \'" + buttonId + "\');\" onmouseover=\"this.className=\'menuRootItemSelected\';MenuUtil.use(event, \'file\', \'" + buttonId + "\');\" onmouseout=\"this.className=\'menuRootItem\'\"><span id=\"" + buttonId + "\" class=\"new\">" + _MessageHelper.GetMessage("lbl New") + "</span></td>");
        }
        if ((_PermissionData.CanAdd) || _PermissionData.IsReadOnly || bCommerceAdmin)
        {
            buttonId = Guid.NewGuid().ToString();

            result.Append("<td class=\"menuRootItem\" onclick=\"MenuUtil.use(event, \'view\', \'" + buttonId + "\');\" onmouseover=\"this.className=\'menuRootItemSelected\';MenuUtil.use(event, \'view\', \'" + buttonId + "\');\" onmouseout=\"this.className=\'menuRootItem\'\"><span id=\"" + buttonId + "\" class=\"folderView\">" + _MessageHelper.GetMessage("lbl View") + "</span></td>");
        }
        if (bViewContent && (_PermissionData.IsAdmin || bFolderAdmin || bCommerceAdmin) || (_PermissionData.CanDelete))
        {
            buttonId = Guid.NewGuid().ToString();

            result.Append("<td class=\"menuRootItem\" onclick=\"MenuUtil.use(event, \'delete\', \'" + buttonId + "\');\" onmouseover=\"this.className=\'menuRootItemSelected\';MenuUtil.use(event, \'delete\', \'" + buttonId + "\');\" onmouseout=\"this.className=\'menuRootItem\'\"><span id=\"" + buttonId + "\" class=\"delete\">" + _MessageHelper.GetMessage("lbl Delete") + "</span></td>");
        }

        buttonId = Guid.NewGuid().ToString();

        result.Append("<td class=\"menuRootItem\" onclick=\"MenuUtil.use(event, \'action\', \'" + buttonId + "\');\" onmouseover=\"this.className=\'menuRootItemSelected\';MenuUtil.use(event, \'action\', \'" + buttonId + "\');\" onmouseout=\"this.className=\'menuRootItem\'\"><span id=\"" + buttonId + "\" class=\"action\">" + _MessageHelper.GetMessage("lbl Action") + "</span></td>");

        if (_EnableMultilingual == 1)
        {
            SiteAPI m_refsite = new SiteAPI();
            LanguageData[] language_data = new LanguageData[1];
            language_data = m_refsite.GetAllActiveLanguages();

        }
        List<ProductTypeData> active_prod_list = new List<ProductTypeData>();
        active_prod_list = pProductType.GetFolderProductTypeList(_FolderData.Id);

        bool smartFormsRequired = System.Convert.ToBoolean(!Utilities.IsNonFormattedContentAllowed(active_prod_list.ToArray()));
        bool canAddAssets = System.Convert.ToBoolean((_PermissionData.CanAdd || _PermissionData.CanAddFolders) && bViewContent);

        result.Append(StyleHelper.ActionBarDivider);

        result.Append("<td>");
        result.Append(_StyleHelper.GetHelpButton(_PageAction, ""));
        result.Append("</td>");
        result.Append("</tr></table>");

        result.Append("<script type=\"text/javascript\">" + Environment.NewLine);

        result.Append("    var filemenu = new Menu( \"file\" );" + Environment.NewLine);
        if (_PermissionData.CanAddFolders || bCommerceAdmin)
        {
            result.Append("    filemenu.addItem(\"&nbsp;<img valign=\'middle\' src=\'" + "images/UI/Icons/folderGreen.png" + "\' />&nbsp;&nbsp;" + _MessageHelper.GetMessage("lbl commerce catalog") + "\", function() { window.location.href = \'content.aspx?LangType=" + _ContentLanguage + "&action=AddSubFolder&type=catalog&id=" + _Id + "\' } );" + Environment.NewLine);
            result.Append("    filemenu.addBreak();" + Environment.NewLine);
        }

        if (_PermissionData.CanAdd)
        {
            if (active_prod_list.Count > 0)
            {
                int k;
                for (k = 0; k <= active_prod_list.Count - 1; k++)
                {
                    if (active_prod_list[k].Id != 0)
                    {

                        result.Append("    filemenu.addItem(\"&nbsp;<img valign=\'middle\' src=\'" + "images/ui/icons/");

                        if (active_prod_list[k].EntryClass == Ektron.Cms.Common.EkEnumeration.CatalogEntryType.SubscriptionProduct)
                        {

                            result.Append("bookGreen.png");
                        }
                        else if (active_prod_list[k].EntryClass == Ektron.Cms.Common.EkEnumeration.CatalogEntryType.Kit)
                        {

                            result.Append("box.png");
                        }
                        else if (active_prod_list[k].EntryClass == Ektron.Cms.Common.EkEnumeration.CatalogEntryType.Bundle)
                        {

                            result.Append("package.png");
                        }
                        else
                        {

                            result.Append("brick.png");
                        }

                        result.Append("\' />&nbsp;&nbsp;" + active_prod_list[k].Title + "\", function() { " + _StyleHelper.GetCatalogAddAnchorType(_Id, active_prod_list[k].Id) + " } );" + Environment.NewLine);
                    }
                }
            }
        }

        if (_PermissionData.CanAdd || _PermissionData.CanAddFolders)
        {
            result.Append("    MenuUtil.add( filemenu );" + Environment.NewLine);
        }

        result.Append("    var viewmenu = new Menu( \"view\" );" + Environment.NewLine);
        result.Append("    viewmenu.addItem(\"&nbsp;<img valign=\'middle\' src=\'" + "images/ui/icons/folderGreenView.png" + "\' />&nbsp;&nbsp;" + MakeBold(_MessageHelper.GetMessage("lbl All Types"), -1, Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.AllTypes) + "\", function() { UpdateView(" + _CMSContentType_AllTypes + "); } );" + Environment.NewLine);
        result.Append("    viewmenu.addItem(\"&nbsp;<img valign=\'middle\' src=\'" + "Images/ui/icons/brick.png" + "\' />&nbsp;&nbsp;" + MakeBold(_MessageHelper.GetMessage("lbl commerce products"), 0, Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.AllTypes) + "\", function() { UpdateView(" + Convert.ToInt32(Ektron.Cms.Common.EkEnumeration.CatalogEntryType.Product) + "); } );" + Environment.NewLine);
        result.Append("    viewmenu.addItem(\"&nbsp;<img valign=\'middle\' src=\'" + "images/ui/icons/box.png" + "\' />&nbsp;&nbsp;" + MakeBold(_MessageHelper.GetMessage("lbl commerce kits"), 2, Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.AllTypes) + "\", function() { UpdateView(" + Convert.ToInt32(Ektron.Cms.Common.EkEnumeration.CatalogEntryType.Kit) + "); } );" + Environment.NewLine);
        result.Append("    viewmenu.addItem(\"&nbsp;<img valign=\'middle\' src=\'" + "images/ui/icons/package.png" + "\' />&nbsp;&nbsp;" + MakeBold(_MessageHelper.GetMessage("lbl commerce bundles"), 3, Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.AllTypes) + "\", function() { UpdateView(" + Convert.ToInt32(Ektron.Cms.Common.EkEnumeration.CatalogEntryType.Bundle) + "); } );" + Environment.NewLine);
        result.Append("    viewmenu.addItem(\"&nbsp;<img valign=\'middle\' src=\'" + "images/ui/icons/bookGreen.png" + "\' />&nbsp;&nbsp;" + MakeBold(_MessageHelper.GetMessage("lbl commerce subscriptions"), 4, Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.AllTypes) + "\", function() { UpdateView(" + Convert.ToInt32(Ektron.Cms.Common.EkEnumeration.CatalogEntryType.SubscriptionProduct) + "); } );" + Environment.NewLine);

        if (((_PermissionData.CanAdd) && bViewContent) || _PermissionData.IsReadOnly == true)
        {
            AddLanguageMenu(result);

            if (bViewContent)
            {
                result.Append("    viewmenu.addItem(\"&nbsp;<img valign=\'middle\' src=\'" + "images/UI/Icons/contentArchived.png" + "\' />&nbsp;&nbsp;&nbsp;" + _MessageHelper.GetMessage("lbl archive entry title") + "\", function() { window.location.href = \'content.aspx?action=" + _NextActionType + "&id=" + _Id + "&LangType=" + _ContentLanguage + ((Ektron.Cms.Common.EkConstants.IsAssetContentType(Convert.ToInt64(_ContentTypeSelected), false)) ? ("&" + _ContentTypeUrlParam + "=" + Ektron.Cms.Common.EkConstants.MakeArchiveAssetContentType(Convert.ToInt64(_ContentTypeSelected))) : ((Ektron.Cms.Common.EkConstants.IsArchiveAssetContentType(Convert.ToInt64(_ContentTypeSelected))) ? ("&" + _ContentTypeUrlParam + "=" + Ektron.Cms.Common.EkConstants.MakeNonArchiveAssetContentType(Convert.ToInt64(_ContentTypeSelected))) : "")) + "\' } );" + Environment.NewLine);
            }
            else
            {
                result.Append("    viewmenu.addItem(\"&nbsp;<img valign=\'middle\' src=\'" + "images/UI/Icons/properties.png" + "\' />&nbsp;&nbsp;&nbsp;" + _MessageHelper.GetMessage("lbl catalog view entry") + "\", function() { window.location.href = \'content.aspx?action=" + _NextActionType + "&id=" + _Id + "&LangType=" + _ContentLanguage + ((Ektron.Cms.Common.EkConstants.IsAssetContentType(Convert.ToInt64(_ContentTypeSelected), false)) ? ("&" + _ContentTypeUrlParam + "=" + Ektron.Cms.Common.EkConstants.MakeArchiveAssetContentType(Convert.ToInt64(_ContentTypeSelected))) : ((Ektron.Cms.Common.EkConstants.IsArchiveAssetContentType(Convert.ToInt64(_ContentTypeSelected))) ? ("&" + _ContentTypeUrlParam + "=" + Ektron.Cms.Common.EkConstants.MakeNonArchiveAssetContentType(Convert.ToInt64(_ContentTypeSelected))) : "")) + "\' } );" + Environment.NewLine);
            }
            if (((_PermissionData.CanEditFolders || _PermissionData.CanEditApprovals) && bViewContent) || bFolderAdmin)
            {
                result.Append("    viewmenu.addBreak();" + Environment.NewLine);
                result.Append("    viewmenu.addItem(\"&nbsp;<img src=\'" + "images/UI/Icons/properties.png" + " \' />&nbsp;&nbsp;" + _MessageHelper.GetMessage("lbl catalog Properties") + "\", function() { window.location.href = \'content.aspx?LangType=" + _ContentLanguage + "&action=ViewFolder&id=" + _Id + "\' } );" + Environment.NewLine);
            }
            result.Append("    MenuUtil.add( viewmenu );" + Environment.NewLine);
            result.Append("    var deletemenu = new Menu( \"delete\" );" + Environment.NewLine);
            if ((_PermissionData.CanDeleteFolders || bCommerceAdmin) && bViewContent && _Id != 0)
            {
                result.Append("    deletemenu.addItem(\"&nbsp;<img src=\'" + "images/UI/Icons/folderGreenDelete.png" + " \' />&nbsp;&nbsp;" + _MessageHelper.GetMessage("lbl this catalog") + "\", function() { if( ConfirmFolderDelete(" + _Id + ") ) { window.location.href = \'content.aspx?LangType=" + _ContentLanguage + "&action=DoDeleteFolder&id=" + _Id + "&ParentID=" + ParentId + "\'; }} );" + Environment.NewLine);
            }
            if ((entryCount > 0) && (bViewContent && (_PermissionData.IsAdmin || bFolderAdmin) || _PermissionData.CanDelete))
            {
                if (Convert.ToString(_EnableMultilingual) == "1" && _ContentLanguage < 1)
                {
                    result.Append("    deletemenu.addItem(\"&nbsp;<img src=\'" + "images/UI/Icons/brickDelete.png" + " \' />&nbsp;&nbsp;" + _MessageHelper.GetMessage("lbl catalog del entry") + "\", function() { alert(\'A language must be selected!\'); } );" + Environment.NewLine);
                }
                else
                {
                    //44595 -  Delete content from the archive view should show up archived list rather than live content list.
                    if (_PageAction == "viewarchivecontentbycategory")
                    {
                        result.Append("    deletemenu.addItem(\"&nbsp;<img src=\'" + "images/UI/Icons/brickDelete.png" + " \' />&nbsp;&nbsp;" + _MessageHelper.GetMessage("lbl catalog del entry") + "\", function() { window.location.href = \'content.aspx?LangType=" + _ContentLanguage + "&action=DeleteContentByCategory&id=" + _Id + "&showarchive=true\'; } );" + Environment.NewLine);
                    }
                    else
                    {
                        result.Append("    deletemenu.addItem(\"&nbsp;<img src=\'" + "images/UI/Icons/brickDelete.png" + " \' />&nbsp;&nbsp;" + _MessageHelper.GetMessage("lbl catalog del entry") + "\", function() { window.location.href = \'content.aspx?LangType=" + _ContentLanguage + "&action=DeleteContentByCategory&id=" + _Id + "\'; } );" + Environment.NewLine);
                    }
                }
            }
            result.Append("    MenuUtil.add( deletemenu );" + Environment.NewLine);
        }
        result.Append("    var actionmenu = new Menu( \"action\" );" + Environment.NewLine);
        result.Append("    actionmenu.addItem(\"&nbsp;<img src=\'" + "images/UI/Icons/magnifier.png" + " \' />&nbsp;&nbsp;" + _MessageHelper.GetMessage("generic Search") + "\", function() { window.location.href = \'productsearch.aspx?LangType=" + _ContentLanguage + "&action=showdlg&folderid=" + _Id + "\'; } );" + Environment.NewLine);

        result.Append("    actionmenu.addBreak();" + Environment.NewLine);

        if (_CheckedInOrApproved && bViewContent && (_PermissionData.IsAdmin || IsFolderAdmin() || IsCopyOrMoveAdmin()) && (_PermissionData.CanAdd || _PermissionData.CanEdit))
        {
            if ((Convert.ToString(_EnableMultilingual) == "1") && (_ContentLanguage < 1))
            {
                result.Append("    actionmenu.addItem(\"&nbsp;<img src=\'" + "images/UI/Icons/cut.png" + " \' />&nbsp;&nbsp;" + _MessageHelper.GetMessage("lbl cut") + "\", function() { alert(\'A language must be selected!\'); } );" + Environment.NewLine);
                result.Append("    actionmenu.addItem(\"&nbsp;<img src=\'" + "images/UI/Icons/contentCopy.png" + " \' />&nbsp;&nbsp;" + _MessageHelper.GetMessage("lbl copy") + "\", function() { alert(\'A language must be selected!\'); } );" + Environment.NewLine);
            }
            else
            {
                result.Append("    actionmenu.addItem(\"&nbsp;<img src=\'" + "images/UI/Icons/cut.png" + " \' />&nbsp;&nbsp;" + _MessageHelper.GetMessage("lbl cut") + "\", function() { setClipBoard(); } );" + Environment.NewLine);
                result.Append("    actionmenu.addItem(\"&nbsp;<img src=\'" + "images/UI/Icons/contentCopy.png" + " \' />&nbsp;&nbsp;" + _MessageHelper.GetMessage("lbl copy") + "\", function() { setCopyClipBoard(); }) ;" + Environment.NewLine);
            }
        }

        result.Append("    MenuUtil.add( actionmenu );" + Environment.NewLine);
        result.Append("    </script>" + Environment.NewLine);
        result.Append("" + Environment.NewLine);
        htmToolBar.InnerHtml = result.ToString();
    }
示例#14
0
    private void ViewApprovalToolBar()
    {
        System.Text.StringBuilder result = new System.Text.StringBuilder();
        bool bInherited = false;
        string WorkareaTitlebarTitle = "";
        bool bFolderUserAdmin;

        if (!(folder_data == null))
        {
            bFolderUserAdmin = security_data.IsAdmin || m_refContentApi.IsARoleMemberForFolder_FolderUserAdmin(folder_data.Id, 0, false);
        }
        else
        {
            if (!(content_data == null))
            {
                bFolderUserAdmin = security_data.IsAdmin || m_refContentApi.IsARoleMemberForFolder_FolderUserAdmin(content_data.FolderId, 0, false);
            }
            else
            {
                bFolderUserAdmin = security_data.IsAdmin;
            }
        }
        if (ItemType == "folder")
        {
            bInherited = folder_data.Inherited;
        }
        else
        {
            bInherited = content_data.IsInherited;
        }
        if (ItemType == "folder")
        {
            WorkareaTitlebarTitle = (string)(m_refMsg.GetMessage("view folder approvals msg") + " \"" + folder_data.Name + "\"");
        }
        else
        {
            WorkareaTitlebarTitle = (string)(m_refMsg.GetMessage("view content approvals msg") + " \"" + content_data.Title + "\"");
        }
        txtTitleBar.InnerHtml = m_refStyle.GetTitleBar(WorkareaTitlebarTitle);
        result.Append("<table><tr>");

        if (ItemType == "folder")
        {
            result.Append(m_refStyle.GetButtonEventsWCaption(m_refContentApi.AppPath + "images/UI/Icons/back.png", (string)("content.aspx?action=ViewFolder&id=" + m_intId + "&LangType=" + ContentLanguage), m_refMsg.GetMessage("alt back button text"), m_refMsg.GetMessage("btn back"), "", StyleHelper.BackButtonCssClass, true));
        }
        else
        {
            result.Append(m_refStyle.GetButtonEventsWCaption(m_refContentApi.AppPath + "images/UI/Icons/back.png", (string)("content.aspx?LangType=" + ContentLanguage + "&action=View&id=" + m_intId), m_refMsg.GetMessage("alt back button text"), m_refMsg.GetMessage("btn back"), "", StyleHelper.BackButtonCssClass, true));
        }

        if (bFolderUserAdmin && (bInherited == false))
        {
            result.Append(m_refStyle.GetButtonEventsWCaption(m_refContentApi.AppPath + "images/UI/Icons/add.png", (string)("content.aspx?LangType=" + ContentLanguage + "&action=AddApproval&id=" + m_intId + "&type=" + ItemType), m_refMsg.GetMessage("alt add button text (approvals)"), m_refMsg.GetMessage("btn add"), "", StyleHelper.AddButtonCssClass, true));
            if (IsApprovalChainExists)
            {
                result.Append(m_refStyle.GetButtonEventsWCaption(m_refContentApi.AppPath + "images/UI/Icons/delete.png", (string)("content.aspx?LangType=" + ContentLanguage + "&action=DeleteApproval&id=" + m_intId + "&type=" + ItemType), m_refMsg.GetMessage("alt delete button text (approvals)"), m_refMsg.GetMessage("btn delete"), "", StyleHelper.DeleteButtonCssClass));
                result.Append(m_refStyle.GetButtonEventsWCaption(m_refContentApi.AppPath + "images/UI/Icons/arrowUpDown.png", (string)("content.aspx?LangType=" + ContentLanguage + "&action=EditApprovalOrder&id=" + m_intId + "&type=" + ItemType), m_refMsg.GetMessage("alt edit button text (approvals)"), m_refMsg.GetMessage("btn reorder"), "", StyleHelper.ReOrderButtonCssClass));
            }
            result.Append(m_refStyle.GetButtonEventsWCaption(m_refContentApi.AppPath + "images/UI/Icons/contentEdit.png", (string)("content.aspx?LangType=" + ContentLanguage + "&action=EditApprovalMethod&id=" + m_intId + "&type=" + ItemType), "Edit Approval Method", m_refMsg.GetMessage("btn edit"), "", StyleHelper.EditButtonCssClass));
        }

        if (EnableMultilingual == 1)
        {
            SiteAPI m_refsite;
            m_refsite = new SiteAPI();
            LanguageData[] language_data;
            language_data = m_refsite.GetAllActiveLanguages();
            int count = 0;
            if (ItemType == "folder")
            {
                result.Append("<td class=\"label\"> | " + m_refMsg.GetMessage("content language label") + ":&nbsp;");
                result.Append("<select id=\"selLang\" name=\"selLang\" OnChange=\"javascript:LoadApproval(\'frmContent\');\">");
                for (count = 0; count <= language_data.Length - 1; count++)
                {
                    if (language_data[count].Id == ContentLanguage)
                    {
                        result.Append("<option value=" + language_data[count].Id + " selected>" + language_data[count].Name + "</option>");
                    }
                    else
                    {
                        result.Append("<option value=" + language_data[count].Id + ">" + language_data[count].Name + "</option>");
                    }
                }
                result.Append("</select></td>");
            }
        }
        result.Append(StyleHelper.ActionBarDivider);
        result.Append("<td>");
        result.Append(m_refStyle.GetHelpButton(m_strPageAction, ""));
        result.Append("</td>");
        result.Append("</tr></table>");
        htmToolBar.InnerHtml = result.ToString();
    }