Пример #1
0
    public string GetGroupTags()
    {
        string returnValue;
        System.Text.StringBuilder result = new System.Text.StringBuilder();
        TagData[] tdaGroup;
        Hashtable htTagsAssignedToUser;
        UserAPI m_refUserApi = new UserAPI();

        try
        {
            htTagsAssignedToUser = new Hashtable();
            result.Append("<fieldset>");
            result.Append("<legend>" + m_refMsg.GetMessage("lbl group tags") + "</legend>");
            result.Append("<div style=\"overflow: auto; height: 80px;\">");

            if (this.m_iID > 0)
            {
                tdaGroup = m_refTagsApi.GetTagsForObject(this.m_iID, Ektron.Cms.Common.EkEnumeration.CMSObjectTypes.CommunityGroup, -1);
                if (tdaGroup.Length > 0)
                {
                    LocalizationAPI localizationApi = new LocalizationAPI();
                    for (int i = 0; i <= (tdaGroup.Length - 1); i++)
                    {
                        result.Append("<input disabled=\"disabled\" checked=\"checked\" type=\"checkbox\">&nbsp;<img src=\'" + localizationApi.GetFlagUrlByLanguageID(tdaGroup[i].LanguageId) + "\' border=\"0\" />&nbsp;" + tdaGroup[i].Text + "<br>");
                    }
                }
            }
            result.Append("</div>");
            result.Append("</fieldset>");

        }
        catch (Exception)
        {
        }
        finally
        {
            returnValue = result.ToString();
            tdaGroup = null;
            htTagsAssignedToUser = null;
        }
        return returnValue;
    }
Пример #2
0
    private void ViewMetaData(ContentData data)
    {
        System.Text.StringBuilder result = new System.Text.StringBuilder();
        string strResult = "";
        string strImagePath = "";
        FolderData fldr_Data = new FolderData();
        ContentAPI contentapi = new ContentAPI();

        fldr_Data = contentapi.GetFolderById(data.FolderId);
        if (data != null)
        {
            List<ContentMetaData> displayMetaDataList = new List<ContentMetaData>();
            for (int i = 0; i < data.MetaData.Length; i++)
            {
                string typeName = data.MetaData[i].TypeName;
                 if (!typeName.StartsWith("L10n", StringComparison.OrdinalIgnoreCase) && !typeName.StartsWith("Xliff", StringComparison.OrdinalIgnoreCase) && data.MetaData[i].Type.ToString() != "ImageSelector")
                {
                    displayMetaDataList.Add(data.MetaData[i]);
                }
                else if (data.MetaData[i].Type.ToString() == "ImageSelector")
                {
                    data.MetaData[i].Text = data.MetaData[i].Text.Replace(SitePath + "assets/", "");
                    data.MetaData[i].Text = System.Text.RegularExpressions.Regex.Replace(data.MetaData[i].Text, "\\?.*", "");
                    displayMetaDataList.Add(data.MetaData[i]);
                }
          }

            if (displayMetaDataList.Count > 0)
            {
                strResult = Ektron.Cms.CustomFields.WriteFilteredMetadataForView(displayMetaDataList.ToArray(), m_intFolderId, false).Trim();
            }

            strImagePath = data.Image;
            if (strImagePath.IndexOf(this.AppImgPath + "spacer.gif") != -1)
            {
                strImagePath = "";
            }

            //if ((fldr_Data.IsDomainFolder == true || fldr_Data.DomainProduction != "") && SitePath != "/")
            //{
            //    if (strImagePath.IndexOf("http://") != -1)
            //    {
            //        strImagePath = strImagePath.Substring(strImagePath.IndexOf("http://"));
            //        data.ImageThumbnail = data.ImageThumbnail.Substring(data.ImageThumbnail.IndexOf("http://"));
            //    }
            //    else
            //    {
            //        if (strImagePath != "")
            //        {
            //            strImagePath = strImagePath.Replace(SitePath, "");
            //            data.ImageThumbnail = data.ImageThumbnail.Replace(SitePath, "");
            //            strImagePath = (string)("http://" + fldr_Data.DomainProduction + "/" + strImagePath);
            //            data.ImageThumbnail = (string)("http://" + fldr_Data.DomainProduction + "/" + data.ImageThumbnail);
            //        }
            //    }
            //}
            //else if ((fldr_Data.IsDomainFolder == true || fldr_Data.DomainProduction != "") && SitePath == "/")
            //{

            //    if (strImagePath.IndexOf("http://") != -1)
            //    {
            //        strImagePath = strImagePath.Substring(strImagePath.IndexOf("http://"));
            //        data.ImageThumbnail = data.ImageThumbnail.Substring(data.ImageThumbnail.IndexOf("http://"));
            //    }
            //    else
            //    {
            //        if (strImagePath != "")
            //        {
            //            strImagePath = (string)("http://" + fldr_Data.DomainProduction + "/" + strImagePath.Substring(1));
            //            data.ImageThumbnail = (string)("http://" + fldr_Data.DomainProduction + "/" + data.ImageThumbnail.Substring(1));
            //        }
            //    }
            //}
            //else if (fldr_Data.IsDomainFolder == false && strImagePath.IndexOf("http://") != -1)
            //{
            //    if (strImagePath.IndexOf(SitePath) == 0)
            //    {
            //        strImagePath = Strings.Replace(strImagePath, SitePath, "", 1, 1, 0);
            //        data.ImageThumbnail = Strings.Replace(data.ImageThumbnail, SitePath, "", 1, 1, 0);
            //    }
            //}
            //strImagePath = strImagePath;//Strings.Replace(strImagePath, SitePath, "", 1, 1, 0);
            data.ImageThumbnail = data.ImageThumbnail;// Strings.Replace(data.ImageThumbnail, SitePath, "", 1, 1, 0);
            if (fldr_Data.FolderType != 9)
            {
                // display tag info for this library item
                System.Text.StringBuilder taghtml = new System.Text.StringBuilder();
                taghtml.Append("<fieldset style=\"margin:10px\">");
                taghtml.Append("<legend>" + m_refMsg.GetMessage("lbl personal tags") + "</legend>");
                taghtml.Append("<div style=\"height: 80px; overflow: auto;\" >");
                if (content_data.Id > 0)
                {
                    LocalizationAPI localizationApi = new LocalizationAPI();
                    TagData[] tdaUser;
                    tdaUser = (new Ektron.Cms.Community.TagsAPI()).GetTagsForObject(content_data.Id, Ektron.Cms.Common.EkEnumeration.CMSObjectTypes.Content, m_refContentApi.ContentLanguage);

                    if (tdaUser != null && tdaUser.Length > 0)
                    {

                        foreach (TagData td in tdaUser)
                        {
                            taghtml.Append("<input disabled=\"disabled\" checked=\"checked\" type=\"checkbox\" id=\"userPTagsCbx_" + td.Id.ToString() + "\" name=\"userPTagsCbx_" + td.Id.ToString() + "\" />&#160;");
                            taghtml.Append("<img src=\'" + localizationApi.GetFlagUrlByLanguageID(td.LanguageId) + "\' />");
                            taghtml.Append("&#160;" + td.Text + "<br />");
                        }
                    }
                    else
                    {
                        taghtml.Append(m_refMsg.GetMessage("lbl notagsselected"));
                    }
                }
                taghtml.Append("</div>");
                taghtml.Append("</fieldset>");
                strResult = strResult + taghtml.ToString();
                if (System.IO.Path.GetExtension(data.ImageThumbnail).ToLower().IndexOf(".gif") != -1 && data.ImageThumbnail.ToLower().IndexOf("spacer.gif") == -1)
                {

                    data.ImageThumbnail = data.ImageThumbnail.Replace(".gif", ".png");
                }

                strResult = strResult + "<fieldset style=\"margin:10px\"><legend>" + this.m_refMsg.GetMessage("lbl image data") + "</legend><table width=\"100%\"><tr><td class=\"info\" width=\"1%\" nowrap=\"true\" align=\"left\">" + this.m_refMsg.GetMessage("images label") + "</td><td width=\"99%\" align=\"left\">" + strImagePath + "</td></tr><tr><td class=\"info\" colomnspan=\"2\" align=\"left\"><img src=\"" + data.ImageThumbnail + "\" atl=\"Thumbnail\" /></td></tr></table></fieldset>";

            }
            if (strResult != "")
            {
                result.Append(strResult);
            }
            else
            {
                result.Append(this.m_refMsg.GetMessage("lbl nometadefined"));
            }
        }

        MetaDataValue.Text = result.ToString();
    }
