コード例 #1
0
        /// <summary> Finds the home page source file and banner images or html for this item aggregation </summary>
        /// <param name="thisObject"> Item aggregation to add the home page link and banner html </param>
        /// <remarks>This method is only called if the item aggregation does not have an existing XML configuration file. </remarks>
        protected static void Add_HTML(Item_Aggregation thisObject)
        {
            // Just use the standard home text
            if (File.Exists(SobekCM_Library_Settings.Base_Design_Location + thisObject.objDirectory + "html/home/text.html"))
            {
                thisObject.Add_Home_Page_File("html/home/text.html", SobekCM_Library_Settings.Default_UI_Language);
            }
            if (File.Exists(SobekCM_Library_Settings.Base_Design_Location + thisObject.objDirectory + "html/home/text_en.html"))
            {
                thisObject.Add_Home_Page_File("html/home/text_en.html", Web_Language_Enum.English);
            }
            if (File.Exists(SobekCM_Library_Settings.Base_Design_Location + thisObject.objDirectory + "html/home/text_fr.html"))
            {
                thisObject.Add_Home_Page_File("html/home/text_fr.html", Web_Language_Enum.French);
            }
            if (File.Exists(SobekCM_Library_Settings.Base_Design_Location + thisObject.objDirectory + "html/home/text_es.html"))
            {
                thisObject.Add_Home_Page_File("html/home/text_es.html", Web_Language_Enum.Spanish);
            }
            if (File.Exists(SobekCM_Library_Settings.Base_Design_Location + thisObject.objDirectory + "html/home/text_sp.html"))
            {
                thisObject.Add_Home_Page_File("html/home/text_sp.html", Web_Language_Enum.Spanish);
            }

            // Just use the standard banner image
            if (File.Exists(SobekCM_Library_Settings.Base_Design_Location + thisObject.objDirectory + "images/banners/coll.jpg"))
            {
                thisObject.Add_Banner_Image("images/banners/coll.jpg", SobekCM_Library_Settings.Default_UI_Language);
            }
            if (File.Exists(SobekCM_Library_Settings.Base_Design_Location + thisObject.objDirectory + "images/banners/coll_en.jpg"))
            {
                thisObject.Add_Banner_Image("images/banners/coll_en.jpg", Web_Language_Enum.English);
            }
            if (File.Exists(SobekCM_Library_Settings.Base_Design_Location + thisObject.objDirectory + "images/banners/coll_fr.jpg"))
            {
                thisObject.Add_Banner_Image("images/banners/coll_fr.jpg", Web_Language_Enum.French);
            }
            if (File.Exists(SobekCM_Library_Settings.Base_Design_Location + thisObject.objDirectory + "images/banners/coll_es.jpg"))
            {
                thisObject.Add_Banner_Image("images/banners/coll_es.jpg", Web_Language_Enum.Spanish);
            }
            if (File.Exists(SobekCM_Library_Settings.Base_Design_Location + thisObject.objDirectory + "images/banners/coll_sp.jpg"))
            {
                thisObject.Add_Banner_Image("images/banners/coll_sp.jpg", Web_Language_Enum.Spanish);
            }
        }
コード例 #2
0
        private static void read_home(XmlNodeReader NodeReader, Item_Aggregation HierarchyObject)
        {
            while (NodeReader.Read())
            {
                // If this is the beginning tag for an element, assign the next values accordingly
                if (NodeReader.NodeType == XmlNodeType.Element)
                {
                    // Get the node name, trimmed and to upper
                    string nodeName = NodeReader.Name.Trim().ToUpper();

                    // switch the rest based on the tag name
                    switch (nodeName)
                    {
                    case "HI:BODY":
                        if ((NodeReader.HasAttributes) && (NodeReader.MoveToAttribute("lang")))
                        {
                            string bodyLanguage = NodeReader.GetAttribute("lang");
                            NodeReader.Read();
                            HierarchyObject.Add_Home_Page_File(NodeReader.Value, Web_Language_Enum_Converter.Code_To_Enum(bodyLanguage));
                        }
                        else
                        {
                            NodeReader.Read();
                            HierarchyObject.Add_Home_Page_File(NodeReader.Value, Web_Language_Enum.DEFAULT);
                        }

                        break;
                    }
                }

                if ((NodeReader.NodeType == XmlNodeType.EndElement) && (NodeReader.Name.Trim().ToUpper() == "HI:HOME"))
                {
                    return;
                }
            }
        }