protected void Page_Load(object sender, EventArgs e) { string currentCulture = string.Empty; int cultureId = QueryHelper.GetInteger("cultureid", 0); CultureInfo ci = CultureInfoProvider.GetSafeCulture(cultureId); EditedObject = ci; currentCulture = ci.CultureName; CurrentMaster.Title.TitleText = GetString("culture.edit.properties"); CurrentMaster.Title.TitleImage = GetImageUrl("Objects/CMS_Culture/object.png"); CurrentMaster.Title.HelpTopicName = "general_tabnew"; CurrentMaster.Title.HelpName = "helpTopic"; string[,] breadcrumbs = new string[2, 3]; breadcrumbs[0, 0] = GetString("general.cultures"); breadcrumbs[0, 1] = "~/CMSSiteManager/Development/Cultures/Culture_List.aspx"; breadcrumbs[0, 2] = "_parent"; breadcrumbs[1, 0] = currentCulture; CurrentMaster.Title.Breadcrumbs = breadcrumbs; string[,] tabs = new string[2, 4]; tabs[0, 0] = GetString("general.general"); tabs[0, 1] = "SetHelpTopic('helpTopic', 'general_tabnew');"; tabs[0, 2] = "Culture_Edit_General.aspx?cultureID=" + cultureId; tabs[1, 0] = GetString("general.sites"); tabs[1, 1] = "SetHelpTopic('helpTopic', 'sites_tab4');"; tabs[1, 2] = "Culture_Edit_Sites.aspx?cultureID=" + cultureId; CurrentMaster.Tabs.Tabs = tabs; CurrentMaster.Tabs.UrlTarget = "content"; }
protected void Page_Load(object sender, EventArgs e) { gridStrings.OnAction += UniGridCultures_OnAction; CurrentMaster.DisplaySiteSelectorPanel = true; cultureSelector.OnSelectionChanged += cultureSelector_OnSelectionChanged; cultureSelector.DropDownSingleSelect.AutoPostBack = true; cultureSelector.OnListItemCreated += cultureSelector_OnListItemCreated; mCultureCode = QueryHelper.GetString("culturecode", CultureHelper.DefaultUICultureCode); mCultureInfo = CultureInfoProvider.GetSafeCulture(mCultureCode); if (mCultureInfo != null && mDefaultUICultureInfo != null) { QueryDataParameters parameters = new QueryDataParameters(); parameters.Add("@Culture", mCultureInfo.CultureID); parameters.AddId("@DefaultCultureID", mDefaultUICultureInfo.CultureID); gridStrings.QueryParameters = parameters; string defaultTextCaption = String.Format(GetString("culture.defaultwithparameter"), CultureHelper.DefaultUICultureCode); gridStrings.GridColumns.Columns.Find(column => column.Source == "DefaultText").Caption = defaultTextCaption; if (CurrentCultureIsDefault) { // Set default translation column to full width gridStrings.GridColumns.Columns[2].Width = "100%"; // Remove 'CultureText' column if current culture is default gridStrings.GridColumns.Columns.RemoveAt(1); } else { if (!LocalizationHelper.ResourceFileExistsForCulture(mCultureInfo.CultureCode)) { string url = "http://devnet.kentico.com/download/localization-packs"; string downloadPage = String.Format(@"<a href=""{0}"" target=""_blank"" >{1}</a> ", url, HTMLHelper.HTMLEncode(url)); ShowInformation(String.Format(GetString("culture.downloadlocalization"), downloadPage)); } } InitializeMasterPage(); } else { gridStrings.StopProcessing = true; ShowError(String.Format(GetString("culture.doesntexist"), HTMLHelper.HTMLEncode(mCultureCode))); } }
private void DeleteCulture(int cultureId) { CultureInfo culture = CultureInfoProvider.GetSafeCulture(cultureId); EditedObject = culture; string cultureCode = culture.CultureCode; DataSet ds = CultureInfoProvider.GetCultureSites(cultureCode); if (DataHelper.DataSourceIsEmpty(ds)) { CultureInfoProvider.DeleteCultureInfo(cultureCode); } else { ShowError(GetString("culture_list.errorremoveculture")); } }
private void DeleteCulture(int cultureId) { CultureInfo culture = CultureInfoProvider.GetSafeCulture(cultureId); EditedObject = culture; string cultureCode = culture.CultureCode; DataSet ds = CultureInfoProvider.GetCultureSites(cultureCode); if (DataHelper.DataSourceIsEmpty(ds)) { CultureInfoProvider.DeleteCultureInfo(cultureCode); } else { lblError.Visible = true; lblError.Text += GetString("culture_list.errorremoveculture") + "\n"; } }
protected void Page_Load(object sender, EventArgs e) { rfvCultureName.ErrorMessage = GetString("Culture_Edit_General.ErrorEmptyCultureName"); rfvCultureCode.ErrorMessage = GetString("Culture_Edit_General.ErrorEmptyCultureCode"); rfvCultureShortName.ErrorMessage = GetString("Culture_Edit_General.ErrorEmptyCultureShortName"); int cultureId = QueryHelper.GetInteger("cultureId", 0); culture = CultureInfoProvider.GetSafeCulture(cultureId); EditedObject = culture; if (!RequestHelper.IsPostBack()) { LoadData(); if (QueryHelper.GetBoolean("saved", false)) { ShowChangesSaved(); } } }