Пример #3
0
    public string GetPersonalTags()
    {
        string returnValue;
            System.Text.StringBuilder result = new System.Text.StringBuilder();
            TagData[] tdaUser;
            TagData[] tdaAll;
            TagData td;
            Hashtable htTagsAssignedToUser;

            try
            {

                error_TagsCantBeBlank.Text = m_refMsg.GetMessage("msg error Blank Tag");
                error_InvalidChars.Text = m_refMsg.GetMessage("msg error Tag invalid chars");

                htTagsAssignedToUser = new Hashtable();
                result.Append("<div id=\"newTagNameDiv\" class=\"ektronWindow\">");
                result.Append("<div></div>");
                result.Append(" <div class=\"ektronTopSpace\" style=\"margin-left: 15px !important;\">");
                result.Append("     <label class=\"tagLabel\" >" + (m_refMsg.GetMessage("name label") + "</label>&nbsp;&nbsp;<input type=\"text\" id=\"newTagName\" class=\"minWidth\" value=\"\" size=\"20\" onkeypress=\"if (event && event.keyCode && (13 == event.keyCode)) {SaveNewPersonalTag(); return false;}\" />"));
                result.Append(" </div>");

                if (IsSiteMultilingual)
                {
                    result.Append("<div class=\"ektronTopSpace\" style=\"margin-left: 15px !important;\">");
                }
                else
                {
                    result.Append("<div style=\"display:none;\" >");
                }
                result.Append("     <label class=\"tagLabel\">" + (m_refMsg.GetMessage("res_lngsel_lbl") + "</label>&nbsp;&nbsp;") + GetSiteEnabledLanguageDropDownMarkup("TagLanguage"));
                result.Append(" </div>");

                result.Append(" <div class=\"ektronTopSpace\">");
                result.Append("     <ul class=\"buttonWrapper ui-helper-clearfix\">");
                result.Append("         <li>");
                result.Append("             <a class=\"button redHover buttonClear buttonLeft\"  type=\"button\" value=\"" + m_refMsg.GetMessage("btn cancel") + "\" onclick=\"CancelSaveNewPersonalTag();\" >" + m_refMsg.GetMessage("btn cancel") + "</a>");
                result.Append("         </li>");
                result.Append("         <li>");
                result.Append("             <a class=\"button greenHover buttonUpdate buttonRight\"  style=\"margin-right:14px;\" type=\"button\" value=\"" + m_refMsg.GetMessage("btn save") + "\" onclick=\"SaveNewPersonalTag();\" >" + m_refMsg.GetMessage("btn save") + "</a>");
                result.Append("         </li>");
                result.Append("     </ul>");
                result.Append(" </div>");
                result.Append(" <input type=\"hidden\" id=\"newTagNameHdn\" name=\"newTagNameHdn\" value=\"\"  />");
                result.Append("</div>");
                result.Append("<div id=\"newTagNameScrollingDiv\" style=\'background-color: white;\'>");

                LocalizationAPI localizationApi = new LocalizationAPI();

                //create hidden list of current tags so we know to delete removed ones.
                foreach (LanguageData lang in languageDataArray)
                {
                    result.Append("<input type=\"hidden\" id=\"flag_" + lang.Id + ("\"  value=\"" + localizationApi.GetFlagUrlByLanguageID(lang.Id) + "\"  />"));
                }
                result.Append("<input type=\"hidden\" id=\"flag_0\"  value=\"" + localizationApi.GetFlagUrlByLanguageID(-1) + "\"  />");

                if (uId > 0)
                {
                    tdaUser = (new Ektron.Cms.Community.TagsAPI()).GetTagsForUser(uId, -1);
                    StringBuilder appliedTagIds = new StringBuilder();

                    //build up a list of tags used by user
                    //add tags to hashtable for reference later when looping through defualt tag list
                    if (tdaUser != null)
                    {
                        foreach (TagData tempLoopVar_td in tdaUser)
                        {
                            td = tempLoopVar_td;
                            htTagsAssignedToUser.Add(td.Id, td);
                            appliedTagIds.Append(td.Id.ToString() + ",");

                            result.Append("<input checked=\"checked\" type=\"checkbox\" id=\"userPTagsCbx_" + td.Id.ToString() + "\" name=\"userPTagsCbx_" + td.Id.ToString() + "\" />&#160;");
                            result.Append("<img src=\'" + localizationApi.GetFlagUrlByLanguageID(td.LanguageId) + "\' border=\"0\" />");
                            result.Append("&#160;" + td.Text + "<br />");
                        }
                    }

                    //create hidden list of current tags so we know to delete removed ones.
                    result.Append("<input type=\"hidden\" id=\"currentTags\" name=\"currentTags\" value=\"" + appliedTagIds.ToString() + "\"  />");

                    tdaAll = (new Ektron.Cms.Community.TagsAPI()).GetDefaultTags(Ektron.Cms.Common.EkEnumeration.CMSObjectTypes.User, -1);
                    if (tdaAll != null)
                    {
                        foreach (TagData tempLoopVar_td in tdaAll)
                        {
                            td = tempLoopVar_td;
                            //don't add to list if its already been added with user's tags above
                            if (! htTagsAssignedToUser.ContainsKey(td.Id))
                            {
                                result.Append("<input type=\"checkbox\" id=\"userPTagsCbx_" + td.Id.ToString() + "\" name=\"userPTagsCbx_" + td.Id.ToString() + "\" />&#160;");
                                result.Append("<img src=\'" + localizationApi.GetFlagUrlByLanguageID(td.LanguageId) + "\' border=\"0\" />");
                                result.Append("&#160;" + td.Text + "<br />");
                            }
                        }
                    }
                }

                result.Append("<div id=\"newAddedTagNamesDiv\"></div>");
                result.Append("</div>");
                result.Append("<div class=\'ektronTopSpace\' style=\'float:left;\'>");
                result.Append(" <a class=\"button buttonLeft greenHover buttonAddTagWithText\" href=\"Javascript:ShowAddPersonalTagArea();\" title=\"" + m_refMsg.GetMessage("alt add btn text (personal tag)") + "\">" + m_refMsg.GetMessage("btn add personal tag") + "</a>");
                result.Append("</div>");

            }
            catch (Exception)
            {
            }
            finally
            {
                returnValue = result.ToString();
                tdaAll = null;
                tdaUser = null;
                td = null;
                htTagsAssignedToUser = null;
            }
            return returnValue;
    }
Пример #4
0
    private void LoadManualAliasList(string siteID)
    {
        PagingInfo req = new PagingInfo();
        System.Collections.Generic.List<UrlAliasManualData> manualAliasList;
        System.Collections.Generic.List<UrlAliasAutoData> autoAliasList;
        System.Collections.Generic.List<UrlAliasCommunityData> communityAliasList;
        Ektron.Cms.Common.EkEnumeration.UrlAliasingOrderBy orderBy = Ektron.Cms.Common.EkEnumeration.UrlAliasingOrderBy.None;
        Ektron.Cms.Common.EkEnumeration.AutoAliasOrderBy orderAutoAlias = Ektron.Cms.Common.EkEnumeration.AutoAliasOrderBy.None;
        Ektron.Cms.Common.EkEnumeration.CommunityAliasOrderBy orderCommunityAlias = Ektron.Cms.Common.EkEnumeration.CommunityAliasOrderBy.None;
        LocalizationAPI objLocalizationApi = new LocalizationAPI();
        string defaultIcon = string.Empty;
        long currentSiteKey = 0;
        bool _isRemoveAlias = false;
        string mode = string.Empty;
        SiteAPI _refsiteApi = new SiteAPI();
        LanguageData[] languageData = _refsiteApi.GetAllActiveLanguages();
        string strSelectedLanguageName = "";
        string strName;

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

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

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

        mode = Request.QueryString["mode"];

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

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

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

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

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

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

                }

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

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

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

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

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

            PageSettings();

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

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

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

                    dr["CONTENT ID"] = manualAliasList[i].ContentId;
                    dt.Rows.Add(dr);
                }
                DataView dv = new DataView(dt);
                CollectionListGrid.DataSource = dv;
                CollectionListGrid.DataBind();
            }
        }
    }
Пример #5
0
        protected string Util_GetTitleField()
        {
            StringBuilder sbTitle = new StringBuilder();
            LocalizationAPI objLocalizationApi = new LocalizationAPI();
            LanguageData language_data = m_refContentApi.EkSiteRef.GetLanguageDataById(ContentLanguage);

            sbTitle.Append(" <table border=\"0\" cellpadding=\"2\" cellspacing=\"2\"> ").Append(Environment.NewLine);
            sbTitle.Append("     <tr> ").Append(Environment.NewLine);
            sbTitle.Append("         <td>").Append(GetMessage("generic title")).Append(":</td> ").Append(Environment.NewLine);
            sbTitle.Append("         <td nowrap=\"nowrap\" align=\"left\"> ").Append(Environment.NewLine);
            sbTitle.Append("             <input name=\"content_title\" type=\"text\" id=\"content_title\" size=\"50\" maxlength=\"200\" onkeypress=\"return CheckKeyValue(event, \'34,13\');\" value=\"");
            if (entry_edit_data != null)
            {
                sbTitle.Append(EkFunctions.HtmlEncode(entry_edit_data.Title));
            }
            sbTitle.Append("\" /> [").Append(language_data.Name).Append("] ").Append(Environment.NewLine);
            sbTitle.Append("<img src=\'" + objLocalizationApi.GetFlagUrlByLanguageID(ContentLanguage) + "\' border=\"0\" />");
            sbTitle.Append("         </td> ").Append(Environment.NewLine);
            sbTitle.Append("         <td>&nbsp;</td> ").Append(Environment.NewLine);
            sbTitle.Append("     </tr> ").Append(Environment.NewLine);
            sbTitle.Append(" </table> ").Append(Environment.NewLine);

            return sbTitle.ToString();
        }
