Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
ae987100
Commit
ae987100
authored
Jan 10, 2002
by
Leigh B. Stoller
Browse files
Take the submenu code from the experiments info page, and generalize
(somewhat) so that we can do submenu easily in other pages.
parent
c7a300e6
Changes
4
Hide whitespace changes
Inline
Side-by-side
www/menu.php3
View file @
ae987100
...
...
@@ -526,4 +526,58 @@ function PAGEERROR($msg) {
PAGEFOOTER
();
die
(
""
);
}
#
# Sub Page/Menu Stuff
#
function
WRITESUBMENUBUTTON
(
$text
,
$link
)
{
echo
"<!-- Table row for button
$text
-->
<tr>
<td valign=center align=left nowrap>
<b>
<a class=sidebarbutton href='
$link
'>
$text
</a>
\n
"
;
#
# XXX these blanks look bad in lynx, but add required
# spacing between menu and body
#
echo
"
\n
"
;
echo
" </b>
</td>
</tr>
\n
"
;
}
#
# Start/End a page within a page.
#
function
SUBPAGESTART
()
{
echo
"<table cellspacing=2 cellpadding=2 width='85%' border=0>
\n
<tr>
\n
<td valign=top>
\n
"
;
}
function
SUBPAGEEND
()
{
echo
" </td>
\n
</tr>
\n
</table>
\n
"
;
}
#
# Start/End a sub menu, located in the upper left of the main frame.
# Note that these cannot be used outside of the SUBPAGE macros above.
#
function
SUBMENUSTART
(
$title
)
{
echo
" <table cellspacing=2 cellpadding=2 border=0 width=200>
\n
<tr>
\n
<td align=center><b>
$title
</b></td>
\n
</tr>
\n
<tr></tr>
\n
"
;
}
function
SUBMENUEND
()
{
echo
" </table>
\n
</td>
\n
<td valign=top align=left width='85%'>
\n
"
;
}
?>
www/showexp.php3
View file @
ae987100
...
...
@@ -43,47 +43,26 @@ if (! TBExptAccessCheck($uid, $exp_pid, $exp_eid, $TB_EXPT_READINFO)) {
USERERROR
(
"You do not have permission to view experiment
$exp_eid
!"
,
1
);
}
function
WRITESIDEBARSUBBUTTON
(
$text
,
$link
)
{
echo
"<!-- Table row for button
$text
-->
<tr>
<td valign=center align=left nowrap>
<b>
<a class=sidebarbutton href='
$link
'>
$text
</a>
\n
"
;
#
# XXX these blanks look bad in lynx, but add required
# spacing between menu and body
#
echo
"
\n
"
;
echo
" </b>
</td>
</tr>
\n
"
;
}
echo
"<table cellspacing=2 cellpadding=2 width='85%' border=0>
\n
"
;
echo
"<tr>
\n
"
;
echo
" <td valign=top>
\n
"
;
echo
" <table cellspacing=2 cellpadding=2 border=0 width=200>
\n
"
;
echo
" <tr><td align=center><b>Experiment Options</b></td></tr>
\n
"
;
echo
" <tr></tr>
\n
"
;
WRITESIDEBARSUBBUTTON
(
"View NS File and Node Assignment"
,
"shownsfile.php3?pid=
$exp_pid
&eid=
$exp_eid
"
);
WRITESIDEBARSUBBUTTON
(
"Terminate this experiment"
,
"endexp.php3?pid=
$exp_pid
&eid=
$exp_eid
"
);
SUBPAGESTART
();
SUBMENUSTART
(
"Experiment Options"
);
WRITESUBMENUBUTTON
(
"View NS File and Node Assignment"
,
"shownsfile.php3?pid=
$exp_pid
&eid=
$exp_eid
"
);
WRITESUBMENUBUTTON
(
"Terminate this experiment"
,
"endexp.php3?pid=
$exp_pid
&eid=
$exp_eid
"
);
# Swap option.
$expstate
=
TBExptState
(
$exp_pid
,
$exp_eid
);
if
(
$expstate
)
{
if
(
strcmp
(
$expstate
,
$TB_EXPTSTATE_SWAPPED
)
==
0
)
{
WRITES
IDEBARSUB
BUTTON
(
"Swap this Experiment in"
,
WRITES
UBMENU
BUTTON
(
"Swap this Experiment in"
,
"swapexp.php3?inout=in&pid=
$exp_pid
&eid=
$exp_eid
"
);
WRITES
IDEBARSUB
BUTTON
(
"Graphic Visualization of Topology"
,
WRITES
UBMENU
BUTTON
(
"Graphic Visualization of Topology"
,
"vistopology.php3?pid=
$exp_pid
&eid=
$exp_eid
"
);
}
elseif
(
strcmp
(
$expstate
,
$TB_EXPTSTATE_ACTIVE
)
==
0
)
{
WRITES
IDEBARSUB
BUTTON
(
"Swap this Experiment out"
,
WRITES
UBMENU
BUTTON
(
"Swap this Experiment out"
,
"swapexp.php3?inout=out&pid=
$exp_pid
&eid=
$exp_eid
"
);
WRITES
IDEBARSUB
BUTTON
(
"Graphic Visualization of Topology"
,
WRITES
UBMENU
BUTTON
(
"Graphic Visualization of Topology"
,
"vistopology.php3?pid=
$exp_pid
&eid=
$exp_eid
"
);
}
}
...
...
@@ -92,21 +71,17 @@ if ($expstate) {
# Admin folks get a swap request link to send email.
#
if
(
ISADMIN
(
$uid
))
{
WRITES
IDEBARSUB
BUTTON
(
"Send a swap/terminate request"
,
WRITES
UBMENU
BUTTON
(
"Send a swap/terminate request"
,
"request_swapexp.php3?&pid=
$exp_pid
&eid=
$exp_eid
"
);
}
echo
" </table>
\n
"
;
echo
" </td>
\n
"
;
echo
" <td valign=top align=left width='85%'>
\n
"
;
SUBMENUEND
();
#
# Dump experiment record.
#
SHOWEXP
(
$exp_pid
,
$exp_eid
);
echo
" </td>
\n
"
;
echo
" </tr>
\n
"
;
echo
"</table>
\n
"
;
SUBPAGEEND
();
#
# Dump the node information.
...
...
www/showgroup.php3
View file @
ae987100
...
...
@@ -57,9 +57,23 @@ if (!$isadmin) {
}
}
SHOWGROUP
(
$pid
,
$gid
);
SUBPAGESTART
();
SUBMENUSTART
(
"Group Options"
);
WRITESUBMENUBUTTON
(
"Edit this Group"
,
"editgroup_form.php3?pid=
$pid
&gid=
$gid
"
);
#
# A delete option, but not for the default group!
#
if
(
strcmp
(
$gid
,
$pid
))
{
WRITESUBMENUBUTTON
(
"Delete this Group"
,
"deletegroup.php3?pid=
$pid
&gid=
$gid
"
);
}
SUBMENUEND
();
SHOWGROUP
(
$pid
,
$gid
);
SHOWGROUPMEMBERS
(
$pid
,
$gid
);
SUBPAGEEND
();
#
# A list of Group experiments.
...
...
@@ -88,23 +102,6 @@ if (mysql_num_rows($query_result)) {
echo
"</table>
\n
"
;
}
#
# An edit option.
#
echo
"<br>
<center>
<A href='editgroup_form.php3?pid=
$pid
&gid=
$gid
'>Edit</a> this Group?
</center>
\n
"
;
#
# A delete option, but not for the default group!
#
if
(
strcmp
(
$gid
,
$pid
))
{
echo
"<p>
<A href='deletegroup.php3?pid=
$pid
&gid=
$gid
'>Delete</a> this Group?
\n
"
;
}
#
# Standard Testbed Footer
#
...
...
www/showstuff.php3
View file @
ae987100
...
...
@@ -18,8 +18,11 @@ function SHOWPROJECT($pid, $thisuid) {
}
$row
=
mysql_fetch_array
(
$query_result
);
echo
"<table align=center border=1>
\n
"
;
echo
"<center>
<h3>Project Profile</h3>
</center>
<table align=center border=1>
\n
"
;
$proj_created
=
$row
[
created
];
$proj_expires
=
$row
[
expires
];
$proj_name
=
$row
[
name
];
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment