protected void Page_Load (object sender, EventArgs e)
{
TableRow row = new TableRow ();
TableCell title = new TableCell ();
TableCell user = new TableCell ();
title.Text = "<a href='index.aspx'>MonkeyWrench</a>";
if (!Utils.IsInRole (MonkeyWrench.DataClasses.Logic.Roles.Administrator)) {
user.Text = "<a href='Login.aspx'>Login</a>";
} else {
user.Text = string.Format ("<a href='User.aspx?id={0}'>{0}</a> <a href='Login.aspx?action=logout'>Log out</a>", Context.User.Identity.Name);
}
user.CssClass = "headerlogin";
row.Cells.Add (title);
row.Cells.Add (user);
tableHeader.Rows.Add (row);
if (!IsPostBack)
CreateTree ();
if (Utils.IsInRole (MonkeyWrench.DataClasses.Logic.Roles.Administrator)) {
tableFooter.Rows.Add (Utils.CreateTableRow ("<a href='EditHosts.aspx'>Edit Hosts</a>"));
tableFooter.Rows.Add (Utils.CreateTableRow ("<a href='EditLanes.aspx'>Edit Lanes</a>"));
tableFooter.Rows.Add (Utils.CreateTableRow ("<a href='Admin.aspx'>Administration</a>"));
}
tableFooter.Rows.Add (Utils.CreateTableRow ("<a href='doc/index.html'>Documentation</a>"));
}