Пример #6
0
    private void Populate_ViewCatalogGrid(System.Collections.Generic.List<EntryData> entryList)
    {
        System.Web.UI.WebControls.BoundColumn colBound = new System.Web.UI.WebControls.BoundColumn();
        string strTag;
        string strtag1;

        if (m_sPageAction == "couponselect")
        {
            this.AddBackButton("javascript:history.go(-1);");
        }

        strTag = "<a href=\"itemselection.aspx?LangType=" + ContentLanguage + (bTabUseCase ? "&SelectedTab=Items" : "") + "&action=" + m_sPageAction + "&orderby=";
        strtag1 = "&id=" + m_iID + (strContType != "" ? "&" + ContentTypeUrlParam + "=" + strContType : "") + "\" title=\"" + m_refMsg.GetMessage("click to sort msg") + "\">";

        colBound.DataField = "TITLE";
        colBound.HeaderText = strTag + "Title" + strtag1 + m_refMsg.GetMessage("generic Title") + "</a>";
        colBound.ItemStyle.VerticalAlign = VerticalAlign.Top;
        colBound.HeaderStyle.CssClass = "title-header";
        colBound.ItemStyle.Wrap = false;
        FolderDataGrid.Columns.Add(colBound);

        colBound = new System.Web.UI.WebControls.BoundColumn();
        colBound.DataField = "LANGUAGE";
        colBound.HeaderText = strTag + "language" + strtag1 + m_refMsg.GetMessage("generic language") + "</a>";
        colBound.HeaderStyle.CssClass = "title-header";
        colBound.ItemStyle.Wrap = false;
        colBound.ItemStyle.VerticalAlign = VerticalAlign.Top;
        colBound.ItemStyle.HorizontalAlign = HorizontalAlign.Center;
        FolderDataGrid.Columns.Add(colBound);

        colBound = new System.Web.UI.WebControls.BoundColumn();
        colBound.DataField = "ID";
        colBound.HeaderText = strTag + "ID" + strtag1 + m_refMsg.GetMessage("generic ID") + "</a>";
        colBound.ItemStyle.Wrap = false;
        colBound.ItemStyle.VerticalAlign = VerticalAlign.Top;
        colBound.ItemStyle.HorizontalAlign = HorizontalAlign.Center;
        colBound.HeaderStyle.CssClass = "title-header";
        FolderDataGrid.Columns.Add(colBound);

        colBound = new System.Web.UI.WebControls.BoundColumn();
        colBound.DataField = "STATUS";
        colBound.HeaderText = m_refMsg.GetMessage("generic Status");
        colBound.ItemStyle.VerticalAlign = VerticalAlign.Top;
        colBound.HeaderStyle.CssClass = "title-header";
        colBound.ItemStyle.HorizontalAlign = HorizontalAlign.Center;
        colBound.ItemStyle.Wrap = false;
        FolderDataGrid.Columns.Add(colBound);

        colBound = new System.Web.UI.WebControls.BoundColumn();
        colBound.DataField = "TYPE";
        colBound.HeaderText = strTag + "type" + strtag1 + m_refMsg.GetMessage("generic type") + "</a>";
        colBound.ItemStyle.VerticalAlign = VerticalAlign.Top;
        colBound.HeaderStyle.CssClass = "title-header";
        colBound.ItemStyle.Wrap = false;
        FolderDataGrid.Columns.Add(colBound);

        colBound = new System.Web.UI.WebControls.BoundColumn();
        colBound.DataField = "PRICE";
        colBound.HeaderText = strTag + "price" + strtag1 + m_refMsg.GetMessage("lbl calatog entry price") + "</a>";
        colBound.ItemStyle.VerticalAlign = VerticalAlign.Top;
        colBound.HeaderStyle.CssClass = "title-header";
        colBound.ItemStyle.Wrap = false;
        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("TYPE", typeof(string)));
        dt.Columns.Add(new DataColumn("PRICE", typeof(string)));

        int i;

        objLocalizationApi = new LocalizationAPI();

        for (i = 0; i <= (entryList.Count - 1); i++)
        {
            dr = dt.NewRow();
            string dmsMenuGuid;
            dmsMenuGuid = (string)(System.Guid.NewGuid().ToString());

            dr[0] = dr[0] + "<a";
            dr[0] = dr[0] + " id=\"dmsViewItemAnchor" + entryList[i].Id + entryList[i].LanguageId + dmsMenuGuid + "\"";
            dr[0] = dr[0] + " class=\"dmsViewItemAnchor\"";
            dr[0] = dr[0] + " onclick=\"" + Util_GetLinkJS(entryList[i]) + "\"";
            dr[0] = dr[0] + " href=\"#\"";
            dr[0] = dr[0] + " title=\"View " + entryList[i].Title + "\"";
            dr[0] = dr[0] + ">";
            if (entryList[i].EntryType == Ektron.Cms.Common.EkEnumeration.CatalogEntryType.SubscriptionProduct)
            {

                dr[0] = dr[0] + "<img border=\"0\" src=\"" + m_refContentApi.AppPath + "images/ui/icons/bookGreen.png" + "\"></img>" + entryList[i].Title;
            }
            else if (entryList[i].EntryType == Ektron.Cms.Common.EkEnumeration.CatalogEntryType.ComplexProduct)
            {

                dr[0] = dr[0] + "<img border=\"0\" src=\"" + m_refContentApi.AppPath + "images/ui/icons/bricks.png" + "\"></img>" + entryList[i].Title;
            }
            else if (entryList[i].EntryType == Ektron.Cms.Common.EkEnumeration.CatalogEntryType.Kit)
            {

                dr[0] = dr[0] + "<img border=\"0\" src=\"" + m_refContentApi.AppPath + "images/ui/icons/box.png" + "\"></img>" + entryList[i].Title;
            }
            else if (entryList[i].EntryType == Ektron.Cms.Common.EkEnumeration.CatalogEntryType.Bundle)
            {

                dr[0] = dr[0] + "<img border=\"0\" src=\"" + m_refContentApi.AppPath + "images/ui/icons/package.png" + "\"></img>" + entryList[i].Title;
            } // Product
            else
            {

                dr[0] = dr[0] + "<img border=\"0\" src=\"" + m_refContentApi.AppPath + "images/ui/icons/brick.png" + "\"></img>" + entryList[i].Title;
            }
            dr[0] = dr[0] + "</a>";
            //dr(0) = dr(0) + "</p>"
            //dr(0) = dr(0) + "</div>"

            dr[1] = "<a href=\"Javascript://\" style=\"text-decoration:none;\">" + "<img src=\'" + objLocalizationApi.GetFlagUrlByLanguageID(System.Convert.ToInt32(entryList[i].LanguageId)) + "\' border=\"0\" />" + "</a>";
            dr[2] = entryList[i].Id;
            dr[3] = entryList[i].Status;
            dr[4] = entryList[i].EntryType.ToString();
            dr[5] = Strings.FormatNumber(entryList[i].ListPrice, 2, Microsoft.VisualBasic.TriState.UseDefault, Microsoft.VisualBasic.TriState.UseDefault, Microsoft.VisualBasic.TriState.UseDefault);
            dt.Rows.Add(dr);
        }

        DataView dv = new DataView(dt);
        FolderDataGrid.DataSource = dv;
        FolderDataGrid.DataBind();
    }
