Ejemplo n.º 1
0
        public static System.Collections.Generic.List <MLNewsGroupInfo> GetNewsGroupsAsListe(int PortalId, string Locale, bool FromCache)
        {
            System.Collections.Generic.Dictionary <string, StringInfo> dic = effority.Ealo.Controller.GetStringsByQualifier(GroupQualifier, Locale, FromCache);
            NewsGroupController groupController = new NewsGroupController();

            System.Collections.Generic.Dictionary <string, NewsGroupInfo> groupDic  = groupController.GetNewsGroupsByPortal(PortalId);
            System.Collections.Generic.List <MLNewsGroupInfo>             neueListe = new System.Collections.Generic.List <MLNewsGroupInfo>();

            foreach (NewsGroupInfo info in groupDic.Values)
            {
                StringInfo      localizedGroupName = null;
                MLNewsGroupInfo MLGroupInfo        = new MLNewsGroupInfo(info);
                if (dic.TryGetValue(info.NewsGroupID, out localizedGroupName))
                {
                    if (!string.IsNullOrEmpty(localizedGroupName.StringText))
                    {
                        localizedGroupName.FallBack       = MLGroupInfo.NewsGroupName;
                        localizedGroupName.FallbackIsNull = false;
                        MLGroupInfo.MLGroupName           = localizedGroupName;
                    }
                }
                neueListe.Add(MLGroupInfo);
            }
            return(neueListe);
        }
        public XmlDocument MLLoadTreeXML(string editFormatUrl, bool ismenu, int PortalID, int source, string codes, string Locale)
        {
            DataTable dt = null;

            if (source == 0)
            {
                dt = LoadTree(ismenu, PortalID);
            }
            else if (source == 1)
            {
                dt = LoadTreeByCode(ismenu, PortalID, codes);
            }

            XmlDocument doc = new XmlDocument();

            doc.LoadXml("<newsgroups></newsgroups>");
            XmlElement root = doc.DocumentElement;

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                XmlElement NewsGroup = doc.CreateElement("newsgroup");
                int        tabid     = Convert.ToInt32(dt.Rows[i]["DesktopListID"]);
                string     link      = DotNetNuke.Common.Globals.NavigateURL(tabid, "", "newsgroupid/" + dt.Rows[i]["NewsGroupID"].ToString());
                string     url_edit  = editFormatUrl.Replace("@@groupid", dt.Rows[i]["NewsGroupID"].ToString());
                DotNetNuke.NewsProvider.Utils.AddNode(doc, NewsGroup, "Img", DotNetNuke.Common.Globals.ApplicationPath + "/images/action_right.gif");
                DotNetNuke.NewsProvider.Utils.AddNode(doc, NewsGroup, "ImgLevel2", DotNetNuke.Common.Globals.ApplicationPath + "/images/edit.gif");
                DotNetNuke.NewsProvider.Utils.AddNode(doc, NewsGroup, "OrderNumber", dt.Rows[i]["OrderNumber"].ToString());

                MLNewsGroupInfo fMLGroup = MLNewsGroupController.GetNewsGroup(dt.Rows[i]["NewsGroupID"].ToString(), Locale, false);
                if (fMLGroup != null)
                {
                    if (fMLGroup.MLGroupName != null)
                    {
                        DotNetNuke.NewsProvider.Utils.AddNode(doc, NewsGroup, "NewsGroupName", fMLGroup.MLGroupName.StringTextOrFallBack);
                    }
                    else
                    {
                        DotNetNuke.NewsProvider.Utils.AddNode(doc, NewsGroup, "NewsGroupName", fMLGroup.NewsGroupName);
                    }
                }
                else
                {
                    DotNetNuke.NewsProvider.Utils.AddNode(doc, NewsGroup, "NewsGroupName", dt.Rows[i]["NewsGroupName"].ToString());
                }
                DotNetNuke.NewsProvider.Utils.AddNode(doc, NewsGroup, "NewsGroupCode", dt.Rows[i]["NewsGroupCode"].ToString());
                DotNetNuke.NewsProvider.Utils.AddNode(doc, NewsGroup, "PortalID", dt.Rows[i]["PortalID"].ToString());
                DotNetNuke.NewsProvider.Utils.AddNode(doc, NewsGroup, "link", link);
                DotNetNuke.NewsProvider.Utils.AddNode(doc, NewsGroup, "url_edit", url_edit);
                if (i % 2 == 1)
                {
                    DotNetNuke.NewsProvider.Utils.AddNode(doc, NewsGroup, "odd", "true");
                }
                root.AppendChild(NewsGroup);
            }
            return(doc);
        }
