void LoadCatalog()
{
int CatalogValue = -1;
if (base.ContainerValue > 0)
{
CatalogValue = base.ContainerValue;
}
else
{
if (!string.IsNullOrEmpty(CMSConfig.QueryString.CatalogID))
{
int.TryParse(Request.QueryString[CMSConfig.QueryString.CatalogID], out CatalogValue);
}
}
if (base.XSLTemplateID > 0)
{
string catalogPath = CMSWebHelper.GetCatalogPath();
catalogPath = CatalogManager.GetCatalogXMLPath(catalogPath, CMSContext.PortalID, CMSContext.LanguageID);
string xslPath = CMSWebHelper.GetXSLTemplateFilePath(base.XSLTemplateID);
xslPath = XSLTemplateManager.GetXSLTemplatePath(xslPath, base.XSLTemplateID);
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.Load(catalogPath);
if (xmlDoc.ChildNodes.Count > 1)
{
XmlAttribute xmlAtt = xmlDoc.CreateAttribute("CurrentCatalog");
xmlAtt.Value = CatalogValue.ToString();
xmlDoc.ChildNodes[1].Attributes.Append(xmlAtt);
xmlAtt = xmlDoc.CreateAttribute("LanguageID");
xmlAtt.Value = CMSContext.LanguageID.ToString();
xmlDoc.ChildNodes[1].Attributes.Append(xmlAtt);
}
XsltArgumentList arguments = new XsltArgumentList();
arguments.AddExtensionObject("CMS:UserControl", this);
xmlCatalog.DocumentContent = xmlDoc.OuterXml;
xmlCatalog.TransformSource = xslPath;
xmlCatalog.TransformArgumentList = arguments;
xmlCatalog.DataBind();
}
}
#endregion