Beispiel #1
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();
    }
Beispiel #2
0
    private void EditSelectedTemplate()
    {
        StringBuilder str = new StringBuilder();
        bool bShowTemplateUI = false;
        int iContType;

        if (Request.QueryString["ContType"] == null)
        {
            iContType = Ektron.Cms.Common.EkConstants.CMSContentType_Content;
        }
        else
        {
            iContType = Convert.ToInt32(Request.QueryString["ContType"]);
        }

        if (m_strType == "add")
        {
            if (iContType == Ektron.Cms.Common.EkConstants.CMSContentType_Content || iContType == Ektron.Cms.Common.EkConstants.CMSContentType_Forms || iContType == EkConstants.CMSContentType_Media || iContType == EkConstants.CMSContentType_Archive_Content || iContType == EkConstants.CMSContentType_Archive_Forms || iContType == EkConstants.CMSContentType_Archive_Media)
            {
                bShowTemplateUI = true;
            }
        }
        else
        {
            if (content_edit_data != null)
            {
                iContType = content_edit_data.Type;
                if (iContType == Ektron.Cms.Common.EkConstants.CMSContentType_Content || iContType == Ektron.Cms.Common.EkConstants.CMSContentType_Forms || iContType == EkConstants.CMSContentType_Media || iContType == EkConstants.CMSContentType_Archive_Content || iContType == EkConstants.CMSContentType_Archive_Forms || iContType == EkConstants.CMSContentType_Archive_Media)
                {
                    bShowTemplateUI = true;
                }
            }
        }
        if (!bShowTemplateUI)
        {
            str.Append( m_refMsg.GetMessage("Generic Not Applicable"));
        }
        else
        {
            if ((m_strType == "add" && (content_data != null) && (content_data.SubType == Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.PageBuilderData || content_data.SubType == Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.PageBuilderMasterData)) || ((content_edit_data != null) && (content_edit_data.SubType == Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.PageBuilderData || content_edit_data.SubType == Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.PageBuilderMasterData)))
            {
                 //show available wireframes
                Ektron.Cms.PageBuilder.WireframeModel wfm = new Ektron.Cms.PageBuilder.WireframeModel();

                Ektron.Cms.PageBuilder.WireframeData[] active_template_list = wfm.FindByFolderID(folder_data.Id);

                long selected_templateid = this.m_refContApi.GetSelectedTemplateByContent(m_refContentId, m_refContApi.RequestInformationRef.ContentLanguage);
                if (selected_templateid == 0)
                {
                    //check if this is a translation, if so, get the one from the original language
                    if (!string.IsNullOrEmpty(Request.QueryString["translate"]) && !string.IsNullOrEmpty(Request.QueryString["con_lang_id"]))
                    {
                        int originalLang = Int32.Parse(Request.QueryString["con_lang_id"]);
                        selected_templateid = this.m_refContApi.GetSelectedTemplateByContent(m_refContentId, originalLang);
                    }
                    //check if default language has one
                    if (selected_templateid == 0 && m_refContApi.RequestInformationRef.ContentLanguage != m_refContApi.RequestInformationRef.DefaultContentLanguage)
                    {
                        selected_templateid = this.m_refContApi.GetSelectedTemplateByContent(m_refContentId, m_refContApi.RequestInformationRef.DefaultContentLanguage);
                    }
                    if (selected_templateid == 0)//just use the default
                    {
                        selected_templateid = folder_data.TemplateId;
                    }
                }

                if (active_template_list.Length < 1 && selected_templateid == 0)
                {
                    phTemplates.Visible = false;
                    EditTemplateHtml.Visible = false;
                }

                str.Append("<table class=\"ektronForm\">");
                str.Append("<tr>");
                str.Append("<td class=\"label\">");
                str.Append(m_refMsg.GetMessage("template label") + ":");
                str.Append("</td>");
                str.Append("<td class=\"value\">");
                str.Append("<select id=\"templateSelect\" name=\"templateSelect\">");
                foreach (Ektron.Cms.PageBuilder.WireframeData wireframe in active_template_list)
                {
                    if (wireframe.Template.Id == selected_templateid)
                    {
                        str.Append("<option value=\"" + wireframe.Template.Id + "\" selected>" + wireframe.Path + "</option>");
                    }
                    else
                    {
                        str.Append("<option value=\"" + wireframe.Template.Id + "\">" + wireframe.Path + "</option>");
                    }
                }

                if (active_template_list.Length == 0)
                {
                    Ektron.Cms.PageBuilder.TemplateModel templModel = new Ektron.Cms.PageBuilder.TemplateModel();
                    TemplateData selectedTemplate = templModel.FindByID(selected_templateid);
                    string selectedTemplateName = (selectedTemplate != null) ? selectedTemplate.TemplateName : "";

                    str.Append("<option value=\"" + selected_templateid + "\" selected>" + selectedTemplateName + "</option>");
                }
                str.Append("</select>");
                str.Append("</td>");
                str.Append("</tr>");
                str.Append("</table>");
                if (content_edit_data != null)
                {
                    if (content_edit_data.LockedContentLink)
                    {
                        str.AppendLine("<br/>");
                        str.AppendLine("<label>Quicklink Locked:</label><input type=\"checkbox\" onclick=\"DisableTemplateSelect(this.checked)\" name=\"chkLockedContentLink\" id=\"chkLockedContentLink\"" + (content_edit_data.LockedContentLink ? "checked=\"true\"" : "") + "\"/>");
                        str.AppendLine("<br/>");
                        str.AppendLine("<label>Quicklink:</label> \"" + content_edit_data.Quicklink + "\"");
                        str.AppendLine("<script language=\"Javascript\"> DisableTemplateSelect(true) </script>");
                    }
                    else
                    {
                        str.AppendLine("<input type=\"hidden\" name=\"chkLockedContentLink\" id=\"chkLockedContentLink\" value=\"false\" />");
                    }
                }
                else
                {
                    str.AppendLine("<input type=\"hidden\" name=\"chkLockedContentLink\" id=\"chkLockedContentLink\" value=\"false\" />");
                }
            }
            else
            {
                TemplateData[] active_template_list = m_refContApi.GetEnabledTemplatesByFolder(folder_data.Id);

                if (active_template_list.Length < 1)
                {
                    phTemplates.Visible = false;
                    EditTemplateHtml.Visible = false;
                }

                long selected_folder = this.m_refContApi.GetSelectedTemplateByContent(m_refContentId, m_refContApi.RequestInformationRef.ContentLanguage);
                if (selected_folder == 0)
                {
                    selected_folder = folder_data.TemplateId;
                }

                str.Append("<table class=\"ektronForm\">");
                str.Append("<tr>");
                str.Append("<td class=\"label\">");
                str.Append(m_refMsg.GetMessage("template label") + ":");
                str.Append("</td>");
                str.Append("<td class=\"value\">");
                str.Append("<select id=\"templateSelect\" name=\"templateSelect\">");
                foreach (TemplateData template in active_template_list)
                {
                    if (template.SubType != Ektron.Cms.Common.EkEnumeration.TemplateSubType.Wireframes)
                    {
                        if (template.Id == selected_folder)
                        {
                            str.Append("<option value=\"" + template.Id + "\" selected>" + template.FileName + "</option>");
                        }
                        else
                        {
                            str.Append("<option value=\"" + template.Id + "\">" + template.FileName + "</option>");
                        }
                    }
                }

                if (active_template_list.Length == 0)
                {
                    str.Append("<option value=\"" + folder_data.TemplateId + "\">" + folder_data.TemplateFileName + "</option>");
                }
                str.Append("</select>");
                str.Append("</td>");
                str.Append("</tr>");
                str.Append("</table>");
                if (content_edit_data != null)
                {
                    if (content_edit_data.LockedContentLink)
                    {
                        str.AppendLine("<br/>");
                        str.AppendLine("<label>Quicklink Locked:</label><input type=\"checkbox\" onclick=\"DisableTemplateSelect(this.checked)\" name=\"chkLockedContentLink\" id=\"chkLockedContentLink\"" + (content_edit_data.LockedContentLink ? "checked=\"true\"" : "") + "\"/>");
                        str.AppendLine("<br/>");
                        str.AppendLine("<label>Quicklink:</label> \"" + content_edit_data.Quicklink + "\"");
                        str.AppendLine("<script language=\"Javascript\"> DisableTemplateSelect(true) </script>");
                    }
                    else
                    {
                        str.AppendLine("<input type=\"hidden\" name=\"chkLockedContentLink\" id=\"chkLockedContentLink\" value=\"false\" />");
                    }
                }
                else
                {
                    str.AppendLine("<input type=\"hidden\" name=\"chkLockedContentLink\" id=\"chkLockedContentLink\" value=\"false\" />");
                }
            }
        }

        EditTemplateHtml.Text = "<div id=\"dvTemplates\">" + str.ToString() + "</div>";
    }