Пример #7
0
    private void Display_ViewLibraryItem()
    {
        ViewLibraryItemPanel.Visible = true;
        FolderData folder_data;
        PermissionData security_data;
        LibraryData library_data;
        librarytoolbar m_libraryToolBar;
        _Id = Convert.ToInt64(Request.QueryString["id"]);
        _FolderId = Convert.ToInt64(Request.QueryString["parent_id"]);
        folder_data = _ContentApi.GetFolderById(_FolderId);
        security_data = _ContentApi.LoadPermissions(_FolderId, "folder", 0);
        library_data = _ContentApi.GetLibraryItemByID(_Id, _FolderId);

        //StagingFileName property would be empty for non-multisite links and as well as when the site is not in Staging Mode
        if (library_data.StagingFileName == "")
        {
            library_data.StagingFileName = library_data.FileName;
        }

        if (!(library_data == null))
        {
            _Type = library_data.Type;
        }
        else
        {
            //ErrorString = "Item not found -HC"
        }

        System.Web.UI.WebControls.BoundColumn colBound = new System.Web.UI.WebControls.BoundColumn();
        colBound.DataField = "TITLE";
        colBound.ItemStyle.CssClass = "label";
        ViewLibraryItemGrid.Columns.Add(colBound);

        colBound = new System.Web.UI.WebControls.BoundColumn();
        colBound.DataField = "TEXT";
        System.Web.UI.WebControls.Unit percUnit;
        percUnit = System.Web.UI.WebControls.Unit.Percentage(95);
        colBound.HeaderStyle.Width = percUnit;
        ViewLibraryItemGrid.Columns.Add(colBound);
        percUnit = System.Web.UI.WebControls.Unit.Empty;

        DataTable dt = new DataTable();
        DataRow dr;
        dt.Columns.Add(new DataColumn("TITLE", typeof(string)));
        dt.Columns.Add(new DataColumn("TEXT", typeof(string)));

        if (!(library_data == null))
        {
            dr = dt.NewRow();
            dr[0] = "<span class=\"label\">" + _MessageHelper.GetMessage("generic title label") + "</span>";
            dr[1] = library_data.Title;
            dt.Rows.Add(dr);

            dr = dt.NewRow();
            if (library_data.Type == "quicklinks" || library_data.Type == "hyperlinks")
            {
                dr[0] = "<span class=\"label\">" + _MessageHelper.GetMessage("url link label") + "</span>";
            }
            else
            {
                dr[0] = "<span class=\"label\">" + _MessageHelper.GetMessage("filename label") + "</span>";
            }
            dr[1] = library_data.FileName;
            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr[0] = "<span class=\"label\">" + _MessageHelper.GetMessage("library id label") + "</span>";
            dr[1] = library_data.Id;
            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr[0] = "<span class=\"label\">" + _MessageHelper.GetMessage("parent folder label") + "</span>";
            dr[1] = library_data.FolderName;
            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr[0] = "<span class=\"label\">" + _MessageHelper.GetMessage("content LUE label") + "</span>";
            dr[1] = library_data.EditorLastName + ", " + library_data.EditorFirstName;
            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr[0] = "<span class=\"label\">" + _MessageHelper.GetMessage("content LED label") + "</span>";
            dr[1] = library_data.DisplayLastEditDate;
            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr[0] = "<span class=\"label\">" + _MessageHelper.GetMessage("content DC label") + "</span>";
            dr[1] = library_data.DisplayDateCreated;

            dt.Rows.Add(dr);
        }
        // Don't tbind the data yet, may have teaser data to include...

        //SEARCH METADATA''''''''''''
        ContentData content_data = null;
        if (_Type != "quicklinks" && _Type != "forms")
        {
            bool bManagedAsset = false;

            ContentAPI m_refcontentapi = new ContentAPI();
            CustomFields cFieldsO = new CustomFields();
            ContentMetaData[] meta_data;

            if (_ContentLanguage == Ektron.Cms.Common.EkConstants.CONTENT_LANGUAGES_UNDEFINED)
            {
                m_refcontentapi.ContentLanguage = Ektron.Cms.Common.EkConstants.ALL_CONTENT_LANGUAGES;
            }
            else
            {
                m_refcontentapi.ContentLanguage = _ContentLanguage;
            }

            if (library_data.ContentId != 0)
            {
                content_data = m_refcontentapi.GetContentById(library_data.ContentId, 0);
            }
            if (!(content_data == null))
            {
                meta_data = content_data.MetaData;
                _ContentTeaser = content_data.Teaser;
                _ContentTeaser = _ContentTeaser.Replace("<p> </p>", string.Empty);
                if (content_data.Type != Ektron.Cms.Common.EkConstants.CMSContentType_Library)
                {
                    bManagedAsset = true;
                }
            }
            else
            {
                meta_data = m_refcontentapi.GetMetaDataTypes("id");
            }

            // Add the Teaser-Data for this Library item:
            dr = dt.NewRow();
            dr[0] = _MessageHelper.GetMessage("description label");
            dr[1] = _ContentTeaser;
            dt.Rows.Add(dr);

            if (meta_data != null)
            {
                if (meta_data.Length > 0)
                {
                    if (!bManagedAsset)
                    {
                        //ViewLibraryMeta.Text = cFieldsO.WriteMetadataForView(meta_data).ToString
                        if (m_refcontentapi.ContentLanguage != Ektron.Cms.Common.EkConstants.ALL_CONTENT_LANGUAGES)
                        {
                            ViewLibraryMeta.Text = CustomFields.WriteFilteredMetadataForView(meta_data, _FolderId, true).ToString();

                            // display tag info for this library item
                            System.Text.StringBuilder taghtml = new System.Text.StringBuilder();
                            taghtml.Append("<fieldset style=\"margin:10px\">");
                            taghtml.Append("<legend>" + _MessageHelper.GetMessage("lbl personal tags") + "</legend>");
                            taghtml.Append("<div style=\"height: 80px; overflow: auto;\" >");
                            if (library_data.Id > 0)
                            {
                                LocalizationAPI localizationApi = new LocalizationAPI();
                                TagData[] tdaUser;
                                tdaUser = (new Ektron.Cms.Community.TagsAPI()).GetTagsForObject(library_data.Id, EkEnumeration.CMSObjectTypes.Library, m_refcontentapi.ContentLanguage);

                                if (tdaUser != null && tdaUser.Length > 0)
                                {

                                    foreach (TagData td in tdaUser)
                                    {
                                        taghtml.Append("<input disabled=\"disabled\" checked=\"checked\" type=\"checkbox\" id=\"userPTagsCbx_" + td.Id.ToString() + "\" name=\"userPTagsCbx_" + td.Id.ToString() + "\" />&#160;");
                                        taghtml.Append("<img src=\'" + localizationApi.GetFlagUrlByLanguageID(td.LanguageId) + "\' />");
                                        taghtml.Append("&#160;" + td.Text + "<br />");
                                    }
                                }
                                else
                                {
                                    taghtml.Append(_MessageHelper.GetMessage("lbl notagsselected"));
                                }
                            }
                            taghtml.Append("</div>");
                            taghtml.Append("</fieldset>");
                            ViewLibraryTags.Text = taghtml.ToString();
                        }
                        else
                        {
                            string strLink;
                            strLink = "<a href=\"library.aspx?LangType=" + meta_data[0].Language.ToString() + "&action=" + _PageAction + "&id=" + _Id + "&parent_id=" + _FolderId + "\">";
                            ViewLibraryMeta.Text = "<span style=\"COLOR: red\">*Note - Related metadata/tags will be displayed only if a specific language was selected on the previous page. You may either go back to the previous page to select a language, or click " + strLink + "here</a> to view the metadata with the language selected automatically.</span>";
                        }
                    }
                }
            }
        }
        ///'''''''''''''''''''''''''

        //Binding the Taxonomy
        if (_Type != "quicklinks" && _Type != "forms")
        {
            if (library_data.ContentId != 0)
            {
                TaxonomyBaseData[] data = null;
                ContentAPI m_refcontentapi = new ContentAPI();
                Ektron.Cms.Content.EkContent cref;
                cref = m_refcontentapi.EkContentRef;
                data = cref.ReadAllAssignedCategory(library_data.ContentId);
                ViewTaxonomy.Text = "<fieldset style=\"margin: 10px;\"><legend>Category</legend>";
                ViewTaxonomy.Text += "<table width=\"100%\">";
                ViewTaxonomy.Text += "<tr><td>";
                if ((data != null) && data.Length > 0)
                {
                    foreach (TaxonomyBaseData tax_data in data)
                    {
                        ViewTaxonomy.Text = ViewTaxonomy.Text + "<li>" + tax_data.TaxonomyPath.Remove(0, 1).Replace("\\", ">") + "</li>";
                    }
                }
                else
                {
                    ViewTaxonomy.Text += _MessageHelper.GetMessage("lbl nocatselected");
                }
                ViewTaxonomy.Text += "</td>" + "</tr>" + "</table>" + "</fieldset>";
            }
        }

        // now bind data, possibly with teaser:
        DataView dv = new DataView(dt);
        ViewLibraryItemGrid.DataSource = dv;
        ViewLibraryItemGrid.DataBind();

        colBound = new System.Web.UI.WebControls.BoundColumn();
        colBound.DataField = "LINK";
        colBound.HeaderStyle.Width = Unit.Empty;
        colBound.HeaderStyle.Height = Unit.Empty;
        colBound.ItemStyle.Wrap = false;
        colBound.ItemStyle.VerticalAlign = VerticalAlign.Top;
        colBound.ItemStyle.HorizontalAlign = HorizontalAlign.Left;
        ViewLibraryItemLinkGrid.Columns.Add(colBound);
        ViewLibraryItemLinkGrid.BorderColor = System.Drawing.Color.White;
        dt = new DataTable();
        dt.Columns.Add(new DataColumn("LINK", typeof(string)));

        if (!(library_data == null))
        {
            library_data.FileName = Server.HtmlDecode(library_data.FileName);
            if (library_data.TypeId == 1 || library_data.TypeId == 2)
            {
                library_data.FileName = library_data.FileName.Replace("%", "%25");
                library_data.FileName = library_data.FileName.Replace("#", "%23");
                library_data.FileName = library_data.FileName.Replace("$", "%24");
                library_data.FileName = library_data.FileName.Replace("&", "%26");
                library_data.FileName = library_data.FileName.Replace("^", "%5E");
            }

            dr = dt.NewRow();
            if (library_data.Type == "images")
            {
                Random r = new Random(System.DateTime.Now.Millisecond);
                if (content_data != null)
                {
                    if (content_data.AssetData.Id != "" && content_data.Status == "I")
                    {
                        dr[0] = content_data.Html;
                    }
                    else
                    {
                        dr[0] = "<img src=\"" + library_data.StagingFileName.Replace(" ", "%20") + "?n=" + r.Next(1, 5000) + "\">";
                    }
                }
                else
                {
                    dr[0] = "<img src=\"" + library_data.FileName.Replace(" ", "%20") + "?n=" + r.Next(1, 5000) + "\">";
                }

            }
            else if (library_data.Type == "quicklinks")
            {
                if (Ektron.Cms.Common.EkConstants.IsAssetContentType(library_data.ContentType, true) && library_data.ContentType != Ektron.Cms.Common.EkConstants.CMSContentType_Media)
                {
                    if ((library_data.FileName.ToString().ToLower().IndexOf("javascript:") == -1) && library_data.FileName.ToString().ToLower().IndexOf("downloadasset.aspx") == -1)
                    {
                        library_data.FileName = this._SiteApi.SitePath + library_data.FileName;
                    }
                    dr[0] = "<a href=\"" + library_data.StagingFileName.Replace(" ", "%20") + "&LangType=" + library_data.LanguageId + "\" title=\"" + _MessageHelper.GetMessage("generic Preview title") + " " + library_data.Title + "\">" + _MessageHelper.GetMessage("generic Preview title") + " " + library_data.Title + "</a>";
                }
                else if ((library_data.FileName.IndexOf("?") + 1) > 0)
                {
                    if (library_data.FileName.ToString().ToLower().IndexOf("downloadasset.aspx") > -1)
                    {
                        dr[0] = "<a href=\"" + library_data.StagingFileName.Replace(" ", "%20") + "&LangType=" + library_data.LanguageId + "\" title=\"" + _MessageHelper.GetMessage("generic Preview title") + " " + library_data.Title + "\">" + _MessageHelper.GetMessage("generic Preview title") + " " + library_data.Title + "</a>";
                    }
                    else
                    {
                        dr[0] = "<a href=\"" + ((library_data.StagingFileName.Replace(" ", "%20").StartsWith(_SitePath)) ? (library_data.StagingFileName.Replace(" ", "%20")) : (((library_data.StagingFileName.Substring(0, 7) != "http://") && (library_data.StagingFileName.Substring(0, 8) != "https://")) ? _SitePath + library_data.StagingFileName.Replace(" ", "%20") : library_data.StagingFileName.Replace(" ", "%20"))) + "\"&Preview=True&LangType=" + library_data.LanguageId + "\" target=\"Preview\" title=\"" + _MessageHelper.GetMessage("generic Preview title") + " " + library_data.Title + "\">" + _MessageHelper.GetMessage("generic Preview title") + " " + library_data.Title + "</a>";
                    }
                }
                else
                {
                    dr[0] = "<a href=\"" + library_data.StagingFileName.Replace(" ", "%20") + "\"&Preview=True&LangType=" + library_data.LanguageId + "\" target=\"Preview\" title=\"" + _MessageHelper.GetMessage("generic Preview title") + " " + library_data.Title + "\">" + _MessageHelper.GetMessage("generic Preview title") + " " + library_data.Title + "</a>";
                }
            }
            else if (library_data.Type == "forms")
            {
                if ((library_data.FileName.IndexOf("?") + 1) > 0)
                {
                    dr[0] = "<a href=\"" + library_data.StagingFileName.Replace(" ", "%20") + "\"&Preview=True&LangType=" + library_data.LanguageId + "\" target=\"Preview\" title=\"" + _MessageHelper.GetMessage("generic Preview title") + " " + library_data.Title + "\">" + _MessageHelper.GetMessage("generic Preview title") + " " + library_data.Title + "</a>";
                }
                else
                {
                    dr[0] = "<a href=\"" + library_data.StagingFileName.Replace(" ", "%20") + "\"&Preview=True&LangType=" + library_data.LanguageId + "\" target=\"Preview\" title=\"" + _MessageHelper.GetMessage("generic Preview title") + " " + library_data.Title + "\">" + _MessageHelper.GetMessage("generic Preview title") + " " + library_data.Title + "</a>";
                }
            }
            else if ((library_data.Type == "hyperlinks") && (!library_data.FileName.Contains("http://")) && (!library_data.FileName.Contains("https://")))
            {
                dr[0] = "<a href=\"" + library_data.FileName.Replace(" ", "%20") + "\" target=\"Preview\" title=\"" + _MessageHelper.GetMessage("generic Preview title") + " " + library_data.Title + "\">" + _MessageHelper.GetMessage("generic Preview title") + " " + library_data.Title + "</a>";
            }
            else
            {

                dr[0] = "<a href=\"" + library_data.StagingFileName.Replace(" ", "%20") + "\" target=\"Preview\" title=\"" + _MessageHelper.GetMessage("generic Preview title") + " " + library_data.Title + "\">" + _MessageHelper.GetMessage("generic Preview title") + " " + library_data.Title + "</a>";

            }
            dt.Rows.Add(dr);
        }

        dv = new DataView(dt);
        ViewLibraryItemLinkGrid.DataSource = dv;
        ViewLibraryItemLinkGrid.DataBind();

        m_libraryToolBar = (librarytoolbar)(LoadControl("controls/library/librarytoolbar.ascx"));
        ToolBarHolder.Controls.Add(m_libraryToolBar);
        m_libraryToolBar.AppImgPath = _AppImgPath;
        m_libraryToolBar.PageAction = _PageAction;
        m_libraryToolBar.FolderInfo = folder_data;
        m_libraryToolBar.SecurityInfo = security_data;
        m_libraryToolBar.FolderId = _FolderId;
        m_libraryToolBar.LibType = _Type;
        m_libraryToolBar.ContentLanguage = _ContentLanguage;
        m_libraryToolBar.ContentType = library_data.ContentType;
        m_libraryToolBar.LibraryInfo = library_data;
    }
