private void Populate_DeleteContentByCategory(EkContentCol contentdata) { DeleteContentByGategoryGrid.Controls.Clear(); contentids.Value = ""; System.Web.UI.WebControls.BoundColumn colBound; colBound = new System.Web.UI.WebControls.BoundColumn(); colBound.DataField = "BOX"; colBound.HeaderText = "<input type=\"checkbox\" name=\"all\" onclick=\"javascript:checkAll(document.forms[0].all.checked);\">"; colBound.ItemStyle.Width = Unit.Parse("1"); colBound.ItemStyle.VerticalAlign = VerticalAlign.Top; colBound.ItemStyle.HorizontalAlign = HorizontalAlign.Center; colBound.HeaderStyle.CssClass = "title-header"; DeleteContentByGategoryGrid.Columns.Add(colBound); colBound = new System.Web.UI.WebControls.BoundColumn(); colBound.DataField = "TITLE"; colBound.HeaderText = "<a class=\"title-header\" href=\"content.aspx?action=DeleteContentByCategory&orderby=Title&id=" + _Id + "&LangType=" + _ContentLanguage + "\" title=\"" + _MessageHelper.GetMessage("click to sort msg") + "\">" + _MessageHelper.GetMessage("generic Title") + "</a>"; colBound.ItemStyle.VerticalAlign = VerticalAlign.Top; colBound.HeaderStyle.CssClass = "title-header"; colBound.ItemStyle.Wrap = false; DeleteContentByGategoryGrid.Columns.Add(colBound); colBound = new System.Web.UI.WebControls.BoundColumn(); colBound.DataField = "ID"; colBound.HeaderText = "<a class=\"title-header\" href=\"content.aspx?action=DeleteContentByCategory&orderby=ID&id=" + _Id + "&LangType=" + _ContentLanguage + "\" title=\"" + _MessageHelper.GetMessage("click to sort msg") + "\">" + _MessageHelper.GetMessage("generic ID") + "</a>"; colBound.HeaderStyle.CssClass = "title-header"; colBound.ItemStyle.Wrap = false; colBound.ItemStyle.VerticalAlign = VerticalAlign.Top; colBound.ItemStyle.HorizontalAlign = HorizontalAlign.Center; DeleteContentByGategoryGrid.Columns.Add(colBound); colBound = new System.Web.UI.WebControls.BoundColumn(); colBound.DataField = "STATUS"; colBound.HeaderText = "<a class=\"title-header\" href=\"content.aspx?action=DeleteContentByCategory&orderby=status&id=" + _Id + "&LangType=" + _ContentLanguage + "\" title=\"" + _MessageHelper.GetMessage("click to sort msg") + "\">" + _MessageHelper.GetMessage("generic Status") + "</a>"; colBound.ItemStyle.VerticalAlign = VerticalAlign.Top; colBound.HeaderStyle.CssClass = "title-header"; colBound.ItemStyle.HorizontalAlign = HorizontalAlign.Center; colBound.ItemStyle.Wrap = false; DeleteContentByGategoryGrid.Columns.Add(colBound); colBound = new System.Web.UI.WebControls.BoundColumn(); colBound.DataField = "DATEMODIFIED"; colBound.HeaderText = "<a class=\"title-header\" href=\"content.aspx?action=DeleteContentByCategory&orderby=DateModified&id=" + _Id + "&LangType=" + _ContentLanguage + "\" title=\"" + _MessageHelper.GetMessage("click to sort msg") + "\">" + _MessageHelper.GetMessage("generic Date Modified") + "</a>"; colBound.ItemStyle.VerticalAlign = VerticalAlign.Top; colBound.HeaderStyle.CssClass = "title-header"; colBound.ItemStyle.Wrap = false; DeleteContentByGategoryGrid.Columns.Add(colBound); colBound = new System.Web.UI.WebControls.BoundColumn(); colBound.DataField = "EDITORNAME"; colBound.HeaderText = "<a class=\"title-header\" href=\"content.aspx?action=DeleteContentByCategory&orderby=editor&id=" + _Id + "&LangType=" + _ContentLanguage + "\" title=\"" + _MessageHelper.GetMessage("click to sort msg") + "\">" + _MessageHelper.GetMessage("generic Last Editor") + "</a>"; colBound.ItemStyle.VerticalAlign = VerticalAlign.Top; colBound.HeaderStyle.CssClass = "title-header"; colBound.ItemStyle.Wrap = false; DeleteContentByGategoryGrid.Columns.Add(colBound); DataTable dt = new DataTable(); DataRow dr; dt.Columns.Add(new DataColumn("BOX", typeof(string))); dt.Columns.Add(new DataColumn("TITLE", typeof(string))); dt.Columns.Add(new DataColumn("ID", typeof(long))); dt.Columns.Add(new DataColumn("STATUS", typeof(string))); dt.Columns.Add(new DataColumn("DATEMODIFIED", typeof(string))); dt.Columns.Add(new DataColumn("EDITORNAME", typeof(string))); int i; for (i = 0; i <= contentdata.Count - 1; i++) { dr = dt.NewRow(); dr[0] = ""; if ((contentdata.get_Item(i).ContentStatus == "A") || (contentdata.get_Item(i).ContentStatus == "I")) { if (_EkContent.IsAllowed(contentdata.get_Item(i).Id, contentdata.get_Item(i).Language, "content", "delete", 0)) { if (contentids.Value == "") { contentids.Value = contentdata.get_Item(i).Id.ToString(); } else { contentids.Value += "," + contentdata.get_Item(i).Id; } dr[0] = "<input type=\"checkbox\" onclick=\"javascript:checkAllFalse();\" name=\"id_" + contentdata.get_Item(i).Id + "\">"; } } dr[1] = "<a href=\"content.aspx?LangType=" + contentdata.get_Item(i).Language + "&action=View&id=" + contentdata.get_Item(i).Id + "\" title=\'" + _MessageHelper.GetMessage("generic View") + " \"" + Strings.Replace(contentdata.get_Item(i).Title, "\'", "`", 1, -1, 0) + "\"" + "\'>" + contentdata.get_Item(i).Title + "</a>"; dr[2] = contentdata.get_Item(i).Id; dr[3] = contentdata.get_Item(i).Status; dr[4] = contentdata.get_Item(i).DisplayDateModified; dr[5] = contentdata.get_Item(i).LastEditorLname; dt.Rows.Add(dr); } DataView dv = new DataView(dt); DeleteContentByGategoryGrid.DataSource = dv; DeleteContentByGategoryGrid.DataBind(); }
private void FillContentInfo() { //cConts = m_refContent.GetAllViewableChildContentInfoV4_2(cTmp) if (folderType == EkEnumeration.FolderType.Catalog) { CatalogEntryApi catalogAPI = new CatalogEntryApi(); Criteria<EntryProperty> criteria = new Criteria<EntryProperty>(); criteria.PagingInfo = new PagingInfo(m_refContentApi.RequestInformationRef.PagingSize); criteria.PagingInfo.CurrentPage = _currentPageNumber; criteria.AddFilter(EntryProperty.CatalogId, CriteriaFilterOperator.EqualTo, FolderId); criteria.AddFilter(EntryProperty.LanguageId, CriteriaFilterOperator.EqualTo, ContentLanguage); criteria.OrderByField = EntryProperty.Title; entryList = catalogAPI.GetList(criteria); TotalPagesNumber = System.Convert.ToInt32(criteria.PagingInfo.TotalPages); } else { cConts = m_refContent.GetAllViewableChildInfov5_0(cTmp, _currentPageNumber, m_refContentApi.RequestInformationRef.PagingSize, ref TotalPagesNumber, Ektron.Cms.Common.EkEnumeration.CMSContentType.NonLibraryContent, EkEnumeration.CMSContentSubtype.AllTypes); } if (overrideContentEnum == "calfolder" || TotalPagesNumber <= 1) { TotalPages.Visible = false; CurrentPage.Visible = false; lnkBtnPreviousPage.Visible = false; NextPage.Visible = false; LastPage.Visible = false; FirstPage.Visible = false; PageLabel.Visible = false; OfLabel.Visible = false; } else { TotalPages.Visible = true; CurrentPage.Visible = true; lnkBtnPreviousPage.Visible = true; NextPage.Visible = true; LastPage.Visible = true; FirstPage.Visible = true; PageLabel.Visible = true; OfLabel.Visible = true; TotalPages.Text = (System.Math.Ceiling(Convert.ToDouble(TotalPagesNumber))).ToString(); TotalPages.ToolTip = TotalPages.Text; CurrentPage.Text = _currentPageNumber.ToString(); CurrentPage.ToolTip = CurrentPage.Text; if (_currentPageNumber == 1) { lnkBtnPreviousPage.Enabled = false; if (TotalPagesNumber > 1) { NextPage.Enabled = true; } else { NextPage.Enabled = false; } } else { lnkBtnPreviousPage.Enabled = true; if (_currentPageNumber == TotalPagesNumber) { NextPage.Enabled = false; } else { NextPage.Enabled = true; } } } DrawData(); }
protected void Page_PreRender(object sender, System.EventArgs e) { try { if ((this._FolderData != null) && this._FolderData.FolderType == Convert.ToInt32(Ektron.Cms.Common.EkEnumeration.FolderType.Calendar)) { if (_PageData.Contains("ContentType")) _PageData.Remove("ContentType"); if (_PageData.Contains("ContentSubType")) _PageData.Remove("ContentSubType"); if (_PageAction == "viewarchivecontentbycategory") { _EkContentCol = _EkContent.GetAllViewArchiveContentInfov5_0(_PageData, _PagingCurrentPageNumber, _PagingPageSize, ref _PagingTotalPagesNumber); _NextActionType = "ViewContentByCategory"; } else if (_PageAction == "viewcontentbycategory") { _EkContentCol = _EkContent.GetAllViewableChildContentInfoV5_0(_PageData, _PagingCurrentPageNumber, _PagingPageSize, ref _PagingTotalPagesNumber); _NextActionType = "ViewArchiveContentByCategory"; } //paging goes here Populate_ViewCalendar(_EkContentCol); Util_SetJs(); if (_PagingTotalPagesNumber > 1) { this.SetPagingUI(); } else { divPaging.Visible = false; } } } catch (Exception ex) { Response.Redirect((string)("reterror.aspx?info=" + EkFunctions.UrlEncode(ex.Message) + "&LangType=" + _ContentLanguage), false); } }
private void PopulateQLinkList() { //Next two lines were moved from Page_Load to implement paging ContentData = m_refContentApi.EkContentRef.GetAllViewableChildInfov5_0(cTmp, _currentPageNumber, m_refContentApi.RequestInformationRef.PagingSize, ref TotalPagesNumber, EkEnumeration.CMSContentType.NonLibraryContent, EkEnumeration.CMSContentSubtype.AllTypes); if (TotalPagesNumber <= 1) { TotalPages.Visible = false; CurrentPage.Visible = false; lnkBtnPreviousPage.Visible = false; NextPage.Visible = false; LastPage.Visible = false; FirstPage.Visible = false; PageLabel.Visible = false; OfLabel.Visible = false; } else { TotalPages.Visible = true; CurrentPage.Visible = true; lnkBtnPreviousPage.Visible = true; NextPage.Visible = true; LastPage.Visible = true; FirstPage.Visible = true; PageLabel.Visible = true; OfLabel.Visible = true; TotalPages.Text = (System.Math.Ceiling(Convert.ToDecimal(TotalPagesNumber))).ToString(); TotalPages.ToolTip = TotalPages.Text; CurrentPage.Text = _currentPageNumber.ToString(); CurrentPage.ToolTip = CurrentPage.Text; if (_currentPageNumber == 1) { lnkBtnPreviousPage.Enabled = false; if (TotalPagesNumber > 1) { NextPage.Enabled = true; } else { NextPage.Enabled = false; } } else { lnkBtnPreviousPage.Enabled = true; if (_currentPageNumber == TotalPagesNumber) { NextPage.Enabled = false; } else { NextPage.Enabled = true; } } } System.Web.UI.WebControls.BoundColumn colBound; colBound = new System.Web.UI.WebControls.BoundColumn(); colBound.DataField = "Q1"; //info QLinkGrid.Columns.Add(colBound); colBound = new System.Web.UI.WebControls.BoundColumn(); colBound.DataField = "Q2"; //info QLinkGrid.Columns.Add(colBound); colBound = new System.Web.UI.WebControls.BoundColumn(); colBound.DataField = "Q3"; QLinkGrid.Columns.Add(colBound); DataTable dt = new DataTable(); DataRow dr; dt.Columns.Add(new DataColumn("Q1", typeof(string))); dt.Columns.Add(new DataColumn("Q2", typeof(string))); dt.Columns.Add(new DataColumn("Q3", typeof(string))); dr = dt.NewRow(); dr[0] = m_refMsg.GetMessage("msg select qlink") + ":" + "<br>"; dr[1] = "COLSPAN"; dr[2] = "COLSPAN"; dt.Rows.Add(dr); dr = dt.NewRow(); dr[0] = m_refMsg.GetMessage("generic path") + ":<span class=\"filePath\">" + fpath + "</span>"; dr[1] = "COLSPAN"; dr[2] = "COLSPAN"; dt.Rows.Add(dr); if (folderID != 0) { dr = dt.NewRow(); dr[0] = "<a href=\"QuickLinkSelect.aspx?" + intQStringNoFID + "&folderid=" + parentfolderid + "&forcetemplate=" + forceTemplate + "&disAllowAddContent=" + ((System.Convert.ToInt32(CanCreateContent)) + 1) + "title=\"" + m_refMsg.GetMessage("alt: generic previous dir text") + "\"><img src=\"" + AppPath + "images/ui/icons/folderUp.png\" border=\"0\" title=\"" + m_refMsg.GetMessage("alt: generic previous dir text") + "\" alt=\"" + m_refMsg.GetMessage("alt: generic previous dir text") + "\" align=\"absbottom\"></a> <a href=\"QuickLinkSelect.aspx?" + intQStringNoFID + "&folderid=" + parentfolderid + "&forcetemplate=" + forceTemplate + "&disAllowAddContent=" + ((System.Convert.ToInt32(CanCreateContent)) + 1) + "title=\"" + m_refMsg.GetMessage("alt: generic previous dir text") + "\">..</a>"; dr[1] = " "; dr[2] = " "; dt.Rows.Add(dr); } foreach (object temp in cfolders) { Collection folder = (Collection)temp; dr = dt.NewRow(); dr[0] = "<a href=\"QuickLinkSelect.aspx?" + intQStringNoFID + "&folderid=" + folder["id"] + "&forcetemplate=" + forceTemplate + "&disAllowAddContent=" + ((System.Convert.ToInt32(CanCreateContent)) + 1) + "title=\"" + m_refMsg.GetMessage("alt: generic view folder content text") + "\"><img src=\""; if (Convert.ToString(folder["FolderType"]) == "9") //EkEnumeration.FolderType.Catalo"g { dr[0] += AppPath + "images/ui/icons/folderGreen.png"; } else { dr[0] += AppPath + "images/ui/icons/folder.png"; } dr[0] += "\" border=\"0\" title=\"" + m_refMsg.GetMessage("alt: generic view folder content text") + "\" alt=\"" + m_refMsg.GetMessage("alt: generic view folder content text") + "\" align=\"absbottom\"> <a href=\"QuickLinkSelect.aspx?" + intQStringNoFID + "&folderid=" + folder["Id"] + "&forcetemplate=" + forceTemplate + "&disAllowAddContent=" + ((System.Convert.ToInt32(CanCreateContent)) + 1) + "title=\"" + m_refMsg.GetMessage("alt: generic view folder content text") + "\">" + folder["Name"] + "</a>"; dr[1] = " "; dr[2] = " "; dt.Rows.Add(dr); } foreach (ContentBase contBase in ContentData) { if (contBase.ContentSubType == EkEnumeration.CMSContentSubtype.PageBuilderMasterData) { continue; } QuickLink = ""; if ((contBase.ContentType != EkEnumeration.CMSContentType.LibraryItem) && (contBase.ContentType != EkEnumeration.CMSContentType.Archive_Content) && (contBase.ContentType != EkEnumeration.CMSContentType.Archive_Forms)) { if (contBase.QuickLink == "" && Utilities.IsAsset((int)contBase.ContentType, "")) { contBase.QuickLink = (string)(Strings.Replace(this._SiteApi.AppPath, this._SiteApi.SitePath, "", 1, 1, 0) + "showcontent.aspx?id=" + contBase.Id); } QuickLink = _SiteApi.SitePath + contBase.QuickLink; if (Convert.ToInt32(iQLInkCheck) > 0) { if (this._SiteApi.RequestInformationRef.LinkManagement) { if (contBase.ContentType == EkEnumeration.CMSContentType.Forms) { QuickLink = _SiteApi.AppPath + "linkit.aspx?LinkIdentifier=ekfrm&ItemID=" + contBase.Id; } else { QuickLink = _SiteApi.AppPath + "linkit.aspx?LinkIdentifier=ID&ItemID=" + contBase.Id; } } } //If ((forceTemplate = "1") AndAlso (QuickLink.Length > 0)) Then // QuickLink = ektRW.urlAlias(QuickLink, False) // QuickLink = ektRW.urlRewrite(QuickLink, False) //End If QuickLink = QuickLink.Replace("\'", "\\\'\'"); contBase.Title = contBase.Title.Replace("\'", "'"); // to Prevent accidental bad data. if (sFormName == "frm_urlalias") { if (contBase.ContentStatus == "A" && !(Ektron.Cms.Common.EkFunctions.IsImage((string)("." + contBase.AssetInfo.FileExtension)))) //AndAlso Not (contBase.QuickLink.ToLower().IndexOf("blogs.aspx?") >= 0) Last condition to filter blog post to be removed in 7.6 maintenance. { dr = dt.NewRow(); //23692 - title is HTML encoded here (by ReadDbString called earlier), replace ' (') with \' for JScript string to work dr[0] = " <a style=\"text-decoration:none\" href=\"#\" onclick=\"SetQLinkChoice(\'" + contBase.Title.Replace("'", "\\\'") + "\',\'" + contBase.Id + "\',\'" + contBase.Language + "\',\'" + QuickLink + "\', \'" + sFormName + "\', \'" + sTFormElement + "\', \'" + iQLInkCheck + "\', \'" + SetBrowserState + "\', \'" + contBase.ContentStatus + "\');\">"; if (contBase.ContentType == EkEnumeration.CMSContentType.Forms) { dr[0] += "<img src=\"" + getNewContentTypeIcon((int)contBase.ContentType, contBase.AssetInfo.Icon) + "\" border=\"0\" title=\"Select a Form\" alt=\"Select a Form\" align=\"absbottom\"> " + contBase.Title + "</a>"; } else if (contBase.ContentType == EkEnumeration.CMSContentType.Content) { dr[0] += "<img src=\"" + getNewContentTypeIcon((int)contBase.ContentType, contBase.AssetInfo.Icon, (int)contBase.ContentSubType) + "\" border=\"0\" title=\"" + m_refMsg.GetMessage("alt: generic view folder content text") + "\" alt=\"" + m_refMsg.GetMessage("alt: generic view folder content text") + "\" align=\"absbottom\"> " + contBase.Title + "</a>"; } else if (contBase.ContentType == EkEnumeration.CMSContentType.CatalogEntry) { dr[0] += "<img src=\"" + getNewContentTypeIcon((int)contBase.ContentType, contBase.AssetInfo.Icon) + "\" border=\"0\" title=\"" + m_refMsg.GetMessage("alt: generic view folder content text") + "\" alt=\"" + m_refMsg.GetMessage("alt: generic view folder content text") + "\" align=\"absbottom\"> " + contBase.Title + "</a>"; } else { dr[0] += getNewContentTypeIcon((int)contBase.ContentType, contBase.AssetInfo.Icon, (int)contBase.ContentSubType) + " " + contBase.Title + "</a>"; } dr[1] = " "; dr[2] = " "; dt.Rows.Add(dr); } } else { dr = dt.NewRow(); dr[0] = " <a style=\"text-decoration:none\" href=\"#\" onclick=\"SetContentChoice(\'" + contBase.Title.Replace("'", "\\\'") + "\',\'" + contBase.Id + "\',\'" + contBase.Language + "\',\'" + QuickLink + "\', \'" + sFormName + "\', \'" + sTFormElement + "\', \'" + iQLInkCheck + "\', \'" + SetBrowserState + "\', \'" + contBase.ContentStatus + "\');\">"; if (contBase.ContentType == EkEnumeration.CMSContentType.Forms || contBase.ContentType == EkEnumeration.CMSContentType.CatalogEntry) { dr[0] += "<img src=\"" + getNewContentTypeIcon((int)contBase.ContentType, contBase.AssetInfo.Icon) + "\" border=\"0\" title=\"Select a Form\" alt=\"Select a Form\" align=\"absbottom\"> " + contBase.Title + "</a>"; } else if (contBase.ContentType == EkEnumeration.CMSContentType.Content) { dr[0] += "<img src=\"" + getNewContentTypeIcon((int)contBase.ContentType, contBase.AssetInfo.Icon) + "\" border=\"0\" title=\"" + m_refMsg.GetMessage("alt: generic view folder content text") + "\" alt=\"" + m_refMsg.GetMessage("alt: generic view folder content text") + "\" align=\"absbottom\"> " + contBase.Title + "</a>"; } else { dr[0] += getNewContentTypeIcon((int)contBase.ContentType, contBase.AssetInfo.Icon) + " " + contBase.Title + "</a>"; } dr[1] = " "; dr[2] = " "; dt.Rows.Add(dr); } } } DataView dv = new DataView(dt); QLinkGrid.DataSource = dv; QLinkGrid.DataBind(); }
public bool ViewContentByCategory() { _CurrentUserId = _ContentApi.UserId; _AppImgPath = _ContentApi.AppImgPath; _AppPath = _ContentApi.AppPath; _SitePath = _ContentApi.SitePath; _EnableMultilingual = _ContentApi.EnableMultilingual; url_action.Text = _PageAction; url_id.Text = _Id.ToString(); if (_FolderData == null) { _FolderData = _ContentApi.GetFolderById(_Id); } if (_FolderData == null) { Response.Redirect((string)("reterror.aspx?info=" + _MessageHelper.GetMessage("com: folder does not exist")), true); return false; } else { if (_FolderData.XmlConfiguration != null) { _HasXmlConfig = true; } _PermissionData = _ContentApi.LoadPermissions(_Id, "folder", 0); _FolderType = _FolderData.FolderType; } //Setting JS Variable for global use through workarea.aspx page. pasteFolderType.Text = Convert.ToString(_FolderData.FolderType); pasteFolderId.Text = Convert.ToString(_FolderData.Id); pasteParentId.Text = Convert.ToString(_FolderData.ParentId); if (!string.IsNullOrEmpty(Request.QueryString["IsArchivedEvent"])) { _IsArchivedEvent = Convert.ToBoolean(Request.QueryString["IsArchivedEvent"]); is_archived.Text = Convert.ToString(_IsArchivedEvent); } _AssetInfoData = _ContentApi.GetAssetSupertypes(); if ((Ektron.Cms.Common.EkConstants.CMSContentType_Content == Convert.ToInt32(_ContentTypeSelected)) || (Ektron.Cms.Common.EkConstants.CMSContentType_Archive_Content == Convert.ToInt32(_ContentTypeSelected)) || (Ektron.Cms.Common.EkConstants.CMSContentType_XmlConfig == Convert.ToInt32(_ContentTypeSelected))) { _ContentType = int.Parse(_ContentTypeSelected); } else if (Ektron.Cms.Common.EkConstants.CMSContentType_Forms == Convert.ToInt32(_ContentTypeSelected) || Ektron.Cms.Common.EkConstants.CMSContentType_Archive_Forms == Convert.ToInt32(_ContentTypeSelected)) { _ContentType = int.Parse(_ContentTypeSelected); } else if (_ManagedAsset_Min <= Convert.ToInt32(_ContentTypeSelected) && Convert.ToInt32(_ContentTypeSelected) <= _ManagedAsset_Max) { if (DoesAssetSupertypeExist(_AssetInfoData, int.Parse(_ContentTypeSelected))) { _ContentType = int.Parse(_ContentTypeSelected); } } else if (Convert.ToInt32(_ContentTypeSelected) == _CMSContentType_AllTypes) { _ContentType = Ektron.Cms.Common.EkConstants.CMSContentType_NonLibraryForms; } else if (_IsArchivedEvent == true && (Convert.ToInt32(_ContentTypeSelected) == EkConstants.CMSContentType_Archive_ManagedFiles || Convert.ToInt32(_ContentTypeSelected) == EkConstants.CMSContentType_Archive_OfficeDoc || Convert.ToInt32(_ContentTypeSelected) == EkConstants.CMSContentType_Archive_MultiMedia || Convert.ToInt32(_ContentTypeSelected) == EkConstants.CMSContentType_Archive_Images)) { _ContentType = int.Parse(_ContentTypeSelected); } _ContentTypeSelected = _ContentType.ToString(); _PageData = new Microsoft.VisualBasic.Collection(); _PageData.Add(_Id, "FolderID", null, null); if (_FolderData.FolderType == 1) //blog { _PageData.Add("BlogPost", "OrderBy", null, null); } else { _PageData.Add(_OrderBy, "OrderBy", null, null); } if (Request.QueryString["orderbydirection"] == "desc") direction = "desc"; else direction = "asc"; _OrderByDirection = direction; _PageData.Add(_OrderByDirection, "OrderByDirection", null, null); _PageData.Add(_ContentLanguage, "m_intContentLanguage", null, null); switch ((Ektron.Cms.Common.EkEnumeration.FolderType)_FolderData.FolderType) { case Ektron.Cms.Common.EkEnumeration.FolderType.Blog: _ContentType = Ektron.Cms.Common.EkConstants.CMSContentType_Content; _PageData.Add(_ContentType, "ContentType", null, null); break; case Ektron.Cms.Common.EkEnumeration.FolderType.DiscussionForum: _ContentType = Ektron.Cms.Common.EkConstants.CMSContentType_Content; _PageData.Add(_ContentType, "ContentType", null, null); break; default: if (_ContentType > 0) { _PageData.Add(_ContentType, "ContentType", null, null); } break; } if (_ContentType == 1 && _ContentSubTypeSelected != Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.AllTypes) { _PageData.Add(_ContentSubTypeSelected, "ContentSubType", null, null); } if ((Ektron.Cms.Common.EkEnumeration.FolderType)(_FolderData.FolderType) == Ektron.Cms.Common.EkEnumeration.FolderType.Calendar) { calendardisplay.Visible = true; pnlThreadedDiscussions.Visible = false; if ((Request.QueryString["showAddEventForm"] != null) && Request.QueryString["showAddEventForm"] == "true") { if (ViewState["AddEventFormDisplay"] == null || System.Convert.ToBoolean(ViewState["AddEventFormDisplay"]) == false) //only show once { ViewState.Add("AddEventFormDisplay", true); DateTime startDT = DateTime.Now.Date.AddHours(8); if (Request.QueryString["startDT"] != null) { startDT = DateTime.ParseExact(Request.QueryString["startDT"], "yyyyMMddHHmm", new System.Globalization.CultureInfo(1033)); } calendardisplay.ShowInsertForm(startDT); } } if (Request.QueryString["editEvent"] != null) { if (ViewState["editEvent"] == null || System.Convert.ToBoolean(ViewState["editEvent"]) == false) //only show once { ViewState.Add("editEvent", true); calendardisplay.ShowEditForm(Request.QueryString["editEvent"]); } } ScriptManager.RegisterClientScriptBlock(Page, typeof(UserControl), "CalendarCleanup", "try{ window.EditorCleanup(); }catch(ex){}", true); } _PagingPageSize = _ContentApi.RequestInformationRef.PagingSize; if ((Ektron.Cms.Common.EkEnumeration.FolderType)(_FolderData.FolderType) == Ektron.Cms.Common.EkEnumeration.FolderType.Blog) { _BlogData = _ContentApi.BlogObject(_FolderData); } //if it's a calendar then we do it on prerender if ((Ektron.Cms.Common.EkEnumeration.FolderType)(_FolderData.FolderType) != Ektron.Cms.Common.EkEnumeration.FolderType.Calendar) { if (_PageAction == "viewarchivecontentbycategory") { _EkContentCol = _EkContent.GetAllViewArchiveContentInfov5_0(_PageData, _PagingCurrentPageNumber, _PagingPageSize, ref _PagingTotalPagesNumber); _NextActionType = "ViewContentByCategory"; } else if (_PageAction == "viewcontentbycategory") { _EkContentCol = _EkContent.GetAllViewableChildContentInfoV5_0(_PageData, _PagingCurrentPageNumber, _PagingPageSize, ref _PagingTotalPagesNumber); _NextActionType = "ViewArchiveContentByCategory"; } //paging goes here int i; for (i = 0; i <= _EkContentCol.Count - 1; i++) { if (_EkContentCol.get_Item(i).ContentStatus == "A") { _TakeAction = true; _CheckedInOrApproved = true; break; } else { if (_EkContentCol.get_Item(i).ContentStatus == "I") { _CheckedInOrApproved = true; } } } } else { if (_PageAction == "viewarchivecontentbycategory") { _NextActionType = "ViewContentByCategory"; } else if (_PageAction == "viewcontentbycategory") { _NextActionType = "ViewArchiveContentByCategory"; } } switch ((Ektron.Cms.Common.EkEnumeration.FolderType)(_FolderData.FolderType)) { case Ektron.Cms.Common.EkEnumeration.FolderType.Catalog: if (_PageAction == "viewarchivecontentbycategory") { _NextActionType = "ViewContentByCategory"; } else if (_PageAction == "viewcontentbycategory") { _NextActionType = "ViewArchiveContentByCategory"; } Page.ClientScript.RegisterClientScriptBlock(typeof(string), "objselnotice", "<script type=\"text/javascript\">var objSelSupertype = null;</script>"); CatalogEntry CatalogManager = new CatalogEntry(_ContentApi.RequestInformationRef); System.Collections.Generic.List<EntryData> entryList = new System.Collections.Generic.List<EntryData>(); Ektron.Cms.Common.Criteria<EntryProperty> entryCriteria = new Ektron.Cms.Common.Criteria<EntryProperty>(); entryCriteria.AddFilter(EntryProperty.CatalogId, Ektron.Cms.Common.CriteriaFilterOperator.EqualTo, _Id); entryCriteria.PagingInfo.CurrentPage = Convert.ToInt32(_PagingCurrentPageNumber.ToString()); entryCriteria.PagingInfo.RecordsPerPage = _ContentApi.RequestInformationRef.PagingSize; if (_ContentApi.RequestInformationRef.ContentLanguage > 0) { entryCriteria.AddFilter(EntryProperty.LanguageId, Ektron.Cms.Common.CriteriaFilterOperator.EqualTo, _ContentApi.RequestInformationRef.ContentLanguage); } switch (this._ContentTypeQuerystringParam) { case "0": long[] IdList = new long[3]; IdList[0] = Convert.ToInt64(Ektron.Cms.Common.EkEnumeration.CatalogEntryType.Product); IdList[1] = Convert.ToInt64(Ektron.Cms.Common.EkEnumeration.CatalogEntryType.ComplexProduct); entryCriteria.AddFilter(EntryProperty.EntryType, Ektron.Cms.Common.CriteriaFilterOperator.In, IdList); break; case "2": entryCriteria.AddFilter(EntryProperty.EntryType, Ektron.Cms.Common.CriteriaFilterOperator.EqualTo, Ektron.Cms.Common.EkEnumeration.CatalogEntryType.Kit); break; case "3": entryCriteria.AddFilter(EntryProperty.EntryType, Ektron.Cms.Common.CriteriaFilterOperator.EqualTo, Ektron.Cms.Common.EkEnumeration.CatalogEntryType.Bundle); break; case "4": entryCriteria.AddFilter(EntryProperty.EntryType, Ektron.Cms.Common.CriteriaFilterOperator.EqualTo, Ektron.Cms.Common.EkEnumeration.CatalogEntryType.SubscriptionProduct); break; } if (_PageAction == "viewarchivecontentbycategory") { entryCriteria.AddFilter(EntryProperty.IsArchived, Ektron.Cms.Common.CriteriaFilterOperator.EqualTo, true); } else { entryCriteria.AddFilter(EntryProperty.IsArchived, Ektron.Cms.Common.CriteriaFilterOperator.EqualTo, false); } if (Request.QueryString["orderbydirection"] == "desc") direction = "desc"; else direction = "asc"; if(direction == "desc") entryCriteria.OrderByDirection = (EkEnumeration.OrderByDirection)OrderByDirection.Descending; else entryCriteria.OrderByDirection = (EkEnumeration.OrderByDirection)OrderByDirection.Ascending; switch (_OrderBy.ToLower()) { case "language": entryCriteria.OrderByField = EntryProperty.LanguageId; break; case "id": entryCriteria.OrderByField = EntryProperty.Id; break; case "status": entryCriteria.OrderByField = EntryProperty.ContentStatus; break; case "entrytype": entryCriteria.OrderByField = EntryProperty.EntryType; break; case "sale": entryCriteria.OrderByField = EntryProperty.SalePrice; break; case "list": entryCriteria.OrderByField = EntryProperty.ListPrice; break; default: //"title" entryCriteria.OrderByField = EntryProperty.Title; break; } entryList = CatalogManager.GetList(entryCriteria); for (int j = 0; j <= entryList.Count - 1; j++) { if (entryList[j].Status == "A") { _TakeAction = true; _CheckedInOrApproved = true; break; } else { if (entryList[j].Status == "I") { _CheckedInOrApproved = true; } } } _PagingTotalPagesNumber = System.Convert.ToInt32(entryCriteria.PagingInfo.TotalPages); //paging goes here ViewCatalogToolBar(entryList.Count); Populate_ViewCatalogGrid(_EkContentCol, entryList); _ContentType = int.Parse(_ContentTypeSelected); break; case Ektron.Cms.Common.EkEnumeration.FolderType.Blog: _IsMyBlog = System.Convert.ToBoolean((_BlogData.Id == _ContentApi.GetUserBlog(_ContentApi.UserId)) ? true : false); Page.ClientScript.RegisterClientScriptBlock(typeof(string), "objselnotice", "<script type=\"text/javascript\">var objSelSupertype = null;</script>"); if (!string.IsNullOrEmpty(Request.QueryString["ContType"]) && (Request.QueryString["ContType"] == Ektron.Cms.Common.EkConstants.CMSContentType_BlogComments.ToString())) { _ContentType = System.Convert.ToInt32(Request.QueryString["ContType"]); _Task = _ContentApi.EkTaskRef; if (!string.IsNullOrEmpty(Request.QueryString["contentid"])) { _PostID = Convert.ToInt64(Request.QueryString["contentid"]); _ContentData = _ContentApi.GetContentById(_PostID, 0); Ektron.Cms.PageRequestData null_EktronCmsPageRequestData = null; _Comments = _Task.GetTasks(_PostID, -1, -1, Convert.ToInt32(Ektron.Cms.Common.EkEnumeration.CMSTaskItemType.BlogCommentItem), "postcomment", 0, ref null_EktronCmsPageRequestData, ""); } else { Ektron.Cms.PageRequestData null_EktronCmsPageRequestData2 = null; _Comments = _Task.GetTasks(-1, -1, -1, Convert.ToInt32(Ektron.Cms.Common.EkEnumeration.CMSTaskItemType.BlogCommentItem), "", 0, ref null_EktronCmsPageRequestData2, ""); } ViewBlogContentByCategoryToolBar(); Populate_ViewBlogCommentsByCategoryGrid(_Comments); } else { Hashtable BlogPostCommentTally = new Hashtable(); BlogPostCommentTally = _EkContent.TallyCommentsForBlogPosts(_Id); ViewBlogContentByCategoryToolBar(); Populate_ViewBlogPostsByCategoryGrid(_EkContentCol, BlogPostCommentTally); } break; case Ektron.Cms.Common.EkEnumeration.FolderType.Media: Page.ClientScript.RegisterClientScriptBlock(typeof(string), "objselnotice", "<script type=\"text/javascript\">var objSelSupertype = null;</script>"); ViewContentByCategoryToolBar(); Populate_ViewMediaGrid(_EkContentCol); break; case Ektron.Cms.Common.EkEnumeration.FolderType.DiscussionBoard: Page.ClientScript.RegisterClientScriptBlock(typeof(string), "objselnotice", "<script type=\"text/javascript\">var objSelSupertype = null;</script>"); ViewDiscussionBoardToolBar(); Populate_ViewDiscussionBoardGrid(); break; case Ektron.Cms.Common.EkEnumeration.FolderType.DiscussionForum: Page.ClientScript.RegisterClientScriptBlock(typeof(string), "objselnotice", "<script type=\"text/javascript\">var objSelSupertype = null;</script>"); bool bCanModerate = false; int itotalpages = 1; int icurrentpage = 1; if (!string.IsNullOrEmpty(Request.QueryString["ContType"]) && (Request.QueryString["ContType"] == Ektron.Cms.Common.EkConstants.CMSContentType_BlogComments.ToString())) { _ContentType = System.Convert.ToInt32(Request.QueryString["ContType"]); if (this._ContentApi.UserId > 0 && ((!(_PermissionData == null) && _PermissionData.CanAddToImageLib == true) || _PermissionData.IsAdmin)) { bCanModerate = true; } _DiscussionBoard = _ContentApi.GetTopic(_ContentId, true); if (_DiscussionBoard == null) { throw new Exception("You may not have permission to view this object or it has been deleted."); } _BoardID = _DiscussionBoard.Id; _ContentData = (ContentData)(_DiscussionBoard.Forums[0].Topics[0]); _PermissionData = _ContentApi.LoadPermissions(_ContentId, "content", ContentAPI.PermissionResultType.All); ViewRepliesToolBar(); _Task = _ContentApi.EkTaskRef; if (!string.IsNullOrEmpty(Request.QueryString["contentid"])) { _PostID = Convert.ToInt64(Request.QueryString["contentid"]); _Comments = _Task.GetTopicReplies(_PostID, _DiscussionBoard.Id, ref icurrentpage, 0, 0, ref itotalpages, bCanModerate); } else { Ektron.Cms.PageRequestData null_EktronCmsPageRequestData3 = null; _Comments = _Task.GetTasks(-1, -1, -1, Convert.ToInt32(Ektron.Cms.Common.EkEnumeration.CMSTaskItemType.TopicReplyItem), "", 0, ref null_EktronCmsPageRequestData3, ""); } Populate_ViewTopicRepliesGrid(_Comments); } else { ArrayList ForumPostCommentTally = new ArrayList(); DiscussionBoard thisboard; bool bModerator = false; if (_PermissionData.IsAdmin == true || _PermissionData.CanAddToImageLib == true) { bModerator = true; } thisboard = _EkContent.GetForumbyID(_Id.ToString(), bModerator, _PagingCurrentPageNumber, ref this._PagingTotalPagesNumber, "", this._ContentApi.RequestInformationRef.PagingSize); //paging here ForumPostCommentTally = _EkContent.GetRepliesForTopics(_Id); ViewDiscussionForumToolBar(); Populate_ViewForumPostsByCategoryGrid(thisboard.Forums[0].Topics, ForumPostCommentTally); } break; case Ektron.Cms.Common.EkEnumeration.FolderType.Calendar: ViewCalendarToolBar(); break; default: ViewContentByCategoryToolBar(); Populate_ViewContentByCategoryGrid(_EkContentCol); break; } Util_SetJs(); return true; }
private void Populate_ViewMediaGrid(EkContentCol contentdata) { System.Web.UI.WebControls.BoundColumn colBound = new System.Web.UI.WebControls.BoundColumn(); string strTag; string strtag1; strTag = "<a href=\"content.aspx?LangType=" + _ContentLanguage + "&action=" + _PageAction + "&orderby="; strtag1 = "&id=" + _Id + (_ContentTypeQuerystringParam != "" ? "&" + _ContentTypeUrlParam + "=" + _ContentTypeQuerystringParam : "") + "\" title=\"" + _MessageHelper.GetMessage("click to sort msg") + "\">"; colBound.DataField = "A"; colBound.HeaderText = "#&160;"; colBound.ItemStyle.Width = Unit.Percentage(33); colBound.HeaderStyle.CssClass = "title-header"; FolderDataGrid.Columns.Add(colBound); colBound = new System.Web.UI.WebControls.BoundColumn(); colBound.DataField = "B"; colBound.HeaderText = "#&160;"; colBound.ItemStyle.Width = Unit.Percentage(33); colBound.HeaderStyle.CssClass = "title-header"; FolderDataGrid.Columns.Add(colBound); colBound = new System.Web.UI.WebControls.BoundColumn(); colBound.DataField = "C"; colBound.HeaderText = "#&160;"; colBound.ItemStyle.Width = Unit.Percentage(33); colBound.HeaderStyle.CssClass = "title-header"; FolderDataGrid.Columns.Add(colBound); DataTable dt = new DataTable(); DataRow dr = dt.NewRow(); dt.Columns.Add(new DataColumn("A", typeof(string))); dt.Columns.Add(new DataColumn("B", typeof(string))); dt.Columns.Add(new DataColumn("C", typeof(string))); string ViewUrl = ""; string EditUrl = ""; int i; bool bAssetItem = false; int iMod = 0; FolderData[] f = this._EkContent.GetChildFolders(this._Id, false, Ektron.Cms.Common.EkEnumeration.FolderOrderBy.Name); if ((f != null) && f.Length > 0) { for (i = 0; i <= (f.Length - 1); i++) { iMod = i % 3; if (iMod == 0) { dr = dt.NewRow(); } dr[iMod] += "<br/><img src=\"" + this._ContentApi.AppImgPath + "thumb_folder.gif\" border=\"1\"/><br/><a href=\"content.aspx?action=ViewContentByCategory&id=" + f[i].Id.ToString() + "\">" + f[i].Name + "</a><br/><br/>"; if (iMod == 2) { dt.Rows.Add(dr); dr = null; } } } int offset = iMod + 1; for (i = 0; i <= contentdata.Count - 1; i++) { bAssetItem = System.Convert.ToBoolean((contentdata.get_Item(i).ContentType == Ektron.Cms.Common.EkEnumeration.CMSContentType.Assets) || ((Convert.ToInt32(contentdata.get_Item(i).ContentType) >= Ektron.Cms.Common.EkConstants.ManagedAsset_Min) && (Convert.ToInt32(contentdata.get_Item(i).ContentType) <= Ektron.Cms.Common.EkConstants.ManagedAsset_Max))); iMod = System.Convert.ToInt32((i + offset) % 3); if (iMod == 0) { dr = dt.NewRow(); } dr[iMod] = "<br/><img src=\"" + this._ContentApi.AppImgPath + "thumb_bmp.gif\" border=\"1\"/><br/>"; if (bAssetItem && (contentdata.get_Item(i).ContentStatus == "O") && (contentdata.get_Item(i).UserId == _CurrentUserId)) { ViewUrl = System.Convert.ToString("content.aspx?action=View&folder_id=" + _Id + "&id=" + contentdata.get_Item(i).Id + "&LangType=" + contentdata.get_Item(i).Language); //& "&callerpage=content.aspx&origurl=" '& EkFunctions.UrlEncode(Request.ServerVariables("QUERY_STRING")) EditUrl = System.Convert.ToString("edit.aspx?close=false&LangType=" + contentdata.get_Item(i).Language + "&id=" + contentdata.get_Item(i).Id + "&type=update&back_file=content.aspx&back_action=ViewContentByCategory&back_id=" + contentdata.get_Item(i).FolderId + "&back_LangType=" + contentdata.get_Item(i).Language); } else { if (contentdata.get_Item(i).ContentStatus == "A") { dr[iMod] += "<a href=\"content.aspx?action=View&folder_id=" + _Id + "&id=" + contentdata.get_Item(i).Id + "&LangType=" + contentdata.get_Item(i).Language + "&callerpage=content.aspx&origurl=" + EkFunctions.UrlEncode(Request.ServerVariables["QUERY_STRING"]) + "\"" + "title=\'" + _MessageHelper.GetMessage("generic View") + " \"" + Strings.Replace((string)(contentdata.get_Item(i).Title + "\""), "\'", "`", 1, -1, 0) + "\'" + "> " + contentdata.get_Item(i).Title + " </a> "; } else { dr[iMod] += "<a href=\"content.aspx?action=viewstaged&folder_id=" + _Id + "&id=" + contentdata.get_Item(i).Id + "&LangType=" + contentdata.get_Item(i).Language + "&callerpage=content.aspx&origurl=" + EkFunctions.UrlEncode(Request.ServerVariables["QUERY_STRING"]) + "\"" + "title=\'" + _MessageHelper.GetMessage("generic View") + " \"" + Strings.Replace((string)(contentdata.get_Item(i).Title + "\""), "\'", "`", 1, -1, 0) + "\'" + "> " + contentdata.get_Item(i).Title + " </a> "; } } dr[iMod] += "<br/><br/>"; if (iMod == 2) { dt.Rows.Add(dr); dr = null; } } if (iMod < 2) { dt.Rows.Add(dr); } DataView dv = new DataView(dt); FolderDataGrid.DataSource = dv; FolderDataGrid.DataBind(); }
private void Populate_ViewCatalogGrid(EkContentCol folder_data, System.Collections.Generic.List<EntryData> entryList) { System.Web.UI.WebControls.BoundColumn colBound = new System.Web.UI.WebControls.BoundColumn(); string strTag; string strtag1; string langDesc = string.Empty; string imageDirection = string.Empty; if (Request.QueryString["orderbydirection"] == null) direction = "desc"; else if (Request.QueryString["orderbydirection"] == "desc") { imageDirection = " <img src=\"" + _ContentApi.ApplicationPath + "images/ui/icons/arrowHeadDownGrey.png\" \" />"; direction = "asc"; } else if (Request.QueryString["orderbydirection"] == "asc") { imageDirection = " <img src=\"" + _ContentApi.ApplicationPath + "images/ui/icons/arrowHeadUpGrey.png\" \" />"; direction = "desc"; } strTag = "<a href=\"content.aspx?LangType=" + _ContentLanguage + "&action=" + _PageAction + "&orderbydirection=" + direction + "&orderby="; strtag1 = "&id=" + _Id + (_ContentTypeQuerystringParam != "" ? "&" + _ContentTypeUrlParam + "=" + _ContentTypeQuerystringParam : "") + "\" title=\"" + _MessageHelper.GetMessage("click to sort msg") + "\">"; colBound.DataField = "TITLE"; if (!string.IsNullOrEmpty(Request.QueryString["orderby"]) && Request.QueryString["orderby"].ToString().ToLower() == "title") colBound.HeaderText = strTag + "Title" + strtag1 + _MessageHelper.GetMessage("generic title") + imageDirection + "</a>"; else colBound.HeaderText = strTag + "Title" + strtag1 + _MessageHelper.GetMessage("generic title") + "</a>"; colBound.HeaderStyle.CssClass = "title-header"; colBound.ItemStyle.CssClass = "left"; FolderDataGrid.Columns.Add(colBound); colBound = new System.Web.UI.WebControls.BoundColumn(); colBound.DataField = "CONTENTTYPE"; colBound.HeaderText = strTag + "Type" + strtag1 + _MessageHelper.GetMessage("lbl product type xml config") + "</a>"; colBound.HeaderStyle.CssClass = "title-header"; colBound.ItemStyle.CssClass = "left"; FolderDataGrid.Columns.Add(colBound); colBound = new System.Web.UI.WebControls.BoundColumn(); colBound.DataField = "LANGUAGE"; if (!string.IsNullOrEmpty(Request.QueryString["orderby"]) && Request.QueryString["orderby"].ToString().ToLower() == "language") colBound.HeaderText = strTag + "language" + strtag1 + _MessageHelper.GetMessage("generic language") + imageDirection + "</a>"; else colBound.HeaderText = strTag + "language" + strtag1 + _MessageHelper.GetMessage("generic language") + "</a>"; colBound.HeaderStyle.CssClass = "title-header center"; colBound.ItemStyle.CssClass = "center"; FolderDataGrid.Columns.Add(colBound); colBound = new System.Web.UI.WebControls.BoundColumn(); colBound.DataField = "ID"; if (!string.IsNullOrEmpty(Request.QueryString["orderby"]) && Request.QueryString["orderby"].ToString().ToLower() == "id") colBound.HeaderText = strTag + "ID" + strtag1 + _MessageHelper.GetMessage("generic ID") + imageDirection + "</a>"; else colBound.HeaderText = strTag + "ID" + strtag1 + _MessageHelper.GetMessage("generic ID") + "</a>"; colBound.HeaderStyle.CssClass = "title-header center"; colBound.ItemStyle.CssClass = "center"; FolderDataGrid.Columns.Add(colBound); colBound = new System.Web.UI.WebControls.BoundColumn(); colBound.DataField = "STATUS"; if (!string.IsNullOrEmpty(Request.QueryString["orderby"]) && Request.QueryString["orderby"].ToString().ToLower() == "status") colBound.HeaderText = strTag + "status" + strtag1 + _MessageHelper.GetMessage("generic Status") + imageDirection + "</a>"; else colBound.HeaderText = strTag + "status" + strtag1 + _MessageHelper.GetMessage("generic Status") + "</a>"; colBound.HeaderStyle.CssClass = "title-header center"; colBound.ItemStyle.CssClass = "center"; FolderDataGrid.Columns.Add(colBound); colBound = new System.Web.UI.WebControls.BoundColumn(); colBound.DataField = "TYPE"; colBound.HeaderText = strTag + "entrytype" + strtag1 + _MessageHelper.GetMessage("lbl product type class") + "</a>"; colBound.HeaderStyle.CssClass = "title-header center"; colBound.ItemStyle.CssClass = "center"; FolderDataGrid.Columns.Add(colBound); colBound = new System.Web.UI.WebControls.BoundColumn(); colBound.DataField = "SALEPRICE"; if (!string.IsNullOrEmpty(Request.QueryString["orderby"]) && Request.QueryString["orderby"].ToString().ToLower() == "sale") colBound.HeaderText = strTag + "sale" + strtag1 + _MessageHelper.GetMessage("lbl sale price") + imageDirection + "</a>"; else colBound.HeaderText = strTag + "sale" + strtag1 + _MessageHelper.GetMessage("lbl sale price") + "</a>"; colBound.HeaderStyle.CssClass = "title-header center"; colBound.ItemStyle.CssClass = "right"; FolderDataGrid.Columns.Add(colBound); colBound = new System.Web.UI.WebControls.BoundColumn(); colBound.DataField = "LISTPRICE"; if (!string.IsNullOrEmpty(Request.QueryString["orderby"]) && Request.QueryString["orderby"].ToString().ToLower() == "list") colBound.HeaderText = strTag + "list" + strtag1 + _MessageHelper.GetMessage("lbl list price") + imageDirection + "</a>"; else colBound.HeaderText = strTag + "list" + strtag1 + _MessageHelper.GetMessage("lbl list price") + "</a>"; colBound.HeaderStyle.CssClass = "title-header center"; colBound.ItemStyle.CssClass = "right"; FolderDataGrid.Columns.Add(colBound); DataTable dt = new DataTable(); DataRow dr; dt.Columns.Add(new DataColumn("TITLE", typeof(string))); dt.Columns.Add(new DataColumn("CONTENTTYPE", typeof(string))); dt.Columns.Add(new DataColumn("LANGUAGE", typeof(string))); dt.Columns.Add(new DataColumn("ID", typeof(long))); dt.Columns.Add(new DataColumn("STATUS", typeof(string))); dt.Columns.Add(new DataColumn("TYPE", typeof(string))); dt.Columns.Add(new DataColumn("SALEPRICE", typeof(string))); dt.Columns.Add(new DataColumn("LISTPRICE", typeof(string))); string ViewUrl = ""; int i; for (i = 0; i <= (entryList.Count - 1); i++) { dr = dt.NewRow(); if (entryList[i].ContentStatus == "A") { ViewUrl = (string)("content.aspx?action=View&folder_id=" + _Id + "&id=" + entryList[i].Id + "&LangType=" + entryList[i].LanguageId + "&callerpage=content.aspx&origurl=" + EkFunctions.UrlEncode(Request.ServerVariables["QUERY_STRING"])); } else { ViewUrl = (string)("content.aspx?action=ViewStaged&folder_id=" + _Id + "&id=" + entryList[i].Id + "&LangType=" + entryList[i].LanguageId + "&callerpage=content.aspx&origurl=" + EkFunctions.UrlEncode(Request.ServerVariables["QUERY_STRING"])); } string dmsMenuGuid; dmsMenuGuid = (string)(System.Guid.NewGuid().ToString()); string makeUnique = (string)(entryList[i].Id + entryList[i].LanguageId + dmsMenuGuid); long contentType = Convert.ToInt64(EkEnumeration.CMSContentType.CatalogEntry); dr[0] = "<div class=\"dmsWrapper\""; dr[0] = dr[0] + " id=\"dmsWrapper" + makeUnique + "\">"; dr[0] = dr[0] + "<p class=\"dmsItemWrapper\""; dr[0] = dr[0] + " id=\"dmsItemWrapper" + makeUnique + "\""; dr[0] = dr[0] + " title=\"View Menu\""; dr[0] = dr[0] + " style=\"overflow:visible;\""; dr[0] = dr[0] + ">"; dr[0] = dr[0] + "<input type=\"hidden\" value=\'{\"id\":" + entryList[i].Id + ","; dr[0] = dr[0] + "\"parentId\":" + entryList[i].FolderId + ","; dr[0] = dr[0] + "\"languageId\":" + entryList[i].LanguageId + ","; dr[0] = dr[0] + "\"status\":\"" + entryList[i].ContentStatus + "\","; dr[0] = dr[0] + "\"guid\":\"" + dmsMenuGuid + "\","; dr[0] = dr[0] + "\"communityDocumentsMenu\": \"\","; dr[0] = dr[0] + "\"contentType\":" + contentType + ","; dr[0] = dr[0] + "\"dmsSubtype\":\"\"}\'"; dr[0] = dr[0] + " id=\"dmsContentInfo" + makeUnique + "\" />"; if (entryList[i].EntryType == Ektron.Cms.Common.EkEnumeration.CatalogEntryType.SubscriptionProduct) { dr[0] = dr[0] + "<img src=\"" + _ContentApi.AppPath + "images/ui/icons/bookGreen.png" + "\" onclick=\"event.cancelBubble=true;\" />"; } else if (entryList[i].EntryType == Ektron.Cms.Common.EkEnumeration.CatalogEntryType.Product) { dr[0] = dr[0] + "<img src=\"" + _ContentApi.AppPath + "Images/ui/icons/brick.png" + "\" onclick=\"event.cancelBubble=true;\" />"; } else if (entryList[i].EntryType == Ektron.Cms.Common.EkEnumeration.CatalogEntryType.ComplexProduct) { dr[0] = dr[0] + "<img src=\"" + _ContentApi.AppPath + "Images/ui/icons/bricks.png" + "\" onclick=\"event.cancelBubble=true;\" />"; } else if (entryList[i].EntryType == Ektron.Cms.Common.EkEnumeration.CatalogEntryType.Kit) { dr[0] = dr[0] + "<img src=\"" + _ContentApi.AppPath + "Images/ui/icons/box.png" + "\" onclick=\"event.cancelBubble=true;\" />"; } else if (entryList[i].EntryType == Ektron.Cms.Common.EkEnumeration.CatalogEntryType.Bundle) { dr[0] = dr[0] + "<img src=\"" + _ContentApi.AppPath + "Images/ui/icons/package.png\" onclick=\"event.cancelBubble=true;\" />"; } dr[0] = dr[0] + "<a"; dr[0] = dr[0] + " id=\"dmsViewItemAnchor" + makeUnique + "\""; dr[0] = dr[0] + " class=\"dmsViewItemAnchor\""; dr[0] = dr[0] + " onclick=\"event.cancelBubble=true;\""; dr[0] = dr[0] + " href=\"" + ViewUrl + "\""; dr[0] = dr[0] + " title=\"View " + entryList[i].Title + "\""; dr[0] = dr[0] + ">" + entryList[i].Title; dr[0] = dr[0] + "</a>"; dr[0] = dr[0] + "</p>"; dr[0] = dr[0] + "</div>"; Ektron.Cms.Framework.Localization.LocaleManager _locApi = new Ektron.Cms.Framework.Localization.LocaleManager(); LocaleData langData = _locApi.GetItem(System.Convert.ToInt32(entryList[i].LanguageId)); if (langData != null) { langDesc = langData.EnglishName; } dr[1] = GetContentTypeText(contentType, entryList[i].ProductType.Id, 0, ""); dr[2] = "<a href=\"#Language\" onclick=\"return false;\" onmouseover=\"ddrivetip(\'" + langDesc.ToString() + "\',\'ADC5EF\', 100);\" onmouseout=\"hideddrivetip()\" style=\"text-decoration:none;\">" + "<img src=\'" + _LocalizationApi.GetFlagUrlByLanguageID(System.Convert.ToInt32(entryList[i].LanguageId)) + "\' alt=\"Flag\" />" + "</a>"; dr[3] = entryList[i].Id; dr[4] = _StyleHelper.StatusWithToolTip((string)(entryList[i].ContentStatus)); dr[5] = entryList[i].EntryType.ToString(); dr[6] = Ektron.Cms.Common.EkFunctions.FormatCurrency(System.Convert.ToDecimal(entryList[i].SalePrice), _ContentApi.RequestInformationRef.CommerceSettings.CurrencyCultureCode); dr[7] = Ektron.Cms.Common.EkFunctions.FormatCurrency(System.Convert.ToDecimal(entryList[i].ListPrice), _ContentApi.RequestInformationRef.CommerceSettings.CurrencyCultureCode); dt.Rows.Add(dr); } DataView dv = new DataView(dt); FolderDataGrid.DataSource = dv; FolderDataGrid.DataBind(); }
private void Populate_ViewContentByCategoryGrid(EkContentCol contentdata) { System.Web.UI.WebControls.BoundColumn colBound = new System.Web.UI.WebControls.BoundColumn(); string strTag; string strtag1; string imageDirection = string.Empty; if (Request.QueryString["orderbydirection"] == null) direction = "desc"; else if (Request.QueryString["orderbydirection"] == "desc") { imageDirection = " <img src=\"" + _ContentApi.ApplicationPath + "images/ui/icons/arrowHeadDownGrey.png\" \" />"; direction = "asc"; } else if (Request.QueryString["orderbydirection"] == "asc") { imageDirection = " <img src=\"" + _ContentApi.ApplicationPath + "images/ui/icons/arrowHeadUpGrey.png\" \" />"; direction = "desc"; } strTag = "<a href=\"content.aspx?LangType=" + _ContentLanguage + "&action=" + _PageAction + "&orderbydirection=" + direction + "&orderby="; strtag1 = "&id=" + _Id + (_ContentTypeQuerystringParam != "" ? "&" + _ContentTypeUrlParam + "=" + _ContentTypeQuerystringParam : "") + "\" title=\"" + _MessageHelper.GetMessage("click to sort msg") + "\">"; colBound.DataField = "TITLE"; if (!string.IsNullOrEmpty(Request.QueryString["orderby"]) && Request.QueryString["orderby"].ToString().ToLower() == "title") { colBound.HeaderText = strTag + "Title" + strtag1 + _MessageHelper.GetMessage("generic title") + imageDirection + "</a>"; } else { colBound.HeaderText = strTag + "Title" + strtag1 + _MessageHelper.GetMessage("generic title") + "</a>"; } colBound.HeaderStyle.CssClass = "title-header"; colBound.ItemStyle.CssClass = "left"; FolderDataGrid.Columns.Add(colBound); colBound = new System.Web.UI.WebControls.BoundColumn(); colBound.DataField = "CONTENTTYPE"; colBound.HeaderText = _MessageHelper.GetMessage("content type"); colBound.HeaderStyle.CssClass = "title-header"; colBound.ItemStyle.CssClass = "left"; FolderDataGrid.Columns.Add(colBound); colBound = new System.Web.UI.WebControls.BoundColumn(); colBound.DataField = "LANGUAGE"; if (!string.IsNullOrEmpty(Request.QueryString["orderby"]) && Request.QueryString["orderby"].ToString().ToLower() == "language") { colBound.HeaderText = strTag + "language" + strtag1 + _MessageHelper.GetMessage("generic language") + imageDirection +"</a>"; } else { colBound.HeaderText = strTag + "language" + strtag1 + _MessageHelper.GetMessage("generic language") + "</a>"; } colBound.HeaderStyle.CssClass = "title-header center"; colBound.ItemStyle.CssClass = "center"; FolderDataGrid.Columns.Add(colBound); colBound = new System.Web.UI.WebControls.BoundColumn(); colBound.DataField = "ID"; if (!string.IsNullOrEmpty(Request.QueryString["orderby"]) && Request.QueryString["orderby"].ToString().ToLower() == "id") colBound.HeaderText = strTag + "ID" + strtag1 + _MessageHelper.GetMessage("generic ID") + imageDirection + "</a>"; else colBound.HeaderText = strTag + "ID" + strtag1 + _MessageHelper.GetMessage("generic ID") + "</a>"; colBound.HeaderStyle.CssClass = "title-header center"; colBound.ItemStyle.CssClass = "center"; FolderDataGrid.Columns.Add(colBound); colBound = new System.Web.UI.WebControls.BoundColumn(); colBound.DataField = "STATUS"; if (!string.IsNullOrEmpty(Request.QueryString["orderby"]) && Request.QueryString["orderby"].ToString().ToLower() == "status") colBound.HeaderText = strTag + "status" + strtag1 + _MessageHelper.GetMessage("generic Status") + imageDirection + "</a>"; else colBound.HeaderText = strTag + "status" + strtag1 + _MessageHelper.GetMessage("generic Status") + "</a>"; colBound.HeaderStyle.CssClass = "title-header center"; colBound.ItemStyle.CssClass = "center"; FolderDataGrid.Columns.Add(colBound); colBound = new System.Web.UI.WebControls.BoundColumn(); colBound.DataField = "DATEMODIFIED"; if (!string.IsNullOrEmpty(Request.QueryString["orderby"]) && Request.QueryString["orderby"].ToString().ToLower() == "datemodified") colBound.HeaderText = strTag + "DateModified" + strtag1 + _MessageHelper.GetMessage("generic Date Modified") + imageDirection + "</a>"; else colBound.HeaderText = strTag + "DateModified" + strtag1 + _MessageHelper.GetMessage("generic Date Modified") + "</a>"; colBound.HeaderStyle.CssClass = "title-header"; colBound.ItemStyle.CssClass = "left"; FolderDataGrid.Columns.Add(colBound); colBound = new System.Web.UI.WebControls.BoundColumn(); colBound.DataField = "EDITORNAME"; if (!string.IsNullOrEmpty(Request.QueryString["orderby"]) && Request.QueryString["orderby"].ToString().ToLower() == "editor") colBound.HeaderText = strTag + "editor" + strtag1 + _MessageHelper.GetMessage("generic Last Editor") + imageDirection + "</a>"; else colBound.HeaderText = strTag + "editor" + strtag1 + _MessageHelper.GetMessage("generic Last Editor") + "</a>"; colBound.HeaderStyle.CssClass = "title-header"; colBound.ItemStyle.CssClass = "left"; FolderDataGrid.Columns.Add(colBound); DataTable dt = new DataTable(); DataRow dr; dt.Columns.Add(new DataColumn("TITLE", typeof(string))); dt.Columns.Add(new DataColumn("CONTENTTYPE", typeof(string))); dt.Columns.Add(new DataColumn("LANGUAGE", typeof(string))); dt.Columns.Add(new DataColumn("ID", typeof(long))); dt.Columns.Add(new DataColumn("STATUS", typeof(string))); dt.Columns.Add(new DataColumn("DATEMODIFIED", typeof(string))); dt.Columns.Add(new DataColumn("EDITORNAME", typeof(string))); string ViewUrl = ""; int i; bool bAssetItem = false; string extension = ""; for (i = 0; i <= contentdata.Count - 1; i++) { bAssetItem = System.Convert.ToBoolean((contentdata.get_Item(i).ContentType == Ektron.Cms.Common.EkEnumeration.CMSContentType.Assets) || ((Convert.ToInt32(contentdata.get_Item(i).ContentType) >= Ektron.Cms.Common.EkConstants.ManagedAsset_Min) && (Convert.ToInt32(contentdata.get_Item(i).ContentType) <= Ektron.Cms.Common.EkConstants.ManagedAsset_Max))); dr = dt.NewRow(); if (contentdata.get_Item(i).ContentType == Ektron.Cms.Common.EkEnumeration.CMSContentType.Forms || contentdata.get_Item(i).ContentType == Ektron.Cms.Common.EkEnumeration.CMSContentType.Archive_Forms) { if (contentdata.get_Item(i).ContentStatus == "A") { ViewUrl = (string)("cmsform.aspx?action=ViewForm&folder_id=" + _Id + "&form_id=" + contentdata.get_Item(i).Id + "&LangType=" + contentdata.get_Item(i).Language + "&callerpage=content.aspx&origurl=" + EkFunctions.UrlEncode(Request.ServerVariables["QUERY_STRING"])); } else { ViewUrl = (string)("cmsform.aspx?action=viewform&staged=true&folder_id=" + _Id + "&form_id=" + contentdata.get_Item(i).Id + "&LangType=" + contentdata.get_Item(i).Language + "&callerpage=content.aspx&origurl=" + EkFunctions.UrlEncode(Request.ServerVariables["QUERY_STRING"])); } } else { if (contentdata.get_Item(i).ContentStatus == "A") { ViewUrl = (string)("content.aspx?action=View&folder_id=" + _Id + "&id=" + contentdata.get_Item(i).Id + "&LangType=" + contentdata.get_Item(i).Language + "&callerpage=content.aspx&origurl=" + EkFunctions.UrlEncode(Request.ServerVariables["QUERY_STRING"])); } else { ViewUrl = (string)("content.aspx?action=ViewStaged&folder_id=" + _Id + "&id=" + contentdata.get_Item(i).Id + "&LangType=" + contentdata.get_Item(i).Language + "&callerpage=content.aspx&origurl=" + EkFunctions.UrlEncode(Request.ServerVariables["QUERY_STRING"])); } } //dmsMenuGuid is created to uniquely identify menu element component in the DOM, //just in case there is more than one menu that contains the same contentId & language //This case is known to apply in non-Workarea implementations of the DmsMenu but is //implemented for ALL DmsMenus, including the Workarea string dmsMenuGuid; dmsMenuGuid = (string)(System.Guid.NewGuid().ToString()); string makeUnique = (string)(contentdata.get_Item(i).Id + contentdata.get_Item(i).Language + dmsMenuGuid); string contentStatus = contentdata.get_Item(i).ContentStatus; //If (contentdata.Item(i).ContentStatus = "A") Then dr[0] = "<div class=\"ektron dmsWrapper\""; dr[0] = dr[0] + " id=\"dmsWrapper" + makeUnique + "\">"; dr[0] = dr[0] + "<p class=\"dmsItemWrapper\""; dr[0] = dr[0] + " id=\"dmsItemWrapper" + makeUnique + "\""; dr[0] = dr[0] + " title=\"View Menu\""; dr[0] = dr[0] + " style=\"overflow:visible;\""; dr[0] = dr[0] + ">"; dr[0] = dr[0] + "<input type=\"hidden\" value=\'{\"id\":" + contentdata.get_Item(i).Id + ","; dr[0] = dr[0] + "\"parentId\":" + contentdata.get_Item(i).FolderId + ","; dr[0] = dr[0] + "\"languageId\":" + contentdata.get_Item(i).Language + ","; dr[0] = dr[0] + "\"status\":\"" + contentStatus + "\","; dr[0] = dr[0] + "\"guid\":\"" + dmsMenuGuid + "\","; dr[0] = dr[0] + "\"communityDocumentsMenu\": \"\","; dr[0] = dr[0] + "\"contentType\":" + Convert.ToInt32(contentdata.get_Item(i).ContentType) + ","; dr[0] = dr[0] + "\"dmsSubtype\":\"\"}\'"; dr[0] = dr[0] + " id=\"dmsContentInfo" + makeUnique + "\" />"; if (contentdata.get_Item(i).ContentType == Ektron.Cms.Common.EkEnumeration.CMSContentType.Content || contentdata.get_Item(i).ContentType == Ektron.Cms.Common.EkEnumeration.CMSContentType.Archive_Content) { if (contentdata.get_Item(i).ContentSubType == Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.PageBuilderData) { dr[0] = dr[0] + "<img src=\"" + _ContentApi.AppImgPath + "layout_content.png" + "\" onclick=\"event.cancelBubble=true;\" />"; } else if (contentdata.get_Item(i).ContentSubType == Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.PageBuilderMasterData) { dr[0] = dr[0] + "<img src=\"" + _ContentApi.AppImgPath + "layout_content.png" + "\" onclick=\"event.cancelBubble=true;\" />"; } else { if (contentdata.get_Item(i).ContentType == Ektron.Cms.Common.EkEnumeration.CMSContentType.Archive_Content) { dr[0] = dr[0] + "<img src=\"" + _ContentApi.ApplicationPath + "Images/ui/icons/contentArchived.png\" onclick=\"event.cancelBubble=true;\" />"; } else { dr[0] = dr[0] + "<img src=\"" + _ContentApi.ApplicationPath + "images/ui/icons/contentHtml.png\" onclick=\"event.cancelBubble=true;\" />"; } } } else { dr[0] = dr[0] + "<span onclick=\"event.cancelBubble=true;\">" + contentdata.get_Item(i).AssetInfo.Icon + "</span>"; } dr[0] = dr[0] + "<a"; dr[0] = dr[0] + " id=\"dmsViewItemAnchor" + makeUnique + "\""; dr[0] = dr[0] + " class=\"dmsViewItemAnchor\""; dr[0] = dr[0] + " onclick=\"event.cancelBubble=true;\""; dr[0] = dr[0] + " href=\"" + ViewUrl + "\""; dr[0] = dr[0] + " title=\"View " + contentdata.get_Item(i).Title + "\""; dr[0] = dr[0] + ">"; dr[0] = dr[0] + contentdata.get_Item(i).Title; dr[0] = dr[0] + "</a>"; dr[0] = dr[0] + "</p>"; dr[0] = dr[0] + "</div>"; if (!(contentdata.get_Item(i).AssetInfo == null) && contentdata.get_Item(i).AssetInfo.Version != "") { extension = System.IO.Path.GetExtension(contentdata.get_Item(i).AssetInfo.Version); } dr[1] = GetContentTypeText(Convert.ToInt64(contentdata.get_Item(i).ContentType), contentdata.get_Item(i).XMLCollectionID, Convert.ToInt64(contentdata.get_Item(i).ContentSubType), extension); string LanguageDescription = Ektron.Cms.API.JS.Escape(contentdata.get_Item(i).LanguageDescription); dr[2] = "<a href=\"#ShowTip" + contentdata.get_Item(i).LanguageDescription + "\" onmouseover=\"ddrivetip(\'" + LanguageDescription + "\',\'ADC5EF\', 100);\" onmouseout=\"hideddrivetip()\" style=\"text-decoration:none;\">" + "<img src=\'" + _LocalizationApi.GetFlagUrlByLanguageID(contentdata.get_Item(i).Language) + "\' />" + "</a>"; dr[3] = contentdata.get_Item(i).Id; dr[4] = _StyleHelper.StatusWithToolTip(contentStatus); dr[5] = contentdata.get_Item(i).DateModified.ToString(); dr[6] = contentdata.get_Item(i).LastEditorLname + ", " + contentdata.get_Item(i).LastEditorFname; dt.Rows.Add(dr); } DataView dv = new DataView(dt); FolderDataGrid.DataSource = dv; FolderDataGrid.DataBind(); }
private void Populate_ViewCalendar(EkContentCol contentdata) { System.Web.UI.WebControls.BoundColumn colBound = new System.Web.UI.WebControls.BoundColumn(); string strTag; string strtag1; string imageDirection = string.Empty; if (Request.QueryString["orderbydirection"] == null) direction = "desc"; else if (Request.QueryString["orderbydirection"] == "desc") { imageDirection = " <img src=\"" + _ContentApi.ApplicationPath + "images/ui/icons/arrowHeadDownGrey.png\" \" />"; direction = "asc"; } else if (Request.QueryString["orderbydirection"] == "asc") { imageDirection = " <img src=\"" + _ContentApi.ApplicationPath + "images/ui/icons/arrowHeadUpGrey.png\" \" />"; direction = "desc"; } strTag = "<a href=\"content.aspx?LangType=" + _ContentLanguage + "&action=" + _PageAction + "&orderbydirection=" + direction + "&orderby="; strtag1 = "&id=" + _Id + (_ContentTypeQuerystringParam != "" ? "&" + _ContentTypeUrlParam + "=" + _ContentTypeQuerystringParam : "") + "\" title=\"" + _MessageHelper.GetMessage("click to sort msg") + "\">"; colBound.DataField = "TITLE"; if (!string.IsNullOrEmpty(Request.QueryString["orderby"]) && Request.QueryString["orderby"].ToString().ToLower() == "title") colBound.HeaderText = strTag + "Title" + strtag1 + _MessageHelper.GetMessage("generic title") + imageDirection + "</a> "; else colBound.HeaderText = strTag + "Title" + strtag1 + _MessageHelper.GetMessage("generic title") + "</a>"; colBound.HeaderStyle.CssClass = "title-header"; colBound.ItemStyle.CssClass = "left"; FolderDataGrid.Columns.Add(colBound); colBound = new System.Web.UI.WebControls.BoundColumn(); colBound.DataField = "FIRSTOCCURENCE"; colBound.HeaderText = _MessageHelper.GetMessage("webcalendar first occurence"); colBound.HeaderStyle.CssClass = "title-header"; colBound.ItemStyle.CssClass = "left"; FolderDataGrid.Columns.Add(colBound); colBound = new System.Web.UI.WebControls.BoundColumn(); colBound.DataField = "TYPE"; colBound.HeaderText = _MessageHelper.GetMessage("lbl event type"); colBound.HeaderStyle.CssClass = "title-header"; colBound.ItemStyle.CssClass = "left"; FolderDataGrid.Columns.Add(colBound); colBound = new System.Web.UI.WebControls.BoundColumn(); colBound.DataField = "LANGUAGE"; if (!string.IsNullOrEmpty(Request.QueryString["orderby"]) && Request.QueryString["orderby"].ToString().ToLower() == "language") colBound.HeaderText = strTag + "language" + strtag1 + _MessageHelper.GetMessage("generic language") + imageDirection + "</a>"; else colBound.HeaderText = strTag + "language" + strtag1 + _MessageHelper.GetMessage("generic language") + "</a>"; colBound.HeaderStyle.CssClass = "title-header center"; colBound.ItemStyle.CssClass = "center"; FolderDataGrid.Columns.Add(colBound); colBound = new System.Web.UI.WebControls.BoundColumn(); colBound.DataField = "ID"; if (!string.IsNullOrEmpty(Request.QueryString["orderby"]) && Request.QueryString["orderby"].ToString().ToLower() == "id") colBound.HeaderText = strTag + "ID" + strtag1 + _MessageHelper.GetMessage("generic ID") + imageDirection + "</a>"; else colBound.HeaderText = strTag + "ID" + strtag1 + _MessageHelper.GetMessage("generic ID") + "</a>"; colBound.HeaderStyle.CssClass = "title-header center"; colBound.ItemStyle.CssClass = "center"; FolderDataGrid.Columns.Add(colBound); colBound = new System.Web.UI.WebControls.BoundColumn(); colBound.DataField = "STATUS"; if (!string.IsNullOrEmpty(Request.QueryString["orderby"]) && Request.QueryString["orderby"].ToString().ToLower() == "status") colBound.HeaderText = strTag + "status" + strtag1 + _MessageHelper.GetMessage("generic Status") + imageDirection + "</a>"; else colBound.HeaderText = strTag + "status" + strtag1 + _MessageHelper.GetMessage("generic Status") + "</a>"; colBound.HeaderStyle.CssClass = "title-header center"; colBound.ItemStyle.CssClass = "center"; FolderDataGrid.Columns.Add(colBound); colBound = new System.Web.UI.WebControls.BoundColumn(); colBound.DataField = "DATEMODIFIED"; if (!string.IsNullOrEmpty(Request.QueryString["orderby"]) && Request.QueryString["orderby"].ToString().ToLower() == "datemodified") colBound.HeaderText = strTag + "DateModified" + strtag1 + _MessageHelper.GetMessage("generic Date Modified") + imageDirection + "</a>"; else colBound.HeaderText = strTag + "DateModified" + strtag1 + _MessageHelper.GetMessage("generic Date Modified") + "</a>"; colBound.HeaderStyle.CssClass = "title-header"; colBound.ItemStyle.CssClass = "left"; FolderDataGrid.Columns.Add(colBound); colBound = new System.Web.UI.WebControls.BoundColumn(); colBound.DataField = "EDITORNAME"; if (!string.IsNullOrEmpty(Request.QueryString["orderby"]) && Request.QueryString["orderby"].ToString().ToLower() == "editor") colBound.HeaderText = strTag + "editor" + strtag1 + _MessageHelper.GetMessage("generic Last Editor") + imageDirection + "</a>"; else colBound.HeaderText = strTag + "editor" + strtag1 + _MessageHelper.GetMessage("generic Last Editor") + "</a>"; colBound.HeaderStyle.CssClass = "title-header"; colBound.ItemStyle.CssClass = "left"; FolderDataGrid.Columns.Add(colBound); DataTable dt = new DataTable(); DataRow dr; dt.Columns.Add(new DataColumn("TITLE", typeof(string))); dt.Columns.Add(new DataColumn("FIRSTOCCURENCE", typeof(string))); dt.Columns.Add(new DataColumn("TYPE", typeof(string))); dt.Columns.Add(new DataColumn("LANGUAGE", typeof(string))); dt.Columns.Add(new DataColumn("ID", typeof(long))); dt.Columns.Add(new DataColumn("STATUS", typeof(string))); dt.Columns.Add(new DataColumn("DATEMODIFIED", typeof(string))); dt.Columns.Add(new DataColumn("EDITORNAME", typeof(string))); string ViewUrl = ""; int i; for (i = 0; i <= contentdata.Count - 1; i++) { dr = dt.NewRow(); //dmsMenuGuid is created to uniquely identify menu element component in the DOM, //just in case there is more than one menu that contains the same contentId & language //This case is known to apply in non-Workarea implementations of the DmsMenu but is //implemented for ALL DmsMenus, including the Workarea string dmsMenuGuid; dmsMenuGuid = (string)(System.Guid.NewGuid().ToString()); string makeUnique = (string)(contentdata.get_Item(i).Id + contentdata.get_Item(i).Language + dmsMenuGuid); string contentStatus = contentdata.get_Item(i).ContentStatus; //If (contentdata.get_Item(i).ContentStatus = "A") Then dr[0] = "<div class=\"ektron dmsWrapper\""; dr[0] = dr[0] + " id=\"dmsWrapper" + makeUnique + "\">"; dr[0] = dr[0] + "<p class=\"dmsItemWrapper\""; dr[0] = dr[0] + " id=\"dmsItemWrapper" + makeUnique + "\""; dr[0] = dr[0] + " title=\"View Menu\""; dr[0] = dr[0] + " style=\"overflow:visible;\""; dr[0] = dr[0] + ">"; dr[0] = dr[0] + "<input type=\"hidden\" value=\'{\"id\":" + contentdata.get_Item(i).Id + ","; dr[0] = dr[0] + "\"parentId\":" + contentdata.get_Item(i).FolderId + ","; dr[0] = dr[0] + "\"languageId\":" + contentdata.get_Item(i).Language + ","; dr[0] = dr[0] + "\"status\":\"" + contentStatus + "\","; dr[0] = dr[0] + "\"guid\":\"" + dmsMenuGuid + "\","; dr[0] = dr[0] + "\"communityDocumentsMenu\":\"\","; dr[0] = dr[0] + "\"contentType\":" + Convert.ToInt32(contentdata.get_Item(i).ContentType) + ","; dr[0] = dr[0] + "\"dmsSubtype\":\"\"}\'"; dr[0] = dr[0] + " id=\"dmsContentInfo" + makeUnique + "\" />"; dr[0] = dr[0] + "<img src=\"" + _ContentApi.ApplicationPath + "images/ui/icons/calendarViewDay.png\" onclick=\"event.cancelBubble=true;\" />"; dr[0] = dr[0] + "<a"; dr[0] = dr[0] + " id=\"dmsViewItemAnchor" + makeUnique + "\""; dr[0] = dr[0] + " class=\"dmsViewItemAnchor\""; dr[0] = dr[0] + " onclick=\"event.cancelBubble=true;\""; if (contentdata.get_Item(i).ContentStatus == "A") { ViewUrl = (string)("content.aspx?action=View&folder_id=" + _Id + "&id=" + contentdata.get_Item(i).Id + "&LangType=" + contentdata.get_Item(i).Language + "&callerpage=content.aspx&origurl=" + EkFunctions.UrlEncode(Request.ServerVariables["QUERY_STRING"])); } else { ViewUrl = (string)("content.aspx?action=ViewStaged&folder_id=" + _Id + "&id=" + contentdata.get_Item(i).Id + "&LangType=" + contentdata.get_Item(i).Language + "&callerpage=content.aspx&origurl=" + EkFunctions.UrlEncode(Request.ServerVariables["QUERY_STRING"])); } dr[0] = dr[0] + " href=\"" + ViewUrl + "\""; dr[0] = dr[0] + " title=\"View " + contentdata.get_Item(i).Title + "\""; dr[0] = dr[0] + ">"; dr[0] = dr[0] + contentdata.get_Item(i).Title; dr[0] = dr[0] + "</a>"; dr[0] = dr[0] + "</p>"; dr[0] = dr[0] + "</div>"; System.Xml.XmlDataDocument xd = new System.Xml.XmlDataDocument(); try { xd.LoadXml(contentdata.get_Item(i).Html); System.Xml.XmlNode UTCstartDTXn = xd.SelectSingleNode("/root/StartTime"); if (UTCstartDTXn != null) { System.Xml.XmlNode alldayXn = xd.SelectSingleNode("/root/IsAllDay"); bool alldayBool = false; DateTime UTCstartDT = new DateTime(); System.Globalization.CultureInfo ENci = new System.Globalization.CultureInfo(1033); System.Globalization.CultureInfo userCi = EkFunctions.GetCultureInfo(_ContentApi.RequestInformationRef.UserCulture.ToString()); Ektron.Cms.Common.Calendar.TimeZoneInfo userTzi; UTCstartDT = DateTime.ParseExact(UTCstartDTXn.InnerText, "s", ENci.DateTimeFormat); userTzi = Ektron.Cms.Common.Calendar.TimeZoneInfo.GetTimeZoneInfo(_ContentApi.RequestInformationRef.UserTimeZone); DateTime LocalstartDT = userTzi.ConvertUtcToTimeZone(UTCstartDT); bool.TryParse(alldayXn.InnerText, out alldayBool); if (!(LocalstartDT.Hour == 0 && LocalstartDT.Minute == 0) && !alldayBool) { if (userCi.DateTimeFormat.PMDesignator == string.Empty) //no ampm designator { dr[1] = LocalstartDT.ToString("ddd, MMM d yyyy hh:mm", userCi.DateTimeFormat) + " (" + userTzi.StandardName + ")"; //first occurence } else { dr[1] = LocalstartDT.ToString("ddd, MMM d yyyy h:mm tt", userCi.DateTimeFormat) + " (" + userTzi.StandardName + ")"; //first occurence } } else if (alldayBool) { dr[1] = UTCstartDT.ToString("ddd, MMM d yyyy", userCi.DateTimeFormat); //first occurence } else { dr[1] = LocalstartDT.ToString("ddd, MMM d yyyy", userCi.DateTimeFormat) + " (" + userTzi.StandardName + ")"; //first occurence } } System.Xml.XmlNode isvarianceXn = xd.SelectSingleNode("/root/IsVariance"); System.Xml.XmlNode isCancelledXn = xd.SelectSingleNode("/root/IsCancelled"); if (isvarianceXn != null) { bool isvariance = bool.Parse(isvarianceXn.InnerText); bool isCancelled = bool.Parse(isCancelledXn.InnerText); if (isvariance && isCancelled) { dr[2] = "Variance - Cancelled occurence"; } else if (isvariance && !isCancelled) { dr[2] = "Variance - Extra occurence"; } else { dr[2] = "Original"; } } } catch { dr[1] = "Start Time could not be extracted."; } string LanguageDescription = Ektron.Cms.API.JS.Escape(contentdata.get_Item(i).LanguageDescription); dr[3] = "<a href=\"#ShowTip" + contentdata.get_Item(i).LanguageDescription + "\" onmouseover=\"ddrivetip(\'" + LanguageDescription + "\',\'ADC5EF\', 100);\" onmouseout=\"hideddrivetip()\" style=\"text-decoration:none;\">" + "<img src=\'" + _LocalizationApi.GetFlagUrlByLanguageID(contentdata.get_Item(i).Language) + "\' />" + "</a>"; dr[4] = contentdata.get_Item(i).Id; dr[5] = _StyleHelper.StatusWithToolTip(contentStatus); dr[6] = contentdata.get_Item(i).DateModified.ToString(); dr[7] = contentdata.get_Item(i).LastEditorLname + ", " + contentdata.get_Item(i).LastEditorFname; dt.Rows.Add(dr); } DataView dv = new DataView(dt); FolderDataGrid.DataSource = dv; FolderDataGrid.DataBind(); // _PagingTotalPagesNumber = 1 }
private void Populate_ViewBlogPostsByCategoryGrid(EkContentCol contentdata, Hashtable commenttally) { System.Web.UI.WebControls.BoundColumn colBound = new System.Web.UI.WebControls.BoundColumn(); string strTag; string strtag1; strTag = "<a href=\"content.aspx?LangType=" + _ContentApi.ContentLanguage + "&action=" + _PageAction + "&orderby="; strtag1 = "&id=" + _Id + (_ContentTypeQuerystringParam != "" ? "&" + _ContentTypeUrlParam + "=" + _ContentTypeQuerystringParam : "") + "\" title=\"" + _MessageHelper.GetMessage("click to sort msg") + "\">"; colBound.DataField = "TITLE"; colBound.HeaderText = _MessageHelper.GetMessage("generic Title"); colBound.HeaderStyle.CssClass = "title-header"; colBound.ItemStyle.CssClass = "left"; FolderDataGrid.Columns.Add(colBound); colBound = new System.Web.UI.WebControls.BoundColumn(); colBound.DataField = "LANGUAGE"; colBound.HeaderText = _MessageHelper.GetMessage("generic language"); colBound.HeaderStyle.CssClass = "title-header center"; colBound.ItemStyle.CssClass = "center"; FolderDataGrid.Columns.Add(colBound); colBound = new System.Web.UI.WebControls.BoundColumn(); colBound.DataField = "ID"; colBound.HeaderText = _MessageHelper.GetMessage("generic ID"); colBound.HeaderStyle.CssClass = "title-header center"; colBound.ItemStyle.CssClass = "center"; FolderDataGrid.Columns.Add(colBound); colBound = new System.Web.UI.WebControls.BoundColumn(); colBound.DataField = "STATUS"; colBound.HeaderText = _MessageHelper.GetMessage("generic Status"); colBound.HeaderStyle.CssClass = "title-header center"; colBound.ItemStyle.CssClass = "center"; FolderDataGrid.Columns.Add(colBound); colBound = new System.Web.UI.WebControls.BoundColumn(); colBound.DataField = "DATEMODIFIED"; colBound.HeaderText = _MessageHelper.GetMessage("generic Date Modified"); colBound.HeaderStyle.CssClass = "title-header"; colBound.ItemStyle.CssClass = "left"; FolderDataGrid.Columns.Add(colBound); colBound = new System.Web.UI.WebControls.BoundColumn(); colBound.DataField = "EDITORNAME"; colBound.HeaderText = _MessageHelper.GetMessage("generic Last Editor"); colBound.HeaderStyle.CssClass = "title-header"; colBound.ItemStyle.CssClass = "left"; FolderDataGrid.Columns.Add(colBound); colBound = new System.Web.UI.WebControls.BoundColumn(); colBound.DataField = "COMMENTS"; colBound.HeaderText = _MessageHelper.GetMessage("comments label"); colBound.HeaderStyle.CssClass = "title-header center"; colBound.ItemStyle.CssClass = "center"; FolderDataGrid.Columns.Add(colBound); DataTable dt = new DataTable(); DataRow dr; dt.Columns.Add(new DataColumn("TITLE", typeof(string))); dt.Columns.Add(new DataColumn("LANGUAGE", typeof(string))); dt.Columns.Add(new DataColumn("ID", typeof(long))); dt.Columns.Add(new DataColumn("STATUS", typeof(string))); dt.Columns.Add(new DataColumn("DATEMODIFIED", typeof(string))); dt.Columns.Add(new DataColumn("EDITORNAME", typeof(string))); dt.Columns.Add(new DataColumn("COMMENTS", typeof(string))); int i; string[] aValues; for (i = 0; i <= contentdata.Count - 1; i++) { commenttally = (Hashtable)commenttally.Clone(); dr = dt.NewRow(); dr[0] += "<img src=\"" + _ContentApi.ApplicationPath + "images/ui/icons/blog.png\" style=\"margin-right:.25em;\" />"; dr[0] += "<a href=\"content.aspx?action=View&folder_id=" + _Id + "&id=" + contentdata.get_Item(i).Id + "&mode=1&LangType=" + contentdata.get_Item(i).Language + "&callerpage=content.aspx&origurl=" + EkFunctions.UrlEncode(Request.ServerVariables["QUERY_STRING"]) + "\"" + " title=\'" + _MessageHelper.GetMessage("generic View") + " \"" + Strings.Replace((string)(contentdata.get_Item(i).Title + "\""), "\'", "`", 1, -1, 0) + "\'" + ">"; dr[0] += contentdata.get_Item(i).Title; dr[0] += "</a>"; string LanguageDescription = Ektron.Cms.API.JS.Escape(contentdata.get_Item(i).LanguageDescription); dr[1] = "<a href=\"#ShowTip\" onmouseover=\"ddrivetip(\'" + LanguageDescription + "\',\'ADC5EF\', 100);\" onmouseout=\"hideddrivetip()\" style=\"text-decoration:none;\">" + "<img src=\'" + _LocalizationApi.GetFlagUrlByLanguageID(contentdata.get_Item(i).Language) + "\' border=\"0\" />" + "</a>"; dr[2] = contentdata.get_Item(i).Id; dr[3] = _StyleHelper.StatusWithToolTip(contentdata.get_Item(i).ContentStatus); dr[4] = contentdata.get_Item(i).DateModified.ToString(); dr[5] = contentdata.get_Item(i).LastEditorLname + ", " + contentdata.get_Item(i).LastEditorFname; if (commenttally.ContainsKey((contentdata.get_Item(i).Id.ToString()) + "-" + contentdata.get_Item(i).Language.ToString())) { aValues = (string[])commenttally[(contentdata.get_Item(i).Id.ToString()) + "-" + contentdata.get_Item(i).Language.ToString()]; string actionRequired = ""; // let's do some math to see if any of the comments are pending admin interaction. // if the comment_sum/aValues(1) value is less than the number of comments times "7" // (the value of blog comment status complete), then at least one must be pending action. if (Convert.ToInt32(aValues[1]) < (Convert.ToInt32(aValues[0]) * 7)) { actionRequired = "class=\"blogCommentStatusPending\" title=\"" + _MessageHelper.GetMessage("moderator action required") + "\" "; } dr[6] += "<a " + actionRequired + "href=\"content.aspx?id=" + _Id + "&action=ViewContentByCategory&LangType=" + _ContentLanguage.ToString() + "&ContType=" + Ektron.Cms.Common.EkConstants.CMSContentType_BlogComments + "&contentid=" + contentdata.get_Item(i).Id.ToString() + "&viewin=" + contentdata.get_Item(i).Language.ToString() + "\">" + aValues[0].ToString() + "</a>"; } else { dr[6] += "<a href=\"content.aspx?id=" + _Id + "&action=ViewContentByCategory&LangType=" + _ContentLanguage.ToString() + "&ContType=" + Ektron.Cms.Common.EkConstants.CMSContentType_BlogComments + "&contentid=" + contentdata.get_Item(i).Id.ToString() + "&viewin=" + contentdata.get_Item(i).Language.ToString() + "\">" + 0 + "</a>"; } dt.Rows.Add(dr); } DataView dv = new DataView(dt); FolderDataGrid.DataSource = dv; FolderDataGrid.DataBind(); }
private void FillContentFolderInfo() { try { bool bCheckout = false; NextPage.Attributes.Add("onclick", "return resetPostback()"); lnkBtnPreviousPage.Attributes.Add("onclick", "return resetPostback()"); FirstPage.Attributes.Add("onclick", "return resetPostback()"); LastPage.Attributes.Add("onclick", "return resetPostback()"); m_refMsg = m_refContentApi.EkMsgRef; //Put user code to initialize the page here AppImgPath = m_refContentApi.AppImgPath; AppName = m_refContentApi.AppName; ContentIcon = "<img src=\"" + AppPath + "images/UI/Icons/contentHtml.png\" alt=\"Content\" />"; //-HC- WebEventIcon = "<img src=\"" + AppPath + "images/UI/Icons/calendarViewDay.png\" alt=\"WebEvent\" />"; formsIcon = "<img src=\"" + AppPath + "images/UI/Icons/contentForm.png\" alt=\"Form\" />"; //-HC- pageIcon = "<img src=\"" + AppPath + "images/UI/Icons/layout.png\" alt=\"Page\" />"; //-HC- //intQString = Request.QueryString AddType = Strings.LCase(Request.QueryString["addto"]); nId = Convert.ToInt64(Request.QueryString["nid"]); subfolderid = Convert.ToInt64(Request.QueryString["subfolderid"]); FolderId = Convert.ToInt64(Request.QueryString["folderid"]); bool showQDContentOnly = System.Convert.ToBoolean(Request.QueryString["qdo"] == "1"); m_refContent = m_refContentApi.EkContentRef; if (!(Request.QueryString["subfolderid"] == null)) { locID = subfolderid; } else { locID = FolderId; } gtNavs = m_refContent.GetFolderInfoWithPath(locID); if (!Ektron.Cms.Common.EkFunctions.DoesKeyExist(gtNavs, "FolderName")) { // invalid folder, so start at root instead of taking an error locID = 0; gtNavs = m_refContent.GetFolderInfoWithPath(0); } //Set content type if (Request.QueryString[Ektron.Cms.Common.EkConstants.ContentTypeUrlParam] != "") { if (Information.IsNumeric(Request.QueryString[Ektron.Cms.Common.EkConstants.ContentTypeUrlParam])) { g_ContentTypeSelected = System.Convert.ToInt32(Request.QueryString[Ektron.Cms.Common.EkConstants.ContentTypeUrlParam]); m_refContentApi.SetCookieValue(Ektron.Cms.Common.EkConstants.ContentTypeUrlParam, g_ContentTypeSelected.ToString()); } } else if (Request.Cookies["ecm"][Ektron.Cms.Common.EkConstants.ContentTypeUrlParam] != "") { if (Information.IsNumeric(Request.Cookies["ecm"][Ektron.Cms.Common.EkConstants.ContentTypeUrlParam])) { g_ContentTypeSelected = System.Convert.ToInt32(Request.Cookies["ecm"][Ektron.Cms.Common.EkConstants.ContentTypeUrlParam]); } } ///end set content type if (AddType == "menu") { if (m_refContentApi.TreeModel == 1) { cRecursive = m_refContent.GetMenuByID(nId, 0, false); } else { cRecursive = m_refContent.GetMenuByID(nId, 0, false); } if (cRecursive.Count > 0) { MenuTitle = cRecursive["MenuTitle"].ToString(); rec = Convert.ToBoolean(cRecursive["Recursive"]); } } else { if (Request.QueryString["checkout"] != null) { bCheckout = System.Convert.ToBoolean(Request.QueryString["checkout"].ToString()); } if (bCheckout) { cRecursive = m_refContent.GetEcmStageCollectionByID(nId, false, false, ref ErrorString, true, false, true); } else { cRecursive = m_refContent.GetEcmCollectionByID(nId, false, false, ref ErrorString, true, false, true); } if (cRecursive.Count > 0) { CollectionTitle = cRecursive["CollectionTitle"].ToString(); rec = Convert.ToBoolean(cRecursive["Recursive"]); } } perm_data = m_refContentApi.LoadPermissions(locID, "folder", 0); if (!perm_data.CanTraverseFolders) { rec = false; } if (rec) { cTmp = new Collection(); cTmp.Add(locID, "ParentID", null, null); cTmp.Add("name", "OrderBy", null, null); cFolders = m_refContent.GetAllViewableChildFoldersv2_0(cTmp); } FolderName = gtNavs["FolderName"].ToString(); backId = Convert.ToInt64(gtNavs["ParentID"]); fPath = gtNavs["Path"].ToString(); EkEnumeration.FolderType folderType = (EkEnumeration.FolderType)Enum.Parse(typeof(EkEnumeration.FolderType), gtNavs["FolderType"].ToString()); cTmp = new Collection(); cTmp.Add("name", "OrderBy", null, null); cTmp.Add(FolderId, "FolderID", null, null); cTmp.Add(FolderId, "ParentID", null, null); EkEnumeration.CMSContentType ContentTypeSelected = (EkEnumeration.CMSContentType)Enum.Parse(typeof(EkEnumeration.CMSContentType), g_ContentTypeSelected.ToString()); if (AddType == "menu") { cConts = m_refContent.GetAllContentNotInEcmMenu(nId, locID, "title", _currentPageNumber, m_refContentApi.RequestInformationRef.PagingSize, ref TotalPagesNumber, ContentTypeSelected); } else { if (bCheckout || ((Request.QueryString["status"] != null) && Request.QueryString["status"].ToUpper() == "O")) { cConts = m_refContent.GetAllContentNotInEcmCollection(nId, locID, "title", _currentPageNumber, m_refContentApi.RequestInformationRef.PagingSize, ref TotalPagesNumber, ContentTypeSelected, Ektron.Cms.Content.EkContent.ContentResultType.Staged); } else { // Defect#: 49013 // cConts = m_refContent.GetAllContentNotInEcmCollection(nId, CLng(locID), "title", _currentPageNumber, m_refContentApi.RequestInformationRef.PagingSize, TotalPagesNumber, g_ContentTypeSelected) EkEnumeration.CMSContentType myContentType = (EkEnumeration.CMSContentType)Enum.Parse(typeof(EkEnumeration.CMSContentType), g_ContentTypeSelected.ToString()); cConts = GetAllContent(nId, locID, "title", _currentPageNumber, m_refContentApi.RequestInformationRef.PagingSize, ref TotalPagesNumber, myContentType); } } if (showQDContentOnly && (gtNavs["ReplicationMethod"].ToString() != "1") && m_refContentApi.RequestInformationRef.EnableReplication) { // only display QD content, clean out the content list cConts.Clear(); } gtNavs = null; if (TotalPagesNumber <= 1) { TotalPages.Visible = false; CurrentPage.Visible = false; lnkBtnPreviousPage.Visible = false; NextPage.Visible = false; LastPage.Visible = false; FirstPage.Visible = false; PageLabel.Visible = false; OfLabel.Visible = false; } else { TotalPages.Visible = true; CurrentPage.Visible = true; lnkBtnPreviousPage.Visible = true; NextPage.Visible = true; LastPage.Visible = true; FirstPage.Visible = true; PageLabel.Visible = true; OfLabel.Visible = true; TotalPages.Text = (System.Math.Ceiling(Convert.ToDouble(TotalPagesNumber))).ToString(); TotalPages.ToolTip = TotalPages.Text; CurrentPage.Text = _currentPageNumber.ToString(); CurrentPage.ToolTip = CurrentPage.Text; if (_currentPageNumber == 1) { lnkBtnPreviousPage.Enabled = false; if (TotalPagesNumber > 1) { NextPage.Enabled = true; } else { NextPage.Enabled = false; } } else { lnkBtnPreviousPage.Enabled = true; if (_currentPageNumber == TotalPagesNumber) { NextPage.Enabled = false; } else { NextPage.Enabled = true; } } } Ektron.Cms.TemplateData[] templatelist = m_refContentApi.GetEnabledTemplatesByFolder(locID); bool hasNormalTemplate = false; foreach (TemplateData template in templatelist) { if (template.Type == EkEnumeration.TemplateType.Default && template.SubType == EkEnumeration.TemplateSubType.Default) { hasNormalTemplate = true; break; } } CanCreateContent = System.Convert.ToBoolean((perm_data.CanAdd && hasNormalTemplate) && !(folderType == EkEnumeration.FolderType.Catalog || folderType == EkEnumeration.FolderType.Calendar)); asset_data = m_refContent.GetAssetSuperTypes(); if (Ektron.Cms.Common.EkConstants.CMSContentType_Content == g_ContentTypeSelected || Ektron.Cms.Common.EkConstants.CMSContentType_Archive_Content == g_ContentTypeSelected) { lContentType = g_ContentTypeSelected; } else if (Ektron.Cms.Common.EkConstants.ManagedAsset_Min <= g_ContentTypeSelected & g_ContentTypeSelected <= Ektron.Cms.Common.EkConstants.ManagedAsset_Max) { if (DoesAssetSupertypeExist(asset_data, g_ContentTypeSelected)) { lContentType = g_ContentTypeSelected; } } DisplayToolBarAndContent(); } catch (Exception ex) { Utilities.ShowError(ex.Message); } }
protected EkContentCol GetAllContent(long nID, long RequestedFolderID, string OrderBy, int currentPage, int pageSize, ref int totalPages, EkEnumeration.CMSContentType ContentType) { EkContentCol returnValue; Collection cCollection = new Collection(); Collection cTmp = new Collection(); Collection cTmps = new Collection(); EkContentCol cAllViewable = new EkContentCol(); // Dim lLoop As Integer bool bIsAllowed = false; Ektron.Cms.CommonApi api = new Ektron.Cms.CommonApi(); object GetContents = ""; try { returnValue = null; bIsAllowed = System.Convert.ToBoolean(m_refContent.IsAllowed(RequestedFolderID, 0, "Folder", "Collections", 0) || m_refContent.IsARoleMember(Convert.ToInt64(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.AminCollectionMenu), api.RequestInformationRef.CallerId, false) || m_refContent.IsARoleMember(Convert.ToInt64(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.AdminCollection), api.RequestInformationRef.CallerId, false)); if (!bIsAllowed) { throw (new Exception(m_refContentApi.EkMsgRef.GetMessage("com: user does not have permission"))); } string strReturn = ""; cCollection = m_refContent.pGetEcmCollectionByID(nID, false, false, ref strReturn, EkContent.ContentResultType.Published, GetContents, true, true); if (cCollection.Count == 0) { throw (new Exception(m_refContentApi.EkMsgRef.GetMessage("com: collection not found"))); } cTmp.Add(RequestedFolderID, "FolderID", null, null); cTmp.Add(OrderBy, "OrderBy", null, null); cTmp.Add(1, "FilterContentAssetType", null, null); if (ContentType != Ektron.Cms.Common.EkEnumeration.CMSContentType.AllTypes) { cTmp.Add(ContentType, "ContentType", null, null); } //m_refContent.RequestInformation.ContentLanguage = AppUI.ContentLanguage; EkEnumeration.CMSContentSubtype subType = (EkEnumeration.CMSContentSubtype)Enum.Parse(typeof(EkEnumeration.CMSContentSubtype), "-1"); cAllViewable = m_refContent.GetAllViewableChildInfov5_0(cTmp, currentPage, pageSize, ref totalPages, ContentType, subType); CollectionContentItems = (Collection)cCollection["Contents"]; returnValue = cAllViewable; } catch (Exception) { return null; } finally { cCollection = null; cTmp = null; cTmps = null; cAllViewable = null; } return returnValue; }
private void Populate_MoveContentByCategoryGrid(EkContentCol contentdata) { MoveContentByGategoryGrid.Controls.Clear(); contentids.Value = ""; contentlanguages.Value = ""; System.Web.UI.WebControls.BoundColumn colBound; colBound = new System.Web.UI.WebControls.BoundColumn(); colBound.DataField = "BOX"; colBound.HeaderText = "<input type=\"checkbox\" name=\"all\" onclick=\"checkAll(document.forms[0].all.checked);\">"; colBound.ItemStyle.Width = Unit.Parse("1"); colBound.ItemStyle.VerticalAlign = VerticalAlign.Top; colBound.ItemStyle.HorizontalAlign = HorizontalAlign.Center; colBound.HeaderStyle.CssClass = "title-header"; MoveContentByGategoryGrid.Columns.Add(colBound); colBound = new System.Web.UI.WebControls.BoundColumn(); colBound.DataField = "TITLE"; colBound.HeaderText = "<a class=\"title-header\" href=\"content.aspx?action=MoveContentByCategory&orderby=Title&id=" + m_intId + "&LangType=" + ContentLanguage + "\" title=\"" + m_refMsg.GetMessage("click to sort msg") + "\">" + m_refMsg.GetMessage("generic Title") + "</a>"; colBound.ItemStyle.VerticalAlign = VerticalAlign.Top; colBound.HeaderStyle.CssClass = "title-header"; colBound.ItemStyle.Wrap = false; MoveContentByGategoryGrid.Columns.Add(colBound); colBound = new System.Web.UI.WebControls.BoundColumn(); colBound.DataField = "ID"; colBound.HeaderText = "<a class=\"title-header\" href=\"content.aspx?action=MoveContentByCategory&orderby=ID&id=" + m_intId + "&LangType=" + ContentLanguage + "\" title=\"" + m_refMsg.GetMessage("click to sort msg") + "\">" + m_refMsg.GetMessage("generic ID") + "</a>"; colBound.HeaderStyle.CssClass = "title-header"; colBound.ItemStyle.Wrap = false; colBound.ItemStyle.VerticalAlign = VerticalAlign.Top; colBound.ItemStyle.HorizontalAlign = HorizontalAlign.Center; MoveContentByGategoryGrid.Columns.Add(colBound); colBound = new System.Web.UI.WebControls.BoundColumn(); colBound.DataField = "STATUS"; colBound.HeaderText = "<a class=\"title-header\" href=\"content.aspx?action=MoveContentByCategory&orderby=status&id=" + m_intId + "&LangType=" + ContentLanguage + "\" title=\"" + m_refMsg.GetMessage("click to sort msg") + "\">" + m_refMsg.GetMessage("generic Status") + "</a>"; colBound.ItemStyle.VerticalAlign = VerticalAlign.Top; colBound.HeaderStyle.CssClass = "title-header"; colBound.ItemStyle.HorizontalAlign = HorizontalAlign.Center; colBound.ItemStyle.Wrap = false; MoveContentByGategoryGrid.Columns.Add(colBound); colBound = new System.Web.UI.WebControls.BoundColumn(); colBound.DataField = "DATEMODIFIED"; colBound.HeaderText = "<a class=\"title-header\" href=\"content.aspx?action=MoveContentByCategory&orderby=DateModified&id=" + m_intId + "&LangType=" + ContentLanguage + "\" title=\"" + m_refMsg.GetMessage("click to sort msg") + "\">" + m_refMsg.GetMessage("generic Date Modified") + "</a>"; colBound.ItemStyle.VerticalAlign = VerticalAlign.Top; colBound.HeaderStyle.CssClass = "title-header"; colBound.ItemStyle.Wrap = false; MoveContentByGategoryGrid.Columns.Add(colBound); colBound = new System.Web.UI.WebControls.BoundColumn(); colBound.DataField = "EDITORNAME"; colBound.HeaderText = "<a class=\"title-header\" href=\"content.aspx?action=MoveContentByCategory&orderby=editor&id=" + m_intId + "&LangType=" + ContentLanguage + "\" title=\"" + m_refMsg.GetMessage("click to sort msg") + "\">" + m_refMsg.GetMessage("generic Last Editor") + "</a>"; colBound.ItemStyle.VerticalAlign = VerticalAlign.Top; colBound.HeaderStyle.CssClass = "title-header"; colBound.ItemStyle.Wrap = false; MoveContentByGategoryGrid.Columns.Add(colBound); DataTable dt = new DataTable(); DataRow dr; dt.Columns.Add(new DataColumn("BOX", typeof(string))); dt.Columns.Add(new DataColumn("TITLE", typeof(string))); dt.Columns.Add(new DataColumn("ID", typeof(long))); dt.Columns.Add(new DataColumn("STATUS", typeof(string))); dt.Columns.Add(new DataColumn("DATEMODIFIED", typeof(string))); dt.Columns.Add(new DataColumn("EDITORNAME", typeof(string))); int i; for (i = 0; i <= contentdata.Count - 1; i++) { //If (contentdata.Item(i).ContentSubType <> CMSContentSubtype.PageBuilderData) Then dr = dt.NewRow(); dr[0] = ""; if (contentdata.get_Item(i).ContentStatus == "A" || (m_bShowCheckin && contentdata.get_Item(i).ContentStatus == "I")) { if (contentdata.get_Item(i).ContentSubType == Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.PageBuilderData) { pbcAction = "1"; } if (contentids.Value == "") { contentids.Value = contentdata.get_Item(i).Id.ToString(); } else { contentids.Value += "," + contentdata.get_Item(i).Id; } if (contentlanguages.Value == "") { contentlanguages.Value = contentdata.get_Item(i).Language.ToString(); } else { contentlanguages.Value += "," + contentdata.get_Item(i).Language; } dr[0] = "<input type=\"checkbox\" onclick=\"checkAllFalse();\" name=\"id_" + contentdata.get_Item(i).Id + "\">"; } if (contentdata.get_Item(i).ContentType == Ektron.Cms.Common.EkEnumeration.CMSContentType.CatalogEntry) { dr[1] = "<img src=\"" + m_refContentApi.AppPath + "images/ui/icons/brick.png\" class=\"ektronRightSpaceVerySmall ektronLeft\" />" + "<a href=\"content.aspx?LangType=" + contentdata.get_Item(i).Language + "&action=View&id=" + contentdata.get_Item(i).Id + "\" title=\'" + m_refMsg.GetMessage("generic View") + " \"" + Strings.Replace(contentdata.get_Item(i).Title, "\'", "`", 1, -1, 0) + "\"" + "\'>" + contentdata.get_Item(i).Title + "</a>"; } else if (contentdata.get_Item(i).ContentType == Ektron.Cms.Common.EkEnumeration.CMSContentType.Forms) { dr[1] = "<img src=\"images/ui/icons/contentForm.png\"/> " + "<a href=\"content.aspx?LangType=" + contentdata.get_Item(i).Language + "&action=View&id=" + contentdata.get_Item(i).Id + "\" title=\'" + m_refMsg.GetMessage("generic View") + " \"" + Strings.Replace(contentdata.get_Item(i).Title, "\'", "`", 1, -1, 0) + "\"" + "\'>" + contentdata.get_Item(i).Title + "</a>"; } else if (contentdata.get_Item(i).ContentType == Ektron.Cms.Common.EkEnumeration.CMSContentType.Content) { if (contentdata.get_Item(i).ContentSubType == Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.PageBuilderData) { dr[1] = "<img src=\"images/application/layout_content.png\"/> " + "<a href=\"content.aspx?LangType=" + contentdata.get_Item(i).Language + "&action=View&id=" + contentdata.get_Item(i).Id + "\" title=\'" + m_refMsg.GetMessage("generic View") + " \"" + Strings.Replace(contentdata.get_Item(i).Title, "\'", "`", 1, -1, 0) + "\"" + "\'>" + contentdata.get_Item(i).Title + "</a>"; } else { dr[1] = "<img src=\"images/ui/icons/contentHtml.png\"/> " + "<a href=\"content.aspx?LangType=" + contentdata.get_Item(i).Language + "&action=View&id=" + contentdata.get_Item(i).Id + "\" title=\'" + m_refMsg.GetMessage("generic View") + " \"" + Strings.Replace(contentdata.get_Item(i).Title, "\'", "`", 1, -1, 0) + "\"" + "\'>" + contentdata.get_Item(i).Title + "</a>"; } } else { dr[1] = "<img src=\"" + contentdata.get_Item(i).AssetInfo.ImageUrl + "\" class=\"ektronRightSpaceVerySmall ektronLeft\"/>" + "<a href=\"content.aspx?LangType=" + contentdata.get_Item(i).Language + "&action=View&id=" + contentdata.get_Item(i).Id + "\" title=\'" + m_refMsg.GetMessage("generic View") + " \"" + Strings.Replace(contentdata.get_Item(i).Title, "\'", "`", 1, -1, 0) + "\"" + "\'>" + contentdata.get_Item(i).Title + "</a>"; } dr[2] = contentdata.get_Item(i).Id; dr[3] = contentdata.get_Item(i).Status; dr[4] = contentdata.get_Item(i).DisplayDateModified; dr[5] = contentdata.get_Item(i).LastEditorLname; dt.Rows.Add(dr); //End If } DataView dv = new DataView(dt); MoveContentByGategoryGrid.DataSource = dv; MoveContentByGategoryGrid.DataBind(); }