Ejemplo n.º 3
0
 public static List <MLNewsGroupInfo> LocalizedNewsGroupList(List <NewsGroupInfo> NewsGroups, string Locale, bool FromCache)
 {
     System.Collections.Generic.Dictionary <string, StringInfo> dic       = effority.Ealo.Controller.GetStringsByQualifier(GroupQualifier, Locale, FromCache);
     System.Collections.Generic.List <MLNewsGroupInfo>          neueListe = new System.Collections.Generic.List <MLNewsGroupInfo>();
     foreach (NewsGroupInfo info in NewsGroups)
     {
         StringInfo      localizedGroupName = null;
         MLNewsGroupInfo MLGroupInfo        = new MLNewsGroupInfo(info);
         if (dic.TryGetValue(info.NewsGroupID, out localizedGroupName))
         {
             MLGroupInfo.MLGroupName = localizedGroupName;
         }
         neueListe.Add(MLGroupInfo);
     }
     return(neueListe);
 }
        public DataTable LoadTreeForMenu(int PortalID, int source, string codes, string Locale)
        {
            DataTable dt = null;

            if (source == 0)
            {
                dt = LoadTree(true, PortalID);
            }
            else if (source == 1)
            {
                dt = LoadTreeByCode(true, PortalID, codes);
            }
            dt.Columns.Add(new DataColumn("Name", typeof(string)));
            dt.Columns.Add(new DataColumn("Link", typeof(string)));
            dt.Columns.Add(new DataColumn("Level", typeof(int)));
            dt.Columns.Add(new DataColumn("Target", typeof(string)));
            dt.Columns.Add(new DataColumn("Image", typeof(string)));

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                dt.Rows[i]["Target"] = "_self";
                dt.Rows[i]["Image"]  = "";
                dt.Rows[i]["Level"]  = 1;
                int tabid = Convert.ToInt32(dt.Rows[i]["DesktopListID"]);
                dt.Rows[i]["Link"] = DotNetNuke.Common.Globals.NavigateURL(tabid, "", "newsgroupid/" + dt.Rows[i]["NewsGroupID"].ToString());
                MLNewsGroupInfo fMLNewsGroup = MLNewsGroupController.GetNewsGroup(dt.Rows[i]["NewsGroupID"].ToString(), Locale, false);
                if (fMLNewsGroup != null)
                {
                    if (fMLNewsGroup.MLGroupName != null)
                    {
                        dt.Rows[i]["Name"] = fMLNewsGroup.MLGroupName.StringText;
                    }
                    else
                    {
                        dt.Rows[i]["Name"] = fMLNewsGroup.NewsGroupName;
                    }
                }
                else
                {
                    dt.Rows[i]["Name"] = dt.Rows[i]["NewsGroupName"].ToString();
                }
            }
            return(dt);
        }
Ejemplo n.º 5
0
        protected void repGroups_ItemDataBound(object sender, System.Web.UI.WebControls.RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                MLNewsGroupInfo groupInfo    = (MLNewsGroupInfo)e.Item.DataItem;
                Label           lblGroupName = (Label)e.Item.FindControl("lblGroupName");
                TextBox         txtGroupName = (TextBox)e.Item.FindControl("txtGroupName");
                HiddenField     groupId      = (HiddenField)e.Item.FindControl("GroupId");

                if (lblGroupName != null)
                {
                    lblGroupName.Text = groupInfo.NewsGroupName;
                }

                bool GroupNameTranslated = false;
                if (groupInfo.MLGroupName != null)
                {
                    GroupNameTranslated = !groupInfo.MLGroupName.StringTextIsNull;
                }
                else
                {
                    GroupNameTranslated = false;
                }

                if (!GroupNameTranslated)
                {
                    txtGroupName.Style.Add("border-color", "Red");
                    txtGroupName.ToolTip = Localization.GetString("notTranslated", this.LocalResourceFile);
                }

                if (txtGroupName != null && groupInfo.MLGroupName != null)
                {
                    txtGroupName.Text = groupInfo.MLGroupName.StringText;
                }

                if (groupId != null)
                {
                    groupId.Value = groupInfo.NewsGroupID;
                }
            }
        }
Ejemplo n.º 6
0
        public static MLNewsGroupInfo GetNewsGroup(string groupID, string Locale, bool FromCache)
        {
            StringInfo          GroupName    = effority.Ealo.Controller.GetStringByQualifierAndStringName(GroupQualifier, groupID, Locale, FromCache);
            MLNewsGroupInfo     fMLGroupInfo = null;
            NewsGroupController groupCont    = new NewsGroupController();
            NewsGroupInfo       groupInfo    = groupCont.Load(groupID);

            fMLGroupInfo = new MLNewsGroupInfo(groupInfo);
            if (GroupName != null)
            {
                if (!String.IsNullOrEmpty(GroupName.StringText))
                {
                    fMLGroupInfo.MLGroupName = GroupName;
                }
            }
            //if (GroupName != null && String.IsNullOrEmpty(GroupName.StringText))
            //{
            //    GroupName.StringText = groupInfo.NewsGroupName;
            //}
            //fMLGroupInfo.MLGroupName = GroupName;
            return(fMLGroupInfo);
        }