Пример #8
0
    private void ShowTagEditArea(ContentAPI m_refcontentapi, LibraryData library_data)
    {
        // display tag edit area
        System.Text.StringBuilder taghtml = new System.Text.StringBuilder();
        error_TagsCantBeBlank.Text = _MessageHelper.GetMessage("msg error Blank Tag");
        error_InvalidChars.Text = _MessageHelper.GetMessage("msg error Tag invalid chars");

        Hashtable htTagsAssignedToUser = new Hashtable();
        taghtml.Append("<div class=\"ektronTopSpace\"></div>");
        taghtml.Append("<div class=\"ektronHeader\">" + _MessageHelper.GetMessage("lbl personal tags") + "</div>");
        taghtml.Append("<div style=\"position: relative; top: 0px; left: 0px;\" >");

        taghtml.Append("    <div id=\"newTagNameDiv\" class=\"ektronWindow\">");
        taghtml.Append("        <div style=\"position: relative; top: 0px; left: 0px;\" >");
        taghtml.Append("            <div style=\"margin-top: 6px; margin-left: 10px; \" >");
        taghtml.Append("                <table class=\"ektronForm\">");
        taghtml.Append("                    <tr>");
        taghtml.Append("                        <td class=\"label\">");
        taghtml.Append(_MessageHelper.GetMessage("name label"));
        taghtml.Append("                        </td>");
        taghtml.Append("                        <td class=\"value\">");
        taghtml.Append("                            <input type=\"text\" style=\"width:275px;\" id=\"newTagName\" value=\"\" size=\"18\" onkeypress=\"if (event && event.keyCode && (13 == event.keyCode)) {SaveNewPersonalTag(); return false;}\" />");
        taghtml.Append("                        </td>");
        taghtml.Append("                    </tr>");
        taghtml.Append("                </table>");
        taghtml.Append("            </div>");

        if (IsSiteMultilingual)
        {
            //taghtml.Append("<div style=""margin-top: 6px; margin-left: 10px; "" >")
            taghtml.Append("<div style=\"display:none;\" >");
        }
        else
        {
            taghtml.Append("<div style=\"display:none;\" >");
        }
        taghtml.Append(_MessageHelper.GetMessage("res_lngsel_lbl") + "&#160;" + GetLanguageDropDownMarkup("TagLanguage"));
        taghtml.Append("    </div>");

        taghtml.Append("        <div style=\"margin-top:.5em;\">");
        taghtml.Append("            <ul class=\"buttonWrapper ui-helper-clearfix\">");
        taghtml.Append("                <li>");
        taghtml.Append("                    <a class=\"button buttonRight buttonInlineBlock redHover buttonClear\" type=\"button\" alt=\"" + _MessageHelper.GetMessage("btn cancel") + "\" title=\"" + _MessageHelper.GetMessage("btn cancel") + "\" onclick=\"CancelSaveNewPersonalTag();\">");
        taghtml.Append("                        <span>" + _MessageHelper.GetMessage("btn cancel") + "</span>");
        taghtml.Append("                    </a>");
        taghtml.Append("                </li>");

        taghtml.Append("                <li>");
        taghtml.Append("                    <a class=\"button buttonRight buttonInlineBlock greenHover buttonUpdate\" type=\"button\" title=\"" + _MessageHelper.GetMessage("btn save") + "\" alt=\"" + _MessageHelper.GetMessage("btn save") + "\" onclick=\"SaveNewPersonalTag();\" />");
        taghtml.Append("                        <span>" + _MessageHelper.GetMessage("btn save") + "</span>");
        taghtml.Append("                    </a>");
        taghtml.Append("                </li>");
        taghtml.Append("            </ul>");
        taghtml.Append("        </div>");

        taghtml.Append("        <input type=\"hidden\" id=\"newTagNameHdn\" name=\"newTagNameHdn\" value=\"\"  />");
        taghtml.Append("        </div>");
        taghtml.Append("    </div>");
        taghtml.Append("</div>");
        taghtml.Append("<div id=\"newTagNameScrollingDiv\" style=\"height: 80px; overflow: auto; border: solid 1px #aaaaaa; z-index: 1;\" >");

        LocalizationAPI localizationApi = new LocalizationAPI();

        //create hidden list of current tags so we know to delete removed ones.
        LanguageData[] languageDataArray = _SiteApi.GetAllActiveLanguages();

        foreach (LanguageData lang in languageDataArray)
        {
            taghtml.Append("<input type=\"hidden\" id=\"flag_" + lang.Id + ("\"  value=\"" + localizationApi.GetFlagUrlByLanguageID(lang.Id) + "\"  />"));
        }
        taghtml.Append("<input type=\"hidden\" id=\"flag_0\"  value=\"" + localizationApi.GetFlagUrlByLanguageID(-1) + "\"  />");

        TagData[] tdaUser = null;
        if (library_data != null)
        {
            if (library_data.Id > 0)
            {
                tdaUser = (new Ektron.Cms.Community.TagsAPI()).GetTagsForObject(library_data.Id, EkEnumeration.CMSObjectTypes.Library, m_refcontentapi.ContentLanguage);
            }
        }
        StringBuilder appliedTagIds = new StringBuilder();

        //build up a list of tags used by user
        //add tags to hashtable for reference later when looping through defualt tag list
        TagData td;
        if (tdaUser != null)
        {
            foreach (TagData tempLoopVar_td in tdaUser)
            {
                td = tempLoopVar_td;
                htTagsAssignedToUser.Add(td.Id, td);
                appliedTagIds.Append(td.Id.ToString() + ",");

                taghtml.Append("<input checked=\"checked\" type=\"checkbox\" id=\"userPTagsCbx_" + td.Id.ToString() + "\" name=\"userPTagsCbx_" + td.Id.ToString() + "\" />&#160;");
                taghtml.Append("<img src=\'" + localizationApi.GetFlagUrlByLanguageID(td.LanguageId) + "\' />");
                taghtml.Append("&#160;" + td.Text + "<br />");
            }
        }

        //create hidden list of current tags so we know to delete removed ones.
        taghtml.Append("<input type=\"hidden\" id=\"currentTags\" name=\"currentTags\" value=\"" + appliedTagIds.ToString() + "\"  />");

        TagData[] tdaAll;
        tdaAll = (new Ektron.Cms.Community.TagsAPI()).GetDefaultTags(EkEnumeration.CMSObjectTypes.Library, m_refcontentapi.ContentLanguage);
        if (tdaAll != null)
        {
            foreach (TagData tempLoopVar_td in tdaAll)
            {
                td = tempLoopVar_td;
                //don't add to list if its already been added with user's tags above
                if (!htTagsAssignedToUser.ContainsKey(td.Id))
                {
                    taghtml.Append("<input type=\"checkbox\" id=\"userPTagsCbx_" + td.Id.ToString() + "\" name=\"userPTagsCbx_" + td.Id.ToString() + "\" />&#160;");
                    taghtml.Append("<img src=\'" + localizationApi.GetFlagUrlByLanguageID(td.LanguageId) + "\' />");
                    taghtml.Append("&#160;" + td.Text + "<br />");
                }
            }
        }

        taghtml.Append("<div id=\"newAddedTagNamesDiv\"></div>");

        taghtml.Append("</div>");

        taghtml.Append("<div style=\"float:left;\">");
        taghtml.Append("    <a class=\"button buttonLeft greenHover buttonAddTagWithText\" href=\"#\" onclick=\"ShowAddPersonalTagArea();\">" + _MessageHelper.GetMessage("btn add personal tag") + "</a>" + "\r\n");
        taghtml.Append("</div>");

        ShowTags.Text = taghtml.ToString();
    }
