Commit 8c4945a1 authored by Leigh Stoller's avatar Leigh Stoller

Minor changes for docwrapper. Add a docwrapper file to each subdir so

that relative links work. This old way:

	<a href="docwrapper.php3?docname=tutorial/nscommands.html">

throws off relative links cause the actual file (docwrapper.php3) is
in a different dir than the file loaded. Instead, do this:

	<a href="tutorial/docwrapper.php3?docname=nscommands.html">

So loading tutorial/docwrapper.php3 sets the current directory
properly, and then loads the specified file.
parent b26d4a93
......@@ -37,6 +37,7 @@ PIXFILES += $(wildcard $(SRCDIR)/pix/*.gif)
DOCFILES = $(wildcard $(SRCDIR)/doc/*.html)
DOCFILES += $(wildcard $(SRCDIR)/doc/*.jpg)
DOCFILES += $(wildcard $(SRCDIR)/doc/*.gif)
DOCFILES += $(wildcard $(SRCDIR)/doc/*.php3)
TUTFILES = $(wildcard $(SRCDIR)/tutorial/*.html)
TUTFILES += $(wildcard $(SRCDIR)/tutorial/*.jpg)
......
......@@ -16,11 +16,11 @@ PAGEHEADER("Documentation");
Emulab Frequently Asked Questions (FAQ)</a></b>
<p>
<li><b><a href="docwrapper.php3?docname=tutorial/nscommands.html">
<li><b><a href="tutorial/docwrapper.php3?docname=nscommands.html">
Emulab-specific NS Extensions Reference Manual</a></b>
<p>
<li><b><a href="docwrapper.php3?docname=doc/tmcd.html">
<li><b><a href="doc/docwrapper.php3?docname=tmcd.html">
Testbed Master Control Daemon (TMCD) Reference Manual</a></b>
<p>
......
<?php
chdir("..");
require("defs.php3");
chdir("doc");
#
# Standard Testbed Header
#
if (!$printable) {
PAGEHEADER("Emulab Documentation");
}
#
# Need to sanity check the path! For now, just make sure the path
# does not start with a dot or a slash.
#
$first = substr($docname, 0, 1);
if (strcmp($first, ".") == 0 ||
strcmp($first, "/") == 0) {
USERERROR("Invalid document name: $docname!");
}
#
# Nothing that looks like a ../ is allowed anywhere in the name
#
if (strstr($docname, "../")) {
USERERROR("Invalid document name: $docname!");
}
if (!$printable) {
echo "<b><a href=$REQUEST_URI&printable=1>
Printable version of this document</a></b><br>";
}
readfile("$docname");
#
# Standard Testbed Footer
#
if (!$printable) {
PAGEFOOTER();
}
?>
......@@ -24,22 +24,6 @@ if (strstr($docname, "../")) {
USERERROR("Invalid document name: $docname!");
}
#
# Want want to spit out a basepath tag since that mimics typical behaviour
# wrt relative links in the doc, when the target file is in a subdir.
#
if (strrchr($docname, "/")) {
$dir = substr($docname, 0, strrpos($docname, "/"));
$docname = substr(strrchr($docname, "/"), 1);
if (isset($SSL_PROTOCOL)) {
echo "<base href='$TBBASE/$dir/'>\n";
}
else {
echo "<base href='$TBDOCBASE/$dir/'>\n";
}
chdir($dir);
}
if (!$printable) {
echo "<b><a href=$REQUEST_URI&printable=1>
Printable version of this document</a></b><br>";
......
......@@ -365,7 +365,7 @@
</p>
<p>
Please see the
<a href="docwrapper.php3?docname=tutorial/nscommands.html">Extensions</a>
<a href="tutorial/docwrapper.php3?docname=nscommands.html">Extensions</a>
page for a summary of all Emulab NS extensions, and the
<a href = "tutorial/tutorial.php3">Emulab Tutorial</a> for an
example.
......@@ -396,7 +396,7 @@
</p>
<p>
Please see the
<a href="docwrapper.php3?docname=tutorial/nscommands.html">Extensions</a>
<a href="tutorial/docwrapper.php3?docname=nscommands.html">Extensions</a>
page for a summary of all Emulab NS extensions, and the
<a href = "tutorial/tutorial.php3">Emulab Tutorial</a> for an
example.
......@@ -417,7 +417,7 @@
</p>
<p>
Please see the
<a href="docwrapper.php3?docname=tutorial/nscommands.html">Extensions</a>
<a href="tutorial/docwrapper.php3?docname=nscommands.html">Extensions</a>
page for a summary of all Emulab NS extensions, and the
<a href = "tutorial/tutorial.php3">Emulab Tutorial</a> for an
example.
......@@ -438,7 +438,7 @@
</p>
<p>
Please see the
<a href="docwrapper.php3?docname=tutorial/nscommands.html">Extensions</a>
<a href="tutorial/docwrapper.php3?docname=nscommands.html">Extensions</a>
page for a summary of all Emulab NS extensions, and the
<a href = "tutorial/tutorial.php3">Emulab Tutorial</a> for an
example.
......@@ -496,7 +496,7 @@ exit 0
</p>
<p>
Please see the
<a href="docwrapper.php3?docname=tutorial/nscommands.html">Extensions</a>
<a href="tutorial/docwrapper.php3?docname=nscommands.html">Extensions</a>
page for a summary of all Emulab NS extensions, and the
<a href = "tutorial/tutorial.php3">Emulab Tutorial</a> for an
example.
......@@ -520,7 +520,7 @@ exit 0
<p>
Use of the ready bits is described in more detail in the <a href =
"tutorial/tutorial.php3">Emulab Tutorial</a> and in the <a href =
"docwrapper.php3?docname=doc/tmcd.html"> Testbed Master Control
"doc/docwrapper.php3?docname=tmcd.html"> Testbed Master Control
Daemon</a> documentation.
</p>
......
......@@ -10,6 +10,7 @@ $login_status = $STATUS_NOSTATUS;
$login_message = "";
$error_message = 0;
$login_uid = 0;
$javacode = file("java.html");
#
# This has to be set so we can spit out http or https paths properly!
......@@ -190,7 +191,7 @@ function WRITESIDEBAR() {
# Now the login/logout box. Remember, already inside a table.
# We want the links to the login/logout pages to always be https,
# but the images path depends on whether the page was loaded as
# http or https, since we don't want to mix them, since they
# http or https, since we do not want to mix them, since they
# cause warnings.
#
if ($login_status == $STATUS_LOGGEDIN) {
......@@ -323,7 +324,7 @@ function PAGEHEADER($title) {
global $TBBASE, $TBDOCBASE, $TBDBNAME;
global $CHECKLOGIN_NOTLOGGEDIN, $CHECKLOGIN_LOGGEDIN;
global $CHECKLOGIN_TIMEDOUT, $CHECKLOGIN_MAYBEVALID;
global $BASEPATH, $SSL_PROTOCOL;
global $BASEPATH, $SSL_PROTOCOL, $javacode;
#
# Determine the proper basepath, which depends on whether the page
......@@ -410,8 +411,10 @@ function PAGEHEADER($title) {
</script>\n";
#
# Shove the rest of the Java code through to the output.
#
readfile("java.html");
#
for ($i = 0; $i < count($javacode); $i++) {
echo "$javacode[$i]";
}
}
echo " <meta HTTP-EQUIV=\"Pragma\" CONTENT=\"no-cache\">
......
<?php
chdir("..");
require("defs.php3");
chdir("tutorial");
#
# Standard Testbed Header
#
if (!$printable) {
PAGEHEADER("Emulab Documentation");
}
#
# Need to sanity check the path! For now, just make sure the path
# does not start with a dot or a slash.
#
$first = substr($docname, 0, 1);
if (strcmp($first, ".") == 0 ||
strcmp($first, "/") == 0) {
USERERROR("Invalid document name: $docname!");
}
#
# Nothing that looks like a ../ is allowed anywhere in the name
#
if (strstr($docname, "../")) {
USERERROR("Invalid document name: $docname!");
}
if (!$printable) {
echo "<b><a href=$REQUEST_URI&printable=1>
Printable version of this document</a></b><br>";
}
readfile("$docname");
#
# Standard Testbed Footer
#
if (!$printable) {
PAGEFOOTER();
}
?>
......@@ -96,7 +96,7 @@ interpreted in a somewhat different manner than ns-2. Therefore, some
ns-2 functionality may work differently than you expect, or may not be
implemented. If you feel there is useful functionality missing,
please let us know. Also, some
<a href="../docwrapper.php3?docname=tutorial/nscommands.html">
<a href="docwrapper.php3?docname=nscommands.html">
testbed-specific syntax</a> has been added, which with the inclusion
of compatibility module (<a href="tb_compat.tcl">tb_compat.tcl</a>),
will be ignored by the NS simulator. This
......@@ -147,7 +147,7 @@ from node A to B.
<p>
In addition to the standard NS syntax above, a number of
<a href="../docwrapper.php3?docname=tutorial/nscommands.html">
<a href="docwrapper.php3?docname=nscommands.html">
extensions</a> have been added that allow you
to better control your experiment. For example, you may specify what
Operating System is booted on your nodes. We currently support FreeBSD
......@@ -248,9 +248,9 @@ A few points should be noted:
<li> Delays of less than 3ms (per trip) are too small to be
accurately modeled at this time, and will be silently ignored.
Please see the
<a href="../docwrapper.php3?docname=tutorial/nscommands.html#LOSS">
<a href="docwrapper.php3?docname=nscommands.html#LOSS">
<i>Link Loss Commands</i></a> section in the
<a href="../docwrapper.php3?docname=tutorial/nscommands.html">
<a href="docwrapper.php3?docname=nscommands.html">
Extensions</a> reference.
<p>
......@@ -492,7 +492,7 @@ proceed. Sometimes called a <i>barrier</i>, this allows programs to
wait at a specific point, and then all proceed at once. Emulab
provides a primitive form of this mechanism using experiment <i>ready
bits</i>, which are set and read using the
<a href="../docwrapper.php3?docname=doc/tmcd.html">
<a href="../doc/docwrapper.php3?docname=tmcd.html">
TMCD/TMCC</a>. When an experiment is first configured, the ready bit
for each node is cleared. As each node starts its application and
reaches the point where it must be sure that all other nodes have
......@@ -604,9 +604,9 @@ cannot be installed on another. In other words, a delta created on a
FreeBSD machine can only be installed on a FreeBSD machine. If you
need the same software installed on a Linux machine as well, you will
need to repeat this process with a node running Linux. See the section
on <a href="../docwrapper.php3?docname=tutorial/nscommands.html#OS">
on <a href="docwrapper.php3?docname=nscommands.html#OS">
<tt>tb-set-node-os</tt></a> in the
<a href="../docwrapper.php3?docname=tutorial/nscommands.html">
<a href="docwrapper.php3?docname=nscommands.html">
Extensions</a> reference.
<p>
......
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