Beispiel #1
0
 private void AppendLinks(StringBuilder leftMenu, NavItem item, string currentPageId)
 {
     foreach (NavPageLink current in item.PageLinks.Values)
     {
         string text = (!string.IsNullOrEmpty(currentPageId) && currentPageId == current.ID) ? (current.Class + " active") : current.Class;
         leftMenu.Append("<li");
         if (!string.IsNullOrEmpty(text))
         {
             leftMenu.AppendFormat(" class=\"{0}\"", text);
         }
         if (!string.IsNullOrEmpty(current.Style))
         {
             leftMenu.AppendFormat(" style=\"{0}\"", current.Style);
         }
         leftMenu.AppendFormat("><a href=\"{0}\" title=\"{1}\"", current.Link, current.Title);
         if (!string.IsNullOrEmpty(current.Target))
         {
             leftMenu.AppendFormat(" target=\"{0}\"", current.Target);
         }
         leftMenu.AppendFormat(">{0}</a></li>", current.Title).AppendLine();
     }
 }
Beispiel #2
0
 private void AppendLinks(StringBuilder leftMenu, NavItem item, string currentPageId)
 {
     foreach (NavPageLink link in item.PageLinks.Values)
     {
         string str = (!string.IsNullOrEmpty(currentPageId) && (currentPageId == link.ID)) ? (link.Class + " active") : link.Class;
         leftMenu.Append("<li");
         if (!string.IsNullOrEmpty(str))
         {
             leftMenu.AppendFormat(" class=\"{0}\"", str);
         }
         if (!string.IsNullOrEmpty(link.Style))
         {
             leftMenu.AppendFormat(" style=\"{0}\"", link.Style);
         }
         leftMenu.AppendFormat("><a href=\"{0}\" title=\"{1}\"", link.Link, link.Title);
         if (!string.IsNullOrEmpty(link.Target))
         {
             leftMenu.AppendFormat(" target=\"{0}\"", link.Target);
         }
         leftMenu.AppendFormat(">{0}</a></li>", link.Title).AppendLine();
     }
 }
Beispiel #3
0
        private void LoadPageLinks(NavItem item, XmlNode itemNode)
        {
            XmlNodeList xmlNodeList = itemNode.SelectNodes("PageLink");

            if (xmlNodeList != null && xmlNodeList.Count != 0)
            {
                foreach (XmlNode xmlNode in xmlNodeList)
                {
                    NavPageLink navPageLink = new NavPageLink
                    {
                        ID    = xmlNode.Attributes["ID"].Value,
                        Title = xmlNode.Attributes["Title"].Value
                    };
                    XmlAttribute xmlAttribute = xmlNode.Attributes["Link"];
                    if (xmlAttribute != null)
                    {
                        navPageLink.Link = (xmlAttribute.Value.StartsWith("http") ? xmlAttribute.Value : (Globals.ApplicationPath + "/Admin/" + xmlAttribute.Value));
                    }
                    XmlAttribute xmlAttribute2 = xmlNode.Attributes["Class"];
                    if (xmlAttribute2 != null)
                    {
                        navPageLink.Class = xmlAttribute2.Value;
                    }
                    XmlAttribute xmlAttribute3 = xmlNode.Attributes["Style"];
                    if (xmlAttribute3 != null)
                    {
                        navPageLink.Style = xmlAttribute3.Value;
                    }
                    XmlAttribute xmlAttribute4 = xmlNode.Attributes["Target"];
                    if (xmlAttribute4 != null)
                    {
                        navPageLink.Target = xmlAttribute4.Value;
                    }
                    item.PageLinks.Add(navPageLink.ID, navPageLink);
                }
            }
        }
Beispiel #4
0
        private void LoadPageLinks(NavItem item, XmlNode itemNode)
        {
            XmlNodeList list = itemNode.SelectNodes("PageLink");

            if ((list != null) && (list.Count != 0))
            {
                foreach (XmlNode node in list)
                {
                    NavPageLink link = new NavPageLink {
                        ID    = node.Attributes["ID"].Value,
                        Title = node.Attributes["Title"].Value
                    };
                    XmlAttribute attribute = node.Attributes["Link"];
                    if (attribute != null)
                    {
                        link.Link = attribute.Value.StartsWith("http") ? attribute.Value : (Globals.ApplicationPath + "/Admin/" + attribute.Value);
                    }
                    XmlAttribute attribute2 = node.Attributes["Class"];
                    if (attribute2 != null)
                    {
                        link.Class = attribute2.Value;
                    }
                    XmlAttribute attribute3 = node.Attributes["Style"];
                    if (attribute3 != null)
                    {
                        link.Style = attribute3.Value;
                    }
                    XmlAttribute attribute4 = node.Attributes["Target"];
                    if (attribute4 != null)
                    {
                        link.Target = attribute4.Value;
                    }
                    item.PageLinks.Add(link.ID, link);
                }
            }
        }