Пример #9
0
    public string GetPersonalTags()
    {
        string returnValue;
        System.Text.StringBuilder result = new System.Text.StringBuilder();
        TagData[] tdaUser;
        TagData td;
        Hashtable htTagsAssignedToUser;

        try
        {
            htTagsAssignedToUser = new Hashtable();
            result.Append("<div>");
            if (uId > 0)
            {

                LocalizationAPI localizationApi = new LocalizationAPI();
                tdaUser = (new Ektron.Cms.Community.TagsAPI()).GetTagsForUser(uId, -1);

                if (tdaUser != null)
                {
                    foreach (TagData tempLoopVar_td in tdaUser)
                    {
                        td = tempLoopVar_td;
                        result.Append("<input disabled=\"disabled\" checked=\"checked\" type=\"checkbox\" id=\"userPTagsCbx_" + td.Id.ToString() + "\" name=\"userPTagsCbx_" + td.Id.ToString() + "\" />&#160;");
                        result.Append("<img src=\'" + localizationApi.GetFlagUrlByLanguageID(td.LanguageId) + "\' border=\"0\" />");
                        result.Append("&#160;" + td.Text + "<br />");
                    }
                }

            }
            result.Append("</div>");

        }
        catch (Exception)
        {
        }
        finally
        {
            returnValue = result.ToString();
            tdaUser = null;
            td = null;
            htTagsAssignedToUser = null;
        }
        return returnValue;
    }
Пример #10
0
    private void DeleteTemplate()
    {
        long template_id = System.Convert.ToInt64(Request.QueryString["id"]);
        Ektron.Cms.PageBuilder.WireframeModel wireframeModel = new Ektron.Cms.PageBuilder.WireframeModel();
        Ektron.Cms.PageBuilder.WireframeData wireframe = wireframeModel.FindByTemplateID(template_id);

        SetTitleBarToMessage("lbl delete template");
        AddBackButton("template_config.aspx?view=list");
        AddHelpButton("template_delete");
        long[] folders = m_refContentApi.EkContentRef.GetTemplateDefaultFolderUsage(template_id);
        Collection contentBlockInfo = m_refContentApi.EkContentRef.GetTemplateContentBlockUsage(template_id);
        StringBuilder str = new StringBuilder();
        str.Append("<div class=\"ektronPageContainer\">");
        if (folders.Length > 0)
        {
            str.Append(m_refMsg.GetMessage("lbl folders with") + " " + "\'<i>" + m_refContentApi.EkContentRef.GetTemplateNameByID(template_id) + "</i>\'" + " " + m_refMsg.GetMessage("lbl as their default template") + ":");
            str.Append("<div class=\"ektronTopSpace\"></div>");
            str.Append("<table width=\"100%\" class=\"ektronGrid ektronBorder\">");
            str.Append("<tbody>");
            str.Append("<tr class=\"title-header\">");
            str.Append("<th>Folder Path</th>");
            str.Append("</tr>");
            int i = 0;
            for (i = 0; i <= folders.Length - 1; i++)
            {
                str.Append("<tr>");
                str.Append("<td>" + m_refContentApi.GetFolderById(folders[i]).NameWithPath + "</td>");
                str.Append("</tr>");
            }
            str.Append("</tbody>");
            str.Append("</table>");
            str.Append("<div class=\"ektronTopSpace\"></div>");
            str.Append(m_refMsg.GetMessage("alert msg set folders") + " " + "\'<i>" + m_refContentApi.EkContentRef.GetTemplateNameByID(template_id) + "</i>\'.");

        }
        else
        {
            if (contentBlockInfo.Count == 0 || !(Request.Form["deleteTemplate"] == null))
            {
                bool messageadded = false;
                if (wireframe != null)
                {
                    if (wireframe.Template.SubType == Ektron.Cms.Common.EkEnumeration.TemplateSubType.MasterLayout)
                    {
                        //delete the layout as well
                        Ektron.Cms.PageBuilder.TemplateModel templmodel = new Ektron.Cms.PageBuilder.TemplateModel();
                        string status = string.Empty;
                        Ektron.Cms.SiteAPI siteApi = new Ektron.Cms.SiteAPI();
                        Ektron.Cms.LanguageData[] langData = siteApi.GetAllActiveLanguages();
                        int j = 0;
                        for (j = 0; j <= langData.Length - 1; j++)
                        {
                            long contType = this.ContentAPIRef.EkContentRef.GetContentType(wireframe.Template.MasterLayoutID, langData[j].Id);
                            if (contType != 0)
                            {
                                int tempLang = System.Convert.ToInt32(ContentAPIRef.ContentLanguage);
                                ContentAPIRef.ContentLanguage = langData[j].Id;
                                status = (string)(this.ContentAPIRef.EkContentRef.GetContentStatev2_0(wireframe.Template.MasterLayoutID)["ContentStatus"]);
                                if (status == "O" || status == "S")
                                {
                                    Collection permissions = ContentAPIRef.EkContentRef.CanIv2_0(wireframe.Template.MasterLayoutID, "content");
                                    if (permissions.Contains("CanIApprove") && System.Convert.ToBoolean(permissions["CanIApprove"]))
                                    {
                                        ContentAPIRef.EkContentRef.TakeOwnership(wireframe.Template.MasterLayoutID);
                                    }
                                }
                                if (status == "S")
                                {
                                    ContentAPIRef.EkContentRef.CheckContentOutv2_0(wireframe.Template.MasterLayoutID);
                                }
                                status = (string)(this.ContentAPIRef.EkContentRef.GetContentStatev2_0(wireframe.Template.MasterLayoutID)["ContentStatus"]);
                                if (status == "O")
                                {
                                    ContentAPIRef.EkContentRef.CheckIn(wireframe.Template.MasterLayoutID, "");
                                }
                                Ektron.Cms.Content.Behaviors.DeleteContentBehavior deletebehavior = new Ektron.Cms.Content.Behaviors.DeleteContentBehavior(ContentAPIRef.RequestInformationRef);
                                deletebehavior.Delete(wireframe.Template.MasterLayoutID, null);
                                ContentAPIRef.ContentLanguage = tempLang;
                                //if content exists and status is now M then show tell user that layout has been marked for delete
                                if (!messageadded)
                                {
                                    Collection cont = ContentAPIRef.EkContentRef.GetContentByIDv2_0(wireframe.Template.MasterLayoutID);
                                    if (cont.Contains("ContentStatus"))
                                    {
                                        if ((string)cont["ContentStatus"] == "M")
                                        {
                                            str.Append("Template <i>" + wireframe.Template.FileName + "</i> is a Master Layout and has been marked for delete. When an approver approves this delete it will be removed from the templates list.");
                                            messageadded = true;
                                        }
                                    }
                                }
                            }
                        }
                    }
                    else
                    {
                        wireframeModel.Remove(wireframe.ID);
                        Response.Redirect("template_config.aspx", false);
                    }
                }
                try
                {
                    m_refContentApi.EkContentRef.PurgeTemplate(template_id);
                }
                catch (Exception ex)
                {
                    string _error = ex.Message;
                }
                if (!messageadded)
                {
                    Response.Redirect("template_config.aspx", false);
                }
            }
            else
            {
                LocalizationAPI objLocalizationApi = new LocalizationAPI();
                str.Append(m_refMsg.GetMessage("lbl content with") + " " + "\'<i>" + m_refContentApi.EkContentRef.GetTemplateNameByID(template_id) + "</i>\'" + " " + m_refMsg.GetMessage("lbl as a template") + ":");
                str.Append("<div class=\"ektronTopSpace\"></div>");
                str.Append("<table width=\"100%\" class=\"ektronGrid ektronBorder\">");
                str.Append("<tbody>");
                str.Append("<tr class=\"title-header\">");
                str.Append("<th width=\"70%\" align=\"center\">Title</th>");
                str.Append("<th width=\"15%\" align=\"center\">ID</th>");
                str.Append("<th width=\"15%\" align=\"center\">Language</th>");
                str.Append("</tr>");
                int i = 0;

                foreach (Collection col in contentBlockInfo)
                {
                    str.Append("<tr>");
                    m_refContentApi.ContentLanguage = Convert.ToInt32(col["language_id"]);
                    ContentData content_data = m_refContentApi.EkContentRef.GetContentById(Convert.ToInt64(col["content_id"]), Ektron.Cms.Content.EkContent.ContentResultType.Published);
                    str.Append("<td>" + content_data.Title + "</td>");
                    str.Append("<td align=\"center\">" + content_data.Id + "</td>");
                    str.Append("<td align=\"center\"><img src=\"" + objLocalizationApi.GetFlagUrlByLanguageID(content_data.LanguageId) + "\" /></td>");
                    str.Append("</tr>");
                    i++;
                }
                str.Append("</tbody>");
                str.Append("</table>");

                if (wireframe == null || wireframe.Template.SubType != Ektron.Cms.Common.EkEnumeration.TemplateSubType.MasterLayout)
                {
                    str.Append("<div class=\"ektronTopSpace\"></div>");
                    str.Append(m_refMsg.GetMessage("alert msg del template"));
                    str.Append(" <input type=\"submit\" id=\"deleteTemplate\" name=\"deleteTemplate\" value=\"Delete\" />&nbsp;&nbsp;");
                    str.Append("<input type=\"button\" id=\"cancelDelete\" name=\"cancelDelete\" value=\"Cancel\" onclick=\"window.location.replace(\'template_config.aspx\')\" />");
                }
                else
                {
                    str.Append("<div class=\"ektronTopSpace\"></div>");
                    str.Append(m_refMsg.GetMessage("alert msg set layout") + " " + "\'<i>" + wireframe.Template.FileName + "</i>\'.");
                }
            }
        }
        str.Append("</div>");
        MainBody.Text = str.ToString();
    }
