Commit 66d34b8f authored by Mac Newbold's avatar Mac Newbold

Make admin-only stuff more clear on the expt page. Put beta-test stuff in

its own subsection, and admin funcs in another one. (These both only show
up when you're red-dotted.)

Reusable SUBMENUSECTION($title) calls added, so you can do this in any of
these submenus.
parent 9ddb7224
......@@ -597,7 +597,7 @@ function WRITESUBMENUBUTTON($text, $link) {
function SUBPAGESTART() {
echo "<!-- begin subpage -->";
echo "<table class=\"stealth\"
cellspacing='0' cellpadding='0' width='85%' border='0'>\n
cellspacing='0' cellpadding='0' width='100%' border='0'>\n
<tr>\n
<td class=\"stealth\"valign=top>\n";
}
......@@ -616,7 +616,7 @@ function SUBPAGEEND() {
function SUBMENUSTART($title) {
?>
<!-- begin submenu -->
<table class='menu' width='200' cellpadding="0" cellspacing="0"
<table class='menu' cellpadding="0" cellspacing="0"
style="margin-right: 6px;" >
<tr>
<td class="menuheader"><b><?php echo "$title";?></b></td>
......@@ -629,10 +629,28 @@ function SUBMENUEND() {
</table>
<!-- end submenu -->
</td>
<td class="stealth" valign=top align=left width='85%'>
<td class="stealth" valign=top align=left width='100%'>
<?php
}
# Start a new section in an existing submenu
# This includes ending the one before it
function SUBMENUSECTION($title) {
SUBMENUSECTIONEND();
?>
<!-- new submenu section -->
<tr>
<td class="menuheader"><b><?php echo "$title";?></b></td>
</tr>
<?php
}
# End a submenu section - only need this on the last one of the table.
function SUBMENUSECTIONEND() {
?>
<tr height=5><td></td></tr>
<?php
}
# These are here so you can wedge something else under the menu in the left column.
......
......@@ -81,40 +81,16 @@ if ($expstate) {
# Swap option.
if (strcmp($expstate, $TB_EXPTSTATE_SWAPPED) == 0) {
WRITESUBMENUBUTTON("Swap this Experiment in",
WRITESUBMENUBUTTON("Swap this Experiment In",
"swapexp.php3?inout=in&pid=$exp_pid&eid=$exp_eid");
}
elseif (strcmp($expstate, $TB_EXPTSTATE_ACTIVE) == 0) {
WRITESUBMENUBUTTON("Swap this Experiment out",
WRITESUBMENUBUTTON("Swap this Experiment Out",
"swapexp.php3?inout=out&pid=$exp_pid&eid=$exp_eid");
#
# Admin folks get a swap request link to send email.
#
if (ISADMIN($uid)) {
WRITESUBMENUBUTTON("Send a swap/terminate request",
"request_swapexp.php3?".
"&pid=$exp_pid&eid=$exp_eid");
if (strcmp($expstate, $TB_EXPTSTATE_ACTIVE) == 0) {
WRITESUBMENUBUTTON("Force Swap Out (Idle-Swap)",
"swapexp.php3?inout=out&force=1".
"&pid=$exp_pid&eid=$exp_eid");
}
WRITESUBMENUBUTTON("Control Delay Nodes (BETA)",
"delaycontrol.php3?pid=$exp_pid&eid=$exp_eid");
WRITESUBMENUBUTTON("Restart this Experiment",
"swapexp.php3?inout=restart&pid=$exp_pid&eid=$exp_eid");
}
}
if (ISADMIN($uid)) {
WRITESUBMENUBUTTON("Modify this Experiment",
"modifyexp.php3?pid=$exp_pid&eid=$exp_eid");
}
}
WRITESUBMENUBUTTON("Terminate this experiment",
WRITESUBMENUBUTTON("Terminate this Experiment",
"endexp.php3?pid=$exp_pid&eid=$exp_eid");
#
......@@ -127,10 +103,40 @@ if (TBExptAccessCheck($uid, $exp_pid, $exp_eid, $TB_EXPT_UPDATEACCOUNTS)) {
# Reboot option
if (TBExptAccessCheck($uid, $exp_pid, $exp_eid, $TB_EXPT_MODIFY)) {
WRITESUBMENUBUTTON("Reboot all Nodes",
WRITESUBMENUBUTTON("Reboot All Nodes",
"boot.php3?pid=$exp_pid&eid=$exp_eid");
}
if (ISADMIN($uid)) {
if (strcmp($expstate, $TB_EXPTSTATE_ACTIVE) == 0) {
SUBMENUSECTION("Beta-Test Options");
WRITESUBMENUBUTTON("Control Delay Nodes",
"delaycontrol.php3?pid=$exp_pid&eid=$exp_eid");
WRITESUBMENUBUTTON("Restart this Experiment",
"swapexp.php3?inout=restart&pid=$exp_pid".
"&eid=$exp_eid");
WRITESUBMENUBUTTON("Modify this Experiment",
"modifyexp.php3?pid=$exp_pid&eid=$exp_eid");
SUBMENUSECTION("Admin Options");
WRITESUBMENUBUTTON("Send a Swap Request",
"request_swapexp.php3?".
"&pid=$exp_pid&eid=$exp_eid");
WRITESUBMENUBUTTON("Force Swap Out (Idle-Swap)",
"swapexp.php3?inout=out&force=1".
"&pid=$exp_pid&eid=$exp_eid");
SUBMENUSECTIONEND();
}
}
SUBMENUEND_2A();
echo "<br>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment