//tasks /// <summary> /// Loads deleted tabs and modules into the lists /// </summary> /// <remarks> /// </remarks> /// <history> /// [VMasanas] 18/08/2004 /// [VMasanas] 20/08/2004 Update display information for deleted modules to: /// ModuleFriendlyName: ModuleTitle - Tab: TabName /// </history> private void BindData() { int intTab; ArrayList arrDeletedTabs = new ArrayList(); TabController objTabs = new TabController(); TabInfo objTab; ArrayList arrTabs = objTabs.GetTabs( PortalId ); for( intTab = 0; intTab <= arrTabs.Count - 1; intTab++ ) { objTab = (TabInfo)arrTabs[intTab]; if( objTab.IsDeleted == true ) { arrDeletedTabs.Add( objTab ); } } ModuleController objModules = new ModuleController(); ModuleInfo objModule; int intModule; ArrayList arrDeletedModules = new ArrayList(); ArrayList arrModules = objModules.GetModules( PortalId ); for( intModule = 0; intModule <= arrModules.Count - 1; intModule++ ) { objModule = (ModuleInfo)arrModules[intModule]; if( objModule.IsDeleted == true ) { if( objModule.ModuleTitle == "" ) { objModule.ModuleTitle = objModule.FriendlyName; } arrDeletedModules.Add( objModule ); } } lstTabs.DataSource = arrDeletedTabs; lstTabs.DataBind(); lstModules.DataSource = arrDeletedModules; lstModules.DataBind(); cboTab.DataSource = Globals.GetPortalTabs(PortalSettings.DesktopTabs, -1, false, true, false, false, true); cboTab.DataBind(); }
public override void LoadSettings() { try { if (!Page.IsPostBack) { // Fill Catalog Page combo TabController tabController = new TabController(); ArrayList tabs = tabController.GetTabs(PortalId); cmbCatalogPage.Items.Add(new ListItem(Localization.GetString("SamePage", this.LocalResourceFile), "0")); foreach (TabInfo tabInfo in tabs) { if (tabInfo.IsVisible && !tabInfo.IsDeleted && !tabInfo.IsAdminTab && !tabInfo.IsSuperTab) { cmbCatalogPage.Items.Add(new ListItem(tabInfo.TabName, tabInfo.TabID.ToString())); } } // Get values from settings txtColumnCount.Text = _settings.CategoryMenu.ColumnCount; int catalogTabID = int.Parse(_settings.CategoryMenu.CatalogPage); if (catalogTabID <= 0) { cmbCatalogPage.SelectedIndex = 0; } else { cmbCatalogPage.SelectedValue = catalogTabID.ToString(); } } } catch(Exception ex) { Exceptions.ProcessModuleLoadException(this, ex); } }
/// <summary> /// Serializes all portal Tabs /// </summary> /// <param name="xmlTemplate">Reference to XmlDocument context</param> /// <param name="nodeTabs">Node to add the serialized objects</param> /// <param name="objportal">Portal to serialize</param> /// <param name="hRoles">A hastable with all serialized roles</param> /// <remarks> /// Only portal tabs will be exported to the template, Admin tabs are not exported. /// On each tab, all modules will also be exported. /// </remarks> /// <history> /// [VMasanas] 23/09/2004 Created /// </history> public void SerializeTabs( XmlDocument xmlTemplate, XmlNode nodeTabs, PortalInfo objportal, Hashtable hRoles ) { TabController objtabs = new TabController(); //supporting object to build the tab hierarchy Hashtable hTabs = new Hashtable(); XmlSerializer xserTabs = new XmlSerializer( typeof( TabInfo ) ); foreach( TabInfo objtab in objtabs.GetTabs( objportal.PortalID ) ) { //if not an admin tab & not deleted if( objtab.TabOrder < 10000 && ! objtab.IsDeleted ) { StringWriter sw = new StringWriter(); xserTabs.Serialize( sw, objtab ); XmlDocument xmlTab = new XmlDocument(); xmlTab.LoadXml( sw.GetStringBuilder().ToString() ); XmlNode nodeTab = xmlTab.SelectSingleNode( "tab" ); nodeTab.Attributes.Remove( nodeTab.Attributes["xmlns:xsd"] ); nodeTab.Attributes.Remove( nodeTab.Attributes["xmlns:xsi"] ); XmlNode newnode; if( objtab.TabID == objportal.SplashTabId ) { newnode = xmlTab.CreateElement( "tabtype" ); newnode.InnerXml = "splashtab"; nodeTab.AppendChild( newnode ); } else if( objtab.TabID == objportal.HomeTabId ) { newnode = xmlTab.CreateElement( "tabtype" ); newnode.InnerXml = "hometab"; nodeTab.AppendChild( newnode ); } else if( objtab.TabID == objportal.UserTabId ) { newnode = xmlTab.CreateElement( "tabtype" ); newnode.InnerXml = "usertab"; nodeTab.AppendChild( newnode ); } else if( objtab.TabID == objportal.LoginTabId ) { newnode = xmlTab.CreateElement( "tabtype" ); newnode.InnerXml = "logintab"; nodeTab.AppendChild( newnode ); } if( ! Null.IsNull( objtab.ParentId ) ) { newnode = xmlTab.CreateElement( "parent" ); newnode.InnerXml = Server.HtmlEncode( hTabs[objtab.ParentId].ToString() ); nodeTab.AppendChild( newnode ); // save tab as: ParentTabName/CurrentTabName hTabs.Add( objtab.TabID, hTabs[objtab.ParentId] + "/" + objtab.TabName ); } else { // save tab as: CurrentTabName hTabs.Add( objtab.TabID, objtab.TabName ); } // Serialize modules XmlNode nodePanes; nodePanes = nodeTab.AppendChild( xmlTab.CreateElement( "panes" ) ); ModuleController objmodules = new ModuleController(); DesktopModuleController objDesktopModules = new DesktopModuleController(); ModuleDefinitionController objModuleDefController = new ModuleDefinitionController(); XmlSerializer xserModules = new XmlSerializer( typeof( ModuleInfo ) ); Dictionary<int, ModuleInfo> dict = objmodules.GetTabModules(objtab.TabID); foreach( KeyValuePair<int, ModuleInfo> pair in dict ) { ModuleInfo objmodule = pair.Value; if (!objmodule.IsDeleted) { sw = new StringWriter(); xserModules.Serialize(sw, objmodule); XmlDocument xmlModule = new XmlDocument(); xmlModule.LoadXml(sw.GetStringBuilder().ToString()); XmlNode nodeModule = xmlModule.SelectSingleNode("module"); nodeModule.Attributes.Remove(nodeModule.Attributes["xmlns:xsd"]); nodeModule.Attributes.Remove(nodeModule.Attributes["xmlns:xsi"]); if (nodePanes.SelectSingleNode("descendant::pane[name='" + objmodule.PaneName + "']") == null) { // new pane found XmlNode nodePane = xmlModule.CreateElement("pane"); XmlNode nodeName = nodePane.AppendChild(xmlModule.CreateElement("name")); nodeName.InnerText = objmodule.PaneName; nodePane.AppendChild(xmlModule.CreateElement("modules")); nodePanes.AppendChild(xmlTab.ImportNode(nodePane, true)); } XmlNode nodeModules = nodePanes.SelectSingleNode("descendant::pane[name='" + objmodule.PaneName + "']/modules"); newnode = xmlModule.CreateElement("definition"); ModuleDefinitionInfo objModuleDef = objModuleDefController.GetModuleDefinition(objmodule.ModuleDefID); newnode.InnerText = objDesktopModules.GetDesktopModule(objModuleDef.DesktopModuleID).ModuleName; nodeModule.AppendChild(newnode); //Add Module Definition Info XmlNode nodeDefinition = xmlModule.CreateElement("moduledefinition"); nodeDefinition.InnerText = objModuleDef.FriendlyName; nodeModule.AppendChild(nodeDefinition); if (chkContent.Checked) { AddContent(nodeModule, objmodule); } nodeModules.AppendChild(xmlTab.ImportNode(nodeModule, true)); } } nodeTabs.AppendChild( xmlTemplate.ImportNode( nodeTab, true ) ); } } }
private void loadTabs(string cartPageID) { TabController tabController = new TabController(); ArrayList tabs = tabController.GetTabs(PortalId); foreach (TabInfo tabInfo in tabs) { if (tabInfo.IsVisible && !tabInfo.IsDeleted && !tabInfo.IsAdminTab && !tabInfo.IsSuperTab) { lstShoppingCartPageID.Items.Add(new ListItem(tabInfo.TabName, tabInfo.TabID.ToString())); } } if (cartPageID != string.Empty) { try { lstShoppingCartPageID.SelectedValue = cartPageID; } catch{} } }
public override void LoadSettings() { try { if (!Page.IsPostBack) { if (storeInfo == null) { StoreController storeController = new StoreController(); storeInfo = storeController.GetStoreInfo(PortalId); if (storeInfo.PortalTemplates) { templatesPath = PortalSettings.HomeDirectoryMapPath + "Store\\"; } else { templatesPath = MapPath(ModulePath) + "\\"; } } TabController tabController = new TabController(); ArrayList tabs = tabController.GetTabs(PortalId); lstNPLDetailPage.Items.Add(new ListItem(Localization.GetString("NPLSamePage", this.LocalResourceFile), "0")); lstFPLDetailPage.Items.Add(new ListItem(Localization.GetString("FPLSamePage", this.LocalResourceFile), "0")); lstPPLDetailPage.Items.Add(new ListItem(Localization.GetString("PPLSamePage", this.LocalResourceFile), "0")); lstCPLDetailPage.Items.Add(new ListItem(Localization.GetString("CPLSamePage", this.LocalResourceFile), "0")); lstPDSReturnPage.Items.Add(new ListItem(Localization.GetString("PDSSamePage", this.LocalResourceFile), "0")); foreach (TabInfo tabInfo in tabs) { if (!tabInfo.IsDeleted && !tabInfo.IsAdminTab && !tabInfo.IsSuperTab) { lstNPLDetailPage.Items.Add(new ListItem(tabInfo.TabName, tabInfo.TabID.ToString())); lstFPLDetailPage.Items.Add(new ListItem(tabInfo.TabName, tabInfo.TabID.ToString())); lstPPLDetailPage.Items.Add(new ListItem(tabInfo.TabName, tabInfo.TabID.ToString())); lstCPLDetailPage.Items.Add(new ListItem(tabInfo.TabName, tabInfo.TabID.ToString())); lstPDSReturnPage.Items.Add(new ListItem(tabInfo.TabName, tabInfo.TabID.ToString())); } } loadTemplates(); String repeatDirection = Localization.GetString("RepeatDirectionHoriz", this.LocalResourceFile); lstNPLRepeatDirection.Items.Add(new ListItem(repeatDirection, "H")); lstFPLRepeatDirection.Items.Add(new ListItem(repeatDirection, "H")); lstPPLRepeatDirection.Items.Add(new ListItem(repeatDirection, "H")); lstCPLRepeatDirection.Items.Add(new ListItem(repeatDirection, "H")); repeatDirection = Localization.GetString("RepeatDirectionVert", this.LocalResourceFile); lstNPLRepeatDirection.Items.Add(new ListItem(repeatDirection, "V")); lstFPLRepeatDirection.Items.Add(new ListItem(repeatDirection, "V")); lstPPLRepeatDirection.Items.Add(new ListItem(repeatDirection, "V")); lstCPLRepeatDirection.Items.Add(new ListItem(repeatDirection, "V")); // General Player Settings chkUseDefaultCategory.Checked = bool.Parse(moduleSettings.General.UseDefaultCategory); chkShowMessage.Checked = bool.Parse(moduleSettings.General.ShowMessage); chkShowNew.Checked = bool.Parse(moduleSettings.General.ShowNewProducts); chkShowFeatured.Checked = bool.Parse(moduleSettings.General.ShowFeaturedProducts); chkShowPopular.Checked = bool.Parse(moduleSettings.General.ShowPopularProducts); chkShowCategory.Checked = bool.Parse(moduleSettings.General.ShowCategoryProducts); chkShowDetail.Checked = bool.Parse(moduleSettings.General.ShowProductDetail); lstDefaultCategory.SelectedValue = moduleSettings.General.DefaultCategoryID; ListItem itemTemplate = lstTemplate.Items.FindByText(moduleSettings.General.Template); if (itemTemplate != null) { itemTemplate.Selected = true; } // New list settings ListItem itemNPLContainerTemplate = lstNPLContainerTemplate.Items.FindByText(moduleSettings.NewProducts.ContainerTemplate); if (itemNPLContainerTemplate != null) { itemNPLContainerTemplate.Selected = true; } ListItem itemNPLTemplate = lstNPLTemplate.Items.FindByText(moduleSettings.NewProducts.Template); if (itemNPLTemplate != null) { itemNPLTemplate.Selected = true; } txtNPLRowCount.Text = moduleSettings.NewProducts.RowCount; txtNPLColumnCount.Text = moduleSettings.NewProducts.ColumnCount; txtNPLColumnWidth.Text = moduleSettings.NewProducts.ColumnWidth; ListItem itemNPLDirection = lstNPLRepeatDirection.Items.FindByValue(moduleSettings.NewProducts.RepeatDirection); if (itemNPLDirection != null) { itemNPLDirection.Selected = true; } txtNPLThumbnailWidth.Text = moduleSettings.NewProducts.ThumbnailWidth; chkNPLShowThumbnail.Checked = bool.Parse(moduleSettings.NewProducts.ShowThumbnail); lstNPLDetailPage.SelectedValue = moduleSettings.NewProducts.DetailPage; // Featured list settings ListItem itemFPLContainerTemplate = lstFPLContainerTemplate.Items.FindByText(moduleSettings.FeaturedProducts.ContainerTemplate); if (itemFPLContainerTemplate != null) { itemFPLContainerTemplate.Selected = true; } ListItem itemFPLTemplate = lstFPLTemplate.Items.FindByText(moduleSettings.FeaturedProducts.Template); if (itemFPLTemplate != null) { itemFPLTemplate.Selected = true; } txtFPLRowCount.Text = moduleSettings.FeaturedProducts.RowCount; txtFPLColumnCount.Text = moduleSettings.FeaturedProducts.ColumnCount; txtFPLColumnWidth.Text = moduleSettings.FeaturedProducts.ColumnWidth; ListItem itemFPLDirection = lstFPLRepeatDirection.Items.FindByValue(moduleSettings.FeaturedProducts.RepeatDirection); if (itemFPLDirection != null) { itemFPLDirection.Selected = true; } txtFPLThumbnailWidth.Text = moduleSettings.FeaturedProducts.ThumbnailWidth; chkFPLShowThumbnail.Checked = bool.Parse(moduleSettings.FeaturedProducts.ShowThumbnail); lstFPLDetailPage.SelectedValue = moduleSettings.FeaturedProducts.DetailPage; // Popular list settings ListItem itemPPLContainerTemplate = lstPPLContainerTemplate.Items.FindByText(moduleSettings.PopularProducts.ContainerTemplate); if (itemPPLContainerTemplate != null) { itemPPLContainerTemplate.Selected = true; } ListItem itemPPLTemplate = lstPPLTemplate.Items.FindByText(moduleSettings.PopularProducts.Template); if (itemPPLTemplate != null) { itemPPLTemplate.Selected = true; } txtPPLRowCount.Text = moduleSettings.PopularProducts.RowCount; txtPPLColumnCount.Text = moduleSettings.PopularProducts.ColumnCount; txtPPLColumnWidth.Text = moduleSettings.PopularProducts.ColumnWidth; ListItem itemPPLDirection = lstPPLRepeatDirection.Items.FindByValue(moduleSettings.PopularProducts.RepeatDirection); if (itemPPLDirection != null) { itemPPLDirection.Selected = true; } txtPPLThumbnailWidth.Text = moduleSettings.PopularProducts.ThumbnailWidth; chkPPLShowThumbnail.Checked = bool.Parse(moduleSettings.PopularProducts.ShowThumbnail); lstPPLDetailPage.SelectedValue = moduleSettings.PopularProducts.DetailPage; // Category list settings ListItem itemCPLContainerTemplate = lstCPLContainerTemplate.Items.FindByText(moduleSettings.CategoryProducts.ContainerTemplate); if (itemCPLContainerTemplate != null) { itemCPLContainerTemplate.Selected = true; } ListItem itemCPLTemplate = lstCPLTemplate.Items.FindByText(moduleSettings.CategoryProducts.Template); if (itemCPLTemplate != null) { itemCPLTemplate.Selected = true; } txtCPLRowCount.Text = moduleSettings.CategoryProducts.RowCount; txtCPLColumnCount.Text = moduleSettings.CategoryProducts.ColumnCount; txtCPLColumnWidth.Text = moduleSettings.CategoryProducts.ColumnWidth; ListItem itemCPLDirection = lstCPLRepeatDirection.Items.FindByValue(moduleSettings.CategoryProducts.RepeatDirection); if (itemCPLDirection != null) { itemCPLDirection.Selected = true; } txtCPLThumbnailWidth.Text = moduleSettings.CategoryProducts.ThumbnailWidth; chkCPLShowThumbnail.Checked = bool.Parse(moduleSettings.CategoryProducts.ShowThumbnail); lstCPLDetailPage.SelectedValue = moduleSettings.CategoryProducts.DetailPage; // Detail settings ListItem itemDetailTemplate = lstDetailTemplate.Items.FindByText(moduleSettings.ProductDetail.Template); if (itemDetailTemplate != null) { itemDetailTemplate.Selected = true; } chkDetailShowThumbnail.Checked = bool.Parse(moduleSettings.ProductDetail.ShowThumbnail); txtDetailThumbnailWidth.Text = moduleSettings.ProductDetail.ThumbnailWidth; chkDetailShowReviews.Checked = bool.Parse(moduleSettings.ProductDetail.ShowReviews); lstPDSReturnPage.SelectedValue = moduleSettings.ProductDetail.ReturnPage; } } catch(Exception ex) { Exceptions.ProcessModuleLoadException(this, ex); } }
public static ArrayList GetPortalTabs(int intPortalId, bool blnNoneSpecified, bool blnHidden, bool blnDeleted, bool blnURL, bool bCheckAuthorised) { TabController objTabs = new TabController(); ArrayList arrTabs = null; // Obtain current PortalSettings from Current Context PortalSettings _portalSettings = PortalController.GetCurrentPortalSettings(); //Get the portal's tabs if (intPortalId == _portalSettings.PortalId) { //Load current Portals tabs into arrTabs arrTabs = _portalSettings.DesktopTabs; } else { //We are editing a different portal (as host) so get the portal's tabs arrTabs = objTabs.GetTabs(intPortalId); } return GetPortalTabs(arrTabs, -1, blnNoneSpecified, blnHidden, blnDeleted, blnURL, bCheckAuthorised); }