Пример #11
0
    public string GetGroupTags()
    {
        string returnValue;
        System.Text.StringBuilder result = new System.Text.StringBuilder();
        TagData[] tdaGroup = (TagData[])Array.CreateInstance(typeof(TagData), 0);
        TagData[] tdaGroupDefault = (TagData[])Array.CreateInstance(typeof(TagData), 0);
        TagData td;
        Hashtable htTagsAssignedToGroup = new Hashtable();
        Hashtable htDefTagsAssignedToGroup = new Hashtable();
        try
        {

            error_TagsCantBeBlank.Text = m_refMsg.GetMessage("msg error Blank Tag");
            error_InvalidChars.Text = m_refMsg.GetMessage("msg error Tag invalid chars");

            result.Append("<div id=\"newTagNameDiv\" class=\"ektronWindow ektronModalStandard\">");
            result.Append("<div class=\"ektronModalHeader\">");
            result.Append("     <h3>");
            result.Append("         <span class=\"headerText\">" + m_refMsg.GetMessage("btn add personal tag") + "</span>");
            result.Append("         <a id=\"closeDialogLink3\" class=\"ektronModalClose\" href=\"#\" onclick=\"CancelSaveNewGroupTag();\"></a>");
            result.Append("     </h3>");
            result.Append("</div>");
            result.Append("<div class=\"ektronModalBody\">");
            result.Append(" <label class=\"nameWidth\">" + GetMessage("name label") + "</label>&#160;<input type=\"text\" id=\"newTagName\" value=\"\" size=\"20\" />");
            result.Append("<div class=\"ektronTopSpace\"/>");

            if (IsSiteMultilingual)
            {
                result.Append("<div class=\"ektronTopSpace\">");
            }
            else
            {
                result.Append("<div style=\"display:none;\" >");
            }
            result.Append(" <label class=\"nameWidth\">" + GetMessage("res_lngsel_lbl") + "</label>&#160;" + GetLanguageDropDownMarkup("TagLanguage"));
            result.Append("</div><br />");

            if (this.m_iID > 0)
            {
                tdaGroup = m_refTagsApi.GetTagsForObject(this.m_iID, EkEnumeration.CMSObjectTypes.CommunityGroup, -1);
            }
            StringBuilder appliedTagIds = new StringBuilder();
            if (tdaGroup != null)
            {
                foreach (TagData tempLoopVar_td in tdaGroup)
                {
                    td = tempLoopVar_td;
                    htTagsAssignedToGroup.Add(td.Id, td);
                    appliedTagIds.Append(td.Id.ToString() + ",");
                    //sAppliedTags = sAppliedTags & td.Id & ";"
                }
            }

            result.Append("<div class=\"ektronTopSpace\">");
            result.Append(" <ul class=\"buttonWrapper ui-helper-clearfix\">");
            result.Append("     <li>");
            result.Append("         <a class=\"button buttonInline redHover buttonClear\" type=\"button\" value=\"" + GetMessage("btn cancel") + "\" title=\"" + GetMessage("btn cancel") + "\" onclick=\"CancelSaveNewGroupTag();\">" + GetMessage("btn cancel") + "</a>");
            result.Append("     </li>");
            result.Append("     <li>");
            result.Append("         <a class=\"button buttonInline greenHover buttonUpdate\" type=\"button\" value=\"" + GetMessage("btn save") + "\" title=\"" + GetMessage("btn save") + "\" onclick=\"SaveNewGroupTag();\">" + GetMessage("btn save") + "</a> ");
            result.Append("     </li>");
            result.Append(" </ul>");
            result.Append("</div>");

            //create hidden list of current tags so we know to delete removed ones.
            result.Append("<input type=\"hidden\" id=\"currentTags\" name=\"currentTags\" value=\"" + appliedTagIds.ToString() + "\"  />");
            //hidden variable for capturing new tags
            result.Append("<input type=\"hidden\" id=\"newTagNameHdn\" name=\"newTagNameHdn\" />");

            result.Append("</div>");
            result.Append("</div>");
            result.Append("</div>");

            result.Append("<div id=\"newTagNameScrollingDiv\" class=\"ektronBorder\">");

            if (true)
            {
                tdaGroupDefault = m_refTagsApi.GetDefaultTags(EkEnumeration.CMSObjectTypes.CommunityGroup, -1);
                //create hidden list of current tags so we know to delete removed ones.
                result.Append("<input type=\"hidden\" id=\"currentTags\" name=\"currentTags\" value=\"" + appliedTagIds.ToString() + "\"  />");

                LocalizationAPI localizationApi = new LocalizationAPI();

                foreach (LanguageData lang in languageDataArray)
                {
                    //create hidden list of current tags so we know to delete removed ones.
                    result.Append("<input type=\"hidden\" id=\"flag_" + lang.Id + ("\"  value=\"" + localizationApi.GetFlagUrlByLanguageID(lang.Id) + "\"  />"));
                }

                if (tdaGroupDefault != null)
                {
                    foreach (TagData tempLoopVar_td in tdaGroupDefault)
                    {
                        td = tempLoopVar_td;
                        bool bCheck = false;
                        if (htTagsAssignedToGroup.ContainsKey(td.Id))
                        {
                            bCheck = true;
                            htDefTagsAssignedToGroup.Add(td.Id, td);
                        }
                        result.Append("<input type=\"checkbox\" " + (bCheck ? "checked=\"checked\"" : "") + (" id=\"userPTagsCbx_" + td.Id.ToString() + "\" name=\"userPTagsCbx_" + td.Id.ToString() + "\" onclick=\"ToggleCustomPTagsCbx(this, \'" + td.Text.Replace("\'", "\\\'") + "\');\" />&#160;"));
                        result.Append("<img src=\'" + localizationApi.GetFlagUrlByLanguageID(td.LanguageId) + "\' />");
                        result.Append("&#160;" + td.Text + "<br />");
                    }
                }
                if (tdaGroup != null)
                {
                    foreach (TagData tempLoopVar_td in tdaGroup)
                    {
                        td = tempLoopVar_td;
                        if (!htDefTagsAssignedToGroup.ContainsKey(td.Id))
                        {
                            result.Append("<input type=\"checkbox\" checked=\"checked\" id=\"userPTagsCbx_" + td.Id.ToString() + "\" name=\"userPTagsCbx_" + td.Id.ToString() + "\" onclick=\"ToggleCustomPTagsCbx(this, \'" + td.Text.Replace("\'", "\\\'") + "\');\");\' />&#160;");
                            result.Append("<img src=\'" + localizationApi.GetFlagUrlByLanguageID(td.LanguageId) + "\' />");
                            result.Append("&#160;" + td.Text + "<br />");
                        }
                    }
                }
            }

            result.Append("<div id=\"newAddedTagNamesDiv\"></div>");

            result.Append("</div>");

            result.Append("<div style=\"float:left;\">");
            result.Append("     <a class=\"button buttonLeft greenHover buttonAddTagWithText\" href=\"javascript:ShowAddGroupTagArea();\" title=\"" + GetMessage("alt add btn text (group tag)") + "\">");
            result.Append("" + GetMessage("btn add personal tag") + "</a>");
            result.Append("</div>");

        }
        catch (Exception)
        {
        }
        finally
        {
            returnValue = result.ToString();
            tdaGroup = null;
            td = null;
            htTagsAssignedToGroup = null;
            htDefTagsAssignedToGroup = null;
        }
        return returnValue;
    }
