/
TabPath.ascx.cs
96 lines (85 loc) · 2.09 KB
/
TabPath.ascx.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
namespace Portal
{
using System;
using System.Collections;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
/// <summary>
/// Summary description for TabPath.
/// </summary>
public abstract class TabPath : System.Web.UI.UserControl
{
protected Repeater tabpath;
/// <summary>
/// Wrapper Class for the Tab Object.
/// </summary>
public class DisplayTabItem
{
/// <summary>
/// Menus Text
/// </summary>
public string Text
{
get { return m_Text; }
}
/// <summary>
/// Tabs URL.
/// </summary>
public string URL
{
get { return m_URL; }
}
/// <summary>
/// True if the menu item represents the current Tab
/// </summary>
public bool CurrentTab
{
get { return m_CurrentTab; }
}
internal string m_Text = "";
internal string m_URL = "";
internal bool m_CurrentTab = false;
}
private void Page_Load(object sender, System.EventArgs e)
{
// Load Protal Definition and the current Tab
PortalDefinition pd = PortalDefinition.Load();
PortalDefinition.Tab currentTab = pd.GetTab(Request["TabRef"]);
// Great, we are a top level Tab
if(currentTab.parent == null) return;
ArrayList tabList = new ArrayList();
while(currentTab != null)
{
DisplayTabItem dt = new DisplayTabItem();
tabList.Insert(0, dt);
dt.m_Text = currentTab.title;
dt.m_URL = Portal.API.Config.GetTabURL(currentTab.reference);
// one up...
currentTab = currentTab.parent;
}
// Bind Repeater
tabpath.DataSource = tabList;
tabpath.DataBind();
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
}
}