Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SA12xx fixes - rearrange members #3882

Merged
merged 1 commit into from
Jul 1, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public string UpgradeModule(string version)

break;
}


return "Success";
}
catch (Exception)
Expand Down
62 changes: 31 additions & 31 deletions DNN Platform/Admin Modules/Dnn.Modules.Console/Settings.ascx.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public override void LoadSettings()
// DefaultSize.Items.Add(new ListItem(Localization.GetString(val, LocalResourceFile), val));
this.DefaultSize.AddItem(Localization.GetString(val, this.LocalResourceFile), val);
}

this.SelectDropDownListItem(ref this.DefaultSize, "DefaultSize");

this.SelectDropDownListItem(ref this.modeList, "Mode");
Expand All @@ -51,39 +51,39 @@ public override void LoadSettings()
{
this.AllowResize.Checked = Convert.ToBoolean(this.Settings["AllowSizeChange"]);
}

foreach (var val in ConsoleController.GetViewValues())
{
// DefaultView.Items.Add(new ListItem(Localization.GetString(val, LocalResourceFile), val));
this.DefaultView.AddItem(Localization.GetString(val, this.LocalResourceFile), val);
}

this.SelectDropDownListItem(ref this.DefaultView, "DefaultView");
if (this.Settings.ContainsKey("IncludeParent"))
{
this.IncludeParent.Checked = Convert.ToBoolean(this.Settings["IncludeParent"]);
}

if (this.Settings.ContainsKey("AllowViewChange"))
{
this.AllowViewChange.Checked = Convert.ToBoolean(this.Settings["AllowViewChange"]);
}

if (this.Settings.ContainsKey("ShowTooltip"))
{
this.ShowTooltip.Checked = Convert.ToBoolean(this.Settings["ShowTooltip"]);
}

if (this.Settings.ContainsKey("OrderTabsByHierarchy"))
{
this.OrderTabsByHierarchy.Checked = Convert.ToBoolean(this.Settings["OrderTabsByHierarchy"]);
}

if (this.Settings.ContainsKey("IncludeHiddenPages"))
{
this.IncludeHiddenPages.Checked = Convert.ToBoolean(this.Settings["IncludeHiddenPages"]);
}

if (this.Settings.ContainsKey("ConsoleWidth"))
{
this.ConsoleWidth.Text = Convert.ToString(this.Settings["ConsoleWidth"]);
Expand Down Expand Up @@ -117,7 +117,7 @@ public override void UpdateSettings()
throw new Exception("ConsoleWidth value is invalid. Value must be numeric.");
}
}

if (this.ParentTab.SelectedItemValueAsInt == Null.NullInteger)
{
ModuleController.Instance.DeleteModuleSetting(this.ModuleId, "ParentTabID");
Expand Down Expand Up @@ -156,6 +156,21 @@ public override void UpdateSettings()
}
}

protected override void OnInit(EventArgs e)
{
base.OnInit(e);

this.tabs.ItemDataBound += this.tabs_ItemDataBound;
this.modeList.SelectedIndexChanged += this.modeList_SelectedIndexChanged;

this.ParentTab.UndefinedItem = new ListItem(DynamicSharedConstants.Unspecified, string.Empty);
}

protected void parentTab_SelectedIndexChanged(object sender, EventArgs e)
{
this.BindTabs(this.ParentTab.SelectedItemValueAsInt, this.IncludeParent.Checked);
}

private void BindTabs(int tabId, bool includeParent)
{
List<TabInfo> tempTabs = TabController.GetTabsBySortOrder(this.PortalId).OrderBy(t => t.Level).ThenBy(t => t.HasChildren).ToList();
Expand All @@ -173,25 +188,25 @@ private void BindTabs(int tabId, bool includeParent)
tabList.Add(consoleTab);
}
}

foreach (TabInfo tab in tempTabs)
{
bool canShowTab = TabPermissionController.CanViewPage(tab) &&
!tab.IsDeleted &&
(tab.StartDate < DateTime.Now || tab.StartDate == Null.NullDate);
!tab.IsDeleted &&
(tab.StartDate < DateTime.Now || tab.StartDate == Null.NullDate);

if (!canShowTab)
{
continue;
}

if (tabIdList.Contains(tab.ParentId))
{
if (!tabIdList.Contains(tab.TabID))
{
tabIdList.Add(tab.TabID);
}

tabList.Add(tab);
}
}
Expand All @@ -207,7 +222,7 @@ private void SwitchMode()
{
parentTabId = Convert.ToInt32(this.Settings["ParentTabID"]);
}

switch (this.modeList.SelectedValue)
{
case "Normal":
Expand All @@ -232,21 +247,6 @@ private void SwitchMode()
this.BindTabs(parentTabId, this.IncludeParent.Checked);
}

protected override void OnInit(EventArgs e)
{
base.OnInit(e);

this.tabs.ItemDataBound += this.tabs_ItemDataBound;
this.modeList.SelectedIndexChanged += this.modeList_SelectedIndexChanged;

this.ParentTab.UndefinedItem = new ListItem(DynamicSharedConstants.Unspecified, string.Empty);
}

protected void parentTab_SelectedIndexChanged(object sender, EventArgs e)
{
this.BindTabs(this.ParentTab.SelectedItemValueAsInt, this.IncludeParent.Checked);
}

private void modeList_SelectedIndexChanged(object sender, EventArgs e)
{
this.SwitchMode();
Expand All @@ -263,7 +263,7 @@ private void tabs_ItemDataBound(object Sender, RepeaterItemEventArgs e)
var tabPathField = (HiddenField)e.Item.FindControl("tabPath");

visibilityDropDown.Items.Clear();

// visibilityDropDown.Items.Add(new ListItem(LocalizeString("AllUsers"), "AllUsers"));
visibilityDropDown.AddItem(this.LocalizeString("AllUsers"), "AllUsers");
if (this.modeList.SelectedValue == "Profile")
Expand Down
Loading