protected void Page_Load(object sender, EventArgs e) { string templateType = QueryHelper.GetString("templatetype", String.Empty); // If not in site manager - filter class selector for only site documents if (!IsSiteManager) { ucClassSelector.SiteID = CMSContext.CurrentSiteID; } if (!RequestHelper.IsPostBack()) { drpTemplateType.Items.Add(new ListItem(GetString("hiertransf.item"), "item")); drpTemplateType.Items.Add(new ListItem(GetString("hiertransf.alternatingitem"), "alternatingitem")); drpTemplateType.Items.Add(new ListItem(GetString("hiertransf.firstitem"), "firstitem")); drpTemplateType.Items.Add(new ListItem(GetString("hiertransf.lastitem"), "lastitem")); drpTemplateType.Items.Add(new ListItem(GetString("hiertransf.header"), "header")); drpTemplateType.Items.Add(new ListItem(GetString("hiertransf.footer"), "footer")); drpTemplateType.Items.Add(new ListItem(GetString("hiertransf.singleitem"), "singleitem")); drpTemplateType.Items.Add(new ListItem(GetString("hiertransf.separator"), "separator")); drpTemplateType.Items.Add(new ListItem(GetString("hiertransf.currentitem"), "currentitem")); //If new template type set via url if (!String.IsNullOrEmpty(templateType)) { //lblTemplateType.Text = ConvertTemplateTypeToString(templateType); if (templateType != "all") { drpTemplateType.SelectedValue = templateType; } else { drpTemplateType.SelectedValue = "item"; } } } //Info and error messages lblInfo.Text = GetString("general.changessaved"); //First edit after save ... show info message if (ShowInfoLabel) { lblInfo.Visible = true; } if (!String.IsNullOrEmpty(templateType)) { mTemplateType = HierarchicalTransformations.StringToUniViewItemType(templateType); } //Load transformations xml mTransformations = new HierarchicalTransformations("ClassName"); if (TransInfo != null) { if (!String.IsNullOrEmpty(TransInfo.TransformationHierarchicalXML)) { mTransformations.LoadFromXML(TransInfo.TransformationHierarchicalXML); } } //Edit if (HierarchicalID != Guid.Empty) { mHierInfo = mTransformations.GetTransformation(HierarchicalID); //Load Transformation values if (!RequestHelper.IsPostBack()) { txtLevel.Text = mHierInfo.ItemLevel.ToString(); ucTransformations.Value = mHierInfo.TransformationName; ucClassSelector.Value = mHierInfo.Value; templateType = HierarchicalTransformations.UniViewItemTypeToString(mHierInfo.ItemType); drpTemplateType.SelectedValue = templateType; mTemplateType = mHierInfo.ItemType; } } }
protected void Page_Load(object sender, EventArgs e) { string templateType = QueryHelper.GetString("templatetype", String.Empty); // If not in site manager - filter class selector for only site documents if (!IsSiteManager) { ucClassSelector.SiteID = SiteContext.CurrentSiteID; } if (!RequestHelper.IsPostBack()) { drpTemplateType.Items.Add(new ListItem(GetString("hiertransf.item"), "item")); drpTemplateType.Items.Add(new ListItem(GetString("hiertransf.alternatingitem"), "alternatingitem")); drpTemplateType.Items.Add(new ListItem(GetString("hiertransf.firstitem"), "firstitem")); drpTemplateType.Items.Add(new ListItem(GetString("hiertransf.lastitem"), "lastitem")); drpTemplateType.Items.Add(new ListItem(GetString("hiertransf.header"), "header")); drpTemplateType.Items.Add(new ListItem(GetString("hiertransf.footer"), "footer")); drpTemplateType.Items.Add(new ListItem(GetString("hiertransf.singleitem"), "singleitem")); drpTemplateType.Items.Add(new ListItem(GetString("hiertransf.separator"), "separator")); drpTemplateType.Items.Add(new ListItem(GetString("hiertransf.currentitem"), "currentitem")); //If new template type set via url if (!String.IsNullOrEmpty(templateType)) { drpTemplateType.SelectedValue = templateType == "all" ? "item" : templateType; } } //First edit after save ... show info message if (ShowInfoLabel) { ShowChangesSaved(); } //Load transformations xml mTransformations = new HierarchicalTransformations("ClassName"); if (TransInfo != null) { if (!String.IsNullOrEmpty(TransInfo.TransformationHierarchicalXML)) { mTransformations.LoadFromXML(TransInfo.TransformationHierarchicalXML); } } //Edit if (HierarchicalID != Guid.Empty) { mHierInfo = mTransformations.GetTransformation(HierarchicalID); //Load Transformation values if (!RequestHelper.IsPostBack()) { txtLevel.Text = mHierInfo.ItemLevel.ToString(); ucTransformations.Value = mHierInfo.TransformationName; ucClassSelector.Value = mHierInfo.Value; templateType = HierarchicalTransformations.UniViewItemTypeToString(mHierInfo.ItemType); drpTemplateType.SelectedValue = templateType; chkApplyToSublevels.Checked = mHierInfo.ApplyToSublevels; } } // Disable class selector for separator, header and foot transformation ucClassSelector.Enabled = true; if ((drpTemplateType.SelectedValue == "header") || (drpTemplateType.SelectedValue == "footer") || (drpTemplateType.SelectedValue == "separator")) { ucClassSelector.Value = ""; ucClassSelector.Enabled = false; } // Add save button if (Visible) { HeaderActions.AddAction(new SaveAction(Page)); HeaderActions.ActionPerformed += btnOK_Click; } }
protected void Page_Load(object sender, EventArgs e) { string templateType = QueryHelper.GetString("templatetype", String.Empty); // If not in site manager - filter class selector for only site documents if (!IsSiteManager) { ucClassSelector.SiteID = SiteContext.CurrentSiteID; } if (!RequestHelper.IsPostBack()) { drpTemplateType.Items.Add(new ListItem(GetString("hiertransf.item"), "item")); drpTemplateType.Items.Add(new ListItem(GetString("hiertransf.alternatingitem"), "alternatingitem")); drpTemplateType.Items.Add(new ListItem(GetString("hiertransf.firstitem"), "firstitem")); drpTemplateType.Items.Add(new ListItem(GetString("hiertransf.lastitem"), "lastitem")); drpTemplateType.Items.Add(new ListItem(GetString("hiertransf.header"), "header")); drpTemplateType.Items.Add(new ListItem(GetString("hiertransf.footer"), "footer")); drpTemplateType.Items.Add(new ListItem(GetString("hiertransf.singleitem"), "singleitem")); drpTemplateType.Items.Add(new ListItem(GetString("hiertransf.separator"), "separator")); drpTemplateType.Items.Add(new ListItem(GetString("hiertransf.currentitem"), "currentitem")); //If new template type set via url if (!String.IsNullOrEmpty(templateType)) { drpTemplateType.SelectedValue = templateType == "all" ? "item" : templateType; } } //First edit after save ... show info message if (ShowInfoLabel) { ShowChangesSaved(); } //Load transformations xml mTransformations = new HierarchicalTransformations("ClassName"); if (TransInfo != null) { if (!String.IsNullOrEmpty(TransInfo.TransformationHierarchicalXML)) { mTransformations.LoadFromXML(TransInfo.TransformationHierarchicalXML); } } //Edit if (HierarchicalID != Guid.Empty) { mHierInfo = mTransformations.GetTransformation(HierarchicalID); //Load Transformation values if (!RequestHelper.IsPostBack()) { txtLevel.Text = mHierInfo.ItemLevel.ToString(); ucTransformations.Value = mHierInfo.TransformationName; ucClassSelector.Value = mHierInfo.Value; templateType = HierarchicalTransformations.UniViewItemTypeToString(mHierInfo.ItemType); drpTemplateType.SelectedValue = templateType; chkApplyToSublevels.Checked = mHierInfo.ApplyToSublevels; } } // Disable class selector for separator, header and foot transformation ucClassSelector.Enabled = true; if ((drpTemplateType.SelectedValue == "header") || (drpTemplateType.SelectedValue == "footer") || (drpTemplateType.SelectedValue == "separator")) { ucClassSelector.Value = ""; ucClassSelector.Enabled = false; } // Add save button if (Visible) { HeaderActions.AddAction(new SaveAction()); HeaderActions.ActionPerformed += btnOK_Click; } }
protected void Page_Load(object sender, EventArgs e) { string templateType = QueryHelper.GetString("templatetype", String.Empty); // If not in site manager - filter class selector for only site documents if (!IsSiteManager) { ucClassSelector.SiteID = CMSContext.CurrentSiteID; } if (!RequestHelper.IsPostBack()) { drpTemplateType.Items.Add(new ListItem(GetString("hiertransf.item"), "item")); drpTemplateType.Items.Add(new ListItem(GetString("hiertransf.alternatingitem"), "alternatingitem")); drpTemplateType.Items.Add(new ListItem(GetString("hiertransf.firstitem"), "firstitem")); drpTemplateType.Items.Add(new ListItem(GetString("hiertransf.lastitem"), "lastitem")); drpTemplateType.Items.Add(new ListItem(GetString("hiertransf.header"), "header")); drpTemplateType.Items.Add(new ListItem(GetString("hiertransf.footer"), "footer")); drpTemplateType.Items.Add(new ListItem(GetString("hiertransf.singleitem"), "singleitem")); drpTemplateType.Items.Add(new ListItem(GetString("hiertransf.separator"), "separator")); drpTemplateType.Items.Add(new ListItem(GetString("hiertransf.currentitem"), "currentitem")); //If new template type set via url if (!String.IsNullOrEmpty(templateType)) { //lblTemplateType.Text = ConvertTemplateTypeToString(templateType); if (templateType != "all") { drpTemplateType.SelectedValue = templateType; } else { drpTemplateType.SelectedValue = "item"; } } } //Info and error messages lblInfo.Text = GetString("general.changessaved"); //First edit after save ... show info message if (ShowInfoLabel) { lblInfo.Visible = true; } if (!String.IsNullOrEmpty(templateType)) { mTemplateType = HierarchicalTransformations.StringToUniViewItemType(templateType); } //Load transformations xml mTransformations = new HierarchicalTransformations("ClassName"); if (TransInfo != null) { if (!String.IsNullOrEmpty(TransInfo.TransformationHierarchicalXML)) { mTransformations.LoadFromXML(TransInfo.TransformationHierarchicalXML); } } //Edit if (HierarchicalID != Guid.Empty) { mHierInfo = mTransformations.GetTransformation(HierarchicalID); //Load Transformation values if (!RequestHelper.IsPostBack()) { txtLevel.Text = mHierInfo.ItemLevel.ToString(); ucTransformations.Value = mHierInfo.TransformationName; ucClassSelector.Value = mHierInfo.Value; templateType = HierarchicalTransformations.UniViewItemTypeToString(mHierInfo.ItemType); drpTemplateType.SelectedValue = templateType; mTemplateType = mHierInfo.ItemType; } } }