Пример #12
0
    private void DisplayGrid()
    {
        System.Collections.Generic.List<CmsMessageData> NotificationMessageList;
        PagingInfo page;
        CmsMessageCriteria criteria = new CmsMessageCriteria();
        LocalizationAPI objLocalizationApi = new LocalizationAPI();
        LanguageData[] languageData = _refSiteAPI.GetAllActiveLanguages();
        string strSelectedLanguageName = "";
        string strName;

        Toolbar("viewnotificationmsggrid", 0);
        AddNewMessage.Visible = false;

        page = new PagingInfo();
        page.CurrentPage = _currentPageNumber;
        criteria.PagingInfo = page;
        criteria.PagingInfo.RecordsPerPage = _refContentApi.RequestInformationRef.PagingSize;

        string[] scopes = new string[] { "UserActivity", "GroupActivity", "Notifications" };
        criteria.AddFilter(CmsMessageProperty.MessageTypeScope, CriteriaFilterOperator.In, scopes);
        criteria.AddFilter(CmsMessageProperty.LanguageId, CriteriaFilterOperator.EqualTo, _refContentApi.GetCookieValue("LastValidLanguageID"));
        criteria.AddFilter(CmsMessageProperty.SiteId, CriteriaFilterOperator.EqualTo, _siteId);

        AddNewMessage.Visible = false;
        NotificationMessageList = _NotificationMessageApi.GetList(criteria);
        TotalPagesNumber = page.TotalPages;
        PageSettings();

        if (NotificationMessageList != null)
        {
            ViewMessageGrid.Columns.Add(_refStyle.CreateBoundField("TITLE", "" + msgHelper.GetMessage("event title") + "", "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(20), Unit.Percentage(20), false, false));
            ViewMessageGrid.Columns.Add(_refStyle.CreateBoundField("ID", "" + msgHelper.GetMessage("generic subscriptionid") + "", "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(5), Unit.Percentage(5), false, false));
            ViewMessageGrid.Columns.Add(_refStyle.CreateBoundField("TYPE", "" + msgHelper.GetMessage("generic Type") + "", "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(9), Unit.Percentage(9), false, false));
            ViewMessageGrid.Columns.Add(_refStyle.CreateBoundField("SUBTYPE", "" + msgHelper.GetMessage("generic subtype") + "", "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(11), Unit.Percentage(11), false, false));
            ViewMessageGrid.Columns.Add(_refStyle.CreateBoundField("LANGUAGE", "" + msgHelper.GetMessage("lbl language") + "", "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(5), Unit.Percentage(5), false, false));
            ViewMessageGrid.Columns.Add(_refStyle.CreateBoundField("DEFAULT", "" + msgHelper.GetMessage("lbl default") + "", "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(2), Unit.Percentage(2), false, false));

            DataTable dt = new DataTable();
            DataRow dr;
            dt.Columns.Add(new DataColumn("TITLE", typeof(string)));
            dt.Columns.Add(new DataColumn("ID", typeof(string)));
            dt.Columns.Add(new DataColumn("TYPE", typeof(string)));
            dt.Columns.Add(new DataColumn("SUBTYPE", typeof(string)));
            dt.Columns.Add(new DataColumn("LANGUAGE", typeof(string)));
            dt.Columns.Add(new DataColumn("DEFAULT", typeof(string)));
            for (int i = 0; i <= NotificationMessageList.Count - 1; i++)
            {
                dr = dt.NewRow();
                dr["TITLE"] = "<a href=\"notificationmessages.aspx?mode=viewnotificationmsg&id=" + NotificationMessageList[i].Id + "&LangType=" + _refContentApi.GetCookieValue("LastValidLanguageID") + "&siteId=" + _siteId.ToString() + "\">" + NotificationMessageList[i].Title + "</a>";
                dr["ID"] = NotificationMessageList[i].Id;
                dr["TYPE"] = NotificationMessageList[i].MessageType.Scope;
                dr["SUBTYPE"] = NotificationMessageList[i].MessageType.Name;
                for (int iLang = 0; iLang <= languageData.Length - 1; iLang++)
                {
                    strName = languageData[iLang].LocalName;
                    if (NotificationMessageList[i].LanguageId == languageData[iLang].Id)
                    {
                        strSelectedLanguageName = strName;
                    }
                }
                dr["LANGUAGE"] = "<center><img src=" + objLocalizationApi.GetFlagUrlByLanguageID(System.Convert.ToInt32(NotificationMessageList[i].LanguageId)) + " alt=\"" + strSelectedLanguageName + "\" title=\"" + strSelectedLanguageName + "\" /></center>";
                if (NotificationMessageList[i].IsDefaultMessage)
                {
                    dr["DEFAULT"] = "<img src=\"" + _refCommonApi.AppPath + "images/UI/Icons/check.png\" alt=\"Default Message\"/>";
                }
                dt.Rows.Add(dr);
            }
            DataView dv = new DataView(dt);
            ViewMessageGrid.DataSource = dv;
            ViewMessageGrid.DataBind();
        }
    }
Пример #13
0
    protected ICollection CreateMsgData()
    {
        ICollection returnValue;
            DataTable dt = new DataTable();
            DataRow dr;
            int totalTags = 0;
            TagData[] tags;
            LocalizationAPI localizationApi = new LocalizationAPI();

            try
            {
                // header:
                dt.Columns.Add(new DataColumn("fId", typeof(string))); // 0
                dt.Columns.Add(new DataColumn("fName", typeof(string))); // 1
                dt.Columns.Add(new DataColumn("fTotal", typeof(string))); // 3
                dt.Columns.Add(new DataColumn("fLanguage", typeof(string))); // 4

                // data:
                TagRequestData request = new TagRequestData();
                request.PageSize = m_containerPage.RefCommonAPI.RequestInformationRef.PagingSize;
                request.PageIndex = m_intCurrentPage;
                request.LanguageId = m_containerPage.ContentLanguage;
                request.OrderByDirection = m_sortOrder == "asc" ? EkEnumeration.OrderByDirection.Ascending : EkEnumeration.OrderByDirection.Descending;
                request.OrderBy = m_sortOrderBy;
                tags = m_tagApi.GetAllTags(request, ref totalTags);

                //get totalpages
                m_intTotalPages = totalTags / m_containerPage.RefCommonAPI.RequestInformationRef.PagingSize;
                if (m_intTotalPages * m_containerPage.RefCommonAPI.RequestInformationRef.PagingSize < totalTags)
                {
                    m_intTotalPages++;
                }

                foreach (TagData tag in tags)
                {
                    dr = dt.NewRow();
                    dr[0] = tag.Id.ToString();
                    dr[1] = "<a href=\"?action=viewtag&id=" + tag.Id.ToString() + "\" title=\"" + m_containerPage.RefMsg.GetMessage("btn click to view tag") + "\" target=\"_self\" >" + tag.Text + "</a>";
                    dr[2] = tag.TotalUsedCount.ToString();
                    dr[3] = "<img src=\'" + localizationApi.GetFlagUrlByLanguageID(tag.LanguageId) + "\' border=\"0\" />";
                    dt.Rows.Add(dr);
                }

            }
            catch (Exception)
            {
            }
            finally
            {
                returnValue = new DataView(dt);
            }
            return returnValue;
    }